index.umd.js 1.1 MB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042280432804428045280462804728048280492805028051280522805328054280552805628057280582805928060280612806228063280642806528066280672806828069280702807128072280732807428075280762807728078280792808028081280822808328084280852808628087280882808928090280912809228093280942809528096280972809828099281002810128102281032810428105281062810728108281092811028111281122811328114281152811628117281182811928120281212812228123281242812528126281272812828129281302813128132281332813428135281362813728138281392814028141281422814328144281452814628147281482814928150281512815228153281542815528156281572815828159281602816128162281632816428165281662816728168281692817028171281722817328174281752817628177281782817928180281812818228183281842818528186281872818828189281902819128192281932819428195281962819728198281992820028201282022820328204282052820628207282082820928210282112821228213282142821528216282172821828219282202822128222282232822428225282262822728228282292823028231282322823328234282352823628237282382823928240282412824228243282442824528246282472824828249282502825128252282532825428255282562825728258282592826028261282622826328264282652826628267282682826928270282712827228273282742827528276282772827828279282802828128282282832828428285282862828728288282892829028291282922829328294282952829628297282982829928300283012830228303283042830528306283072830828309283102831128312283132831428315283162831728318283192832028321283222832328324283252832628327283282832928330283312833228333283342833528336283372833828339283402834128342283432834428345283462834728348283492835028351283522835328354283552835628357283582835928360283612836228363283642836528366283672836828369283702837128372283732837428375283762837728378283792838028381283822838328384283852838628387283882838928390283912839228393283942839528396283972839828399284002840128402284032840428405284062840728408284092841028411284122841328414284152841628417284182841928420284212842228423284242842528426284272842828429284302843128432284332843428435284362843728438284392844028441284422844328444284452844628447284482844928450284512845228453284542845528456284572845828459284602846128462284632846428465284662846728468284692847028471284722847328474284752847628477284782847928480284812848228483284842848528486284872848828489284902849128492284932849428495284962849728498284992850028501285022850328504285052850628507285082850928510285112851228513285142851528516285172851828519285202852128522285232852428525285262852728528285292853028531285322853328534285352853628537285382853928540285412854228543285442854528546285472854828549285502855128552285532855428555285562855728558285592856028561285622856328564285652856628567285682856928570285712857228573285742857528576285772857828579285802858128582285832858428585285862858728588285892859028591285922859328594285952859628597285982859928600286012860228603286042860528606286072860828609286102861128612286132861428615286162861728618286192862028621286222862328624286252862628627286282862928630286312863228633286342863528636286372863828639286402864128642286432864428645286462864728648286492865028651286522865328654286552865628657286582865928660286612866228663286642866528666286672866828669286702867128672286732867428675286762867728678286792868028681286822868328684286852868628687286882868928690286912869228693286942869528696286972869828699287002870128702287032870428705287062870728708287092871028711287122871328714287152871628717287182871928720287212872228723287242872528726287272872828729287302873128732287332873428735287362873728738287392874028741287422874328744287452874628747287482874928750287512875228753287542875528756287572875828759287602876128762287632876428765287662876728768287692877028771287722877328774287752877628777287782877928780287812878228783287842878528786287872878828789287902879128792287932879428795287962879728798287992880028801288022880328804288052880628807288082880928810288112881228813288142881528816288172881828819288202882128822288232882428825288262882728828288292883028831288322883328834288352883628837288382883928840288412884228843288442884528846288472884828849288502885128852288532885428855288562885728858288592886028861288622886328864288652886628867288682886928870288712887228873288742887528876288772887828879288802888128882288832888428885288862888728888288892889028891288922889328894288952889628897288982889928900289012890228903289042890528906289072890828909289102891128912289132891428915289162891728918289192892028921289222892328924289252892628927289282892928930289312893228933289342893528936289372893828939289402894128942289432894428945289462894728948289492895028951289522895328954289552895628957289582895928960289612896228963289642896528966289672896828969289702897128972289732897428975289762897728978289792898028981289822898328984289852898628987289882898928990289912899228993289942899528996289972899828999290002900129002290032900429005290062900729008290092901029011290122901329014290152901629017290182901929020290212902229023290242902529026290272902829029290302903129032290332903429035290362903729038290392904029041290422904329044290452904629047290482904929050290512905229053290542905529056290572905829059290602906129062290632906429065290662906729068290692907029071290722907329074290752907629077290782907929080290812908229083290842908529086290872908829089290902909129092290932909429095290962909729098290992910029101291022910329104291052910629107291082910929110291112911229113291142911529116291172911829119291202912129122291232912429125291262912729128291292913029131291322913329134291352913629137291382913929140291412914229143291442914529146291472914829149291502915129152291532915429155291562915729158291592916029161291622916329164291652916629167291682916929170291712917229173291742917529176291772917829179291802918129182291832918429185291862918729188291892919029191291922919329194291952919629197291982919929200292012920229203292042920529206292072920829209292102921129212292132921429215292162921729218292192922029221292222922329224292252922629227292282922929230292312923229233292342923529236292372923829239292402924129242292432924429245292462924729248292492925029251292522925329254292552925629257292582925929260292612926229263292642926529266292672926829269292702927129272292732927429275292762927729278292792928029281292822928329284292852928629287292882928929290292912929229293292942929529296292972929829299293002930129302293032930429305293062930729308293092931029311293122931329314293152931629317293182931929320293212932229323293242932529326293272932829329293302933129332293332933429335293362933729338293392934029341293422934329344293452934629347293482934929350293512935229353293542935529356293572935829359293602936129362293632936429365293662936729368293692937029371293722937329374293752937629377293782937929380293812938229383293842938529386293872938829389293902939129392293932939429395293962939729398293992940029401294022940329404294052940629407294082940929410294112941229413294142941529416294172941829419294202942129422294232942429425294262942729428294292943029431294322943329434294352943629437294382943929440294412944229443294442944529446294472944829449294502945129452294532945429455294562945729458294592946029461294622946329464294652946629467294682946929470294712947229473294742947529476294772947829479294802948129482294832948429485294862948729488294892949029491294922949329494294952949629497294982949929500295012950229503295042950529506295072950829509295102951129512295132951429515295162951729518295192952029521295222952329524295252952629527295282952929530295312953229533295342953529536295372953829539295402954129542295432954429545295462954729548295492955029551295522955329554295552955629557295582955929560295612956229563295642956529566295672956829569295702957129572295732957429575295762957729578295792958029581295822958329584295852958629587295882958929590295912959229593295942959529596295972959829599296002960129602296032960429605296062960729608296092961029611296122961329614296152961629617296182961929620296212962229623296242962529626296272962829629296302963129632296332963429635296362963729638296392964029641296422964329644296452964629647296482964929650296512965229653296542965529656296572965829659296602966129662296632966429665296662966729668296692967029671296722967329674296752967629677296782967929680296812968229683296842968529686296872968829689296902969129692296932969429695296962969729698296992970029701297022970329704297052970629707297082970929710297112971229713297142971529716297172971829719297202972129722297232972429725297262972729728297292973029731297322973329734297352973629737297382973929740297412974229743297442974529746297472974829749297502975129752297532975429755297562975729758297592976029761297622976329764297652976629767297682976929770297712977229773297742977529776297772977829779297802978129782297832978429785297862978729788297892979029791297922979329794297952979629797297982979929800298012980229803298042980529806298072980829809298102981129812298132981429815298162981729818298192982029821298222982329824298252982629827298282982929830298312983229833298342983529836298372983829839298402984129842298432984429845298462984729848298492985029851298522985329854298552985629857298582985929860298612986229863298642986529866298672986829869298702987129872298732987429875298762987729878298792988029881298822988329884298852988629887298882988929890298912989229893298942989529896298972989829899299002990129902299032990429905299062990729908299092991029911299122991329914299152991629917299182991929920299212992229923299242992529926299272992829929299302993129932299332993429935299362993729938299392994029941299422994329944299452994629947299482994929950299512995229953299542995529956299572995829959299602996129962299632996429965299662996729968299692997029971299722997329974299752997629977299782997929980299812998229983299842998529986299872998829989299902999129992299932999429995299962999729998299993000030001300023000330004300053000630007300083000930010300113001230013300143001530016300173001830019300203002130022300233002430025300263002730028300293003030031300323003330034300353003630037300383003930040300413004230043300443004530046300473004830049300503005130052300533005430055300563005730058300593006030061300623006330064300653006630067300683006930070300713007230073300743007530076300773007830079300803008130082300833008430085300863008730088300893009030091300923009330094300953009630097300983009930100301013010230103301043010530106301073010830109301103011130112301133011430115301163011730118301193012030121301223012330124301253012630127301283012930130301313013230133301343013530136301373013830139301403014130142301433014430145301463014730148301493015030151301523015330154301553015630157301583015930160301613016230163301643016530166301673016830169301703017130172301733017430175301763017730178301793018030181301823018330184301853018630187301883018930190301913019230193301943019530196301973019830199302003020130202302033020430205302063020730208302093021030211302123021330214302153021630217302183021930220302213022230223302243022530226302273022830229302303023130232302333023430235302363023730238302393024030241302423024330244302453024630247302483024930250302513025230253302543025530256302573025830259302603026130262302633026430265302663026730268302693027030271302723027330274302753027630277302783027930280302813028230283302843028530286302873028830289302903029130292302933029430295302963029730298302993030030301303023030330304303053030630307303083030930310303113031230313303143031530316303173031830319303203032130322303233032430325303263032730328303293033030331303323033330334303353033630337303383033930340303413034230343303443034530346303473034830349303503035130352303533035430355303563035730358303593036030361303623036330364303653036630367303683036930370303713037230373303743037530376303773037830379303803038130382303833038430385303863038730388303893039030391303923039330394303953039630397303983039930400304013040230403304043040530406304073040830409304103041130412304133041430415304163041730418304193042030421304223042330424304253042630427304283042930430304313043230433304343043530436304373043830439304403044130442304433044430445304463044730448304493045030451304523045330454304553045630457304583045930460304613046230463304643046530466304673046830469304703047130472304733047430475304763047730478304793048030481304823048330484304853048630487304883048930490304913049230493304943049530496304973049830499305003050130502305033050430505305063050730508305093051030511305123051330514305153051630517305183051930520305213052230523305243052530526305273052830529305303053130532305333053430535305363053730538305393054030541305423054330544305453054630547305483054930550305513055230553305543055530556305573055830559305603056130562305633056430565305663056730568305693057030571305723057330574305753057630577305783057930580305813058230583305843058530586305873058830589305903059130592305933059430595305963059730598305993060030601306023060330604306053060630607306083060930610306113061230613306143061530616306173061830619306203062130622306233062430625306263062730628306293063030631306323063330634306353063630637306383063930640306413064230643306443064530646306473064830649306503065130652306533065430655306563065730658306593066030661306623066330664306653066630667306683066930670306713067230673306743067530676306773067830679306803068130682306833068430685306863068730688306893069030691306923069330694306953069630697306983069930700307013070230703307043070530706307073070830709307103071130712307133071430715307163071730718307193072030721307223072330724307253072630727307283072930730307313073230733307343073530736307373073830739307403074130742307433074430745307463074730748307493075030751307523075330754307553075630757307583075930760307613076230763307643076530766307673076830769307703077130772307733077430775307763077730778307793078030781307823078330784307853078630787307883078930790307913079230793307943079530796307973079830799308003080130802308033080430805308063080730808308093081030811308123081330814308153081630817308183081930820308213082230823308243082530826308273082830829308303083130832308333083430835308363083730838308393084030841308423084330844308453084630847308483084930850308513085230853308543085530856308573085830859308603086130862308633086430865308663086730868308693087030871308723087330874308753087630877308783087930880308813088230883308843088530886308873088830889308903089130892308933089430895308963089730898308993090030901309023090330904309053090630907309083090930910309113091230913309143091530916309173091830919309203092130922309233092430925309263092730928309293093030931309323093330934309353093630937309383093930940309413094230943309443094530946309473094830949309503095130952309533095430955309563095730958309593096030961309623096330964309653096630967309683096930970309713097230973309743097530976309773097830979309803098130982309833098430985309863098730988309893099030991309923099330994309953099630997309983099931000310013100231003310043100531006310073100831009310103101131012310133101431015310163101731018310193102031021310223102331024310253102631027310283102931030310313103231033310343103531036310373103831039310403104131042310433104431045310463104731048310493105031051310523105331054310553105631057310583105931060310613106231063310643106531066310673106831069310703107131072310733107431075310763107731078310793108031081310823108331084310853108631087310883108931090310913109231093310943109531096310973109831099311003110131102311033110431105311063110731108311093111031111311123111331114311153111631117311183111931120311213112231123311243112531126311273112831129311303113131132311333113431135311363113731138311393114031141311423114331144311453114631147311483114931150311513115231153311543115531156311573115831159311603116131162311633116431165311663116731168311693117031171311723117331174311753117631177311783117931180311813118231183311843118531186311873118831189311903119131192311933119431195311963119731198311993120031201312023120331204312053120631207312083120931210312113121231213312143121531216312173121831219312203122131222312233122431225312263122731228312293123031231312323123331234312353123631237312383123931240312413124231243312443124531246312473124831249312503125131252312533125431255312563125731258312593126031261312623126331264312653126631267312683126931270312713127231273312743127531276312773127831279312803128131282312833128431285312863128731288312893129031291312923129331294312953129631297312983129931300313013130231303313043130531306313073130831309313103131131312313133131431315313163131731318313193132031321313223132331324313253132631327313283132931330313313133231333313343133531336313373133831339313403134131342313433134431345313463134731348313493135031351313523135331354313553135631357313583135931360313613136231363313643136531366313673136831369313703137131372313733137431375313763137731378313793138031381313823138331384313853138631387313883138931390313913139231393313943139531396313973139831399314003140131402314033140431405314063140731408314093141031411314123141331414314153141631417314183141931420314213142231423314243142531426314273142831429314303143131432314333143431435314363143731438314393144031441314423144331444314453144631447314483144931450314513145231453314543145531456314573145831459314603146131462314633146431465314663146731468314693147031471314723147331474314753147631477314783147931480314813148231483314843148531486314873148831489314903149131492314933149431495314963149731498314993150031501315023150331504315053150631507315083150931510315113151231513315143151531516315173151831519315203152131522315233152431525315263152731528315293153031531315323153331534315353153631537315383153931540315413154231543315443154531546315473154831549315503155131552315533155431555315563155731558315593156031561315623156331564315653156631567315683156931570315713157231573315743157531576315773157831579315803158131582315833158431585315863158731588315893159031591315923159331594315953159631597315983159931600316013160231603316043160531606316073160831609316103161131612316133161431615316163161731618316193162031621316223162331624316253162631627316283162931630316313163231633316343163531636316373163831639316403164131642316433164431645316463164731648316493165031651316523165331654316553165631657316583165931660316613166231663316643166531666316673166831669316703167131672316733167431675316763167731678316793168031681316823168331684316853168631687316883168931690316913169231693316943169531696316973169831699317003170131702317033170431705317063170731708317093171031711317123171331714317153171631717317183171931720317213172231723317243172531726317273172831729317303173131732317333173431735317363173731738317393174031741317423174331744317453174631747317483174931750317513175231753317543175531756317573175831759317603176131762317633176431765317663176731768317693177031771317723177331774317753177631777317783177931780317813178231783317843178531786317873178831789317903179131792317933179431795317963179731798317993180031801318023180331804318053180631807318083180931810318113181231813318143181531816318173181831819318203182131822318233182431825318263182731828318293183031831318323183331834318353183631837318383183931840318413184231843318443184531846318473184831849318503185131852318533185431855318563185731858318593186031861318623186331864318653186631867318683186931870318713187231873318743187531876318773187831879318803188131882318833188431885318863188731888318893189031891318923189331894318953189631897318983189931900319013190231903319043190531906319073190831909319103191131912319133191431915319163191731918319193192031921319223192331924319253192631927319283192931930319313193231933319343193531936319373193831939319403194131942319433194431945319463194731948319493195031951319523195331954319553195631957319583195931960319613196231963319643196531966319673196831969319703197131972319733197431975319763197731978319793198031981319823198331984319853198631987319883198931990319913199231993319943199531996319973199831999320003200132002320033200432005320063200732008320093201032011320123201332014320153201632017320183201932020320213202232023320243202532026320273202832029320303203132032320333203432035320363203732038320393204032041320423204332044320453204632047320483204932050320513205232053320543205532056320573205832059320603206132062320633206432065320663206732068320693207032071320723207332074320753207632077320783207932080320813208232083320843208532086320873208832089320903209132092320933209432095320963209732098320993210032101321023210332104321053210632107321083210932110321113211232113321143211532116321173211832119321203212132122321233212432125321263212732128321293213032131321323213332134321353213632137321383213932140321413214232143321443214532146321473214832149321503215132152321533215432155321563215732158321593216032161321623216332164321653216632167321683216932170321713217232173321743217532176321773217832179321803218132182321833218432185321863218732188321893219032191321923219332194321953219632197321983219932200322013220232203322043220532206322073220832209322103221132212322133221432215322163221732218322193222032221322223222332224322253222632227322283222932230322313223232233322343223532236322373223832239322403224132242322433224432245322463224732248322493225032251322523225332254322553225632257322583225932260322613226232263322643226532266322673226832269322703227132272322733227432275322763227732278322793228032281322823228332284322853228632287322883228932290322913229232293322943229532296322973229832299323003230132302323033230432305323063230732308323093231032311323123231332314323153231632317323183231932320323213232232323323243232532326323273232832329323303233132332323333233432335323363233732338323393234032341323423234332344323453234632347323483234932350323513235232353323543235532356323573235832359323603236132362323633236432365323663236732368323693237032371323723237332374323753237632377323783237932380323813238232383323843238532386323873238832389323903239132392323933239432395323963239732398323993240032401324023240332404324053240632407324083240932410324113241232413324143241532416324173241832419324203242132422324233242432425324263242732428324293243032431324323243332434324353243632437324383243932440324413244232443324443244532446324473244832449324503245132452324533245432455324563245732458324593246032461324623246332464324653246632467324683246932470324713247232473324743247532476324773247832479324803248132482324833248432485324863248732488324893249032491324923249332494324953249632497324983249932500325013250232503325043250532506325073250832509325103251132512325133251432515325163251732518325193252032521325223252332524325253252632527325283252932530325313253232533325343253532536325373253832539325403254132542325433254432545325463254732548325493255032551325523255332554325553255632557325583255932560325613256232563325643256532566325673256832569325703257132572325733257432575325763257732578325793258032581325823258332584325853258632587325883258932590325913259232593325943259532596325973259832599326003260132602326033260432605326063260732608326093261032611326123261332614326153261632617326183261932620326213262232623326243262532626326273262832629326303263132632326333263432635326363263732638326393264032641326423264332644326453264632647326483264932650326513265232653326543265532656326573265832659326603266132662326633266432665326663266732668326693267032671326723267332674326753267632677326783267932680326813268232683326843268532686326873268832689326903269132692326933269432695326963269732698326993270032701327023270332704327053270632707327083270932710327113271232713327143271532716327173271832719327203272132722327233272432725327263272732728327293273032731327323273332734327353273632737327383273932740327413274232743327443274532746327473274832749327503275132752327533275432755327563275732758327593276032761327623276332764327653276632767327683276932770327713277232773327743277532776327773277832779327803278132782327833278432785327863278732788327893279032791327923279332794327953279632797327983279932800328013280232803328043280532806328073280832809328103281132812328133281432815328163281732818328193282032821328223282332824328253282632827328283282932830328313283232833328343283532836328373283832839328403284132842328433284432845328463284732848328493285032851328523285332854328553285632857328583285932860328613286232863328643286532866328673286832869328703287132872328733287432875328763287732878328793288032881328823288332884328853288632887328883288932890328913289232893328943289532896328973289832899329003290132902329033290432905329063290732908329093291032911329123291332914329153291632917329183291932920329213292232923329243292532926329273292832929329303293132932329333293432935329363293732938329393294032941329423294332944329453294632947329483294932950329513295232953329543295532956329573295832959329603296132962329633296432965329663296732968329693297032971329723297332974329753297632977329783297932980329813298232983329843298532986329873298832989329903299132992329933299432995329963299732998329993300033001330023300333004330053300633007330083300933010330113301233013330143301533016330173301833019330203302133022330233302433025330263302733028330293303033031330323303333034330353303633037330383303933040330413304233043330443304533046330473304833049330503305133052330533305433055330563305733058330593306033061330623306333064330653306633067330683306933070330713307233073330743307533076330773307833079330803308133082330833308433085330863308733088330893309033091330923309333094330953309633097330983309933100331013310233103331043310533106331073310833109331103311133112331133311433115331163311733118331193312033121331223312333124331253312633127331283312933130331313313233133331343313533136331373313833139331403314133142331433314433145331463314733148331493315033151331523315333154331553315633157331583315933160331613316233163331643316533166331673316833169331703317133172331733317433175331763317733178331793318033181331823318333184331853318633187331883318933190331913319233193331943319533196331973319833199332003320133202332033320433205332063320733208332093321033211332123321333214332153321633217332183321933220332213322233223332243322533226332273322833229332303323133232332333323433235332363323733238332393324033241332423324333244332453324633247332483324933250332513325233253332543325533256332573325833259332603326133262332633326433265332663326733268332693327033271332723327333274332753327633277332783327933280332813328233283332843328533286332873328833289332903329133292332933329433295332963329733298332993330033301333023330333304333053330633307333083330933310333113331233313333143331533316333173331833319333203332133322333233332433325333263332733328333293333033331333323333333334333353333633337333383333933340333413334233343333443334533346333473334833349333503335133352333533335433355333563335733358333593336033361333623336333364333653336633367333683336933370333713337233373333743337533376333773337833379333803338133382333833338433385333863338733388333893339033391333923339333394333953339633397333983339933400334013340233403334043340533406334073340833409334103341133412334133341433415334163341733418334193342033421334223342333424334253342633427334283342933430334313343233433334343343533436334373343833439334403344133442334433344433445334463344733448334493345033451334523345333454334553345633457334583345933460334613346233463334643346533466334673346833469334703347133472334733347433475334763347733478334793348033481334823348333484334853348633487334883348933490334913349233493334943349533496334973349833499335003350133502335033350433505335063350733508335093351033511335123351333514335153351633517335183351933520335213352233523335243352533526335273352833529335303353133532335333353433535335363353733538335393354033541335423354333544335453354633547335483354933550335513355233553335543355533556335573355833559335603356133562335633356433565335663356733568335693357033571335723357333574335753357633577335783357933580335813358233583335843358533586335873358833589335903359133592335933359433595335963359733598335993360033601336023360333604336053360633607336083360933610336113361233613336143361533616336173361833619336203362133622336233362433625336263362733628336293363033631336323363333634336353363633637336383363933640336413364233643336443364533646336473364833649336503365133652336533365433655336563365733658336593366033661336623366333664336653366633667336683366933670336713367233673336743367533676336773367833679336803368133682336833368433685336863368733688336893369033691336923369333694336953369633697336983369933700337013370233703337043370533706337073370833709337103371133712337133371433715337163371733718337193372033721337223372333724337253372633727337283372933730337313373233733337343373533736337373373833739337403374133742337433374433745337463374733748337493375033751337523375333754337553375633757337583375933760337613376233763337643376533766337673376833769337703377133772337733377433775337763377733778337793378033781337823378333784337853378633787337883378933790337913379233793337943379533796337973379833799338003380133802338033380433805338063380733808338093381033811338123381333814338153381633817338183381933820338213382233823338243382533826338273382833829338303383133832338333383433835338363383733838338393384033841338423384333844338453384633847338483384933850338513385233853338543385533856338573385833859338603386133862338633386433865338663386733868338693387033871338723387333874338753387633877338783387933880338813388233883338843388533886338873388833889338903389133892338933389433895338963389733898338993390033901339023390333904339053390633907339083390933910339113391233913339143391533916339173391833919339203392133922339233392433925339263392733928339293393033931339323393333934339353393633937339383393933940339413394233943339443394533946339473394833949339503395133952339533395433955339563395733958339593396033961339623396333964339653396633967339683396933970339713397233973339743397533976339773397833979339803398133982339833398433985339863398733988339893399033991339923399333994339953399633997339983399934000340013400234003340043400534006340073400834009340103401134012340133401434015340163401734018340193402034021340223402334024340253402634027340283402934030340313403234033340343403534036340373403834039340403404134042340433404434045340463404734048340493405034051340523405334054340553405634057340583405934060340613406234063340643406534066340673406834069340703407134072340733407434075340763407734078340793408034081340823408334084340853408634087340883408934090340913409234093340943409534096340973409834099341003410134102341033410434105341063410734108341093411034111341123411334114341153411634117341183411934120341213412234123341243412534126341273412834129341303413134132341333413434135341363413734138341393414034141341423414334144341453414634147341483414934150341513415234153341543415534156341573415834159341603416134162341633416434165341663416734168341693417034171341723417334174341753417634177341783417934180341813418234183341843418534186341873418834189341903419134192341933419434195341963419734198341993420034201342023420334204342053420634207342083420934210342113421234213342143421534216342173421834219342203422134222342233422434225342263422734228342293423034231342323423334234342353423634237342383423934240342413424234243342443424534246342473424834249342503425134252342533425434255342563425734258342593426034261342623426334264342653426634267342683426934270342713427234273342743427534276342773427834279342803428134282342833428434285342863428734288342893429034291342923429334294342953429634297342983429934300343013430234303343043430534306343073430834309343103431134312343133431434315343163431734318343193432034321343223432334324343253432634327343283432934330343313433234333343343433534336343373433834339343403434134342343433434434345343463434734348343493435034351343523435334354343553435634357343583435934360343613436234363343643436534366343673436834369343703437134372343733437434375343763437734378343793438034381343823438334384343853438634387343883438934390343913439234393343943439534396343973439834399344003440134402344033440434405344063440734408344093441034411344123441334414344153441634417344183441934420344213442234423344243442534426344273442834429344303443134432344333443434435344363443734438344393444034441344423444334444344453444634447344483444934450344513445234453344543445534456344573445834459344603446134462344633446434465344663446734468344693447034471344723447334474344753447634477344783447934480344813448234483344843448534486344873448834489344903449134492344933449434495344963449734498344993450034501345023450334504345053450634507345083450934510345113451234513345143451534516345173451834519345203452134522345233452434525345263452734528345293453034531345323453334534345353453634537345383453934540345413454234543345443454534546345473454834549345503455134552345533455434555345563455734558345593456034561345623456334564345653456634567345683456934570345713457234573345743457534576345773457834579345803458134582345833458434585345863458734588345893459034591345923459334594345953459634597345983459934600346013460234603346043460534606346073460834609346103461134612346133461434615346163461734618346193462034621346223462334624346253462634627346283462934630346313463234633346343463534636346373463834639346403464134642346433464434645346463464734648346493465034651346523465334654346553465634657346583465934660346613466234663346643466534666346673466834669346703467134672346733467434675346763467734678346793468034681346823468334684346853468634687346883468934690346913469234693346943469534696346973469834699347003470134702347033470434705347063470734708347093471034711347123471334714347153471634717347183471934720347213472234723347243472534726347273472834729347303473134732347333473434735347363473734738347393474034741347423474334744347453474634747347483474934750347513475234753347543475534756347573475834759347603476134762347633476434765347663476734768347693477034771347723477334774347753477634777347783477934780347813478234783347843478534786347873478834789347903479134792347933479434795347963479734798347993480034801348023480334804348053480634807348083480934810348113481234813348143481534816348173481834819348203482134822348233482434825348263482734828348293483034831348323483334834348353483634837348383483934840348413484234843348443484534846348473484834849348503485134852348533485434855348563485734858348593486034861348623486334864348653486634867348683486934870348713487234873348743487534876348773487834879348803488134882348833488434885348863488734888348893489034891348923489334894348953489634897348983489934900349013490234903349043490534906349073490834909349103491134912349133491434915349163491734918349193492034921349223492334924349253492634927349283492934930349313493234933349343493534936349373493834939349403494134942349433494434945349463494734948349493495034951349523495334954349553495634957349583495934960349613496234963349643496534966349673496834969349703497134972349733497434975349763497734978349793498034981349823498334984349853498634987349883498934990349913499234993349943499534996349973499834999350003500135002350033500435005350063500735008350093501035011350123501335014350153501635017350183501935020350213502235023350243502535026350273502835029350303503135032350333503435035350363503735038350393504035041350423504335044350453504635047350483504935050350513505235053350543505535056350573505835059350603506135062350633506435065350663506735068350693507035071350723507335074350753507635077350783507935080350813508235083350843508535086350873508835089350903509135092350933509435095350963509735098350993510035101351023510335104351053510635107351083510935110351113511235113351143511535116351173511835119351203512135122351233512435125351263512735128351293513035131351323513335134351353513635137351383513935140351413514235143351443514535146351473514835149351503515135152351533515435155351563515735158351593516035161351623516335164351653516635167351683516935170351713517235173351743517535176351773517835179351803518135182351833518435185351863518735188351893519035191351923519335194351953519635197351983519935200352013520235203352043520535206352073520835209352103521135212352133521435215352163521735218352193522035221352223522335224352253522635227352283522935230352313523235233352343523535236352373523835239352403524135242352433524435245352463524735248352493525035251352523525335254352553525635257352583525935260352613526235263352643526535266352673526835269352703527135272352733527435275352763527735278352793528035281352823528335284352853528635287352883528935290352913529235293352943529535296352973529835299353003530135302353033530435305353063530735308353093531035311353123531335314353153531635317353183531935320353213532235323353243532535326353273532835329353303533135332353333533435335353363533735338353393534035341353423534335344353453534635347353483534935350353513535235353353543535535356353573535835359353603536135362353633536435365353663536735368353693537035371353723537335374353753537635377353783537935380353813538235383353843538535386353873538835389353903539135392353933539435395353963539735398353993540035401354023540335404354053540635407354083540935410354113541235413354143541535416354173541835419354203542135422354233542435425354263542735428354293543035431354323543335434354353543635437354383543935440354413544235443354443544535446354473544835449354503545135452354533545435455354563545735458354593546035461354623546335464354653546635467354683546935470354713547235473354743547535476354773547835479354803548135482354833548435485354863548735488354893549035491354923549335494354953549635497354983549935500355013550235503355043550535506355073550835509355103551135512355133551435515355163551735518355193552035521355223552335524355253552635527
  1. (function webpackUniversalModuleDefinition(root, factory) {
  2. if(typeof exports === 'object' && typeof module === 'object')
  3. module.exports = factory(require("xe-utils"));
  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"));
  8. else
  9. root["VXETable"] = factory(root["XEUtils"]);
  10. })((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE_f0af__) {
  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.es/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. /***/ "0cb2":
  175. /***/ (function(module, exports, __webpack_require__) {
  176. var toObject = __webpack_require__("7b0b");
  177. var floor = Math.floor;
  178. var replace = ''.replace;
  179. var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g;
  180. var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g;
  181. // https://tc39.es/ecma262/#sec-getsubstitution
  182. module.exports = function (matched, str, position, captures, namedCaptures, replacement) {
  183. var tailPos = position + matched.length;
  184. var m = captures.length;
  185. var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
  186. if (namedCaptures !== undefined) {
  187. namedCaptures = toObject(namedCaptures);
  188. symbols = SUBSTITUTION_SYMBOLS;
  189. }
  190. return replace.call(replacement, symbols, function (match, ch) {
  191. var capture;
  192. switch (ch.charAt(0)) {
  193. case '$': return '$';
  194. case '&': return matched;
  195. case '`': return str.slice(0, position);
  196. case "'": return str.slice(tailPos);
  197. case '<':
  198. capture = namedCaptures[ch.slice(1, -1)];
  199. break;
  200. default: // \d\d?
  201. var n = +ch;
  202. if (n === 0) return match;
  203. if (n > m) {
  204. var f = floor(n / 10);
  205. if (f === 0) return match;
  206. if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);
  207. return match;
  208. }
  209. capture = captures[n - 1];
  210. }
  211. return capture === undefined ? '' : capture;
  212. });
  213. };
  214. /***/ }),
  215. /***/ "0ccb":
  216. /***/ (function(module, exports, __webpack_require__) {
  217. // https://github.com/tc39/proposal-string-pad-start-end
  218. var toLength = __webpack_require__("50c4");
  219. var repeat = __webpack_require__("1148");
  220. var requireObjectCoercible = __webpack_require__("1d80");
  221. var ceil = Math.ceil;
  222. // `String.prototype.{ padStart, padEnd }` methods implementation
  223. var createMethod = function (IS_END) {
  224. return function ($this, maxLength, fillString) {
  225. var S = String(requireObjectCoercible($this));
  226. var stringLength = S.length;
  227. var fillStr = fillString === undefined ? ' ' : String(fillString);
  228. var intMaxLength = toLength(maxLength);
  229. var fillLen, stringFiller;
  230. if (intMaxLength <= stringLength || fillStr == '') return S;
  231. fillLen = intMaxLength - stringLength;
  232. stringFiller = repeat.call(fillStr, ceil(fillLen / fillStr.length));
  233. if (stringFiller.length > fillLen) stringFiller = stringFiller.slice(0, fillLen);
  234. return IS_END ? S + stringFiller : stringFiller + S;
  235. };
  236. };
  237. module.exports = {
  238. // `String.prototype.padStart` method
  239. // https://tc39.es/ecma262/#sec-string.prototype.padstart
  240. start: createMethod(false),
  241. // `String.prototype.padEnd` method
  242. // https://tc39.es/ecma262/#sec-string.prototype.padend
  243. end: createMethod(true)
  244. };
  245. /***/ }),
  246. /***/ "0cfb":
  247. /***/ (function(module, exports, __webpack_require__) {
  248. var DESCRIPTORS = __webpack_require__("83ab");
  249. var fails = __webpack_require__("d039");
  250. var createElement = __webpack_require__("cc12");
  251. // Thank's IE8 for his funny defineProperty
  252. module.exports = !DESCRIPTORS && !fails(function () {
  253. return Object.defineProperty(createElement('div'), 'a', {
  254. get: function () { return 7; }
  255. }).a != 7;
  256. });
  257. /***/ }),
  258. /***/ "0d3b":
  259. /***/ (function(module, exports, __webpack_require__) {
  260. var fails = __webpack_require__("d039");
  261. var wellKnownSymbol = __webpack_require__("b622");
  262. var IS_PURE = __webpack_require__("c430");
  263. var ITERATOR = wellKnownSymbol('iterator');
  264. module.exports = !fails(function () {
  265. var url = new URL('b?a=1&b=2&c=3', 'http://a');
  266. var searchParams = url.searchParams;
  267. var result = '';
  268. url.pathname = 'c%20d';
  269. searchParams.forEach(function (value, key) {
  270. searchParams['delete']('b');
  271. result += key + value;
  272. });
  273. return (IS_PURE && !url.toJSON)
  274. || !searchParams.sort
  275. || url.href !== 'http://a/c%20d?a=1&c=3'
  276. || searchParams.get('c') !== '3'
  277. || String(new URLSearchParams('?a=1')) !== 'a=1'
  278. || !searchParams[ITERATOR]
  279. // throws in Edge
  280. || new URL('https://a@b').username !== 'a'
  281. || new URLSearchParams(new URLSearchParams('a=b')).get('a') !== 'b'
  282. // not punycoded in Edge
  283. || new URL('http://тест').host !== 'xn--e1aybc'
  284. // not escaped in Chrome 62-
  285. || new URL('http://a#б').hash !== '#%D0%B1'
  286. // fails in Chrome 66-
  287. || result !== 'a1c3'
  288. // throws in Safari
  289. || new URL('http://x', undefined).host !== 'x';
  290. });
  291. /***/ }),
  292. /***/ "1148":
  293. /***/ (function(module, exports, __webpack_require__) {
  294. "use strict";
  295. var toInteger = __webpack_require__("a691");
  296. var requireObjectCoercible = __webpack_require__("1d80");
  297. // `String.prototype.repeat` method implementation
  298. // https://tc39.es/ecma262/#sec-string.prototype.repeat
  299. module.exports = ''.repeat || function repeat(count) {
  300. var str = String(requireObjectCoercible(this));
  301. var result = '';
  302. var n = toInteger(count);
  303. if (n < 0 || n == Infinity) throw RangeError('Wrong number of repetitions');
  304. for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) result += str;
  305. return result;
  306. };
  307. /***/ }),
  308. /***/ "1276":
  309. /***/ (function(module, exports, __webpack_require__) {
  310. "use strict";
  311. var fixRegExpWellKnownSymbolLogic = __webpack_require__("d784");
  312. var isRegExp = __webpack_require__("44e7");
  313. var anObject = __webpack_require__("825a");
  314. var requireObjectCoercible = __webpack_require__("1d80");
  315. var speciesConstructor = __webpack_require__("4840");
  316. var advanceStringIndex = __webpack_require__("8aa5");
  317. var toLength = __webpack_require__("50c4");
  318. var callRegExpExec = __webpack_require__("14c3");
  319. var regexpExec = __webpack_require__("9263");
  320. var fails = __webpack_require__("d039");
  321. var arrayPush = [].push;
  322. var min = Math.min;
  323. var MAX_UINT32 = 0xFFFFFFFF;
  324. // babel-minify transpiles RegExp('x', 'y') -> /x/y and it causes SyntaxError
  325. var SUPPORTS_Y = !fails(function () { return !RegExp(MAX_UINT32, 'y'); });
  326. // @@split logic
  327. fixRegExpWellKnownSymbolLogic('split', 2, function (SPLIT, nativeSplit, maybeCallNative) {
  328. var internalSplit;
  329. if (
  330. 'abbc'.split(/(b)*/)[1] == 'c' ||
  331. // eslint-disable-next-line regexp/no-empty-group -- required for testing
  332. 'test'.split(/(?:)/, -1).length != 4 ||
  333. 'ab'.split(/(?:ab)*/).length != 2 ||
  334. '.'.split(/(.?)(.?)/).length != 4 ||
  335. // eslint-disable-next-line regexp/no-assertion-capturing-group, regexp/no-empty-group -- required for testing
  336. '.'.split(/()()/).length > 1 ||
  337. ''.split(/.?/).length
  338. ) {
  339. // based on es5-shim implementation, need to rework it
  340. internalSplit = function (separator, limit) {
  341. var string = String(requireObjectCoercible(this));
  342. var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
  343. if (lim === 0) return [];
  344. if (separator === undefined) return [string];
  345. // If `separator` is not a regex, use native split
  346. if (!isRegExp(separator)) {
  347. return nativeSplit.call(string, separator, lim);
  348. }
  349. var output = [];
  350. var flags = (separator.ignoreCase ? 'i' : '') +
  351. (separator.multiline ? 'm' : '') +
  352. (separator.unicode ? 'u' : '') +
  353. (separator.sticky ? 'y' : '');
  354. var lastLastIndex = 0;
  355. // Make `global` and avoid `lastIndex` issues by working with a copy
  356. var separatorCopy = new RegExp(separator.source, flags + 'g');
  357. var match, lastIndex, lastLength;
  358. while (match = regexpExec.call(separatorCopy, string)) {
  359. lastIndex = separatorCopy.lastIndex;
  360. if (lastIndex > lastLastIndex) {
  361. output.push(string.slice(lastLastIndex, match.index));
  362. if (match.length > 1 && match.index < string.length) arrayPush.apply(output, match.slice(1));
  363. lastLength = match[0].length;
  364. lastLastIndex = lastIndex;
  365. if (output.length >= lim) break;
  366. }
  367. if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++; // Avoid an infinite loop
  368. }
  369. if (lastLastIndex === string.length) {
  370. if (lastLength || !separatorCopy.test('')) output.push('');
  371. } else output.push(string.slice(lastLastIndex));
  372. return output.length > lim ? output.slice(0, lim) : output;
  373. };
  374. // Chakra, V8
  375. } else if ('0'.split(undefined, 0).length) {
  376. internalSplit = function (separator, limit) {
  377. return separator === undefined && limit === 0 ? [] : nativeSplit.call(this, separator, limit);
  378. };
  379. } else internalSplit = nativeSplit;
  380. return [
  381. // `String.prototype.split` method
  382. // https://tc39.es/ecma262/#sec-string.prototype.split
  383. function split(separator, limit) {
  384. var O = requireObjectCoercible(this);
  385. var splitter = separator == undefined ? undefined : separator[SPLIT];
  386. return splitter !== undefined
  387. ? splitter.call(separator, O, limit)
  388. : internalSplit.call(String(O), separator, limit);
  389. },
  390. // `RegExp.prototype[@@split]` method
  391. // https://tc39.es/ecma262/#sec-regexp.prototype-@@split
  392. //
  393. // NOTE: This cannot be properly polyfilled in engines that don't support
  394. // the 'y' flag.
  395. function (regexp, limit) {
  396. var res = maybeCallNative(internalSplit, regexp, this, limit, internalSplit !== nativeSplit);
  397. if (res.done) return res.value;
  398. var rx = anObject(regexp);
  399. var S = String(this);
  400. var C = speciesConstructor(rx, RegExp);
  401. var unicodeMatching = rx.unicode;
  402. var flags = (rx.ignoreCase ? 'i' : '') +
  403. (rx.multiline ? 'm' : '') +
  404. (rx.unicode ? 'u' : '') +
  405. (SUPPORTS_Y ? 'y' : 'g');
  406. // ^(? + rx + ) is needed, in combination with some S slicing, to
  407. // simulate the 'y' flag.
  408. var splitter = new C(SUPPORTS_Y ? rx : '^(?:' + rx.source + ')', flags);
  409. var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
  410. if (lim === 0) return [];
  411. if (S.length === 0) return callRegExpExec(splitter, S) === null ? [S] : [];
  412. var p = 0;
  413. var q = 0;
  414. var A = [];
  415. while (q < S.length) {
  416. splitter.lastIndex = SUPPORTS_Y ? q : 0;
  417. var z = callRegExpExec(splitter, SUPPORTS_Y ? S : S.slice(q));
  418. var e;
  419. if (
  420. z === null ||
  421. (e = min(toLength(splitter.lastIndex + (SUPPORTS_Y ? 0 : q)), S.length)) === p
  422. ) {
  423. q = advanceStringIndex(S, q, unicodeMatching);
  424. } else {
  425. A.push(S.slice(p, q));
  426. if (A.length === lim) return A;
  427. for (var i = 1; i <= z.length - 1; i++) {
  428. A.push(z[i]);
  429. if (A.length === lim) return A;
  430. }
  431. q = p = e;
  432. }
  433. }
  434. A.push(S.slice(p));
  435. return A;
  436. }
  437. ];
  438. }, !SUPPORTS_Y);
  439. /***/ }),
  440. /***/ "13d5":
  441. /***/ (function(module, exports, __webpack_require__) {
  442. "use strict";
  443. var $ = __webpack_require__("23e7");
  444. var $reduce = __webpack_require__("d58f").left;
  445. var arrayMethodIsStrict = __webpack_require__("a640");
  446. var CHROME_VERSION = __webpack_require__("2d00");
  447. var IS_NODE = __webpack_require__("605d");
  448. var STRICT_METHOD = arrayMethodIsStrict('reduce');
  449. // Chrome 80-82 has a critical bug
  450. // https://bugs.chromium.org/p/chromium/issues/detail?id=1049982
  451. var CHROME_BUG = !IS_NODE && CHROME_VERSION > 79 && CHROME_VERSION < 83;
  452. // `Array.prototype.reduce` method
  453. // https://tc39.es/ecma262/#sec-array.prototype.reduce
  454. $({ target: 'Array', proto: true, forced: !STRICT_METHOD || CHROME_BUG }, {
  455. reduce: function reduce(callbackfn /* , initialValue */) {
  456. return $reduce(this, callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined);
  457. }
  458. });
  459. /***/ }),
  460. /***/ "14c3":
  461. /***/ (function(module, exports, __webpack_require__) {
  462. var classof = __webpack_require__("c6b6");
  463. var regexpExec = __webpack_require__("9263");
  464. // `RegExpExec` abstract operation
  465. // https://tc39.es/ecma262/#sec-regexpexec
  466. module.exports = function (R, S) {
  467. var exec = R.exec;
  468. if (typeof exec === 'function') {
  469. var result = exec.call(R, S);
  470. if (typeof result !== 'object') {
  471. throw TypeError('RegExp exec method returned something other than an Object or null');
  472. }
  473. return result;
  474. }
  475. if (classof(R) !== 'RegExp') {
  476. throw TypeError('RegExp#exec called on incompatible receiver');
  477. }
  478. return regexpExec.call(R, S);
  479. };
  480. /***/ }),
  481. /***/ "159b":
  482. /***/ (function(module, exports, __webpack_require__) {
  483. var global = __webpack_require__("da84");
  484. var DOMIterables = __webpack_require__("fdbc");
  485. var forEach = __webpack_require__("17c2");
  486. var createNonEnumerableProperty = __webpack_require__("9112");
  487. for (var COLLECTION_NAME in DOMIterables) {
  488. var Collection = global[COLLECTION_NAME];
  489. var CollectionPrototype = Collection && Collection.prototype;
  490. // some Chrome versions have non-configurable methods on DOMTokenList
  491. if (CollectionPrototype && CollectionPrototype.forEach !== forEach) try {
  492. createNonEnumerableProperty(CollectionPrototype, 'forEach', forEach);
  493. } catch (error) {
  494. CollectionPrototype.forEach = forEach;
  495. }
  496. }
  497. /***/ }),
  498. /***/ "17c2":
  499. /***/ (function(module, exports, __webpack_require__) {
  500. "use strict";
  501. var $forEach = __webpack_require__("b727").forEach;
  502. var arrayMethodIsStrict = __webpack_require__("a640");
  503. var STRICT_METHOD = arrayMethodIsStrict('forEach');
  504. // `Array.prototype.forEach` method implementation
  505. // https://tc39.es/ecma262/#sec-array.prototype.foreach
  506. module.exports = !STRICT_METHOD ? function forEach(callbackfn /* , thisArg */) {
  507. return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  508. } : [].forEach;
  509. /***/ }),
  510. /***/ "19aa":
  511. /***/ (function(module, exports) {
  512. module.exports = function (it, Constructor, name) {
  513. if (!(it instanceof Constructor)) {
  514. throw TypeError('Incorrect ' + (name ? name + ' ' : '') + 'invocation');
  515. } return it;
  516. };
  517. /***/ }),
  518. /***/ "1a97":
  519. /***/ (function(module, exports, __webpack_require__) {
  520. // extracted by mini-css-extract-plugin
  521. /***/ }),
  522. /***/ "1be4":
  523. /***/ (function(module, exports, __webpack_require__) {
  524. var getBuiltIn = __webpack_require__("d066");
  525. module.exports = getBuiltIn('document', 'documentElement');
  526. /***/ }),
  527. /***/ "1c0b":
  528. /***/ (function(module, exports) {
  529. module.exports = function (it) {
  530. if (typeof it != 'function') {
  531. throw TypeError(String(it) + ' is not a function');
  532. } return it;
  533. };
  534. /***/ }),
  535. /***/ "1c7e":
  536. /***/ (function(module, exports, __webpack_require__) {
  537. var wellKnownSymbol = __webpack_require__("b622");
  538. var ITERATOR = wellKnownSymbol('iterator');
  539. var SAFE_CLOSING = false;
  540. try {
  541. var called = 0;
  542. var iteratorWithReturn = {
  543. next: function () {
  544. return { done: !!called++ };
  545. },
  546. 'return': function () {
  547. SAFE_CLOSING = true;
  548. }
  549. };
  550. iteratorWithReturn[ITERATOR] = function () {
  551. return this;
  552. };
  553. // eslint-disable-next-line no-throw-literal -- required for testing
  554. Array.from(iteratorWithReturn, function () { throw 2; });
  555. } catch (error) { /* empty */ }
  556. module.exports = function (exec, SKIP_CLOSING) {
  557. if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
  558. var ITERATION_SUPPORT = false;
  559. try {
  560. var object = {};
  561. object[ITERATOR] = function () {
  562. return {
  563. next: function () {
  564. return { done: ITERATION_SUPPORT = true };
  565. }
  566. };
  567. };
  568. exec(object);
  569. } catch (error) { /* empty */ }
  570. return ITERATION_SUPPORT;
  571. };
  572. /***/ }),
  573. /***/ "1cdc":
  574. /***/ (function(module, exports, __webpack_require__) {
  575. var userAgent = __webpack_require__("342f");
  576. module.exports = /(iphone|ipod|ipad).*applewebkit/i.test(userAgent);
  577. /***/ }),
  578. /***/ "1d80":
  579. /***/ (function(module, exports) {
  580. // `RequireObjectCoercible` abstract operation
  581. // https://tc39.es/ecma262/#sec-requireobjectcoercible
  582. module.exports = function (it) {
  583. if (it == undefined) throw TypeError("Can't call method on " + it);
  584. return it;
  585. };
  586. /***/ }),
  587. /***/ "1dde":
  588. /***/ (function(module, exports, __webpack_require__) {
  589. var fails = __webpack_require__("d039");
  590. var wellKnownSymbol = __webpack_require__("b622");
  591. var V8_VERSION = __webpack_require__("2d00");
  592. var SPECIES = wellKnownSymbol('species');
  593. module.exports = function (METHOD_NAME) {
  594. // We can't use this feature detection in V8 since it causes
  595. // deoptimization and serious performance degradation
  596. // https://github.com/zloirock/core-js/issues/677
  597. return V8_VERSION >= 51 || !fails(function () {
  598. var array = [];
  599. var constructor = array.constructor = {};
  600. constructor[SPECIES] = function () {
  601. return { foo: 1 };
  602. };
  603. return array[METHOD_NAME](Boolean).foo !== 1;
  604. });
  605. };
  606. /***/ }),
  607. /***/ "2266":
  608. /***/ (function(module, exports, __webpack_require__) {
  609. var anObject = __webpack_require__("825a");
  610. var isArrayIteratorMethod = __webpack_require__("e95a");
  611. var toLength = __webpack_require__("50c4");
  612. var bind = __webpack_require__("0366");
  613. var getIteratorMethod = __webpack_require__("35a1");
  614. var iteratorClose = __webpack_require__("2a62");
  615. var Result = function (stopped, result) {
  616. this.stopped = stopped;
  617. this.result = result;
  618. };
  619. module.exports = function (iterable, unboundFunction, options) {
  620. var that = options && options.that;
  621. var AS_ENTRIES = !!(options && options.AS_ENTRIES);
  622. var IS_ITERATOR = !!(options && options.IS_ITERATOR);
  623. var INTERRUPTED = !!(options && options.INTERRUPTED);
  624. var fn = bind(unboundFunction, that, 1 + AS_ENTRIES + INTERRUPTED);
  625. var iterator, iterFn, index, length, result, next, step;
  626. var stop = function (condition) {
  627. if (iterator) iteratorClose(iterator);
  628. return new Result(true, condition);
  629. };
  630. var callFn = function (value) {
  631. if (AS_ENTRIES) {
  632. anObject(value);
  633. return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
  634. } return INTERRUPTED ? fn(value, stop) : fn(value);
  635. };
  636. if (IS_ITERATOR) {
  637. iterator = iterable;
  638. } else {
  639. iterFn = getIteratorMethod(iterable);
  640. if (typeof iterFn != 'function') throw TypeError('Target is not iterable');
  641. // optimisation for array iterators
  642. if (isArrayIteratorMethod(iterFn)) {
  643. for (index = 0, length = toLength(iterable.length); length > index; index++) {
  644. result = callFn(iterable[index]);
  645. if (result && result instanceof Result) return result;
  646. } return new Result(false);
  647. }
  648. iterator = iterFn.call(iterable);
  649. }
  650. next = iterator.next;
  651. while (!(step = next.call(iterator)).done) {
  652. try {
  653. result = callFn(step.value);
  654. } catch (error) {
  655. iteratorClose(iterator);
  656. throw error;
  657. }
  658. if (typeof result == 'object' && result && result instanceof Result) return result;
  659. } return new Result(false);
  660. };
  661. /***/ }),
  662. /***/ "23cb":
  663. /***/ (function(module, exports, __webpack_require__) {
  664. var toInteger = __webpack_require__("a691");
  665. var max = Math.max;
  666. var min = Math.min;
  667. // Helper for a popular repeating case of the spec:
  668. // Let integer be ? ToInteger(index).
  669. // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
  670. module.exports = function (index, length) {
  671. var integer = toInteger(index);
  672. return integer < 0 ? max(integer + length, 0) : min(integer, length);
  673. };
  674. /***/ }),
  675. /***/ "23e7":
  676. /***/ (function(module, exports, __webpack_require__) {
  677. var global = __webpack_require__("da84");
  678. var getOwnPropertyDescriptor = __webpack_require__("06cf").f;
  679. var createNonEnumerableProperty = __webpack_require__("9112");
  680. var redefine = __webpack_require__("6eeb");
  681. var setGlobal = __webpack_require__("ce4e");
  682. var copyConstructorProperties = __webpack_require__("e893");
  683. var isForced = __webpack_require__("94ca");
  684. /*
  685. options.target - name of the target object
  686. options.global - target is the global object
  687. options.stat - export as static methods of target
  688. options.proto - export as prototype methods of target
  689. options.real - real prototype method for the `pure` version
  690. options.forced - export even if the native feature is available
  691. options.bind - bind methods to the target, required for the `pure` version
  692. options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
  693. options.unsafe - use the simple assignment of property instead of delete + defineProperty
  694. options.sham - add a flag to not completely full polyfills
  695. options.enumerable - export as enumerable property
  696. options.noTargetGet - prevent calling a getter on target
  697. */
  698. module.exports = function (options, source) {
  699. var TARGET = options.target;
  700. var GLOBAL = options.global;
  701. var STATIC = options.stat;
  702. var FORCED, target, key, targetProperty, sourceProperty, descriptor;
  703. if (GLOBAL) {
  704. target = global;
  705. } else if (STATIC) {
  706. target = global[TARGET] || setGlobal(TARGET, {});
  707. } else {
  708. target = (global[TARGET] || {}).prototype;
  709. }
  710. if (target) for (key in source) {
  711. sourceProperty = source[key];
  712. if (options.noTargetGet) {
  713. descriptor = getOwnPropertyDescriptor(target, key);
  714. targetProperty = descriptor && descriptor.value;
  715. } else targetProperty = target[key];
  716. FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
  717. // contained in target
  718. if (!FORCED && targetProperty !== undefined) {
  719. if (typeof sourceProperty === typeof targetProperty) continue;
  720. copyConstructorProperties(sourceProperty, targetProperty);
  721. }
  722. // add a flag to not completely full polyfills
  723. if (options.sham || (targetProperty && targetProperty.sham)) {
  724. createNonEnumerableProperty(sourceProperty, 'sham', true);
  725. }
  726. // extend global
  727. redefine(target, key, sourceProperty, options);
  728. }
  729. };
  730. /***/ }),
  731. /***/ "241c":
  732. /***/ (function(module, exports, __webpack_require__) {
  733. var internalObjectKeys = __webpack_require__("ca84");
  734. var enumBugKeys = __webpack_require__("7839");
  735. var hiddenKeys = enumBugKeys.concat('length', 'prototype');
  736. // `Object.getOwnPropertyNames` method
  737. // https://tc39.es/ecma262/#sec-object.getownpropertynames
  738. exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  739. return internalObjectKeys(O, hiddenKeys);
  740. };
  741. /***/ }),
  742. /***/ "2532":
  743. /***/ (function(module, exports, __webpack_require__) {
  744. "use strict";
  745. var $ = __webpack_require__("23e7");
  746. var notARegExp = __webpack_require__("5a34");
  747. var requireObjectCoercible = __webpack_require__("1d80");
  748. var correctIsRegExpLogic = __webpack_require__("ab13");
  749. // `String.prototype.includes` method
  750. // https://tc39.es/ecma262/#sec-string.prototype.includes
  751. $({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, {
  752. includes: function includes(searchString /* , position = 0 */) {
  753. return !!~String(requireObjectCoercible(this))
  754. .indexOf(notARegExp(searchString), arguments.length > 1 ? arguments[1] : undefined);
  755. }
  756. });
  757. /***/ }),
  758. /***/ "25f0":
  759. /***/ (function(module, exports, __webpack_require__) {
  760. "use strict";
  761. var redefine = __webpack_require__("6eeb");
  762. var anObject = __webpack_require__("825a");
  763. var fails = __webpack_require__("d039");
  764. var flags = __webpack_require__("ad6d");
  765. var TO_STRING = 'toString';
  766. var RegExpPrototype = RegExp.prototype;
  767. var nativeToString = RegExpPrototype[TO_STRING];
  768. var NOT_GENERIC = fails(function () { return nativeToString.call({ source: 'a', flags: 'b' }) != '/a/b'; });
  769. // FF44- RegExp#toString has a wrong name
  770. var INCORRECT_NAME = nativeToString.name != TO_STRING;
  771. // `RegExp.prototype.toString` method
  772. // https://tc39.es/ecma262/#sec-regexp.prototype.tostring
  773. if (NOT_GENERIC || INCORRECT_NAME) {
  774. redefine(RegExp.prototype, TO_STRING, function toString() {
  775. var R = anObject(this);
  776. var p = String(R.source);
  777. var rf = R.flags;
  778. var f = String(rf === undefined && R instanceof RegExp && !('flags' in RegExpPrototype) ? flags.call(R) : rf);
  779. return '/' + p + '/' + f;
  780. }, { unsafe: true });
  781. }
  782. /***/ }),
  783. /***/ "2626":
  784. /***/ (function(module, exports, __webpack_require__) {
  785. "use strict";
  786. var getBuiltIn = __webpack_require__("d066");
  787. var definePropertyModule = __webpack_require__("9bf2");
  788. var wellKnownSymbol = __webpack_require__("b622");
  789. var DESCRIPTORS = __webpack_require__("83ab");
  790. var SPECIES = wellKnownSymbol('species');
  791. module.exports = function (CONSTRUCTOR_NAME) {
  792. var Constructor = getBuiltIn(CONSTRUCTOR_NAME);
  793. var defineProperty = definePropertyModule.f;
  794. if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) {
  795. defineProperty(Constructor, SPECIES, {
  796. configurable: true,
  797. get: function () { return this; }
  798. });
  799. }
  800. };
  801. /***/ }),
  802. /***/ "2a62":
  803. /***/ (function(module, exports, __webpack_require__) {
  804. var anObject = __webpack_require__("825a");
  805. module.exports = function (iterator) {
  806. var returnMethod = iterator['return'];
  807. if (returnMethod !== undefined) {
  808. return anObject(returnMethod.call(iterator)).value;
  809. }
  810. };
  811. /***/ }),
  812. /***/ "2b3d":
  813. /***/ (function(module, exports, __webpack_require__) {
  814. "use strict";
  815. // TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env`
  816. __webpack_require__("3ca3");
  817. var $ = __webpack_require__("23e7");
  818. var DESCRIPTORS = __webpack_require__("83ab");
  819. var USE_NATIVE_URL = __webpack_require__("0d3b");
  820. var global = __webpack_require__("da84");
  821. var defineProperties = __webpack_require__("37e8");
  822. var redefine = __webpack_require__("6eeb");
  823. var anInstance = __webpack_require__("19aa");
  824. var has = __webpack_require__("5135");
  825. var assign = __webpack_require__("60da");
  826. var arrayFrom = __webpack_require__("4df4");
  827. var codeAt = __webpack_require__("6547").codeAt;
  828. var toASCII = __webpack_require__("5fb2");
  829. var setToStringTag = __webpack_require__("d44e");
  830. var URLSearchParamsModule = __webpack_require__("9861");
  831. var InternalStateModule = __webpack_require__("69f3");
  832. var NativeURL = global.URL;
  833. var URLSearchParams = URLSearchParamsModule.URLSearchParams;
  834. var getInternalSearchParamsState = URLSearchParamsModule.getState;
  835. var setInternalState = InternalStateModule.set;
  836. var getInternalURLState = InternalStateModule.getterFor('URL');
  837. var floor = Math.floor;
  838. var pow = Math.pow;
  839. var INVALID_AUTHORITY = 'Invalid authority';
  840. var INVALID_SCHEME = 'Invalid scheme';
  841. var INVALID_HOST = 'Invalid host';
  842. var INVALID_PORT = 'Invalid port';
  843. var ALPHA = /[A-Za-z]/;
  844. var ALPHANUMERIC = /[\d+-.A-Za-z]/;
  845. var DIGIT = /\d/;
  846. var HEX_START = /^(0x|0X)/;
  847. var OCT = /^[0-7]+$/;
  848. var DEC = /^\d+$/;
  849. var HEX = /^[\dA-Fa-f]+$/;
  850. /* eslint-disable no-control-regex -- safe */
  851. var FORBIDDEN_HOST_CODE_POINT = /[\u0000\t\u000A\u000D #%/:?@[\\]]/;
  852. var FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT = /[\u0000\t\u000A\u000D #/:?@[\\]]/;
  853. var LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE = /^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g;
  854. var TAB_AND_NEW_LINE = /[\t\u000A\u000D]/g;
  855. /* eslint-enable no-control-regex -- safe */
  856. var EOF;
  857. var parseHost = function (url, input) {
  858. var result, codePoints, index;
  859. if (input.charAt(0) == '[') {
  860. if (input.charAt(input.length - 1) != ']') return INVALID_HOST;
  861. result = parseIPv6(input.slice(1, -1));
  862. if (!result) return INVALID_HOST;
  863. url.host = result;
  864. // opaque host
  865. } else if (!isSpecial(url)) {
  866. if (FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT.test(input)) return INVALID_HOST;
  867. result = '';
  868. codePoints = arrayFrom(input);
  869. for (index = 0; index < codePoints.length; index++) {
  870. result += percentEncode(codePoints[index], C0ControlPercentEncodeSet);
  871. }
  872. url.host = result;
  873. } else {
  874. input = toASCII(input);
  875. if (FORBIDDEN_HOST_CODE_POINT.test(input)) return INVALID_HOST;
  876. result = parseIPv4(input);
  877. if (result === null) return INVALID_HOST;
  878. url.host = result;
  879. }
  880. };
  881. var parseIPv4 = function (input) {
  882. var parts = input.split('.');
  883. var partsLength, numbers, index, part, radix, number, ipv4;
  884. if (parts.length && parts[parts.length - 1] == '') {
  885. parts.pop();
  886. }
  887. partsLength = parts.length;
  888. if (partsLength > 4) return input;
  889. numbers = [];
  890. for (index = 0; index < partsLength; index++) {
  891. part = parts[index];
  892. if (part == '') return input;
  893. radix = 10;
  894. if (part.length > 1 && part.charAt(0) == '0') {
  895. radix = HEX_START.test(part) ? 16 : 8;
  896. part = part.slice(radix == 8 ? 1 : 2);
  897. }
  898. if (part === '') {
  899. number = 0;
  900. } else {
  901. if (!(radix == 10 ? DEC : radix == 8 ? OCT : HEX).test(part)) return input;
  902. number = parseInt(part, radix);
  903. }
  904. numbers.push(number);
  905. }
  906. for (index = 0; index < partsLength; index++) {
  907. number = numbers[index];
  908. if (index == partsLength - 1) {
  909. if (number >= pow(256, 5 - partsLength)) return null;
  910. } else if (number > 255) return null;
  911. }
  912. ipv4 = numbers.pop();
  913. for (index = 0; index < numbers.length; index++) {
  914. ipv4 += numbers[index] * pow(256, 3 - index);
  915. }
  916. return ipv4;
  917. };
  918. // eslint-disable-next-line max-statements -- TODO
  919. var parseIPv6 = function (input) {
  920. var address = [0, 0, 0, 0, 0, 0, 0, 0];
  921. var pieceIndex = 0;
  922. var compress = null;
  923. var pointer = 0;
  924. var value, length, numbersSeen, ipv4Piece, number, swaps, swap;
  925. var char = function () {
  926. return input.charAt(pointer);
  927. };
  928. if (char() == ':') {
  929. if (input.charAt(1) != ':') return;
  930. pointer += 2;
  931. pieceIndex++;
  932. compress = pieceIndex;
  933. }
  934. while (char()) {
  935. if (pieceIndex == 8) return;
  936. if (char() == ':') {
  937. if (compress !== null) return;
  938. pointer++;
  939. pieceIndex++;
  940. compress = pieceIndex;
  941. continue;
  942. }
  943. value = length = 0;
  944. while (length < 4 && HEX.test(char())) {
  945. value = value * 16 + parseInt(char(), 16);
  946. pointer++;
  947. length++;
  948. }
  949. if (char() == '.') {
  950. if (length == 0) return;
  951. pointer -= length;
  952. if (pieceIndex > 6) return;
  953. numbersSeen = 0;
  954. while (char()) {
  955. ipv4Piece = null;
  956. if (numbersSeen > 0) {
  957. if (char() == '.' && numbersSeen < 4) pointer++;
  958. else return;
  959. }
  960. if (!DIGIT.test(char())) return;
  961. while (DIGIT.test(char())) {
  962. number = parseInt(char(), 10);
  963. if (ipv4Piece === null) ipv4Piece = number;
  964. else if (ipv4Piece == 0) return;
  965. else ipv4Piece = ipv4Piece * 10 + number;
  966. if (ipv4Piece > 255) return;
  967. pointer++;
  968. }
  969. address[pieceIndex] = address[pieceIndex] * 256 + ipv4Piece;
  970. numbersSeen++;
  971. if (numbersSeen == 2 || numbersSeen == 4) pieceIndex++;
  972. }
  973. if (numbersSeen != 4) return;
  974. break;
  975. } else if (char() == ':') {
  976. pointer++;
  977. if (!char()) return;
  978. } else if (char()) return;
  979. address[pieceIndex++] = value;
  980. }
  981. if (compress !== null) {
  982. swaps = pieceIndex - compress;
  983. pieceIndex = 7;
  984. while (pieceIndex != 0 && swaps > 0) {
  985. swap = address[pieceIndex];
  986. address[pieceIndex--] = address[compress + swaps - 1];
  987. address[compress + --swaps] = swap;
  988. }
  989. } else if (pieceIndex != 8) return;
  990. return address;
  991. };
  992. var findLongestZeroSequence = function (ipv6) {
  993. var maxIndex = null;
  994. var maxLength = 1;
  995. var currStart = null;
  996. var currLength = 0;
  997. var index = 0;
  998. for (; index < 8; index++) {
  999. if (ipv6[index] !== 0) {
  1000. if (currLength > maxLength) {
  1001. maxIndex = currStart;
  1002. maxLength = currLength;
  1003. }
  1004. currStart = null;
  1005. currLength = 0;
  1006. } else {
  1007. if (currStart === null) currStart = index;
  1008. ++currLength;
  1009. }
  1010. }
  1011. if (currLength > maxLength) {
  1012. maxIndex = currStart;
  1013. maxLength = currLength;
  1014. }
  1015. return maxIndex;
  1016. };
  1017. var serializeHost = function (host) {
  1018. var result, index, compress, ignore0;
  1019. // ipv4
  1020. if (typeof host == 'number') {
  1021. result = [];
  1022. for (index = 0; index < 4; index++) {
  1023. result.unshift(host % 256);
  1024. host = floor(host / 256);
  1025. } return result.join('.');
  1026. // ipv6
  1027. } else if (typeof host == 'object') {
  1028. result = '';
  1029. compress = findLongestZeroSequence(host);
  1030. for (index = 0; index < 8; index++) {
  1031. if (ignore0 && host[index] === 0) continue;
  1032. if (ignore0) ignore0 = false;
  1033. if (compress === index) {
  1034. result += index ? ':' : '::';
  1035. ignore0 = true;
  1036. } else {
  1037. result += host[index].toString(16);
  1038. if (index < 7) result += ':';
  1039. }
  1040. }
  1041. return '[' + result + ']';
  1042. } return host;
  1043. };
  1044. var C0ControlPercentEncodeSet = {};
  1045. var fragmentPercentEncodeSet = assign({}, C0ControlPercentEncodeSet, {
  1046. ' ': 1, '"': 1, '<': 1, '>': 1, '`': 1
  1047. });
  1048. var pathPercentEncodeSet = assign({}, fragmentPercentEncodeSet, {
  1049. '#': 1, '?': 1, '{': 1, '}': 1
  1050. });
  1051. var userinfoPercentEncodeSet = assign({}, pathPercentEncodeSet, {
  1052. '/': 1, ':': 1, ';': 1, '=': 1, '@': 1, '[': 1, '\\': 1, ']': 1, '^': 1, '|': 1
  1053. });
  1054. var percentEncode = function (char, set) {
  1055. var code = codeAt(char, 0);
  1056. return code > 0x20 && code < 0x7F && !has(set, char) ? char : encodeURIComponent(char);
  1057. };
  1058. var specialSchemes = {
  1059. ftp: 21,
  1060. file: null,
  1061. http: 80,
  1062. https: 443,
  1063. ws: 80,
  1064. wss: 443
  1065. };
  1066. var isSpecial = function (url) {
  1067. return has(specialSchemes, url.scheme);
  1068. };
  1069. var includesCredentials = function (url) {
  1070. return url.username != '' || url.password != '';
  1071. };
  1072. var cannotHaveUsernamePasswordPort = function (url) {
  1073. return !url.host || url.cannotBeABaseURL || url.scheme == 'file';
  1074. };
  1075. var isWindowsDriveLetter = function (string, normalized) {
  1076. var second;
  1077. return string.length == 2 && ALPHA.test(string.charAt(0))
  1078. && ((second = string.charAt(1)) == ':' || (!normalized && second == '|'));
  1079. };
  1080. var startsWithWindowsDriveLetter = function (string) {
  1081. var third;
  1082. return string.length > 1 && isWindowsDriveLetter(string.slice(0, 2)) && (
  1083. string.length == 2 ||
  1084. ((third = string.charAt(2)) === '/' || third === '\\' || third === '?' || third === '#')
  1085. );
  1086. };
  1087. var shortenURLsPath = function (url) {
  1088. var path = url.path;
  1089. var pathSize = path.length;
  1090. if (pathSize && (url.scheme != 'file' || pathSize != 1 || !isWindowsDriveLetter(path[0], true))) {
  1091. path.pop();
  1092. }
  1093. };
  1094. var isSingleDot = function (segment) {
  1095. return segment === '.' || segment.toLowerCase() === '%2e';
  1096. };
  1097. var isDoubleDot = function (segment) {
  1098. segment = segment.toLowerCase();
  1099. return segment === '..' || segment === '%2e.' || segment === '.%2e' || segment === '%2e%2e';
  1100. };
  1101. // States:
  1102. var SCHEME_START = {};
  1103. var SCHEME = {};
  1104. var NO_SCHEME = {};
  1105. var SPECIAL_RELATIVE_OR_AUTHORITY = {};
  1106. var PATH_OR_AUTHORITY = {};
  1107. var RELATIVE = {};
  1108. var RELATIVE_SLASH = {};
  1109. var SPECIAL_AUTHORITY_SLASHES = {};
  1110. var SPECIAL_AUTHORITY_IGNORE_SLASHES = {};
  1111. var AUTHORITY = {};
  1112. var HOST = {};
  1113. var HOSTNAME = {};
  1114. var PORT = {};
  1115. var FILE = {};
  1116. var FILE_SLASH = {};
  1117. var FILE_HOST = {};
  1118. var PATH_START = {};
  1119. var PATH = {};
  1120. var CANNOT_BE_A_BASE_URL_PATH = {};
  1121. var QUERY = {};
  1122. var FRAGMENT = {};
  1123. // eslint-disable-next-line max-statements -- TODO
  1124. var parseURL = function (url, input, stateOverride, base) {
  1125. var state = stateOverride || SCHEME_START;
  1126. var pointer = 0;
  1127. var buffer = '';
  1128. var seenAt = false;
  1129. var seenBracket = false;
  1130. var seenPasswordToken = false;
  1131. var codePoints, char, bufferCodePoints, failure;
  1132. if (!stateOverride) {
  1133. url.scheme = '';
  1134. url.username = '';
  1135. url.password = '';
  1136. url.host = null;
  1137. url.port = null;
  1138. url.path = [];
  1139. url.query = null;
  1140. url.fragment = null;
  1141. url.cannotBeABaseURL = false;
  1142. input = input.replace(LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE, '');
  1143. }
  1144. input = input.replace(TAB_AND_NEW_LINE, '');
  1145. codePoints = arrayFrom(input);
  1146. while (pointer <= codePoints.length) {
  1147. char = codePoints[pointer];
  1148. switch (state) {
  1149. case SCHEME_START:
  1150. if (char && ALPHA.test(char)) {
  1151. buffer += char.toLowerCase();
  1152. state = SCHEME;
  1153. } else if (!stateOverride) {
  1154. state = NO_SCHEME;
  1155. continue;
  1156. } else return INVALID_SCHEME;
  1157. break;
  1158. case SCHEME:
  1159. if (char && (ALPHANUMERIC.test(char) || char == '+' || char == '-' || char == '.')) {
  1160. buffer += char.toLowerCase();
  1161. } else if (char == ':') {
  1162. if (stateOverride && (
  1163. (isSpecial(url) != has(specialSchemes, buffer)) ||
  1164. (buffer == 'file' && (includesCredentials(url) || url.port !== null)) ||
  1165. (url.scheme == 'file' && !url.host)
  1166. )) return;
  1167. url.scheme = buffer;
  1168. if (stateOverride) {
  1169. if (isSpecial(url) && specialSchemes[url.scheme] == url.port) url.port = null;
  1170. return;
  1171. }
  1172. buffer = '';
  1173. if (url.scheme == 'file') {
  1174. state = FILE;
  1175. } else if (isSpecial(url) && base && base.scheme == url.scheme) {
  1176. state = SPECIAL_RELATIVE_OR_AUTHORITY;
  1177. } else if (isSpecial(url)) {
  1178. state = SPECIAL_AUTHORITY_SLASHES;
  1179. } else if (codePoints[pointer + 1] == '/') {
  1180. state = PATH_OR_AUTHORITY;
  1181. pointer++;
  1182. } else {
  1183. url.cannotBeABaseURL = true;
  1184. url.path.push('');
  1185. state = CANNOT_BE_A_BASE_URL_PATH;
  1186. }
  1187. } else if (!stateOverride) {
  1188. buffer = '';
  1189. state = NO_SCHEME;
  1190. pointer = 0;
  1191. continue;
  1192. } else return INVALID_SCHEME;
  1193. break;
  1194. case NO_SCHEME:
  1195. if (!base || (base.cannotBeABaseURL && char != '#')) return INVALID_SCHEME;
  1196. if (base.cannotBeABaseURL && char == '#') {
  1197. url.scheme = base.scheme;
  1198. url.path = base.path.slice();
  1199. url.query = base.query;
  1200. url.fragment = '';
  1201. url.cannotBeABaseURL = true;
  1202. state = FRAGMENT;
  1203. break;
  1204. }
  1205. state = base.scheme == 'file' ? FILE : RELATIVE;
  1206. continue;
  1207. case SPECIAL_RELATIVE_OR_AUTHORITY:
  1208. if (char == '/' && codePoints[pointer + 1] == '/') {
  1209. state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
  1210. pointer++;
  1211. } else {
  1212. state = RELATIVE;
  1213. continue;
  1214. } break;
  1215. case PATH_OR_AUTHORITY:
  1216. if (char == '/') {
  1217. state = AUTHORITY;
  1218. break;
  1219. } else {
  1220. state = PATH;
  1221. continue;
  1222. }
  1223. case RELATIVE:
  1224. url.scheme = base.scheme;
  1225. if (char == EOF) {
  1226. url.username = base.username;
  1227. url.password = base.password;
  1228. url.host = base.host;
  1229. url.port = base.port;
  1230. url.path = base.path.slice();
  1231. url.query = base.query;
  1232. } else if (char == '/' || (char == '\\' && isSpecial(url))) {
  1233. state = RELATIVE_SLASH;
  1234. } else if (char == '?') {
  1235. url.username = base.username;
  1236. url.password = base.password;
  1237. url.host = base.host;
  1238. url.port = base.port;
  1239. url.path = base.path.slice();
  1240. url.query = '';
  1241. state = QUERY;
  1242. } else if (char == '#') {
  1243. url.username = base.username;
  1244. url.password = base.password;
  1245. url.host = base.host;
  1246. url.port = base.port;
  1247. url.path = base.path.slice();
  1248. url.query = base.query;
  1249. url.fragment = '';
  1250. state = FRAGMENT;
  1251. } else {
  1252. url.username = base.username;
  1253. url.password = base.password;
  1254. url.host = base.host;
  1255. url.port = base.port;
  1256. url.path = base.path.slice();
  1257. url.path.pop();
  1258. state = PATH;
  1259. continue;
  1260. } break;
  1261. case RELATIVE_SLASH:
  1262. if (isSpecial(url) && (char == '/' || char == '\\')) {
  1263. state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
  1264. } else if (char == '/') {
  1265. state = AUTHORITY;
  1266. } else {
  1267. url.username = base.username;
  1268. url.password = base.password;
  1269. url.host = base.host;
  1270. url.port = base.port;
  1271. state = PATH;
  1272. continue;
  1273. } break;
  1274. case SPECIAL_AUTHORITY_SLASHES:
  1275. state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
  1276. if (char != '/' || buffer.charAt(pointer + 1) != '/') continue;
  1277. pointer++;
  1278. break;
  1279. case SPECIAL_AUTHORITY_IGNORE_SLASHES:
  1280. if (char != '/' && char != '\\') {
  1281. state = AUTHORITY;
  1282. continue;
  1283. } break;
  1284. case AUTHORITY:
  1285. if (char == '@') {
  1286. if (seenAt) buffer = '%40' + buffer;
  1287. seenAt = true;
  1288. bufferCodePoints = arrayFrom(buffer);
  1289. for (var i = 0; i < bufferCodePoints.length; i++) {
  1290. var codePoint = bufferCodePoints[i];
  1291. if (codePoint == ':' && !seenPasswordToken) {
  1292. seenPasswordToken = true;
  1293. continue;
  1294. }
  1295. var encodedCodePoints = percentEncode(codePoint, userinfoPercentEncodeSet);
  1296. if (seenPasswordToken) url.password += encodedCodePoints;
  1297. else url.username += encodedCodePoints;
  1298. }
  1299. buffer = '';
  1300. } else if (
  1301. char == EOF || char == '/' || char == '?' || char == '#' ||
  1302. (char == '\\' && isSpecial(url))
  1303. ) {
  1304. if (seenAt && buffer == '') return INVALID_AUTHORITY;
  1305. pointer -= arrayFrom(buffer).length + 1;
  1306. buffer = '';
  1307. state = HOST;
  1308. } else buffer += char;
  1309. break;
  1310. case HOST:
  1311. case HOSTNAME:
  1312. if (stateOverride && url.scheme == 'file') {
  1313. state = FILE_HOST;
  1314. continue;
  1315. } else if (char == ':' && !seenBracket) {
  1316. if (buffer == '') return INVALID_HOST;
  1317. failure = parseHost(url, buffer);
  1318. if (failure) return failure;
  1319. buffer = '';
  1320. state = PORT;
  1321. if (stateOverride == HOSTNAME) return;
  1322. } else if (
  1323. char == EOF || char == '/' || char == '?' || char == '#' ||
  1324. (char == '\\' && isSpecial(url))
  1325. ) {
  1326. if (isSpecial(url) && buffer == '') return INVALID_HOST;
  1327. if (stateOverride && buffer == '' && (includesCredentials(url) || url.port !== null)) return;
  1328. failure = parseHost(url, buffer);
  1329. if (failure) return failure;
  1330. buffer = '';
  1331. state = PATH_START;
  1332. if (stateOverride) return;
  1333. continue;
  1334. } else {
  1335. if (char == '[') seenBracket = true;
  1336. else if (char == ']') seenBracket = false;
  1337. buffer += char;
  1338. } break;
  1339. case PORT:
  1340. if (DIGIT.test(char)) {
  1341. buffer += char;
  1342. } else if (
  1343. char == EOF || char == '/' || char == '?' || char == '#' ||
  1344. (char == '\\' && isSpecial(url)) ||
  1345. stateOverride
  1346. ) {
  1347. if (buffer != '') {
  1348. var port = parseInt(buffer, 10);
  1349. if (port > 0xFFFF) return INVALID_PORT;
  1350. url.port = (isSpecial(url) && port === specialSchemes[url.scheme]) ? null : port;
  1351. buffer = '';
  1352. }
  1353. if (stateOverride) return;
  1354. state = PATH_START;
  1355. continue;
  1356. } else return INVALID_PORT;
  1357. break;
  1358. case FILE:
  1359. url.scheme = 'file';
  1360. if (char == '/' || char == '\\') state = FILE_SLASH;
  1361. else if (base && base.scheme == 'file') {
  1362. if (char == EOF) {
  1363. url.host = base.host;
  1364. url.path = base.path.slice();
  1365. url.query = base.query;
  1366. } else if (char == '?') {
  1367. url.host = base.host;
  1368. url.path = base.path.slice();
  1369. url.query = '';
  1370. state = QUERY;
  1371. } else if (char == '#') {
  1372. url.host = base.host;
  1373. url.path = base.path.slice();
  1374. url.query = base.query;
  1375. url.fragment = '';
  1376. state = FRAGMENT;
  1377. } else {
  1378. if (!startsWithWindowsDriveLetter(codePoints.slice(pointer).join(''))) {
  1379. url.host = base.host;
  1380. url.path = base.path.slice();
  1381. shortenURLsPath(url);
  1382. }
  1383. state = PATH;
  1384. continue;
  1385. }
  1386. } else {
  1387. state = PATH;
  1388. continue;
  1389. } break;
  1390. case FILE_SLASH:
  1391. if (char == '/' || char == '\\') {
  1392. state = FILE_HOST;
  1393. break;
  1394. }
  1395. if (base && base.scheme == 'file' && !startsWithWindowsDriveLetter(codePoints.slice(pointer).join(''))) {
  1396. if (isWindowsDriveLetter(base.path[0], true)) url.path.push(base.path[0]);
  1397. else url.host = base.host;
  1398. }
  1399. state = PATH;
  1400. continue;
  1401. case FILE_HOST:
  1402. if (char == EOF || char == '/' || char == '\\' || char == '?' || char == '#') {
  1403. if (!stateOverride && isWindowsDriveLetter(buffer)) {
  1404. state = PATH;
  1405. } else if (buffer == '') {
  1406. url.host = '';
  1407. if (stateOverride) return;
  1408. state = PATH_START;
  1409. } else {
  1410. failure = parseHost(url, buffer);
  1411. if (failure) return failure;
  1412. if (url.host == 'localhost') url.host = '';
  1413. if (stateOverride) return;
  1414. buffer = '';
  1415. state = PATH_START;
  1416. } continue;
  1417. } else buffer += char;
  1418. break;
  1419. case PATH_START:
  1420. if (isSpecial(url)) {
  1421. state = PATH;
  1422. if (char != '/' && char != '\\') continue;
  1423. } else if (!stateOverride && char == '?') {
  1424. url.query = '';
  1425. state = QUERY;
  1426. } else if (!stateOverride && char == '#') {
  1427. url.fragment = '';
  1428. state = FRAGMENT;
  1429. } else if (char != EOF) {
  1430. state = PATH;
  1431. if (char != '/') continue;
  1432. } break;
  1433. case PATH:
  1434. if (
  1435. char == EOF || char == '/' ||
  1436. (char == '\\' && isSpecial(url)) ||
  1437. (!stateOverride && (char == '?' || char == '#'))
  1438. ) {
  1439. if (isDoubleDot(buffer)) {
  1440. shortenURLsPath(url);
  1441. if (char != '/' && !(char == '\\' && isSpecial(url))) {
  1442. url.path.push('');
  1443. }
  1444. } else if (isSingleDot(buffer)) {
  1445. if (char != '/' && !(char == '\\' && isSpecial(url))) {
  1446. url.path.push('');
  1447. }
  1448. } else {
  1449. if (url.scheme == 'file' && !url.path.length && isWindowsDriveLetter(buffer)) {
  1450. if (url.host) url.host = '';
  1451. buffer = buffer.charAt(0) + ':'; // normalize windows drive letter
  1452. }
  1453. url.path.push(buffer);
  1454. }
  1455. buffer = '';
  1456. if (url.scheme == 'file' && (char == EOF || char == '?' || char == '#')) {
  1457. while (url.path.length > 1 && url.path[0] === '') {
  1458. url.path.shift();
  1459. }
  1460. }
  1461. if (char == '?') {
  1462. url.query = '';
  1463. state = QUERY;
  1464. } else if (char == '#') {
  1465. url.fragment = '';
  1466. state = FRAGMENT;
  1467. }
  1468. } else {
  1469. buffer += percentEncode(char, pathPercentEncodeSet);
  1470. } break;
  1471. case CANNOT_BE_A_BASE_URL_PATH:
  1472. if (char == '?') {
  1473. url.query = '';
  1474. state = QUERY;
  1475. } else if (char == '#') {
  1476. url.fragment = '';
  1477. state = FRAGMENT;
  1478. } else if (char != EOF) {
  1479. url.path[0] += percentEncode(char, C0ControlPercentEncodeSet);
  1480. } break;
  1481. case QUERY:
  1482. if (!stateOverride && char == '#') {
  1483. url.fragment = '';
  1484. state = FRAGMENT;
  1485. } else if (char != EOF) {
  1486. if (char == "'" && isSpecial(url)) url.query += '%27';
  1487. else if (char == '#') url.query += '%23';
  1488. else url.query += percentEncode(char, C0ControlPercentEncodeSet);
  1489. } break;
  1490. case FRAGMENT:
  1491. if (char != EOF) url.fragment += percentEncode(char, fragmentPercentEncodeSet);
  1492. break;
  1493. }
  1494. pointer++;
  1495. }
  1496. };
  1497. // `URL` constructor
  1498. // https://url.spec.whatwg.org/#url-class
  1499. var URLConstructor = function URL(url /* , base */) {
  1500. var that = anInstance(this, URLConstructor, 'URL');
  1501. var base = arguments.length > 1 ? arguments[1] : undefined;
  1502. var urlString = String(url);
  1503. var state = setInternalState(that, { type: 'URL' });
  1504. var baseState, failure;
  1505. if (base !== undefined) {
  1506. if (base instanceof URLConstructor) baseState = getInternalURLState(base);
  1507. else {
  1508. failure = parseURL(baseState = {}, String(base));
  1509. if (failure) throw TypeError(failure);
  1510. }
  1511. }
  1512. failure = parseURL(state, urlString, null, baseState);
  1513. if (failure) throw TypeError(failure);
  1514. var searchParams = state.searchParams = new URLSearchParams();
  1515. var searchParamsState = getInternalSearchParamsState(searchParams);
  1516. searchParamsState.updateSearchParams(state.query);
  1517. searchParamsState.updateURL = function () {
  1518. state.query = String(searchParams) || null;
  1519. };
  1520. if (!DESCRIPTORS) {
  1521. that.href = serializeURL.call(that);
  1522. that.origin = getOrigin.call(that);
  1523. that.protocol = getProtocol.call(that);
  1524. that.username = getUsername.call(that);
  1525. that.password = getPassword.call(that);
  1526. that.host = getHost.call(that);
  1527. that.hostname = getHostname.call(that);
  1528. that.port = getPort.call(that);
  1529. that.pathname = getPathname.call(that);
  1530. that.search = getSearch.call(that);
  1531. that.searchParams = getSearchParams.call(that);
  1532. that.hash = getHash.call(that);
  1533. }
  1534. };
  1535. var URLPrototype = URLConstructor.prototype;
  1536. var serializeURL = function () {
  1537. var url = getInternalURLState(this);
  1538. var scheme = url.scheme;
  1539. var username = url.username;
  1540. var password = url.password;
  1541. var host = url.host;
  1542. var port = url.port;
  1543. var path = url.path;
  1544. var query = url.query;
  1545. var fragment = url.fragment;
  1546. var output = scheme + ':';
  1547. if (host !== null) {
  1548. output += '//';
  1549. if (includesCredentials(url)) {
  1550. output += username + (password ? ':' + password : '') + '@';
  1551. }
  1552. output += serializeHost(host);
  1553. if (port !== null) output += ':' + port;
  1554. } else if (scheme == 'file') output += '//';
  1555. output += url.cannotBeABaseURL ? path[0] : path.length ? '/' + path.join('/') : '';
  1556. if (query !== null) output += '?' + query;
  1557. if (fragment !== null) output += '#' + fragment;
  1558. return output;
  1559. };
  1560. var getOrigin = function () {
  1561. var url = getInternalURLState(this);
  1562. var scheme = url.scheme;
  1563. var port = url.port;
  1564. if (scheme == 'blob') try {
  1565. return new URL(scheme.path[0]).origin;
  1566. } catch (error) {
  1567. return 'null';
  1568. }
  1569. if (scheme == 'file' || !isSpecial(url)) return 'null';
  1570. return scheme + '://' + serializeHost(url.host) + (port !== null ? ':' + port : '');
  1571. };
  1572. var getProtocol = function () {
  1573. return getInternalURLState(this).scheme + ':';
  1574. };
  1575. var getUsername = function () {
  1576. return getInternalURLState(this).username;
  1577. };
  1578. var getPassword = function () {
  1579. return getInternalURLState(this).password;
  1580. };
  1581. var getHost = function () {
  1582. var url = getInternalURLState(this);
  1583. var host = url.host;
  1584. var port = url.port;
  1585. return host === null ? ''
  1586. : port === null ? serializeHost(host)
  1587. : serializeHost(host) + ':' + port;
  1588. };
  1589. var getHostname = function () {
  1590. var host = getInternalURLState(this).host;
  1591. return host === null ? '' : serializeHost(host);
  1592. };
  1593. var getPort = function () {
  1594. var port = getInternalURLState(this).port;
  1595. return port === null ? '' : String(port);
  1596. };
  1597. var getPathname = function () {
  1598. var url = getInternalURLState(this);
  1599. var path = url.path;
  1600. return url.cannotBeABaseURL ? path[0] : path.length ? '/' + path.join('/') : '';
  1601. };
  1602. var getSearch = function () {
  1603. var query = getInternalURLState(this).query;
  1604. return query ? '?' + query : '';
  1605. };
  1606. var getSearchParams = function () {
  1607. return getInternalURLState(this).searchParams;
  1608. };
  1609. var getHash = function () {
  1610. var fragment = getInternalURLState(this).fragment;
  1611. return fragment ? '#' + fragment : '';
  1612. };
  1613. var accessorDescriptor = function (getter, setter) {
  1614. return { get: getter, set: setter, configurable: true, enumerable: true };
  1615. };
  1616. if (DESCRIPTORS) {
  1617. defineProperties(URLPrototype, {
  1618. // `URL.prototype.href` accessors pair
  1619. // https://url.spec.whatwg.org/#dom-url-href
  1620. href: accessorDescriptor(serializeURL, function (href) {
  1621. var url = getInternalURLState(this);
  1622. var urlString = String(href);
  1623. var failure = parseURL(url, urlString);
  1624. if (failure) throw TypeError(failure);
  1625. getInternalSearchParamsState(url.searchParams).updateSearchParams(url.query);
  1626. }),
  1627. // `URL.prototype.origin` getter
  1628. // https://url.spec.whatwg.org/#dom-url-origin
  1629. origin: accessorDescriptor(getOrigin),
  1630. // `URL.prototype.protocol` accessors pair
  1631. // https://url.spec.whatwg.org/#dom-url-protocol
  1632. protocol: accessorDescriptor(getProtocol, function (protocol) {
  1633. var url = getInternalURLState(this);
  1634. parseURL(url, String(protocol) + ':', SCHEME_START);
  1635. }),
  1636. // `URL.prototype.username` accessors pair
  1637. // https://url.spec.whatwg.org/#dom-url-username
  1638. username: accessorDescriptor(getUsername, function (username) {
  1639. var url = getInternalURLState(this);
  1640. var codePoints = arrayFrom(String(username));
  1641. if (cannotHaveUsernamePasswordPort(url)) return;
  1642. url.username = '';
  1643. for (var i = 0; i < codePoints.length; i++) {
  1644. url.username += percentEncode(codePoints[i], userinfoPercentEncodeSet);
  1645. }
  1646. }),
  1647. // `URL.prototype.password` accessors pair
  1648. // https://url.spec.whatwg.org/#dom-url-password
  1649. password: accessorDescriptor(getPassword, function (password) {
  1650. var url = getInternalURLState(this);
  1651. var codePoints = arrayFrom(String(password));
  1652. if (cannotHaveUsernamePasswordPort(url)) return;
  1653. url.password = '';
  1654. for (var i = 0; i < codePoints.length; i++) {
  1655. url.password += percentEncode(codePoints[i], userinfoPercentEncodeSet);
  1656. }
  1657. }),
  1658. // `URL.prototype.host` accessors pair
  1659. // https://url.spec.whatwg.org/#dom-url-host
  1660. host: accessorDescriptor(getHost, function (host) {
  1661. var url = getInternalURLState(this);
  1662. if (url.cannotBeABaseURL) return;
  1663. parseURL(url, String(host), HOST);
  1664. }),
  1665. // `URL.prototype.hostname` accessors pair
  1666. // https://url.spec.whatwg.org/#dom-url-hostname
  1667. hostname: accessorDescriptor(getHostname, function (hostname) {
  1668. var url = getInternalURLState(this);
  1669. if (url.cannotBeABaseURL) return;
  1670. parseURL(url, String(hostname), HOSTNAME);
  1671. }),
  1672. // `URL.prototype.port` accessors pair
  1673. // https://url.spec.whatwg.org/#dom-url-port
  1674. port: accessorDescriptor(getPort, function (port) {
  1675. var url = getInternalURLState(this);
  1676. if (cannotHaveUsernamePasswordPort(url)) return;
  1677. port = String(port);
  1678. if (port == '') url.port = null;
  1679. else parseURL(url, port, PORT);
  1680. }),
  1681. // `URL.prototype.pathname` accessors pair
  1682. // https://url.spec.whatwg.org/#dom-url-pathname
  1683. pathname: accessorDescriptor(getPathname, function (pathname) {
  1684. var url = getInternalURLState(this);
  1685. if (url.cannotBeABaseURL) return;
  1686. url.path = [];
  1687. parseURL(url, pathname + '', PATH_START);
  1688. }),
  1689. // `URL.prototype.search` accessors pair
  1690. // https://url.spec.whatwg.org/#dom-url-search
  1691. search: accessorDescriptor(getSearch, function (search) {
  1692. var url = getInternalURLState(this);
  1693. search = String(search);
  1694. if (search == '') {
  1695. url.query = null;
  1696. } else {
  1697. if ('?' == search.charAt(0)) search = search.slice(1);
  1698. url.query = '';
  1699. parseURL(url, search, QUERY);
  1700. }
  1701. getInternalSearchParamsState(url.searchParams).updateSearchParams(url.query);
  1702. }),
  1703. // `URL.prototype.searchParams` getter
  1704. // https://url.spec.whatwg.org/#dom-url-searchparams
  1705. searchParams: accessorDescriptor(getSearchParams),
  1706. // `URL.prototype.hash` accessors pair
  1707. // https://url.spec.whatwg.org/#dom-url-hash
  1708. hash: accessorDescriptor(getHash, function (hash) {
  1709. var url = getInternalURLState(this);
  1710. hash = String(hash);
  1711. if (hash == '') {
  1712. url.fragment = null;
  1713. return;
  1714. }
  1715. if ('#' == hash.charAt(0)) hash = hash.slice(1);
  1716. url.fragment = '';
  1717. parseURL(url, hash, FRAGMENT);
  1718. })
  1719. });
  1720. }
  1721. // `URL.prototype.toJSON` method
  1722. // https://url.spec.whatwg.org/#dom-url-tojson
  1723. redefine(URLPrototype, 'toJSON', function toJSON() {
  1724. return serializeURL.call(this);
  1725. }, { enumerable: true });
  1726. // `URL.prototype.toString` method
  1727. // https://url.spec.whatwg.org/#URL-stringification-behavior
  1728. redefine(URLPrototype, 'toString', function toString() {
  1729. return serializeURL.call(this);
  1730. }, { enumerable: true });
  1731. if (NativeURL) {
  1732. var nativeCreateObjectURL = NativeURL.createObjectURL;
  1733. var nativeRevokeObjectURL = NativeURL.revokeObjectURL;
  1734. // `URL.createObjectURL` method
  1735. // https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL
  1736. // eslint-disable-next-line no-unused-vars -- required for `.length`
  1737. if (nativeCreateObjectURL) redefine(URLConstructor, 'createObjectURL', function createObjectURL(blob) {
  1738. return nativeCreateObjectURL.apply(NativeURL, arguments);
  1739. });
  1740. // `URL.revokeObjectURL` method
  1741. // https://developer.mozilla.org/en-US/docs/Web/API/URL/revokeObjectURL
  1742. // eslint-disable-next-line no-unused-vars -- required for `.length`
  1743. if (nativeRevokeObjectURL) redefine(URLConstructor, 'revokeObjectURL', function revokeObjectURL(url) {
  1744. return nativeRevokeObjectURL.apply(NativeURL, arguments);
  1745. });
  1746. }
  1747. setToStringTag(URLConstructor, 'URL');
  1748. $({ global: true, forced: !USE_NATIVE_URL, sham: !DESCRIPTORS }, {
  1749. URL: URLConstructor
  1750. });
  1751. /***/ }),
  1752. /***/ "2cf4":
  1753. /***/ (function(module, exports, __webpack_require__) {
  1754. var global = __webpack_require__("da84");
  1755. var fails = __webpack_require__("d039");
  1756. var bind = __webpack_require__("0366");
  1757. var html = __webpack_require__("1be4");
  1758. var createElement = __webpack_require__("cc12");
  1759. var IS_IOS = __webpack_require__("1cdc");
  1760. var IS_NODE = __webpack_require__("605d");
  1761. var location = global.location;
  1762. var set = global.setImmediate;
  1763. var clear = global.clearImmediate;
  1764. var process = global.process;
  1765. var MessageChannel = global.MessageChannel;
  1766. var Dispatch = global.Dispatch;
  1767. var counter = 0;
  1768. var queue = {};
  1769. var ONREADYSTATECHANGE = 'onreadystatechange';
  1770. var defer, channel, port;
  1771. var run = function (id) {
  1772. // eslint-disable-next-line no-prototype-builtins -- safe
  1773. if (queue.hasOwnProperty(id)) {
  1774. var fn = queue[id];
  1775. delete queue[id];
  1776. fn();
  1777. }
  1778. };
  1779. var runner = function (id) {
  1780. return function () {
  1781. run(id);
  1782. };
  1783. };
  1784. var listener = function (event) {
  1785. run(event.data);
  1786. };
  1787. var post = function (id) {
  1788. // old engines have not location.origin
  1789. global.postMessage(id + '', location.protocol + '//' + location.host);
  1790. };
  1791. // Node.js 0.9+ & IE10+ has setImmediate, otherwise:
  1792. if (!set || !clear) {
  1793. set = function setImmediate(fn) {
  1794. var args = [];
  1795. var i = 1;
  1796. while (arguments.length > i) args.push(arguments[i++]);
  1797. queue[++counter] = function () {
  1798. // eslint-disable-next-line no-new-func -- spec requirement
  1799. (typeof fn == 'function' ? fn : Function(fn)).apply(undefined, args);
  1800. };
  1801. defer(counter);
  1802. return counter;
  1803. };
  1804. clear = function clearImmediate(id) {
  1805. delete queue[id];
  1806. };
  1807. // Node.js 0.8-
  1808. if (IS_NODE) {
  1809. defer = function (id) {
  1810. process.nextTick(runner(id));
  1811. };
  1812. // Sphere (JS game engine) Dispatch API
  1813. } else if (Dispatch && Dispatch.now) {
  1814. defer = function (id) {
  1815. Dispatch.now(runner(id));
  1816. };
  1817. // Browsers with MessageChannel, includes WebWorkers
  1818. // except iOS - https://github.com/zloirock/core-js/issues/624
  1819. } else if (MessageChannel && !IS_IOS) {
  1820. channel = new MessageChannel();
  1821. port = channel.port2;
  1822. channel.port1.onmessage = listener;
  1823. defer = bind(port.postMessage, port, 1);
  1824. // Browsers with postMessage, skip WebWorkers
  1825. // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
  1826. } else if (
  1827. global.addEventListener &&
  1828. typeof postMessage == 'function' &&
  1829. !global.importScripts &&
  1830. location && location.protocol !== 'file:' &&
  1831. !fails(post)
  1832. ) {
  1833. defer = post;
  1834. global.addEventListener('message', listener, false);
  1835. // IE8-
  1836. } else if (ONREADYSTATECHANGE in createElement('script')) {
  1837. defer = function (id) {
  1838. html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () {
  1839. html.removeChild(this);
  1840. run(id);
  1841. };
  1842. };
  1843. // Rest old browsers
  1844. } else {
  1845. defer = function (id) {
  1846. setTimeout(runner(id), 0);
  1847. };
  1848. }
  1849. }
  1850. module.exports = {
  1851. set: set,
  1852. clear: clear
  1853. };
  1854. /***/ }),
  1855. /***/ "2d00":
  1856. /***/ (function(module, exports, __webpack_require__) {
  1857. var global = __webpack_require__("da84");
  1858. var userAgent = __webpack_require__("342f");
  1859. var process = global.process;
  1860. var versions = process && process.versions;
  1861. var v8 = versions && versions.v8;
  1862. var match, version;
  1863. if (v8) {
  1864. match = v8.split('.');
  1865. version = match[0] + match[1];
  1866. } else if (userAgent) {
  1867. match = userAgent.match(/Edge\/(\d+)/);
  1868. if (!match || match[1] >= 74) {
  1869. match = userAgent.match(/Chrome\/(\d+)/);
  1870. if (match) version = match[1];
  1871. }
  1872. }
  1873. module.exports = version && +version;
  1874. /***/ }),
  1875. /***/ "342f":
  1876. /***/ (function(module, exports, __webpack_require__) {
  1877. var getBuiltIn = __webpack_require__("d066");
  1878. module.exports = getBuiltIn('navigator', 'userAgent') || '';
  1879. /***/ }),
  1880. /***/ "35a1":
  1881. /***/ (function(module, exports, __webpack_require__) {
  1882. var classof = __webpack_require__("f5df");
  1883. var Iterators = __webpack_require__("3f8c");
  1884. var wellKnownSymbol = __webpack_require__("b622");
  1885. var ITERATOR = wellKnownSymbol('iterator');
  1886. module.exports = function (it) {
  1887. if (it != undefined) return it[ITERATOR]
  1888. || it['@@iterator']
  1889. || Iterators[classof(it)];
  1890. };
  1891. /***/ }),
  1892. /***/ "37e8":
  1893. /***/ (function(module, exports, __webpack_require__) {
  1894. var DESCRIPTORS = __webpack_require__("83ab");
  1895. var definePropertyModule = __webpack_require__("9bf2");
  1896. var anObject = __webpack_require__("825a");
  1897. var objectKeys = __webpack_require__("df75");
  1898. // `Object.defineProperties` method
  1899. // https://tc39.es/ecma262/#sec-object.defineproperties
  1900. module.exports = DESCRIPTORS ? Object.defineProperties : function defineProperties(O, Properties) {
  1901. anObject(O);
  1902. var keys = objectKeys(Properties);
  1903. var length = keys.length;
  1904. var index = 0;
  1905. var key;
  1906. while (length > index) definePropertyModule.f(O, key = keys[index++], Properties[key]);
  1907. return O;
  1908. };
  1909. /***/ }),
  1910. /***/ "38cf":
  1911. /***/ (function(module, exports, __webpack_require__) {
  1912. var $ = __webpack_require__("23e7");
  1913. var repeat = __webpack_require__("1148");
  1914. // `String.prototype.repeat` method
  1915. // https://tc39.es/ecma262/#sec-string.prototype.repeat
  1916. $({ target: 'String', proto: true }, {
  1917. repeat: repeat
  1918. });
  1919. /***/ }),
  1920. /***/ "3bbe":
  1921. /***/ (function(module, exports, __webpack_require__) {
  1922. var isObject = __webpack_require__("861d");
  1923. module.exports = function (it) {
  1924. if (!isObject(it) && it !== null) {
  1925. throw TypeError("Can't set " + String(it) + ' as a prototype');
  1926. } return it;
  1927. };
  1928. /***/ }),
  1929. /***/ "3ca3":
  1930. /***/ (function(module, exports, __webpack_require__) {
  1931. "use strict";
  1932. var charAt = __webpack_require__("6547").charAt;
  1933. var InternalStateModule = __webpack_require__("69f3");
  1934. var defineIterator = __webpack_require__("7dd0");
  1935. var STRING_ITERATOR = 'String Iterator';
  1936. var setInternalState = InternalStateModule.set;
  1937. var getInternalState = InternalStateModule.getterFor(STRING_ITERATOR);
  1938. // `String.prototype[@@iterator]` method
  1939. // https://tc39.es/ecma262/#sec-string.prototype-@@iterator
  1940. defineIterator(String, 'String', function (iterated) {
  1941. setInternalState(this, {
  1942. type: STRING_ITERATOR,
  1943. string: String(iterated),
  1944. index: 0
  1945. });
  1946. // `%StringIteratorPrototype%.next` method
  1947. // https://tc39.es/ecma262/#sec-%stringiteratorprototype%.next
  1948. }, function next() {
  1949. var state = getInternalState(this);
  1950. var string = state.string;
  1951. var index = state.index;
  1952. var point;
  1953. if (index >= string.length) return { value: undefined, done: true };
  1954. point = charAt(string, index);
  1955. state.index += point.length;
  1956. return { value: point, done: false };
  1957. });
  1958. /***/ }),
  1959. /***/ "3f8c":
  1960. /***/ (function(module, exports) {
  1961. module.exports = {};
  1962. /***/ }),
  1963. /***/ "408a":
  1964. /***/ (function(module, exports, __webpack_require__) {
  1965. var classof = __webpack_require__("c6b6");
  1966. // `thisNumberValue` abstract operation
  1967. // https://tc39.es/ecma262/#sec-thisnumbervalue
  1968. module.exports = function (value) {
  1969. if (typeof value != 'number' && classof(value) != 'Number') {
  1970. throw TypeError('Incorrect invocation');
  1971. }
  1972. return +value;
  1973. };
  1974. /***/ }),
  1975. /***/ "428f":
  1976. /***/ (function(module, exports, __webpack_require__) {
  1977. var global = __webpack_require__("da84");
  1978. module.exports = global;
  1979. /***/ }),
  1980. /***/ "44ad":
  1981. /***/ (function(module, exports, __webpack_require__) {
  1982. var fails = __webpack_require__("d039");
  1983. var classof = __webpack_require__("c6b6");
  1984. var split = ''.split;
  1985. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  1986. module.exports = fails(function () {
  1987. // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
  1988. // eslint-disable-next-line no-prototype-builtins -- safe
  1989. return !Object('z').propertyIsEnumerable(0);
  1990. }) ? function (it) {
  1991. return classof(it) == 'String' ? split.call(it, '') : Object(it);
  1992. } : Object;
  1993. /***/ }),
  1994. /***/ "44d2":
  1995. /***/ (function(module, exports, __webpack_require__) {
  1996. var wellKnownSymbol = __webpack_require__("b622");
  1997. var create = __webpack_require__("7c73");
  1998. var definePropertyModule = __webpack_require__("9bf2");
  1999. var UNSCOPABLES = wellKnownSymbol('unscopables');
  2000. var ArrayPrototype = Array.prototype;
  2001. // Array.prototype[@@unscopables]
  2002. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  2003. if (ArrayPrototype[UNSCOPABLES] == undefined) {
  2004. definePropertyModule.f(ArrayPrototype, UNSCOPABLES, {
  2005. configurable: true,
  2006. value: create(null)
  2007. });
  2008. }
  2009. // add a key to Array.prototype[@@unscopables]
  2010. module.exports = function (key) {
  2011. ArrayPrototype[UNSCOPABLES][key] = true;
  2012. };
  2013. /***/ }),
  2014. /***/ "44de":
  2015. /***/ (function(module, exports, __webpack_require__) {
  2016. var global = __webpack_require__("da84");
  2017. module.exports = function (a, b) {
  2018. var console = global.console;
  2019. if (console && console.error) {
  2020. arguments.length === 1 ? console.error(a) : console.error(a, b);
  2021. }
  2022. };
  2023. /***/ }),
  2024. /***/ "44e7":
  2025. /***/ (function(module, exports, __webpack_require__) {
  2026. var isObject = __webpack_require__("861d");
  2027. var classof = __webpack_require__("c6b6");
  2028. var wellKnownSymbol = __webpack_require__("b622");
  2029. var MATCH = wellKnownSymbol('match');
  2030. // `IsRegExp` abstract operation
  2031. // https://tc39.es/ecma262/#sec-isregexp
  2032. module.exports = function (it) {
  2033. var isRegExp;
  2034. return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classof(it) == 'RegExp');
  2035. };
  2036. /***/ }),
  2037. /***/ "466d":
  2038. /***/ (function(module, exports, __webpack_require__) {
  2039. "use strict";
  2040. var fixRegExpWellKnownSymbolLogic = __webpack_require__("d784");
  2041. var anObject = __webpack_require__("825a");
  2042. var toLength = __webpack_require__("50c4");
  2043. var requireObjectCoercible = __webpack_require__("1d80");
  2044. var advanceStringIndex = __webpack_require__("8aa5");
  2045. var regExpExec = __webpack_require__("14c3");
  2046. // @@match logic
  2047. fixRegExpWellKnownSymbolLogic('match', 1, function (MATCH, nativeMatch, maybeCallNative) {
  2048. return [
  2049. // `String.prototype.match` method
  2050. // https://tc39.es/ecma262/#sec-string.prototype.match
  2051. function match(regexp) {
  2052. var O = requireObjectCoercible(this);
  2053. var matcher = regexp == undefined ? undefined : regexp[MATCH];
  2054. return matcher !== undefined ? matcher.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));
  2055. },
  2056. // `RegExp.prototype[@@match]` method
  2057. // https://tc39.es/ecma262/#sec-regexp.prototype-@@match
  2058. function (regexp) {
  2059. var res = maybeCallNative(nativeMatch, regexp, this);
  2060. if (res.done) return res.value;
  2061. var rx = anObject(regexp);
  2062. var S = String(this);
  2063. if (!rx.global) return regExpExec(rx, S);
  2064. var fullUnicode = rx.unicode;
  2065. rx.lastIndex = 0;
  2066. var A = [];
  2067. var n = 0;
  2068. var result;
  2069. while ((result = regExpExec(rx, S)) !== null) {
  2070. var matchStr = String(result[0]);
  2071. A[n] = matchStr;
  2072. if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
  2073. n++;
  2074. }
  2075. return n === 0 ? null : A;
  2076. }
  2077. ];
  2078. });
  2079. /***/ }),
  2080. /***/ "4840":
  2081. /***/ (function(module, exports, __webpack_require__) {
  2082. var anObject = __webpack_require__("825a");
  2083. var aFunction = __webpack_require__("1c0b");
  2084. var wellKnownSymbol = __webpack_require__("b622");
  2085. var SPECIES = wellKnownSymbol('species');
  2086. // `SpeciesConstructor` abstract operation
  2087. // https://tc39.es/ecma262/#sec-speciesconstructor
  2088. module.exports = function (O, defaultConstructor) {
  2089. var C = anObject(O).constructor;
  2090. var S;
  2091. return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? defaultConstructor : aFunction(S);
  2092. };
  2093. /***/ }),
  2094. /***/ "4930":
  2095. /***/ (function(module, exports, __webpack_require__) {
  2096. var IS_NODE = __webpack_require__("605d");
  2097. var V8_VERSION = __webpack_require__("2d00");
  2098. var fails = __webpack_require__("d039");
  2099. module.exports = !!Object.getOwnPropertySymbols && !fails(function () {
  2100. /* global Symbol -- required for testing */
  2101. return !Symbol.sham &&
  2102. // Chrome 38 Symbol has incorrect toString conversion
  2103. // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
  2104. (IS_NODE ? V8_VERSION === 38 : V8_VERSION > 37 && V8_VERSION < 41);
  2105. });
  2106. /***/ }),
  2107. /***/ "498a":
  2108. /***/ (function(module, exports, __webpack_require__) {
  2109. "use strict";
  2110. var $ = __webpack_require__("23e7");
  2111. var $trim = __webpack_require__("58a8").trim;
  2112. var forcedStringTrimMethod = __webpack_require__("c8d2");
  2113. // `String.prototype.trim` method
  2114. // https://tc39.es/ecma262/#sec-string.prototype.trim
  2115. $({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
  2116. trim: function trim() {
  2117. return $trim(this);
  2118. }
  2119. });
  2120. /***/ }),
  2121. /***/ "4d63":
  2122. /***/ (function(module, exports, __webpack_require__) {
  2123. var DESCRIPTORS = __webpack_require__("83ab");
  2124. var global = __webpack_require__("da84");
  2125. var isForced = __webpack_require__("94ca");
  2126. var inheritIfRequired = __webpack_require__("7156");
  2127. var defineProperty = __webpack_require__("9bf2").f;
  2128. var getOwnPropertyNames = __webpack_require__("241c").f;
  2129. var isRegExp = __webpack_require__("44e7");
  2130. var getFlags = __webpack_require__("ad6d");
  2131. var stickyHelpers = __webpack_require__("9f7f");
  2132. var redefine = __webpack_require__("6eeb");
  2133. var fails = __webpack_require__("d039");
  2134. var setInternalState = __webpack_require__("69f3").set;
  2135. var setSpecies = __webpack_require__("2626");
  2136. var wellKnownSymbol = __webpack_require__("b622");
  2137. var MATCH = wellKnownSymbol('match');
  2138. var NativeRegExp = global.RegExp;
  2139. var RegExpPrototype = NativeRegExp.prototype;
  2140. var re1 = /a/g;
  2141. var re2 = /a/g;
  2142. // "new" should create a new object, old webkit bug
  2143. var CORRECT_NEW = new NativeRegExp(re1) !== re1;
  2144. var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y;
  2145. var FORCED = DESCRIPTORS && isForced('RegExp', (!CORRECT_NEW || UNSUPPORTED_Y || fails(function () {
  2146. re2[MATCH] = false;
  2147. // RegExp constructor can alter flags and IsRegExp works correct with @@match
  2148. return NativeRegExp(re1) != re1 || NativeRegExp(re2) == re2 || NativeRegExp(re1, 'i') != '/a/i';
  2149. })));
  2150. // `RegExp` constructor
  2151. // https://tc39.es/ecma262/#sec-regexp-constructor
  2152. if (FORCED) {
  2153. var RegExpWrapper = function RegExp(pattern, flags) {
  2154. var thisIsRegExp = this instanceof RegExpWrapper;
  2155. var patternIsRegExp = isRegExp(pattern);
  2156. var flagsAreUndefined = flags === undefined;
  2157. var sticky;
  2158. if (!thisIsRegExp && patternIsRegExp && pattern.constructor === RegExpWrapper && flagsAreUndefined) {
  2159. return pattern;
  2160. }
  2161. if (CORRECT_NEW) {
  2162. if (patternIsRegExp && !flagsAreUndefined) pattern = pattern.source;
  2163. } else if (pattern instanceof RegExpWrapper) {
  2164. if (flagsAreUndefined) flags = getFlags.call(pattern);
  2165. pattern = pattern.source;
  2166. }
  2167. if (UNSUPPORTED_Y) {
  2168. sticky = !!flags && flags.indexOf('y') > -1;
  2169. if (sticky) flags = flags.replace(/y/g, '');
  2170. }
  2171. var result = inheritIfRequired(
  2172. CORRECT_NEW ? new NativeRegExp(pattern, flags) : NativeRegExp(pattern, flags),
  2173. thisIsRegExp ? this : RegExpPrototype,
  2174. RegExpWrapper
  2175. );
  2176. if (UNSUPPORTED_Y && sticky) setInternalState(result, { sticky: sticky });
  2177. return result;
  2178. };
  2179. var proxy = function (key) {
  2180. key in RegExpWrapper || defineProperty(RegExpWrapper, key, {
  2181. configurable: true,
  2182. get: function () { return NativeRegExp[key]; },
  2183. set: function (it) { NativeRegExp[key] = it; }
  2184. });
  2185. };
  2186. var keys = getOwnPropertyNames(NativeRegExp);
  2187. var index = 0;
  2188. while (keys.length > index) proxy(keys[index++]);
  2189. RegExpPrototype.constructor = RegExpWrapper;
  2190. RegExpWrapper.prototype = RegExpPrototype;
  2191. redefine(global, 'RegExp', RegExpWrapper);
  2192. }
  2193. // https://tc39.es/ecma262/#sec-get-regexp-@@species
  2194. setSpecies('RegExp');
  2195. /***/ }),
  2196. /***/ "4d64":
  2197. /***/ (function(module, exports, __webpack_require__) {
  2198. var toIndexedObject = __webpack_require__("fc6a");
  2199. var toLength = __webpack_require__("50c4");
  2200. var toAbsoluteIndex = __webpack_require__("23cb");
  2201. // `Array.prototype.{ indexOf, includes }` methods implementation
  2202. var createMethod = function (IS_INCLUDES) {
  2203. return function ($this, el, fromIndex) {
  2204. var O = toIndexedObject($this);
  2205. var length = toLength(O.length);
  2206. var index = toAbsoluteIndex(fromIndex, length);
  2207. var value;
  2208. // Array#includes uses SameValueZero equality algorithm
  2209. // eslint-disable-next-line no-self-compare -- NaN check
  2210. if (IS_INCLUDES && el != el) while (length > index) {
  2211. value = O[index++];
  2212. // eslint-disable-next-line no-self-compare -- NaN check
  2213. if (value != value) return true;
  2214. // Array#indexOf ignores holes, Array#includes - not
  2215. } else for (;length > index; index++) {
  2216. if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
  2217. } return !IS_INCLUDES && -1;
  2218. };
  2219. };
  2220. module.exports = {
  2221. // `Array.prototype.includes` method
  2222. // https://tc39.es/ecma262/#sec-array.prototype.includes
  2223. includes: createMethod(true),
  2224. // `Array.prototype.indexOf` method
  2225. // https://tc39.es/ecma262/#sec-array.prototype.indexof
  2226. indexOf: createMethod(false)
  2227. };
  2228. /***/ }),
  2229. /***/ "4d90":
  2230. /***/ (function(module, exports, __webpack_require__) {
  2231. "use strict";
  2232. var $ = __webpack_require__("23e7");
  2233. var $padStart = __webpack_require__("0ccb").start;
  2234. var WEBKIT_BUG = __webpack_require__("9a0c");
  2235. // `String.prototype.padStart` method
  2236. // https://tc39.es/ecma262/#sec-string.prototype.padstart
  2237. $({ target: 'String', proto: true, forced: WEBKIT_BUG }, {
  2238. padStart: function padStart(maxLength /* , fillString = ' ' */) {
  2239. return $padStart(this, maxLength, arguments.length > 1 ? arguments[1] : undefined);
  2240. }
  2241. });
  2242. /***/ }),
  2243. /***/ "4de4":
  2244. /***/ (function(module, exports, __webpack_require__) {
  2245. "use strict";
  2246. var $ = __webpack_require__("23e7");
  2247. var $filter = __webpack_require__("b727").filter;
  2248. var arrayMethodHasSpeciesSupport = __webpack_require__("1dde");
  2249. var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');
  2250. // `Array.prototype.filter` method
  2251. // https://tc39.es/ecma262/#sec-array.prototype.filter
  2252. // with adding support of @@species
  2253. $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
  2254. filter: function filter(callbackfn /* , thisArg */) {
  2255. return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  2256. }
  2257. });
  2258. /***/ }),
  2259. /***/ "4df4":
  2260. /***/ (function(module, exports, __webpack_require__) {
  2261. "use strict";
  2262. var bind = __webpack_require__("0366");
  2263. var toObject = __webpack_require__("7b0b");
  2264. var callWithSafeIterationClosing = __webpack_require__("9bdd");
  2265. var isArrayIteratorMethod = __webpack_require__("e95a");
  2266. var toLength = __webpack_require__("50c4");
  2267. var createProperty = __webpack_require__("8418");
  2268. var getIteratorMethod = __webpack_require__("35a1");
  2269. // `Array.from` method implementation
  2270. // https://tc39.es/ecma262/#sec-array.from
  2271. module.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
  2272. var O = toObject(arrayLike);
  2273. var C = typeof this == 'function' ? this : Array;
  2274. var argumentsLength = arguments.length;
  2275. var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
  2276. var mapping = mapfn !== undefined;
  2277. var iteratorMethod = getIteratorMethod(O);
  2278. var index = 0;
  2279. var length, result, step, iterator, next, value;
  2280. if (mapping) mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : undefined, 2);
  2281. // if the target is not iterable or it's an array with the default iterator - use a simple case
  2282. if (iteratorMethod != undefined && !(C == Array && isArrayIteratorMethod(iteratorMethod))) {
  2283. iterator = iteratorMethod.call(O);
  2284. next = iterator.next;
  2285. result = new C();
  2286. for (;!(step = next.call(iterator)).done; index++) {
  2287. value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value;
  2288. createProperty(result, index, value);
  2289. }
  2290. } else {
  2291. length = toLength(O.length);
  2292. result = new C(length);
  2293. for (;length > index; index++) {
  2294. value = mapping ? mapfn(O[index], index) : O[index];
  2295. createProperty(result, index, value);
  2296. }
  2297. }
  2298. result.length = index;
  2299. return result;
  2300. };
  2301. /***/ }),
  2302. /***/ "4ec9":
  2303. /***/ (function(module, exports, __webpack_require__) {
  2304. "use strict";
  2305. var collection = __webpack_require__("6d61");
  2306. var collectionStrong = __webpack_require__("6566");
  2307. // `Map` constructor
  2308. // https://tc39.es/ecma262/#sec-map-objects
  2309. module.exports = collection('Map', function (init) {
  2310. return function Map() { return init(this, arguments.length ? arguments[0] : undefined); };
  2311. }, collectionStrong);
  2312. /***/ }),
  2313. /***/ "50c4":
  2314. /***/ (function(module, exports, __webpack_require__) {
  2315. var toInteger = __webpack_require__("a691");
  2316. var min = Math.min;
  2317. // `ToLength` abstract operation
  2318. // https://tc39.es/ecma262/#sec-tolength
  2319. module.exports = function (argument) {
  2320. return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
  2321. };
  2322. /***/ }),
  2323. /***/ "5135":
  2324. /***/ (function(module, exports) {
  2325. var hasOwnProperty = {}.hasOwnProperty;
  2326. module.exports = function (it, key) {
  2327. return hasOwnProperty.call(it, key);
  2328. };
  2329. /***/ }),
  2330. /***/ "5319":
  2331. /***/ (function(module, exports, __webpack_require__) {
  2332. "use strict";
  2333. var fixRegExpWellKnownSymbolLogic = __webpack_require__("d784");
  2334. var anObject = __webpack_require__("825a");
  2335. var toLength = __webpack_require__("50c4");
  2336. var toInteger = __webpack_require__("a691");
  2337. var requireObjectCoercible = __webpack_require__("1d80");
  2338. var advanceStringIndex = __webpack_require__("8aa5");
  2339. var getSubstitution = __webpack_require__("0cb2");
  2340. var regExpExec = __webpack_require__("14c3");
  2341. var max = Math.max;
  2342. var min = Math.min;
  2343. var maybeToString = function (it) {
  2344. return it === undefined ? it : String(it);
  2345. };
  2346. // @@replace logic
  2347. fixRegExpWellKnownSymbolLogic('replace', 2, function (REPLACE, nativeReplace, maybeCallNative, reason) {
  2348. var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = reason.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE;
  2349. var REPLACE_KEEPS_$0 = reason.REPLACE_KEEPS_$0;
  2350. var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0';
  2351. return [
  2352. // `String.prototype.replace` method
  2353. // https://tc39.es/ecma262/#sec-string.prototype.replace
  2354. function replace(searchValue, replaceValue) {
  2355. var O = requireObjectCoercible(this);
  2356. var replacer = searchValue == undefined ? undefined : searchValue[REPLACE];
  2357. return replacer !== undefined
  2358. ? replacer.call(searchValue, O, replaceValue)
  2359. : nativeReplace.call(String(O), searchValue, replaceValue);
  2360. },
  2361. // `RegExp.prototype[@@replace]` method
  2362. // https://tc39.es/ecma262/#sec-regexp.prototype-@@replace
  2363. function (regexp, replaceValue) {
  2364. if (
  2365. (!REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE && REPLACE_KEEPS_$0) ||
  2366. (typeof replaceValue === 'string' && replaceValue.indexOf(UNSAFE_SUBSTITUTE) === -1)
  2367. ) {
  2368. var res = maybeCallNative(nativeReplace, regexp, this, replaceValue);
  2369. if (res.done) return res.value;
  2370. }
  2371. var rx = anObject(regexp);
  2372. var S = String(this);
  2373. var functionalReplace = typeof replaceValue === 'function';
  2374. if (!functionalReplace) replaceValue = String(replaceValue);
  2375. var global = rx.global;
  2376. if (global) {
  2377. var fullUnicode = rx.unicode;
  2378. rx.lastIndex = 0;
  2379. }
  2380. var results = [];
  2381. while (true) {
  2382. var result = regExpExec(rx, S);
  2383. if (result === null) break;
  2384. results.push(result);
  2385. if (!global) break;
  2386. var matchStr = String(result[0]);
  2387. if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
  2388. }
  2389. var accumulatedResult = '';
  2390. var nextSourcePosition = 0;
  2391. for (var i = 0; i < results.length; i++) {
  2392. result = results[i];
  2393. var matched = String(result[0]);
  2394. var position = max(min(toInteger(result.index), S.length), 0);
  2395. var captures = [];
  2396. // NOTE: This is equivalent to
  2397. // captures = result.slice(1).map(maybeToString)
  2398. // but for some reason `nativeSlice.call(result, 1, result.length)` (called in
  2399. // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
  2400. // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
  2401. for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j]));
  2402. var namedCaptures = result.groups;
  2403. if (functionalReplace) {
  2404. var replacerArgs = [matched].concat(captures, position, S);
  2405. if (namedCaptures !== undefined) replacerArgs.push(namedCaptures);
  2406. var replacement = String(replaceValue.apply(undefined, replacerArgs));
  2407. } else {
  2408. replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
  2409. }
  2410. if (position >= nextSourcePosition) {
  2411. accumulatedResult += S.slice(nextSourcePosition, position) + replacement;
  2412. nextSourcePosition = position + matched.length;
  2413. }
  2414. }
  2415. return accumulatedResult + S.slice(nextSourcePosition);
  2416. }
  2417. ];
  2418. });
  2419. /***/ }),
  2420. /***/ "5692":
  2421. /***/ (function(module, exports, __webpack_require__) {
  2422. var IS_PURE = __webpack_require__("c430");
  2423. var store = __webpack_require__("c6cd");
  2424. (module.exports = function (key, value) {
  2425. return store[key] || (store[key] = value !== undefined ? value : {});
  2426. })('versions', []).push({
  2427. version: '3.9.1',
  2428. mode: IS_PURE ? 'pure' : 'global',
  2429. copyright: '© 2021 Denis Pushkarev (zloirock.ru)'
  2430. });
  2431. /***/ }),
  2432. /***/ "56ef":
  2433. /***/ (function(module, exports, __webpack_require__) {
  2434. var getBuiltIn = __webpack_require__("d066");
  2435. var getOwnPropertyNamesModule = __webpack_require__("241c");
  2436. var getOwnPropertySymbolsModule = __webpack_require__("7418");
  2437. var anObject = __webpack_require__("825a");
  2438. // all object keys, includes non-enumerable and symbols
  2439. module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
  2440. var keys = getOwnPropertyNamesModule.f(anObject(it));
  2441. var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
  2442. return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
  2443. };
  2444. /***/ }),
  2445. /***/ "5899":
  2446. /***/ (function(module, exports) {
  2447. // a string of all valid unicode whitespaces
  2448. module.exports = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
  2449. '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
  2450. /***/ }),
  2451. /***/ "58a8":
  2452. /***/ (function(module, exports, __webpack_require__) {
  2453. var requireObjectCoercible = __webpack_require__("1d80");
  2454. var whitespaces = __webpack_require__("5899");
  2455. var whitespace = '[' + whitespaces + ']';
  2456. var ltrim = RegExp('^' + whitespace + whitespace + '*');
  2457. var rtrim = RegExp(whitespace + whitespace + '*$');
  2458. // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
  2459. var createMethod = function (TYPE) {
  2460. return function ($this) {
  2461. var string = String(requireObjectCoercible($this));
  2462. if (TYPE & 1) string = string.replace(ltrim, '');
  2463. if (TYPE & 2) string = string.replace(rtrim, '');
  2464. return string;
  2465. };
  2466. };
  2467. module.exports = {
  2468. // `String.prototype.{ trimLeft, trimStart }` methods
  2469. // https://tc39.es/ecma262/#sec-string.prototype.trimstart
  2470. start: createMethod(1),
  2471. // `String.prototype.{ trimRight, trimEnd }` methods
  2472. // https://tc39.es/ecma262/#sec-string.prototype.trimend
  2473. end: createMethod(2),
  2474. // `String.prototype.trim` method
  2475. // https://tc39.es/ecma262/#sec-string.prototype.trim
  2476. trim: createMethod(3)
  2477. };
  2478. /***/ }),
  2479. /***/ "5a34":
  2480. /***/ (function(module, exports, __webpack_require__) {
  2481. var isRegExp = __webpack_require__("44e7");
  2482. module.exports = function (it) {
  2483. if (isRegExp(it)) {
  2484. throw TypeError("The method doesn't accept regular expressions");
  2485. } return it;
  2486. };
  2487. /***/ }),
  2488. /***/ "5c6c":
  2489. /***/ (function(module, exports) {
  2490. module.exports = function (bitmap, value) {
  2491. return {
  2492. enumerable: !(bitmap & 1),
  2493. configurable: !(bitmap & 2),
  2494. writable: !(bitmap & 4),
  2495. value: value
  2496. };
  2497. };
  2498. /***/ }),
  2499. /***/ "5fb2":
  2500. /***/ (function(module, exports, __webpack_require__) {
  2501. "use strict";
  2502. // based on https://github.com/bestiejs/punycode.js/blob/master/punycode.js
  2503. var maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1
  2504. var base = 36;
  2505. var tMin = 1;
  2506. var tMax = 26;
  2507. var skew = 38;
  2508. var damp = 700;
  2509. var initialBias = 72;
  2510. var initialN = 128; // 0x80
  2511. var delimiter = '-'; // '\x2D'
  2512. var regexNonASCII = /[^\0-\u007E]/; // non-ASCII chars
  2513. var regexSeparators = /[.\u3002\uFF0E\uFF61]/g; // RFC 3490 separators
  2514. var OVERFLOW_ERROR = 'Overflow: input needs wider integers to process';
  2515. var baseMinusTMin = base - tMin;
  2516. var floor = Math.floor;
  2517. var stringFromCharCode = String.fromCharCode;
  2518. /**
  2519. * Creates an array containing the numeric code points of each Unicode
  2520. * character in the string. While JavaScript uses UCS-2 internally,
  2521. * this function will convert a pair of surrogate halves (each of which
  2522. * UCS-2 exposes as separate characters) into a single code point,
  2523. * matching UTF-16.
  2524. */
  2525. var ucs2decode = function (string) {
  2526. var output = [];
  2527. var counter = 0;
  2528. var length = string.length;
  2529. while (counter < length) {
  2530. var value = string.charCodeAt(counter++);
  2531. if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
  2532. // It's a high surrogate, and there is a next character.
  2533. var extra = string.charCodeAt(counter++);
  2534. if ((extra & 0xFC00) == 0xDC00) { // Low surrogate.
  2535. output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
  2536. } else {
  2537. // It's an unmatched surrogate; only append this code unit, in case the
  2538. // next code unit is the high surrogate of a surrogate pair.
  2539. output.push(value);
  2540. counter--;
  2541. }
  2542. } else {
  2543. output.push(value);
  2544. }
  2545. }
  2546. return output;
  2547. };
  2548. /**
  2549. * Converts a digit/integer into a basic code point.
  2550. */
  2551. var digitToBasic = function (digit) {
  2552. // 0..25 map to ASCII a..z or A..Z
  2553. // 26..35 map to ASCII 0..9
  2554. return digit + 22 + 75 * (digit < 26);
  2555. };
  2556. /**
  2557. * Bias adaptation function as per section 3.4 of RFC 3492.
  2558. * https://tools.ietf.org/html/rfc3492#section-3.4
  2559. */
  2560. var adapt = function (delta, numPoints, firstTime) {
  2561. var k = 0;
  2562. delta = firstTime ? floor(delta / damp) : delta >> 1;
  2563. delta += floor(delta / numPoints);
  2564. for (; delta > baseMinusTMin * tMax >> 1; k += base) {
  2565. delta = floor(delta / baseMinusTMin);
  2566. }
  2567. return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
  2568. };
  2569. /**
  2570. * Converts a string of Unicode symbols (e.g. a domain name label) to a
  2571. * Punycode string of ASCII-only symbols.
  2572. */
  2573. // eslint-disable-next-line max-statements -- TODO
  2574. var encode = function (input) {
  2575. var output = [];
  2576. // Convert the input in UCS-2 to an array of Unicode code points.
  2577. input = ucs2decode(input);
  2578. // Cache the length.
  2579. var inputLength = input.length;
  2580. // Initialize the state.
  2581. var n = initialN;
  2582. var delta = 0;
  2583. var bias = initialBias;
  2584. var i, currentValue;
  2585. // Handle the basic code points.
  2586. for (i = 0; i < input.length; i++) {
  2587. currentValue = input[i];
  2588. if (currentValue < 0x80) {
  2589. output.push(stringFromCharCode(currentValue));
  2590. }
  2591. }
  2592. var basicLength = output.length; // number of basic code points.
  2593. var handledCPCount = basicLength; // number of code points that have been handled;
  2594. // Finish the basic string with a delimiter unless it's empty.
  2595. if (basicLength) {
  2596. output.push(delimiter);
  2597. }
  2598. // Main encoding loop:
  2599. while (handledCPCount < inputLength) {
  2600. // All non-basic code points < n have been handled already. Find the next larger one:
  2601. var m = maxInt;
  2602. for (i = 0; i < input.length; i++) {
  2603. currentValue = input[i];
  2604. if (currentValue >= n && currentValue < m) {
  2605. m = currentValue;
  2606. }
  2607. }
  2608. // Increase `delta` enough to advance the decoder's <n,i> state to <m,0>, but guard against overflow.
  2609. var handledCPCountPlusOne = handledCPCount + 1;
  2610. if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
  2611. throw RangeError(OVERFLOW_ERROR);
  2612. }
  2613. delta += (m - n) * handledCPCountPlusOne;
  2614. n = m;
  2615. for (i = 0; i < input.length; i++) {
  2616. currentValue = input[i];
  2617. if (currentValue < n && ++delta > maxInt) {
  2618. throw RangeError(OVERFLOW_ERROR);
  2619. }
  2620. if (currentValue == n) {
  2621. // Represent delta as a generalized variable-length integer.
  2622. var q = delta;
  2623. for (var k = base; /* no condition */; k += base) {
  2624. var t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
  2625. if (q < t) break;
  2626. var qMinusT = q - t;
  2627. var baseMinusT = base - t;
  2628. output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT)));
  2629. q = floor(qMinusT / baseMinusT);
  2630. }
  2631. output.push(stringFromCharCode(digitToBasic(q)));
  2632. bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);
  2633. delta = 0;
  2634. ++handledCPCount;
  2635. }
  2636. }
  2637. ++delta;
  2638. ++n;
  2639. }
  2640. return output.join('');
  2641. };
  2642. module.exports = function (input) {
  2643. var encoded = [];
  2644. var labels = input.toLowerCase().replace(regexSeparators, '\u002E').split('.');
  2645. var i, label;
  2646. for (i = 0; i < labels.length; i++) {
  2647. label = labels[i];
  2648. encoded.push(regexNonASCII.test(label) ? 'xn--' + encode(label) : label);
  2649. }
  2650. return encoded.join('.');
  2651. };
  2652. /***/ }),
  2653. /***/ "605d":
  2654. /***/ (function(module, exports, __webpack_require__) {
  2655. var classof = __webpack_require__("c6b6");
  2656. var global = __webpack_require__("da84");
  2657. module.exports = classof(global.process) == 'process';
  2658. /***/ }),
  2659. /***/ "60da":
  2660. /***/ (function(module, exports, __webpack_require__) {
  2661. "use strict";
  2662. var DESCRIPTORS = __webpack_require__("83ab");
  2663. var fails = __webpack_require__("d039");
  2664. var objectKeys = __webpack_require__("df75");
  2665. var getOwnPropertySymbolsModule = __webpack_require__("7418");
  2666. var propertyIsEnumerableModule = __webpack_require__("d1e7");
  2667. var toObject = __webpack_require__("7b0b");
  2668. var IndexedObject = __webpack_require__("44ad");
  2669. var nativeAssign = Object.assign;
  2670. var defineProperty = Object.defineProperty;
  2671. // `Object.assign` method
  2672. // https://tc39.es/ecma262/#sec-object.assign
  2673. module.exports = !nativeAssign || fails(function () {
  2674. // should have correct order of operations (Edge bug)
  2675. if (DESCRIPTORS && nativeAssign({ b: 1 }, nativeAssign(defineProperty({}, 'a', {
  2676. enumerable: true,
  2677. get: function () {
  2678. defineProperty(this, 'b', {
  2679. value: 3,
  2680. enumerable: false
  2681. });
  2682. }
  2683. }), { b: 2 })).b !== 1) return true;
  2684. // should work with symbols and should have deterministic property order (V8 bug)
  2685. var A = {};
  2686. var B = {};
  2687. /* global Symbol -- required for testing */
  2688. var symbol = Symbol();
  2689. var alphabet = 'abcdefghijklmnopqrst';
  2690. A[symbol] = 7;
  2691. alphabet.split('').forEach(function (chr) { B[chr] = chr; });
  2692. return nativeAssign({}, A)[symbol] != 7 || objectKeys(nativeAssign({}, B)).join('') != alphabet;
  2693. }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
  2694. var T = toObject(target);
  2695. var argumentsLength = arguments.length;
  2696. var index = 1;
  2697. var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
  2698. var propertyIsEnumerable = propertyIsEnumerableModule.f;
  2699. while (argumentsLength > index) {
  2700. var S = IndexedObject(arguments[index++]);
  2701. var keys = getOwnPropertySymbols ? objectKeys(S).concat(getOwnPropertySymbols(S)) : objectKeys(S);
  2702. var length = keys.length;
  2703. var j = 0;
  2704. var key;
  2705. while (length > j) {
  2706. key = keys[j++];
  2707. if (!DESCRIPTORS || propertyIsEnumerable.call(S, key)) T[key] = S[key];
  2708. }
  2709. } return T;
  2710. } : nativeAssign;
  2711. /***/ }),
  2712. /***/ "6547":
  2713. /***/ (function(module, exports, __webpack_require__) {
  2714. var toInteger = __webpack_require__("a691");
  2715. var requireObjectCoercible = __webpack_require__("1d80");
  2716. // `String.prototype.{ codePointAt, at }` methods implementation
  2717. var createMethod = function (CONVERT_TO_STRING) {
  2718. return function ($this, pos) {
  2719. var S = String(requireObjectCoercible($this));
  2720. var position = toInteger(pos);
  2721. var size = S.length;
  2722. var first, second;
  2723. if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
  2724. first = S.charCodeAt(position);
  2725. return first < 0xD800 || first > 0xDBFF || position + 1 === size
  2726. || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF
  2727. ? CONVERT_TO_STRING ? S.charAt(position) : first
  2728. : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
  2729. };
  2730. };
  2731. module.exports = {
  2732. // `String.prototype.codePointAt` method
  2733. // https://tc39.es/ecma262/#sec-string.prototype.codepointat
  2734. codeAt: createMethod(false),
  2735. // `String.prototype.at` method
  2736. // https://github.com/mathiasbynens/String.prototype.at
  2737. charAt: createMethod(true)
  2738. };
  2739. /***/ }),
  2740. /***/ "6566":
  2741. /***/ (function(module, exports, __webpack_require__) {
  2742. "use strict";
  2743. var defineProperty = __webpack_require__("9bf2").f;
  2744. var create = __webpack_require__("7c73");
  2745. var redefineAll = __webpack_require__("e2cc");
  2746. var bind = __webpack_require__("0366");
  2747. var anInstance = __webpack_require__("19aa");
  2748. var iterate = __webpack_require__("2266");
  2749. var defineIterator = __webpack_require__("7dd0");
  2750. var setSpecies = __webpack_require__("2626");
  2751. var DESCRIPTORS = __webpack_require__("83ab");
  2752. var fastKey = __webpack_require__("f183").fastKey;
  2753. var InternalStateModule = __webpack_require__("69f3");
  2754. var setInternalState = InternalStateModule.set;
  2755. var internalStateGetterFor = InternalStateModule.getterFor;
  2756. module.exports = {
  2757. getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) {
  2758. var C = wrapper(function (that, iterable) {
  2759. anInstance(that, C, CONSTRUCTOR_NAME);
  2760. setInternalState(that, {
  2761. type: CONSTRUCTOR_NAME,
  2762. index: create(null),
  2763. first: undefined,
  2764. last: undefined,
  2765. size: 0
  2766. });
  2767. if (!DESCRIPTORS) that.size = 0;
  2768. if (iterable != undefined) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
  2769. });
  2770. var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);
  2771. var define = function (that, key, value) {
  2772. var state = getInternalState(that);
  2773. var entry = getEntry(that, key);
  2774. var previous, index;
  2775. // change existing entry
  2776. if (entry) {
  2777. entry.value = value;
  2778. // create new entry
  2779. } else {
  2780. state.last = entry = {
  2781. index: index = fastKey(key, true),
  2782. key: key,
  2783. value: value,
  2784. previous: previous = state.last,
  2785. next: undefined,
  2786. removed: false
  2787. };
  2788. if (!state.first) state.first = entry;
  2789. if (previous) previous.next = entry;
  2790. if (DESCRIPTORS) state.size++;
  2791. else that.size++;
  2792. // add to index
  2793. if (index !== 'F') state.index[index] = entry;
  2794. } return that;
  2795. };
  2796. var getEntry = function (that, key) {
  2797. var state = getInternalState(that);
  2798. // fast case
  2799. var index = fastKey(key);
  2800. var entry;
  2801. if (index !== 'F') return state.index[index];
  2802. // frozen object case
  2803. for (entry = state.first; entry; entry = entry.next) {
  2804. if (entry.key == key) return entry;
  2805. }
  2806. };
  2807. redefineAll(C.prototype, {
  2808. // 23.1.3.1 Map.prototype.clear()
  2809. // 23.2.3.2 Set.prototype.clear()
  2810. clear: function clear() {
  2811. var that = this;
  2812. var state = getInternalState(that);
  2813. var data = state.index;
  2814. var entry = state.first;
  2815. while (entry) {
  2816. entry.removed = true;
  2817. if (entry.previous) entry.previous = entry.previous.next = undefined;
  2818. delete data[entry.index];
  2819. entry = entry.next;
  2820. }
  2821. state.first = state.last = undefined;
  2822. if (DESCRIPTORS) state.size = 0;
  2823. else that.size = 0;
  2824. },
  2825. // 23.1.3.3 Map.prototype.delete(key)
  2826. // 23.2.3.4 Set.prototype.delete(value)
  2827. 'delete': function (key) {
  2828. var that = this;
  2829. var state = getInternalState(that);
  2830. var entry = getEntry(that, key);
  2831. if (entry) {
  2832. var next = entry.next;
  2833. var prev = entry.previous;
  2834. delete state.index[entry.index];
  2835. entry.removed = true;
  2836. if (prev) prev.next = next;
  2837. if (next) next.previous = prev;
  2838. if (state.first == entry) state.first = next;
  2839. if (state.last == entry) state.last = prev;
  2840. if (DESCRIPTORS) state.size--;
  2841. else that.size--;
  2842. } return !!entry;
  2843. },
  2844. // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)
  2845. // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)
  2846. forEach: function forEach(callbackfn /* , that = undefined */) {
  2847. var state = getInternalState(this);
  2848. var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);
  2849. var entry;
  2850. while (entry = entry ? entry.next : state.first) {
  2851. boundFunction(entry.value, entry.key, this);
  2852. // revert to the last existing entry
  2853. while (entry && entry.removed) entry = entry.previous;
  2854. }
  2855. },
  2856. // 23.1.3.7 Map.prototype.has(key)
  2857. // 23.2.3.7 Set.prototype.has(value)
  2858. has: function has(key) {
  2859. return !!getEntry(this, key);
  2860. }
  2861. });
  2862. redefineAll(C.prototype, IS_MAP ? {
  2863. // 23.1.3.6 Map.prototype.get(key)
  2864. get: function get(key) {
  2865. var entry = getEntry(this, key);
  2866. return entry && entry.value;
  2867. },
  2868. // 23.1.3.9 Map.prototype.set(key, value)
  2869. set: function set(key, value) {
  2870. return define(this, key === 0 ? 0 : key, value);
  2871. }
  2872. } : {
  2873. // 23.2.3.1 Set.prototype.add(value)
  2874. add: function add(value) {
  2875. return define(this, value = value === 0 ? 0 : value, value);
  2876. }
  2877. });
  2878. if (DESCRIPTORS) defineProperty(C.prototype, 'size', {
  2879. get: function () {
  2880. return getInternalState(this).size;
  2881. }
  2882. });
  2883. return C;
  2884. },
  2885. setStrong: function (C, CONSTRUCTOR_NAME, IS_MAP) {
  2886. var ITERATOR_NAME = CONSTRUCTOR_NAME + ' Iterator';
  2887. var getInternalCollectionState = internalStateGetterFor(CONSTRUCTOR_NAME);
  2888. var getInternalIteratorState = internalStateGetterFor(ITERATOR_NAME);
  2889. // add .keys, .values, .entries, [@@iterator]
  2890. // 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
  2891. defineIterator(C, CONSTRUCTOR_NAME, function (iterated, kind) {
  2892. setInternalState(this, {
  2893. type: ITERATOR_NAME,
  2894. target: iterated,
  2895. state: getInternalCollectionState(iterated),
  2896. kind: kind,
  2897. last: undefined
  2898. });
  2899. }, function () {
  2900. var state = getInternalIteratorState(this);
  2901. var kind = state.kind;
  2902. var entry = state.last;
  2903. // revert to the last existing entry
  2904. while (entry && entry.removed) entry = entry.previous;
  2905. // get next entry
  2906. if (!state.target || !(state.last = entry = entry ? entry.next : state.state.first)) {
  2907. // or finish the iteration
  2908. state.target = undefined;
  2909. return { value: undefined, done: true };
  2910. }
  2911. // return step by kind
  2912. if (kind == 'keys') return { value: entry.key, done: false };
  2913. if (kind == 'values') return { value: entry.value, done: false };
  2914. return { value: [entry.key, entry.value], done: false };
  2915. }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);
  2916. // add [@@species], 23.1.2.2, 23.2.2.2
  2917. setSpecies(CONSTRUCTOR_NAME);
  2918. }
  2919. };
  2920. /***/ }),
  2921. /***/ "65f0":
  2922. /***/ (function(module, exports, __webpack_require__) {
  2923. var isObject = __webpack_require__("861d");
  2924. var isArray = __webpack_require__("e8b5");
  2925. var wellKnownSymbol = __webpack_require__("b622");
  2926. var SPECIES = wellKnownSymbol('species');
  2927. // `ArraySpeciesCreate` abstract operation
  2928. // https://tc39.es/ecma262/#sec-arrayspeciescreate
  2929. module.exports = function (originalArray, length) {
  2930. var C;
  2931. if (isArray(originalArray)) {
  2932. C = originalArray.constructor;
  2933. // cross-realm fallback
  2934. if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
  2935. else if (isObject(C)) {
  2936. C = C[SPECIES];
  2937. if (C === null) C = undefined;
  2938. }
  2939. } return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
  2940. };
  2941. /***/ }),
  2942. /***/ "69f3":
  2943. /***/ (function(module, exports, __webpack_require__) {
  2944. var NATIVE_WEAK_MAP = __webpack_require__("7f9a");
  2945. var global = __webpack_require__("da84");
  2946. var isObject = __webpack_require__("861d");
  2947. var createNonEnumerableProperty = __webpack_require__("9112");
  2948. var objectHas = __webpack_require__("5135");
  2949. var shared = __webpack_require__("c6cd");
  2950. var sharedKey = __webpack_require__("f772");
  2951. var hiddenKeys = __webpack_require__("d012");
  2952. var WeakMap = global.WeakMap;
  2953. var set, get, has;
  2954. var enforce = function (it) {
  2955. return has(it) ? get(it) : set(it, {});
  2956. };
  2957. var getterFor = function (TYPE) {
  2958. return function (it) {
  2959. var state;
  2960. if (!isObject(it) || (state = get(it)).type !== TYPE) {
  2961. throw TypeError('Incompatible receiver, ' + TYPE + ' required');
  2962. } return state;
  2963. };
  2964. };
  2965. if (NATIVE_WEAK_MAP) {
  2966. var store = shared.state || (shared.state = new WeakMap());
  2967. var wmget = store.get;
  2968. var wmhas = store.has;
  2969. var wmset = store.set;
  2970. set = function (it, metadata) {
  2971. metadata.facade = it;
  2972. wmset.call(store, it, metadata);
  2973. return metadata;
  2974. };
  2975. get = function (it) {
  2976. return wmget.call(store, it) || {};
  2977. };
  2978. has = function (it) {
  2979. return wmhas.call(store, it);
  2980. };
  2981. } else {
  2982. var STATE = sharedKey('state');
  2983. hiddenKeys[STATE] = true;
  2984. set = function (it, metadata) {
  2985. metadata.facade = it;
  2986. createNonEnumerableProperty(it, STATE, metadata);
  2987. return metadata;
  2988. };
  2989. get = function (it) {
  2990. return objectHas(it, STATE) ? it[STATE] : {};
  2991. };
  2992. has = function (it) {
  2993. return objectHas(it, STATE);
  2994. };
  2995. }
  2996. module.exports = {
  2997. set: set,
  2998. get: get,
  2999. has: has,
  3000. enforce: enforce,
  3001. getterFor: getterFor
  3002. };
  3003. /***/ }),
  3004. /***/ "6d61":
  3005. /***/ (function(module, exports, __webpack_require__) {
  3006. "use strict";
  3007. var $ = __webpack_require__("23e7");
  3008. var global = __webpack_require__("da84");
  3009. var isForced = __webpack_require__("94ca");
  3010. var redefine = __webpack_require__("6eeb");
  3011. var InternalMetadataModule = __webpack_require__("f183");
  3012. var iterate = __webpack_require__("2266");
  3013. var anInstance = __webpack_require__("19aa");
  3014. var isObject = __webpack_require__("861d");
  3015. var fails = __webpack_require__("d039");
  3016. var checkCorrectnessOfIteration = __webpack_require__("1c7e");
  3017. var setToStringTag = __webpack_require__("d44e");
  3018. var inheritIfRequired = __webpack_require__("7156");
  3019. module.exports = function (CONSTRUCTOR_NAME, wrapper, common) {
  3020. var IS_MAP = CONSTRUCTOR_NAME.indexOf('Map') !== -1;
  3021. var IS_WEAK = CONSTRUCTOR_NAME.indexOf('Weak') !== -1;
  3022. var ADDER = IS_MAP ? 'set' : 'add';
  3023. var NativeConstructor = global[CONSTRUCTOR_NAME];
  3024. var NativePrototype = NativeConstructor && NativeConstructor.prototype;
  3025. var Constructor = NativeConstructor;
  3026. var exported = {};
  3027. var fixMethod = function (KEY) {
  3028. var nativeMethod = NativePrototype[KEY];
  3029. redefine(NativePrototype, KEY,
  3030. KEY == 'add' ? function add(value) {
  3031. nativeMethod.call(this, value === 0 ? 0 : value);
  3032. return this;
  3033. } : KEY == 'delete' ? function (key) {
  3034. return IS_WEAK && !isObject(key) ? false : nativeMethod.call(this, key === 0 ? 0 : key);
  3035. } : KEY == 'get' ? function get(key) {
  3036. return IS_WEAK && !isObject(key) ? undefined : nativeMethod.call(this, key === 0 ? 0 : key);
  3037. } : KEY == 'has' ? function has(key) {
  3038. return IS_WEAK && !isObject(key) ? false : nativeMethod.call(this, key === 0 ? 0 : key);
  3039. } : function set(key, value) {
  3040. nativeMethod.call(this, key === 0 ? 0 : key, value);
  3041. return this;
  3042. }
  3043. );
  3044. };
  3045. var REPLACE = isForced(
  3046. CONSTRUCTOR_NAME,
  3047. typeof NativeConstructor != 'function' || !(IS_WEAK || NativePrototype.forEach && !fails(function () {
  3048. new NativeConstructor().entries().next();
  3049. }))
  3050. );
  3051. if (REPLACE) {
  3052. // create collection constructor
  3053. Constructor = common.getConstructor(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER);
  3054. InternalMetadataModule.REQUIRED = true;
  3055. } else if (isForced(CONSTRUCTOR_NAME, true)) {
  3056. var instance = new Constructor();
  3057. // early implementations not supports chaining
  3058. var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance;
  3059. // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false
  3060. var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); });
  3061. // most early implementations doesn't supports iterables, most modern - not close it correctly
  3062. // eslint-disable-next-line no-new -- required for testing
  3063. var ACCEPT_ITERABLES = checkCorrectnessOfIteration(function (iterable) { new NativeConstructor(iterable); });
  3064. // for early implementations -0 and +0 not the same
  3065. var BUGGY_ZERO = !IS_WEAK && fails(function () {
  3066. // V8 ~ Chromium 42- fails only with 5+ elements
  3067. var $instance = new NativeConstructor();
  3068. var index = 5;
  3069. while (index--) $instance[ADDER](index, index);
  3070. return !$instance.has(-0);
  3071. });
  3072. if (!ACCEPT_ITERABLES) {
  3073. Constructor = wrapper(function (dummy, iterable) {
  3074. anInstance(dummy, Constructor, CONSTRUCTOR_NAME);
  3075. var that = inheritIfRequired(new NativeConstructor(), dummy, Constructor);
  3076. if (iterable != undefined) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
  3077. return that;
  3078. });
  3079. Constructor.prototype = NativePrototype;
  3080. NativePrototype.constructor = Constructor;
  3081. }
  3082. if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) {
  3083. fixMethod('delete');
  3084. fixMethod('has');
  3085. IS_MAP && fixMethod('get');
  3086. }
  3087. if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER);
  3088. // weak collections should not contains .clear method
  3089. if (IS_WEAK && NativePrototype.clear) delete NativePrototype.clear;
  3090. }
  3091. exported[CONSTRUCTOR_NAME] = Constructor;
  3092. $({ global: true, forced: Constructor != NativeConstructor }, exported);
  3093. setToStringTag(Constructor, CONSTRUCTOR_NAME);
  3094. if (!IS_WEAK) common.setStrong(Constructor, CONSTRUCTOR_NAME, IS_MAP);
  3095. return Constructor;
  3096. };
  3097. /***/ }),
  3098. /***/ "6eeb":
  3099. /***/ (function(module, exports, __webpack_require__) {
  3100. var global = __webpack_require__("da84");
  3101. var createNonEnumerableProperty = __webpack_require__("9112");
  3102. var has = __webpack_require__("5135");
  3103. var setGlobal = __webpack_require__("ce4e");
  3104. var inspectSource = __webpack_require__("8925");
  3105. var InternalStateModule = __webpack_require__("69f3");
  3106. var getInternalState = InternalStateModule.get;
  3107. var enforceInternalState = InternalStateModule.enforce;
  3108. var TEMPLATE = String(String).split('String');
  3109. (module.exports = function (O, key, value, options) {
  3110. var unsafe = options ? !!options.unsafe : false;
  3111. var simple = options ? !!options.enumerable : false;
  3112. var noTargetGet = options ? !!options.noTargetGet : false;
  3113. var state;
  3114. if (typeof value == 'function') {
  3115. if (typeof key == 'string' && !has(value, 'name')) {
  3116. createNonEnumerableProperty(value, 'name', key);
  3117. }
  3118. state = enforceInternalState(value);
  3119. if (!state.source) {
  3120. state.source = TEMPLATE.join(typeof key == 'string' ? key : '');
  3121. }
  3122. }
  3123. if (O === global) {
  3124. if (simple) O[key] = value;
  3125. else setGlobal(key, value);
  3126. return;
  3127. } else if (!unsafe) {
  3128. delete O[key];
  3129. } else if (!noTargetGet && O[key]) {
  3130. simple = true;
  3131. }
  3132. if (simple) O[key] = value;
  3133. else createNonEnumerableProperty(O, key, value);
  3134. // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
  3135. })(Function.prototype, 'toString', function toString() {
  3136. return typeof this == 'function' && getInternalState(this).source || inspectSource(this);
  3137. });
  3138. /***/ }),
  3139. /***/ "7156":
  3140. /***/ (function(module, exports, __webpack_require__) {
  3141. var isObject = __webpack_require__("861d");
  3142. var setPrototypeOf = __webpack_require__("d2bb");
  3143. // makes subclassing work correct for wrapped built-ins
  3144. module.exports = function ($this, dummy, Wrapper) {
  3145. var NewTarget, NewTargetPrototype;
  3146. if (
  3147. // it can work only with native `setPrototypeOf`
  3148. setPrototypeOf &&
  3149. // we haven't completely correct pre-ES6 way for getting `new.target`, so use this
  3150. typeof (NewTarget = dummy.constructor) == 'function' &&
  3151. NewTarget !== Wrapper &&
  3152. isObject(NewTargetPrototype = NewTarget.prototype) &&
  3153. NewTargetPrototype !== Wrapper.prototype
  3154. ) setPrototypeOf($this, NewTargetPrototype);
  3155. return $this;
  3156. };
  3157. /***/ }),
  3158. /***/ "7418":
  3159. /***/ (function(module, exports) {
  3160. exports.f = Object.getOwnPropertySymbols;
  3161. /***/ }),
  3162. /***/ "746f":
  3163. /***/ (function(module, exports, __webpack_require__) {
  3164. var path = __webpack_require__("428f");
  3165. var has = __webpack_require__("5135");
  3166. var wrappedWellKnownSymbolModule = __webpack_require__("e538");
  3167. var defineProperty = __webpack_require__("9bf2").f;
  3168. module.exports = function (NAME) {
  3169. var Symbol = path.Symbol || (path.Symbol = {});
  3170. if (!has(Symbol, NAME)) defineProperty(Symbol, NAME, {
  3171. value: wrappedWellKnownSymbolModule.f(NAME)
  3172. });
  3173. };
  3174. /***/ }),
  3175. /***/ "7839":
  3176. /***/ (function(module, exports) {
  3177. // IE8- don't enum bug keys
  3178. module.exports = [
  3179. 'constructor',
  3180. 'hasOwnProperty',
  3181. 'isPrototypeOf',
  3182. 'propertyIsEnumerable',
  3183. 'toLocaleString',
  3184. 'toString',
  3185. 'valueOf'
  3186. ];
  3187. /***/ }),
  3188. /***/ "7b0b":
  3189. /***/ (function(module, exports, __webpack_require__) {
  3190. var requireObjectCoercible = __webpack_require__("1d80");
  3191. // `ToObject` abstract operation
  3192. // https://tc39.es/ecma262/#sec-toobject
  3193. module.exports = function (argument) {
  3194. return Object(requireObjectCoercible(argument));
  3195. };
  3196. /***/ }),
  3197. /***/ "7c73":
  3198. /***/ (function(module, exports, __webpack_require__) {
  3199. var anObject = __webpack_require__("825a");
  3200. var defineProperties = __webpack_require__("37e8");
  3201. var enumBugKeys = __webpack_require__("7839");
  3202. var hiddenKeys = __webpack_require__("d012");
  3203. var html = __webpack_require__("1be4");
  3204. var documentCreateElement = __webpack_require__("cc12");
  3205. var sharedKey = __webpack_require__("f772");
  3206. var GT = '>';
  3207. var LT = '<';
  3208. var PROTOTYPE = 'prototype';
  3209. var SCRIPT = 'script';
  3210. var IE_PROTO = sharedKey('IE_PROTO');
  3211. var EmptyConstructor = function () { /* empty */ };
  3212. var scriptTag = function (content) {
  3213. return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
  3214. };
  3215. // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
  3216. var NullProtoObjectViaActiveX = function (activeXDocument) {
  3217. activeXDocument.write(scriptTag(''));
  3218. activeXDocument.close();
  3219. var temp = activeXDocument.parentWindow.Object;
  3220. activeXDocument = null; // avoid memory leak
  3221. return temp;
  3222. };
  3223. // Create object with fake `null` prototype: use iframe Object with cleared prototype
  3224. var NullProtoObjectViaIFrame = function () {
  3225. // Thrash, waste and sodomy: IE GC bug
  3226. var iframe = documentCreateElement('iframe');
  3227. var JS = 'java' + SCRIPT + ':';
  3228. var iframeDocument;
  3229. iframe.style.display = 'none';
  3230. html.appendChild(iframe);
  3231. // https://github.com/zloirock/core-js/issues/475
  3232. iframe.src = String(JS);
  3233. iframeDocument = iframe.contentWindow.document;
  3234. iframeDocument.open();
  3235. iframeDocument.write(scriptTag('document.F=Object'));
  3236. iframeDocument.close();
  3237. return iframeDocument.F;
  3238. };
  3239. // Check for document.domain and active x support
  3240. // No need to use active x approach when document.domain is not set
  3241. // see https://github.com/es-shims/es5-shim/issues/150
  3242. // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
  3243. // avoid IE GC bug
  3244. var activeXDocument;
  3245. var NullProtoObject = function () {
  3246. try {
  3247. /* global ActiveXObject -- old IE */
  3248. activeXDocument = document.domain && new ActiveXObject('htmlfile');
  3249. } catch (error) { /* ignore */ }
  3250. NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame();
  3251. var length = enumBugKeys.length;
  3252. while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
  3253. return NullProtoObject();
  3254. };
  3255. hiddenKeys[IE_PROTO] = true;
  3256. // `Object.create` method
  3257. // https://tc39.es/ecma262/#sec-object.create
  3258. module.exports = Object.create || function create(O, Properties) {
  3259. var result;
  3260. if (O !== null) {
  3261. EmptyConstructor[PROTOTYPE] = anObject(O);
  3262. result = new EmptyConstructor();
  3263. EmptyConstructor[PROTOTYPE] = null;
  3264. // add "__proto__" for Object.getPrototypeOf polyfill
  3265. result[IE_PROTO] = O;
  3266. } else result = NullProtoObject();
  3267. return Properties === undefined ? result : defineProperties(result, Properties);
  3268. };
  3269. /***/ }),
  3270. /***/ "7db0":
  3271. /***/ (function(module, exports, __webpack_require__) {
  3272. "use strict";
  3273. var $ = __webpack_require__("23e7");
  3274. var $find = __webpack_require__("b727").find;
  3275. var addToUnscopables = __webpack_require__("44d2");
  3276. var FIND = 'find';
  3277. var SKIPS_HOLES = true;
  3278. // Shouldn't skip holes
  3279. if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
  3280. // `Array.prototype.find` method
  3281. // https://tc39.es/ecma262/#sec-array.prototype.find
  3282. $({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
  3283. find: function find(callbackfn /* , that = undefined */) {
  3284. return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  3285. }
  3286. });
  3287. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  3288. addToUnscopables(FIND);
  3289. /***/ }),
  3290. /***/ "7dd0":
  3291. /***/ (function(module, exports, __webpack_require__) {
  3292. "use strict";
  3293. var $ = __webpack_require__("23e7");
  3294. var createIteratorConstructor = __webpack_require__("9ed3");
  3295. var getPrototypeOf = __webpack_require__("e163");
  3296. var setPrototypeOf = __webpack_require__("d2bb");
  3297. var setToStringTag = __webpack_require__("d44e");
  3298. var createNonEnumerableProperty = __webpack_require__("9112");
  3299. var redefine = __webpack_require__("6eeb");
  3300. var wellKnownSymbol = __webpack_require__("b622");
  3301. var IS_PURE = __webpack_require__("c430");
  3302. var Iterators = __webpack_require__("3f8c");
  3303. var IteratorsCore = __webpack_require__("ae93");
  3304. var IteratorPrototype = IteratorsCore.IteratorPrototype;
  3305. var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
  3306. var ITERATOR = wellKnownSymbol('iterator');
  3307. var KEYS = 'keys';
  3308. var VALUES = 'values';
  3309. var ENTRIES = 'entries';
  3310. var returnThis = function () { return this; };
  3311. module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
  3312. createIteratorConstructor(IteratorConstructor, NAME, next);
  3313. var getIterationMethod = function (KIND) {
  3314. if (KIND === DEFAULT && defaultIterator) return defaultIterator;
  3315. if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];
  3316. switch (KIND) {
  3317. case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
  3318. case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
  3319. case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
  3320. } return function () { return new IteratorConstructor(this); };
  3321. };
  3322. var TO_STRING_TAG = NAME + ' Iterator';
  3323. var INCORRECT_VALUES_NAME = false;
  3324. var IterablePrototype = Iterable.prototype;
  3325. var nativeIterator = IterablePrototype[ITERATOR]
  3326. || IterablePrototype['@@iterator']
  3327. || DEFAULT && IterablePrototype[DEFAULT];
  3328. var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
  3329. var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
  3330. var CurrentIteratorPrototype, methods, KEY;
  3331. // fix native
  3332. if (anyNativeIterator) {
  3333. CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
  3334. if (IteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
  3335. if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
  3336. if (setPrototypeOf) {
  3337. setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
  3338. } else if (typeof CurrentIteratorPrototype[ITERATOR] != 'function') {
  3339. createNonEnumerableProperty(CurrentIteratorPrototype, ITERATOR, returnThis);
  3340. }
  3341. }
  3342. // Set @@toStringTag to native iterators
  3343. setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true);
  3344. if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis;
  3345. }
  3346. }
  3347. // fix Array#{values, @@iterator}.name in V8 / FF
  3348. if (DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
  3349. INCORRECT_VALUES_NAME = true;
  3350. defaultIterator = function values() { return nativeIterator.call(this); };
  3351. }
  3352. // define iterator
  3353. if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) {
  3354. createNonEnumerableProperty(IterablePrototype, ITERATOR, defaultIterator);
  3355. }
  3356. Iterators[NAME] = defaultIterator;
  3357. // export additional methods
  3358. if (DEFAULT) {
  3359. methods = {
  3360. values: getIterationMethod(VALUES),
  3361. keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
  3362. entries: getIterationMethod(ENTRIES)
  3363. };
  3364. if (FORCED) for (KEY in methods) {
  3365. if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
  3366. redefine(IterablePrototype, KEY, methods[KEY]);
  3367. }
  3368. } else $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
  3369. }
  3370. return methods;
  3371. };
  3372. /***/ }),
  3373. /***/ "7f9a":
  3374. /***/ (function(module, exports, __webpack_require__) {
  3375. var global = __webpack_require__("da84");
  3376. var inspectSource = __webpack_require__("8925");
  3377. var WeakMap = global.WeakMap;
  3378. module.exports = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap));
  3379. /***/ }),
  3380. /***/ "825a":
  3381. /***/ (function(module, exports, __webpack_require__) {
  3382. var isObject = __webpack_require__("861d");
  3383. module.exports = function (it) {
  3384. if (!isObject(it)) {
  3385. throw TypeError(String(it) + ' is not an object');
  3386. } return it;
  3387. };
  3388. /***/ }),
  3389. /***/ "83ab":
  3390. /***/ (function(module, exports, __webpack_require__) {
  3391. var fails = __webpack_require__("d039");
  3392. // Detect IE8's incomplete defineProperty implementation
  3393. module.exports = !fails(function () {
  3394. return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
  3395. });
  3396. /***/ }),
  3397. /***/ "8418":
  3398. /***/ (function(module, exports, __webpack_require__) {
  3399. "use strict";
  3400. var toPrimitive = __webpack_require__("c04e");
  3401. var definePropertyModule = __webpack_require__("9bf2");
  3402. var createPropertyDescriptor = __webpack_require__("5c6c");
  3403. module.exports = function (object, key, value) {
  3404. var propertyKey = toPrimitive(key);
  3405. if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));
  3406. else object[propertyKey] = value;
  3407. };
  3408. /***/ }),
  3409. /***/ "857a":
  3410. /***/ (function(module, exports, __webpack_require__) {
  3411. var requireObjectCoercible = __webpack_require__("1d80");
  3412. var quot = /"/g;
  3413. // B.2.3.2.1 CreateHTML(string, tag, attribute, value)
  3414. // https://tc39.es/ecma262/#sec-createhtml
  3415. module.exports = function (string, tag, attribute, value) {
  3416. var S = String(requireObjectCoercible(string));
  3417. var p1 = '<' + tag;
  3418. if (attribute !== '') p1 += ' ' + attribute + '="' + String(value).replace(quot, '&quot;') + '"';
  3419. return p1 + '>' + S + '</' + tag + '>';
  3420. };
  3421. /***/ }),
  3422. /***/ "861d":
  3423. /***/ (function(module, exports) {
  3424. module.exports = function (it) {
  3425. return typeof it === 'object' ? it !== null : typeof it === 'function';
  3426. };
  3427. /***/ }),
  3428. /***/ "8875":
  3429. /***/ (function(module, exports, __webpack_require__) {
  3430. var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// addapted from the document.currentScript polyfill by Adam Miller
  3431. // MIT license
  3432. // source: https://github.com/amiller-gh/currentScript-polyfill
  3433. // added support for Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1620505
  3434. (function (root, factory) {
  3435. if (true) {
  3436. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
  3437. __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
  3438. (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
  3439. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  3440. } else {}
  3441. }(typeof self !== 'undefined' ? self : this, function () {
  3442. function getCurrentScript () {
  3443. var descriptor = Object.getOwnPropertyDescriptor(document, 'currentScript')
  3444. // for chrome
  3445. if (!descriptor && 'currentScript' in document && document.currentScript) {
  3446. return document.currentScript
  3447. }
  3448. // for other browsers with native support for currentScript
  3449. if (descriptor && descriptor.get !== getCurrentScript && document.currentScript) {
  3450. return document.currentScript
  3451. }
  3452. // IE 8-10 support script readyState
  3453. // IE 11+ & Firefox support stack trace
  3454. try {
  3455. throw new Error();
  3456. }
  3457. catch (err) {
  3458. // Find the second match for the "at" string to get file src url from stack.
  3459. var ieStackRegExp = /.*at [^(]*\((.*):(.+):(.+)\)$/ig,
  3460. ffStackRegExp = /@([^@]*):(\d+):(\d+)\s*$/ig,
  3461. stackDetails = ieStackRegExp.exec(err.stack) || ffStackRegExp.exec(err.stack),
  3462. scriptLocation = (stackDetails && stackDetails[1]) || false,
  3463. line = (stackDetails && stackDetails[2]) || false,
  3464. currentLocation = document.location.href.replace(document.location.hash, ''),
  3465. pageSource,
  3466. inlineScriptSourceRegExp,
  3467. inlineScriptSource,
  3468. scripts = document.getElementsByTagName('script'); // Live NodeList collection
  3469. if (scriptLocation === currentLocation) {
  3470. pageSource = document.documentElement.outerHTML;
  3471. inlineScriptSourceRegExp = new RegExp('(?:[^\\n]+?\\n){0,' + (line - 2) + '}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*', 'i');
  3472. inlineScriptSource = pageSource.replace(inlineScriptSourceRegExp, '$1').trim();
  3473. }
  3474. for (var i = 0; i < scripts.length; i++) {
  3475. // If ready state is interactive, return the script tag
  3476. if (scripts[i].readyState === 'interactive') {
  3477. return scripts[i];
  3478. }
  3479. // If src matches, return the script tag
  3480. if (scripts[i].src === scriptLocation) {
  3481. return scripts[i];
  3482. }
  3483. // If inline source matches, return the script tag
  3484. if (
  3485. scriptLocation === currentLocation &&
  3486. scripts[i].innerHTML &&
  3487. scripts[i].innerHTML.trim() === inlineScriptSource
  3488. ) {
  3489. return scripts[i];
  3490. }
  3491. }
  3492. // If no match, return null
  3493. return null;
  3494. }
  3495. };
  3496. return getCurrentScript
  3497. }));
  3498. /***/ }),
  3499. /***/ "8925":
  3500. /***/ (function(module, exports, __webpack_require__) {
  3501. var store = __webpack_require__("c6cd");
  3502. var functionToString = Function.toString;
  3503. // this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper
  3504. if (typeof store.inspectSource != 'function') {
  3505. store.inspectSource = function (it) {
  3506. return functionToString.call(it);
  3507. };
  3508. }
  3509. module.exports = store.inspectSource;
  3510. /***/ }),
  3511. /***/ "8aa5":
  3512. /***/ (function(module, exports, __webpack_require__) {
  3513. "use strict";
  3514. var charAt = __webpack_require__("6547").charAt;
  3515. // `AdvanceStringIndex` abstract operation
  3516. // https://tc39.es/ecma262/#sec-advancestringindex
  3517. module.exports = function (S, index, unicode) {
  3518. return index + (unicode ? charAt(S, index).length : 1);
  3519. };
  3520. /***/ }),
  3521. /***/ "90e3":
  3522. /***/ (function(module, exports) {
  3523. var id = 0;
  3524. var postfix = Math.random();
  3525. module.exports = function (key) {
  3526. return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);
  3527. };
  3528. /***/ }),
  3529. /***/ "9112":
  3530. /***/ (function(module, exports, __webpack_require__) {
  3531. var DESCRIPTORS = __webpack_require__("83ab");
  3532. var definePropertyModule = __webpack_require__("9bf2");
  3533. var createPropertyDescriptor = __webpack_require__("5c6c");
  3534. module.exports = DESCRIPTORS ? function (object, key, value) {
  3535. return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));
  3536. } : function (object, key, value) {
  3537. object[key] = value;
  3538. return object;
  3539. };
  3540. /***/ }),
  3541. /***/ "9263":
  3542. /***/ (function(module, exports, __webpack_require__) {
  3543. "use strict";
  3544. var regexpFlags = __webpack_require__("ad6d");
  3545. var stickyHelpers = __webpack_require__("9f7f");
  3546. var nativeExec = RegExp.prototype.exec;
  3547. // This always refers to the native implementation, because the
  3548. // String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js,
  3549. // which loads this file before patching the method.
  3550. var nativeReplace = String.prototype.replace;
  3551. var patchedExec = nativeExec;
  3552. var UPDATES_LAST_INDEX_WRONG = (function () {
  3553. var re1 = /a/;
  3554. var re2 = /b*/g;
  3555. nativeExec.call(re1, 'a');
  3556. nativeExec.call(re2, 'a');
  3557. return re1.lastIndex !== 0 || re2.lastIndex !== 0;
  3558. })();
  3559. var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y || stickyHelpers.BROKEN_CARET;
  3560. // nonparticipating capturing group, copied from es5-shim's String#split patch.
  3561. // eslint-disable-next-line regexp/no-assertion-capturing-group, regexp/no-empty-group -- required for testing
  3562. var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
  3563. var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y;
  3564. if (PATCH) {
  3565. patchedExec = function exec(str) {
  3566. var re = this;
  3567. var lastIndex, reCopy, match, i;
  3568. var sticky = UNSUPPORTED_Y && re.sticky;
  3569. var flags = regexpFlags.call(re);
  3570. var source = re.source;
  3571. var charsAdded = 0;
  3572. var strCopy = str;
  3573. if (sticky) {
  3574. flags = flags.replace('y', '');
  3575. if (flags.indexOf('g') === -1) {
  3576. flags += 'g';
  3577. }
  3578. strCopy = String(str).slice(re.lastIndex);
  3579. // Support anchored sticky behavior.
  3580. if (re.lastIndex > 0 && (!re.multiline || re.multiline && str[re.lastIndex - 1] !== '\n')) {
  3581. source = '(?: ' + source + ')';
  3582. strCopy = ' ' + strCopy;
  3583. charsAdded++;
  3584. }
  3585. // ^(? + rx + ) is needed, in combination with some str slicing, to
  3586. // simulate the 'y' flag.
  3587. reCopy = new RegExp('^(?:' + source + ')', flags);
  3588. }
  3589. if (NPCG_INCLUDED) {
  3590. reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
  3591. }
  3592. if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
  3593. match = nativeExec.call(sticky ? reCopy : re, strCopy);
  3594. if (sticky) {
  3595. if (match) {
  3596. match.input = match.input.slice(charsAdded);
  3597. match[0] = match[0].slice(charsAdded);
  3598. match.index = re.lastIndex;
  3599. re.lastIndex += match[0].length;
  3600. } else re.lastIndex = 0;
  3601. } else if (UPDATES_LAST_INDEX_WRONG && match) {
  3602. re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
  3603. }
  3604. if (NPCG_INCLUDED && match && match.length > 1) {
  3605. // Fix browsers whose `exec` methods don't consistently return `undefined`
  3606. // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
  3607. nativeReplace.call(match[0], reCopy, function () {
  3608. for (i = 1; i < arguments.length - 2; i++) {
  3609. if (arguments[i] === undefined) match[i] = undefined;
  3610. }
  3611. });
  3612. }
  3613. return match;
  3614. };
  3615. }
  3616. module.exports = patchedExec;
  3617. /***/ }),
  3618. /***/ "94ca":
  3619. /***/ (function(module, exports, __webpack_require__) {
  3620. var fails = __webpack_require__("d039");
  3621. var replacement = /#|\.prototype\./;
  3622. var isForced = function (feature, detection) {
  3623. var value = data[normalize(feature)];
  3624. return value == POLYFILL ? true
  3625. : value == NATIVE ? false
  3626. : typeof detection == 'function' ? fails(detection)
  3627. : !!detection;
  3628. };
  3629. var normalize = isForced.normalize = function (string) {
  3630. return String(string).replace(replacement, '.').toLowerCase();
  3631. };
  3632. var data = isForced.data = {};
  3633. var NATIVE = isForced.NATIVE = 'N';
  3634. var POLYFILL = isForced.POLYFILL = 'P';
  3635. module.exports = isForced;
  3636. /***/ }),
  3637. /***/ "9861":
  3638. /***/ (function(module, exports, __webpack_require__) {
  3639. "use strict";
  3640. // TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env`
  3641. __webpack_require__("e260");
  3642. var $ = __webpack_require__("23e7");
  3643. var getBuiltIn = __webpack_require__("d066");
  3644. var USE_NATIVE_URL = __webpack_require__("0d3b");
  3645. var redefine = __webpack_require__("6eeb");
  3646. var redefineAll = __webpack_require__("e2cc");
  3647. var setToStringTag = __webpack_require__("d44e");
  3648. var createIteratorConstructor = __webpack_require__("9ed3");
  3649. var InternalStateModule = __webpack_require__("69f3");
  3650. var anInstance = __webpack_require__("19aa");
  3651. var hasOwn = __webpack_require__("5135");
  3652. var bind = __webpack_require__("0366");
  3653. var classof = __webpack_require__("f5df");
  3654. var anObject = __webpack_require__("825a");
  3655. var isObject = __webpack_require__("861d");
  3656. var create = __webpack_require__("7c73");
  3657. var createPropertyDescriptor = __webpack_require__("5c6c");
  3658. var getIterator = __webpack_require__("9a1f");
  3659. var getIteratorMethod = __webpack_require__("35a1");
  3660. var wellKnownSymbol = __webpack_require__("b622");
  3661. var $fetch = getBuiltIn('fetch');
  3662. var Headers = getBuiltIn('Headers');
  3663. var ITERATOR = wellKnownSymbol('iterator');
  3664. var URL_SEARCH_PARAMS = 'URLSearchParams';
  3665. var URL_SEARCH_PARAMS_ITERATOR = URL_SEARCH_PARAMS + 'Iterator';
  3666. var setInternalState = InternalStateModule.set;
  3667. var getInternalParamsState = InternalStateModule.getterFor(URL_SEARCH_PARAMS);
  3668. var getInternalIteratorState = InternalStateModule.getterFor(URL_SEARCH_PARAMS_ITERATOR);
  3669. var plus = /\+/g;
  3670. var sequences = Array(4);
  3671. var percentSequence = function (bytes) {
  3672. return sequences[bytes - 1] || (sequences[bytes - 1] = RegExp('((?:%[\\da-f]{2}){' + bytes + '})', 'gi'));
  3673. };
  3674. var percentDecode = function (sequence) {
  3675. try {
  3676. return decodeURIComponent(sequence);
  3677. } catch (error) {
  3678. return sequence;
  3679. }
  3680. };
  3681. var deserialize = function (it) {
  3682. var result = it.replace(plus, ' ');
  3683. var bytes = 4;
  3684. try {
  3685. return decodeURIComponent(result);
  3686. } catch (error) {
  3687. while (bytes) {
  3688. result = result.replace(percentSequence(bytes--), percentDecode);
  3689. }
  3690. return result;
  3691. }
  3692. };
  3693. var find = /[!'()~]|%20/g;
  3694. var replace = {
  3695. '!': '%21',
  3696. "'": '%27',
  3697. '(': '%28',
  3698. ')': '%29',
  3699. '~': '%7E',
  3700. '%20': '+'
  3701. };
  3702. var replacer = function (match) {
  3703. return replace[match];
  3704. };
  3705. var serialize = function (it) {
  3706. return encodeURIComponent(it).replace(find, replacer);
  3707. };
  3708. var parseSearchParams = function (result, query) {
  3709. if (query) {
  3710. var attributes = query.split('&');
  3711. var index = 0;
  3712. var attribute, entry;
  3713. while (index < attributes.length) {
  3714. attribute = attributes[index++];
  3715. if (attribute.length) {
  3716. entry = attribute.split('=');
  3717. result.push({
  3718. key: deserialize(entry.shift()),
  3719. value: deserialize(entry.join('='))
  3720. });
  3721. }
  3722. }
  3723. }
  3724. };
  3725. var updateSearchParams = function (query) {
  3726. this.entries.length = 0;
  3727. parseSearchParams(this.entries, query);
  3728. };
  3729. var validateArgumentsLength = function (passed, required) {
  3730. if (passed < required) throw TypeError('Not enough arguments');
  3731. };
  3732. var URLSearchParamsIterator = createIteratorConstructor(function Iterator(params, kind) {
  3733. setInternalState(this, {
  3734. type: URL_SEARCH_PARAMS_ITERATOR,
  3735. iterator: getIterator(getInternalParamsState(params).entries),
  3736. kind: kind
  3737. });
  3738. }, 'Iterator', function next() {
  3739. var state = getInternalIteratorState(this);
  3740. var kind = state.kind;
  3741. var step = state.iterator.next();
  3742. var entry = step.value;
  3743. if (!step.done) {
  3744. step.value = kind === 'keys' ? entry.key : kind === 'values' ? entry.value : [entry.key, entry.value];
  3745. } return step;
  3746. });
  3747. // `URLSearchParams` constructor
  3748. // https://url.spec.whatwg.org/#interface-urlsearchparams
  3749. var URLSearchParamsConstructor = function URLSearchParams(/* init */) {
  3750. anInstance(this, URLSearchParamsConstructor, URL_SEARCH_PARAMS);
  3751. var init = arguments.length > 0 ? arguments[0] : undefined;
  3752. var that = this;
  3753. var entries = [];
  3754. var iteratorMethod, iterator, next, step, entryIterator, entryNext, first, second, key;
  3755. setInternalState(that, {
  3756. type: URL_SEARCH_PARAMS,
  3757. entries: entries,
  3758. updateURL: function () { /* empty */ },
  3759. updateSearchParams: updateSearchParams
  3760. });
  3761. if (init !== undefined) {
  3762. if (isObject(init)) {
  3763. iteratorMethod = getIteratorMethod(init);
  3764. if (typeof iteratorMethod === 'function') {
  3765. iterator = iteratorMethod.call(init);
  3766. next = iterator.next;
  3767. while (!(step = next.call(iterator)).done) {
  3768. entryIterator = getIterator(anObject(step.value));
  3769. entryNext = entryIterator.next;
  3770. if (
  3771. (first = entryNext.call(entryIterator)).done ||
  3772. (second = entryNext.call(entryIterator)).done ||
  3773. !entryNext.call(entryIterator).done
  3774. ) throw TypeError('Expected sequence with length 2');
  3775. entries.push({ key: first.value + '', value: second.value + '' });
  3776. }
  3777. } else for (key in init) if (hasOwn(init, key)) entries.push({ key: key, value: init[key] + '' });
  3778. } else {
  3779. parseSearchParams(entries, typeof init === 'string' ? init.charAt(0) === '?' ? init.slice(1) : init : init + '');
  3780. }
  3781. }
  3782. };
  3783. var URLSearchParamsPrototype = URLSearchParamsConstructor.prototype;
  3784. redefineAll(URLSearchParamsPrototype, {
  3785. // `URLSearchParams.prototype.append` method
  3786. // https://url.spec.whatwg.org/#dom-urlsearchparams-append
  3787. append: function append(name, value) {
  3788. validateArgumentsLength(arguments.length, 2);
  3789. var state = getInternalParamsState(this);
  3790. state.entries.push({ key: name + '', value: value + '' });
  3791. state.updateURL();
  3792. },
  3793. // `URLSearchParams.prototype.delete` method
  3794. // https://url.spec.whatwg.org/#dom-urlsearchparams-delete
  3795. 'delete': function (name) {
  3796. validateArgumentsLength(arguments.length, 1);
  3797. var state = getInternalParamsState(this);
  3798. var entries = state.entries;
  3799. var key = name + '';
  3800. var index = 0;
  3801. while (index < entries.length) {
  3802. if (entries[index].key === key) entries.splice(index, 1);
  3803. else index++;
  3804. }
  3805. state.updateURL();
  3806. },
  3807. // `URLSearchParams.prototype.get` method
  3808. // https://url.spec.whatwg.org/#dom-urlsearchparams-get
  3809. get: function get(name) {
  3810. validateArgumentsLength(arguments.length, 1);
  3811. var entries = getInternalParamsState(this).entries;
  3812. var key = name + '';
  3813. var index = 0;
  3814. for (; index < entries.length; index++) {
  3815. if (entries[index].key === key) return entries[index].value;
  3816. }
  3817. return null;
  3818. },
  3819. // `URLSearchParams.prototype.getAll` method
  3820. // https://url.spec.whatwg.org/#dom-urlsearchparams-getall
  3821. getAll: function getAll(name) {
  3822. validateArgumentsLength(arguments.length, 1);
  3823. var entries = getInternalParamsState(this).entries;
  3824. var key = name + '';
  3825. var result = [];
  3826. var index = 0;
  3827. for (; index < entries.length; index++) {
  3828. if (entries[index].key === key) result.push(entries[index].value);
  3829. }
  3830. return result;
  3831. },
  3832. // `URLSearchParams.prototype.has` method
  3833. // https://url.spec.whatwg.org/#dom-urlsearchparams-has
  3834. has: function has(name) {
  3835. validateArgumentsLength(arguments.length, 1);
  3836. var entries = getInternalParamsState(this).entries;
  3837. var key = name + '';
  3838. var index = 0;
  3839. while (index < entries.length) {
  3840. if (entries[index++].key === key) return true;
  3841. }
  3842. return false;
  3843. },
  3844. // `URLSearchParams.prototype.set` method
  3845. // https://url.spec.whatwg.org/#dom-urlsearchparams-set
  3846. set: function set(name, value) {
  3847. validateArgumentsLength(arguments.length, 1);
  3848. var state = getInternalParamsState(this);
  3849. var entries = state.entries;
  3850. var found = false;
  3851. var key = name + '';
  3852. var val = value + '';
  3853. var index = 0;
  3854. var entry;
  3855. for (; index < entries.length; index++) {
  3856. entry = entries[index];
  3857. if (entry.key === key) {
  3858. if (found) entries.splice(index--, 1);
  3859. else {
  3860. found = true;
  3861. entry.value = val;
  3862. }
  3863. }
  3864. }
  3865. if (!found) entries.push({ key: key, value: val });
  3866. state.updateURL();
  3867. },
  3868. // `URLSearchParams.prototype.sort` method
  3869. // https://url.spec.whatwg.org/#dom-urlsearchparams-sort
  3870. sort: function sort() {
  3871. var state = getInternalParamsState(this);
  3872. var entries = state.entries;
  3873. // Array#sort is not stable in some engines
  3874. var slice = entries.slice();
  3875. var entry, entriesIndex, sliceIndex;
  3876. entries.length = 0;
  3877. for (sliceIndex = 0; sliceIndex < slice.length; sliceIndex++) {
  3878. entry = slice[sliceIndex];
  3879. for (entriesIndex = 0; entriesIndex < sliceIndex; entriesIndex++) {
  3880. if (entries[entriesIndex].key > entry.key) {
  3881. entries.splice(entriesIndex, 0, entry);
  3882. break;
  3883. }
  3884. }
  3885. if (entriesIndex === sliceIndex) entries.push(entry);
  3886. }
  3887. state.updateURL();
  3888. },
  3889. // `URLSearchParams.prototype.forEach` method
  3890. forEach: function forEach(callback /* , thisArg */) {
  3891. var entries = getInternalParamsState(this).entries;
  3892. var boundFunction = bind(callback, arguments.length > 1 ? arguments[1] : undefined, 3);
  3893. var index = 0;
  3894. var entry;
  3895. while (index < entries.length) {
  3896. entry = entries[index++];
  3897. boundFunction(entry.value, entry.key, this);
  3898. }
  3899. },
  3900. // `URLSearchParams.prototype.keys` method
  3901. keys: function keys() {
  3902. return new URLSearchParamsIterator(this, 'keys');
  3903. },
  3904. // `URLSearchParams.prototype.values` method
  3905. values: function values() {
  3906. return new URLSearchParamsIterator(this, 'values');
  3907. },
  3908. // `URLSearchParams.prototype.entries` method
  3909. entries: function entries() {
  3910. return new URLSearchParamsIterator(this, 'entries');
  3911. }
  3912. }, { enumerable: true });
  3913. // `URLSearchParams.prototype[@@iterator]` method
  3914. redefine(URLSearchParamsPrototype, ITERATOR, URLSearchParamsPrototype.entries);
  3915. // `URLSearchParams.prototype.toString` method
  3916. // https://url.spec.whatwg.org/#urlsearchparams-stringification-behavior
  3917. redefine(URLSearchParamsPrototype, 'toString', function toString() {
  3918. var entries = getInternalParamsState(this).entries;
  3919. var result = [];
  3920. var index = 0;
  3921. var entry;
  3922. while (index < entries.length) {
  3923. entry = entries[index++];
  3924. result.push(serialize(entry.key) + '=' + serialize(entry.value));
  3925. } return result.join('&');
  3926. }, { enumerable: true });
  3927. setToStringTag(URLSearchParamsConstructor, URL_SEARCH_PARAMS);
  3928. $({ global: true, forced: !USE_NATIVE_URL }, {
  3929. URLSearchParams: URLSearchParamsConstructor
  3930. });
  3931. // Wrap `fetch` for correct work with polyfilled `URLSearchParams`
  3932. // https://github.com/zloirock/core-js/issues/674
  3933. if (!USE_NATIVE_URL && typeof $fetch == 'function' && typeof Headers == 'function') {
  3934. $({ global: true, enumerable: true, forced: true }, {
  3935. fetch: function fetch(input /* , init */) {
  3936. var args = [input];
  3937. var init, body, headers;
  3938. if (arguments.length > 1) {
  3939. init = arguments[1];
  3940. if (isObject(init)) {
  3941. body = init.body;
  3942. if (classof(body) === URL_SEARCH_PARAMS) {
  3943. headers = init.headers ? new Headers(init.headers) : new Headers();
  3944. if (!headers.has('content-type')) {
  3945. headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8');
  3946. }
  3947. init = create(init, {
  3948. body: createPropertyDescriptor(0, String(body)),
  3949. headers: createPropertyDescriptor(0, headers)
  3950. });
  3951. }
  3952. }
  3953. args.push(init);
  3954. } return $fetch.apply(this, args);
  3955. }
  3956. });
  3957. }
  3958. module.exports = {
  3959. URLSearchParams: URLSearchParamsConstructor,
  3960. getState: getInternalParamsState
  3961. };
  3962. /***/ }),
  3963. /***/ "99af":
  3964. /***/ (function(module, exports, __webpack_require__) {
  3965. "use strict";
  3966. var $ = __webpack_require__("23e7");
  3967. var fails = __webpack_require__("d039");
  3968. var isArray = __webpack_require__("e8b5");
  3969. var isObject = __webpack_require__("861d");
  3970. var toObject = __webpack_require__("7b0b");
  3971. var toLength = __webpack_require__("50c4");
  3972. var createProperty = __webpack_require__("8418");
  3973. var arraySpeciesCreate = __webpack_require__("65f0");
  3974. var arrayMethodHasSpeciesSupport = __webpack_require__("1dde");
  3975. var wellKnownSymbol = __webpack_require__("b622");
  3976. var V8_VERSION = __webpack_require__("2d00");
  3977. var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
  3978. var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
  3979. var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
  3980. // We can't use this feature detection in V8 since it causes
  3981. // deoptimization and serious performance degradation
  3982. // https://github.com/zloirock/core-js/issues/679
  3983. var IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails(function () {
  3984. var array = [];
  3985. array[IS_CONCAT_SPREADABLE] = false;
  3986. return array.concat()[0] !== array;
  3987. });
  3988. var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
  3989. var isConcatSpreadable = function (O) {
  3990. if (!isObject(O)) return false;
  3991. var spreadable = O[IS_CONCAT_SPREADABLE];
  3992. return spreadable !== undefined ? !!spreadable : isArray(O);
  3993. };
  3994. var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
  3995. // `Array.prototype.concat` method
  3996. // https://tc39.es/ecma262/#sec-array.prototype.concat
  3997. // with adding support of @@isConcatSpreadable and @@species
  3998. $({ target: 'Array', proto: true, forced: FORCED }, {
  3999. // eslint-disable-next-line no-unused-vars -- required for `.length`
  4000. concat: function concat(arg) {
  4001. var O = toObject(this);
  4002. var A = arraySpeciesCreate(O, 0);
  4003. var n = 0;
  4004. var i, k, length, len, E;
  4005. for (i = -1, length = arguments.length; i < length; i++) {
  4006. E = i === -1 ? O : arguments[i];
  4007. if (isConcatSpreadable(E)) {
  4008. len = toLength(E.length);
  4009. if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  4010. for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
  4011. } else {
  4012. if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  4013. createProperty(A, n++, E);
  4014. }
  4015. }
  4016. A.length = n;
  4017. return A;
  4018. }
  4019. });
  4020. /***/ }),
  4021. /***/ "9a0c":
  4022. /***/ (function(module, exports, __webpack_require__) {
  4023. // https://github.com/zloirock/core-js/issues/280
  4024. var userAgent = __webpack_require__("342f");
  4025. // eslint-disable-next-line unicorn/no-unsafe-regex -- safe
  4026. module.exports = /Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(userAgent);
  4027. /***/ }),
  4028. /***/ "9a1f":
  4029. /***/ (function(module, exports, __webpack_require__) {
  4030. var anObject = __webpack_require__("825a");
  4031. var getIteratorMethod = __webpack_require__("35a1");
  4032. module.exports = function (it) {
  4033. var iteratorMethod = getIteratorMethod(it);
  4034. if (typeof iteratorMethod != 'function') {
  4035. throw TypeError(String(it) + ' is not iterable');
  4036. } return anObject(iteratorMethod.call(it));
  4037. };
  4038. /***/ }),
  4039. /***/ "9bdd":
  4040. /***/ (function(module, exports, __webpack_require__) {
  4041. var anObject = __webpack_require__("825a");
  4042. var iteratorClose = __webpack_require__("2a62");
  4043. // call something on iterator step with safe closing on error
  4044. module.exports = function (iterator, fn, value, ENTRIES) {
  4045. try {
  4046. return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);
  4047. // 7.4.6 IteratorClose(iterator, completion)
  4048. } catch (error) {
  4049. iteratorClose(iterator);
  4050. throw error;
  4051. }
  4052. };
  4053. /***/ }),
  4054. /***/ "9bf2":
  4055. /***/ (function(module, exports, __webpack_require__) {
  4056. var DESCRIPTORS = __webpack_require__("83ab");
  4057. var IE8_DOM_DEFINE = __webpack_require__("0cfb");
  4058. var anObject = __webpack_require__("825a");
  4059. var toPrimitive = __webpack_require__("c04e");
  4060. var nativeDefineProperty = Object.defineProperty;
  4061. // `Object.defineProperty` method
  4062. // https://tc39.es/ecma262/#sec-object.defineproperty
  4063. exports.f = DESCRIPTORS ? nativeDefineProperty : function defineProperty(O, P, Attributes) {
  4064. anObject(O);
  4065. P = toPrimitive(P, true);
  4066. anObject(Attributes);
  4067. if (IE8_DOM_DEFINE) try {
  4068. return nativeDefineProperty(O, P, Attributes);
  4069. } catch (error) { /* empty */ }
  4070. if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
  4071. if ('value' in Attributes) O[P] = Attributes.value;
  4072. return O;
  4073. };
  4074. /***/ }),
  4075. /***/ "9ed3":
  4076. /***/ (function(module, exports, __webpack_require__) {
  4077. "use strict";
  4078. var IteratorPrototype = __webpack_require__("ae93").IteratorPrototype;
  4079. var create = __webpack_require__("7c73");
  4080. var createPropertyDescriptor = __webpack_require__("5c6c");
  4081. var setToStringTag = __webpack_require__("d44e");
  4082. var Iterators = __webpack_require__("3f8c");
  4083. var returnThis = function () { return this; };
  4084. module.exports = function (IteratorConstructor, NAME, next) {
  4085. var TO_STRING_TAG = NAME + ' Iterator';
  4086. IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(1, next) });
  4087. setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true);
  4088. Iterators[TO_STRING_TAG] = returnThis;
  4089. return IteratorConstructor;
  4090. };
  4091. /***/ }),
  4092. /***/ "9f7f":
  4093. /***/ (function(module, exports, __webpack_require__) {
  4094. "use strict";
  4095. var fails = __webpack_require__("d039");
  4096. // babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError,
  4097. // so we use an intermediate function.
  4098. function RE(s, f) {
  4099. return RegExp(s, f);
  4100. }
  4101. exports.UNSUPPORTED_Y = fails(function () {
  4102. // babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
  4103. var re = RE('a', 'y');
  4104. re.lastIndex = 2;
  4105. return re.exec('abcd') != null;
  4106. });
  4107. exports.BROKEN_CARET = fails(function () {
  4108. // https://bugzilla.mozilla.org/show_bug.cgi?id=773687
  4109. var re = RE('^r', 'gy');
  4110. re.lastIndex = 2;
  4111. return re.exec('str') != null;
  4112. });
  4113. /***/ }),
  4114. /***/ "a15b":
  4115. /***/ (function(module, exports, __webpack_require__) {
  4116. "use strict";
  4117. var $ = __webpack_require__("23e7");
  4118. var IndexedObject = __webpack_require__("44ad");
  4119. var toIndexedObject = __webpack_require__("fc6a");
  4120. var arrayMethodIsStrict = __webpack_require__("a640");
  4121. var nativeJoin = [].join;
  4122. var ES3_STRINGS = IndexedObject != Object;
  4123. var STRICT_METHOD = arrayMethodIsStrict('join', ',');
  4124. // `Array.prototype.join` method
  4125. // https://tc39.es/ecma262/#sec-array.prototype.join
  4126. $({ target: 'Array', proto: true, forced: ES3_STRINGS || !STRICT_METHOD }, {
  4127. join: function join(separator) {
  4128. return nativeJoin.call(toIndexedObject(this), separator === undefined ? ',' : separator);
  4129. }
  4130. });
  4131. /***/ }),
  4132. /***/ "a434":
  4133. /***/ (function(module, exports, __webpack_require__) {
  4134. "use strict";
  4135. var $ = __webpack_require__("23e7");
  4136. var toAbsoluteIndex = __webpack_require__("23cb");
  4137. var toInteger = __webpack_require__("a691");
  4138. var toLength = __webpack_require__("50c4");
  4139. var toObject = __webpack_require__("7b0b");
  4140. var arraySpeciesCreate = __webpack_require__("65f0");
  4141. var createProperty = __webpack_require__("8418");
  4142. var arrayMethodHasSpeciesSupport = __webpack_require__("1dde");
  4143. var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('splice');
  4144. var max = Math.max;
  4145. var min = Math.min;
  4146. var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
  4147. var MAXIMUM_ALLOWED_LENGTH_EXCEEDED = 'Maximum allowed length exceeded';
  4148. // `Array.prototype.splice` method
  4149. // https://tc39.es/ecma262/#sec-array.prototype.splice
  4150. // with adding support of @@species
  4151. $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
  4152. splice: function splice(start, deleteCount /* , ...items */) {
  4153. var O = toObject(this);
  4154. var len = toLength(O.length);
  4155. var actualStart = toAbsoluteIndex(start, len);
  4156. var argumentsLength = arguments.length;
  4157. var insertCount, actualDeleteCount, A, k, from, to;
  4158. if (argumentsLength === 0) {
  4159. insertCount = actualDeleteCount = 0;
  4160. } else if (argumentsLength === 1) {
  4161. insertCount = 0;
  4162. actualDeleteCount = len - actualStart;
  4163. } else {
  4164. insertCount = argumentsLength - 2;
  4165. actualDeleteCount = min(max(toInteger(deleteCount), 0), len - actualStart);
  4166. }
  4167. if (len + insertCount - actualDeleteCount > MAX_SAFE_INTEGER) {
  4168. throw TypeError(MAXIMUM_ALLOWED_LENGTH_EXCEEDED);
  4169. }
  4170. A = arraySpeciesCreate(O, actualDeleteCount);
  4171. for (k = 0; k < actualDeleteCount; k++) {
  4172. from = actualStart + k;
  4173. if (from in O) createProperty(A, k, O[from]);
  4174. }
  4175. A.length = actualDeleteCount;
  4176. if (insertCount < actualDeleteCount) {
  4177. for (k = actualStart; k < len - actualDeleteCount; k++) {
  4178. from = k + actualDeleteCount;
  4179. to = k + insertCount;
  4180. if (from in O) O[to] = O[from];
  4181. else delete O[to];
  4182. }
  4183. for (k = len; k > len - actualDeleteCount + insertCount; k--) delete O[k - 1];
  4184. } else if (insertCount > actualDeleteCount) {
  4185. for (k = len - actualDeleteCount; k > actualStart; k--) {
  4186. from = k + actualDeleteCount - 1;
  4187. to = k + insertCount - 1;
  4188. if (from in O) O[to] = O[from];
  4189. else delete O[to];
  4190. }
  4191. }
  4192. for (k = 0; k < insertCount; k++) {
  4193. O[k + actualStart] = arguments[k + 2];
  4194. }
  4195. O.length = len - actualDeleteCount + insertCount;
  4196. return A;
  4197. }
  4198. });
  4199. /***/ }),
  4200. /***/ "a4b4":
  4201. /***/ (function(module, exports, __webpack_require__) {
  4202. var userAgent = __webpack_require__("342f");
  4203. module.exports = /web0s(?!.*chrome)/i.test(userAgent);
  4204. /***/ }),
  4205. /***/ "a4d3":
  4206. /***/ (function(module, exports, __webpack_require__) {
  4207. "use strict";
  4208. var $ = __webpack_require__("23e7");
  4209. var global = __webpack_require__("da84");
  4210. var getBuiltIn = __webpack_require__("d066");
  4211. var IS_PURE = __webpack_require__("c430");
  4212. var DESCRIPTORS = __webpack_require__("83ab");
  4213. var NATIVE_SYMBOL = __webpack_require__("4930");
  4214. var USE_SYMBOL_AS_UID = __webpack_require__("fdbf");
  4215. var fails = __webpack_require__("d039");
  4216. var has = __webpack_require__("5135");
  4217. var isArray = __webpack_require__("e8b5");
  4218. var isObject = __webpack_require__("861d");
  4219. var anObject = __webpack_require__("825a");
  4220. var toObject = __webpack_require__("7b0b");
  4221. var toIndexedObject = __webpack_require__("fc6a");
  4222. var toPrimitive = __webpack_require__("c04e");
  4223. var createPropertyDescriptor = __webpack_require__("5c6c");
  4224. var nativeObjectCreate = __webpack_require__("7c73");
  4225. var objectKeys = __webpack_require__("df75");
  4226. var getOwnPropertyNamesModule = __webpack_require__("241c");
  4227. var getOwnPropertyNamesExternal = __webpack_require__("057f");
  4228. var getOwnPropertySymbolsModule = __webpack_require__("7418");
  4229. var getOwnPropertyDescriptorModule = __webpack_require__("06cf");
  4230. var definePropertyModule = __webpack_require__("9bf2");
  4231. var propertyIsEnumerableModule = __webpack_require__("d1e7");
  4232. var createNonEnumerableProperty = __webpack_require__("9112");
  4233. var redefine = __webpack_require__("6eeb");
  4234. var shared = __webpack_require__("5692");
  4235. var sharedKey = __webpack_require__("f772");
  4236. var hiddenKeys = __webpack_require__("d012");
  4237. var uid = __webpack_require__("90e3");
  4238. var wellKnownSymbol = __webpack_require__("b622");
  4239. var wrappedWellKnownSymbolModule = __webpack_require__("e538");
  4240. var defineWellKnownSymbol = __webpack_require__("746f");
  4241. var setToStringTag = __webpack_require__("d44e");
  4242. var InternalStateModule = __webpack_require__("69f3");
  4243. var $forEach = __webpack_require__("b727").forEach;
  4244. var HIDDEN = sharedKey('hidden');
  4245. var SYMBOL = 'Symbol';
  4246. var PROTOTYPE = 'prototype';
  4247. var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
  4248. var setInternalState = InternalStateModule.set;
  4249. var getInternalState = InternalStateModule.getterFor(SYMBOL);
  4250. var ObjectPrototype = Object[PROTOTYPE];
  4251. var $Symbol = global.Symbol;
  4252. var $stringify = getBuiltIn('JSON', 'stringify');
  4253. var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
  4254. var nativeDefineProperty = definePropertyModule.f;
  4255. var nativeGetOwnPropertyNames = getOwnPropertyNamesExternal.f;
  4256. var nativePropertyIsEnumerable = propertyIsEnumerableModule.f;
  4257. var AllSymbols = shared('symbols');
  4258. var ObjectPrototypeSymbols = shared('op-symbols');
  4259. var StringToSymbolRegistry = shared('string-to-symbol-registry');
  4260. var SymbolToStringRegistry = shared('symbol-to-string-registry');
  4261. var WellKnownSymbolsStore = shared('wks');
  4262. var QObject = global.QObject;
  4263. // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
  4264. var USE_SETTER = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
  4265. // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
  4266. var setSymbolDescriptor = DESCRIPTORS && fails(function () {
  4267. return nativeObjectCreate(nativeDefineProperty({}, 'a', {
  4268. get: function () { return nativeDefineProperty(this, 'a', { value: 7 }).a; }
  4269. })).a != 7;
  4270. }) ? function (O, P, Attributes) {
  4271. var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor(ObjectPrototype, P);
  4272. if (ObjectPrototypeDescriptor) delete ObjectPrototype[P];
  4273. nativeDefineProperty(O, P, Attributes);
  4274. if (ObjectPrototypeDescriptor && O !== ObjectPrototype) {
  4275. nativeDefineProperty(ObjectPrototype, P, ObjectPrototypeDescriptor);
  4276. }
  4277. } : nativeDefineProperty;
  4278. var wrap = function (tag, description) {
  4279. var symbol = AllSymbols[tag] = nativeObjectCreate($Symbol[PROTOTYPE]);
  4280. setInternalState(symbol, {
  4281. type: SYMBOL,
  4282. tag: tag,
  4283. description: description
  4284. });
  4285. if (!DESCRIPTORS) symbol.description = description;
  4286. return symbol;
  4287. };
  4288. var isSymbol = USE_SYMBOL_AS_UID ? function (it) {
  4289. return typeof it == 'symbol';
  4290. } : function (it) {
  4291. return Object(it) instanceof $Symbol;
  4292. };
  4293. var $defineProperty = function defineProperty(O, P, Attributes) {
  4294. if (O === ObjectPrototype) $defineProperty(ObjectPrototypeSymbols, P, Attributes);
  4295. anObject(O);
  4296. var key = toPrimitive(P, true);
  4297. anObject(Attributes);
  4298. if (has(AllSymbols, key)) {
  4299. if (!Attributes.enumerable) {
  4300. if (!has(O, HIDDEN)) nativeDefineProperty(O, HIDDEN, createPropertyDescriptor(1, {}));
  4301. O[HIDDEN][key] = true;
  4302. } else {
  4303. if (has(O, HIDDEN) && O[HIDDEN][key]) O[HIDDEN][key] = false;
  4304. Attributes = nativeObjectCreate(Attributes, { enumerable: createPropertyDescriptor(0, false) });
  4305. } return setSymbolDescriptor(O, key, Attributes);
  4306. } return nativeDefineProperty(O, key, Attributes);
  4307. };
  4308. var $defineProperties = function defineProperties(O, Properties) {
  4309. anObject(O);
  4310. var properties = toIndexedObject(Properties);
  4311. var keys = objectKeys(properties).concat($getOwnPropertySymbols(properties));
  4312. $forEach(keys, function (key) {
  4313. if (!DESCRIPTORS || $propertyIsEnumerable.call(properties, key)) $defineProperty(O, key, properties[key]);
  4314. });
  4315. return O;
  4316. };
  4317. var $create = function create(O, Properties) {
  4318. return Properties === undefined ? nativeObjectCreate(O) : $defineProperties(nativeObjectCreate(O), Properties);
  4319. };
  4320. var $propertyIsEnumerable = function propertyIsEnumerable(V) {
  4321. var P = toPrimitive(V, true);
  4322. var enumerable = nativePropertyIsEnumerable.call(this, P);
  4323. if (this === ObjectPrototype && has(AllSymbols, P) && !has(ObjectPrototypeSymbols, P)) return false;
  4324. return enumerable || !has(this, P) || !has(AllSymbols, P) || has(this, HIDDEN) && this[HIDDEN][P] ? enumerable : true;
  4325. };
  4326. var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(O, P) {
  4327. var it = toIndexedObject(O);
  4328. var key = toPrimitive(P, true);
  4329. if (it === ObjectPrototype && has(AllSymbols, key) && !has(ObjectPrototypeSymbols, key)) return;
  4330. var descriptor = nativeGetOwnPropertyDescriptor(it, key);
  4331. if (descriptor && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) {
  4332. descriptor.enumerable = true;
  4333. }
  4334. return descriptor;
  4335. };
  4336. var $getOwnPropertyNames = function getOwnPropertyNames(O) {
  4337. var names = nativeGetOwnPropertyNames(toIndexedObject(O));
  4338. var result = [];
  4339. $forEach(names, function (key) {
  4340. if (!has(AllSymbols, key) && !has(hiddenKeys, key)) result.push(key);
  4341. });
  4342. return result;
  4343. };
  4344. var $getOwnPropertySymbols = function getOwnPropertySymbols(O) {
  4345. var IS_OBJECT_PROTOTYPE = O === ObjectPrototype;
  4346. var names = nativeGetOwnPropertyNames(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject(O));
  4347. var result = [];
  4348. $forEach(names, function (key) {
  4349. if (has(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || has(ObjectPrototype, key))) {
  4350. result.push(AllSymbols[key]);
  4351. }
  4352. });
  4353. return result;
  4354. };
  4355. // `Symbol` constructor
  4356. // https://tc39.es/ecma262/#sec-symbol-constructor
  4357. if (!NATIVE_SYMBOL) {
  4358. $Symbol = function Symbol() {
  4359. if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor');
  4360. var description = !arguments.length || arguments[0] === undefined ? undefined : String(arguments[0]);
  4361. var tag = uid(description);
  4362. var setter = function (value) {
  4363. if (this === ObjectPrototype) setter.call(ObjectPrototypeSymbols, value);
  4364. if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
  4365. setSymbolDescriptor(this, tag, createPropertyDescriptor(1, value));
  4366. };
  4367. if (DESCRIPTORS && USE_SETTER) setSymbolDescriptor(ObjectPrototype, tag, { configurable: true, set: setter });
  4368. return wrap(tag, description);
  4369. };
  4370. redefine($Symbol[PROTOTYPE], 'toString', function toString() {
  4371. return getInternalState(this).tag;
  4372. });
  4373. redefine($Symbol, 'withoutSetter', function (description) {
  4374. return wrap(uid(description), description);
  4375. });
  4376. propertyIsEnumerableModule.f = $propertyIsEnumerable;
  4377. definePropertyModule.f = $defineProperty;
  4378. getOwnPropertyDescriptorModule.f = $getOwnPropertyDescriptor;
  4379. getOwnPropertyNamesModule.f = getOwnPropertyNamesExternal.f = $getOwnPropertyNames;
  4380. getOwnPropertySymbolsModule.f = $getOwnPropertySymbols;
  4381. wrappedWellKnownSymbolModule.f = function (name) {
  4382. return wrap(wellKnownSymbol(name), name);
  4383. };
  4384. if (DESCRIPTORS) {
  4385. // https://github.com/tc39/proposal-Symbol-description
  4386. nativeDefineProperty($Symbol[PROTOTYPE], 'description', {
  4387. configurable: true,
  4388. get: function description() {
  4389. return getInternalState(this).description;
  4390. }
  4391. });
  4392. if (!IS_PURE) {
  4393. redefine(ObjectPrototype, 'propertyIsEnumerable', $propertyIsEnumerable, { unsafe: true });
  4394. }
  4395. }
  4396. }
  4397. $({ global: true, wrap: true, forced: !NATIVE_SYMBOL, sham: !NATIVE_SYMBOL }, {
  4398. Symbol: $Symbol
  4399. });
  4400. $forEach(objectKeys(WellKnownSymbolsStore), function (name) {
  4401. defineWellKnownSymbol(name);
  4402. });
  4403. $({ target: SYMBOL, stat: true, forced: !NATIVE_SYMBOL }, {
  4404. // `Symbol.for` method
  4405. // https://tc39.es/ecma262/#sec-symbol.for
  4406. 'for': function (key) {
  4407. var string = String(key);
  4408. if (has(StringToSymbolRegistry, string)) return StringToSymbolRegistry[string];
  4409. var symbol = $Symbol(string);
  4410. StringToSymbolRegistry[string] = symbol;
  4411. SymbolToStringRegistry[symbol] = string;
  4412. return symbol;
  4413. },
  4414. // `Symbol.keyFor` method
  4415. // https://tc39.es/ecma262/#sec-symbol.keyfor
  4416. keyFor: function keyFor(sym) {
  4417. if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol');
  4418. if (has(SymbolToStringRegistry, sym)) return SymbolToStringRegistry[sym];
  4419. },
  4420. useSetter: function () { USE_SETTER = true; },
  4421. useSimple: function () { USE_SETTER = false; }
  4422. });
  4423. $({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL, sham: !DESCRIPTORS }, {
  4424. // `Object.create` method
  4425. // https://tc39.es/ecma262/#sec-object.create
  4426. create: $create,
  4427. // `Object.defineProperty` method
  4428. // https://tc39.es/ecma262/#sec-object.defineproperty
  4429. defineProperty: $defineProperty,
  4430. // `Object.defineProperties` method
  4431. // https://tc39.es/ecma262/#sec-object.defineproperties
  4432. defineProperties: $defineProperties,
  4433. // `Object.getOwnPropertyDescriptor` method
  4434. // https://tc39.es/ecma262/#sec-object.getownpropertydescriptors
  4435. getOwnPropertyDescriptor: $getOwnPropertyDescriptor
  4436. });
  4437. $({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL }, {
  4438. // `Object.getOwnPropertyNames` method
  4439. // https://tc39.es/ecma262/#sec-object.getownpropertynames
  4440. getOwnPropertyNames: $getOwnPropertyNames,
  4441. // `Object.getOwnPropertySymbols` method
  4442. // https://tc39.es/ecma262/#sec-object.getownpropertysymbols
  4443. getOwnPropertySymbols: $getOwnPropertySymbols
  4444. });
  4445. // Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives
  4446. // https://bugs.chromium.org/p/v8/issues/detail?id=3443
  4447. $({ target: 'Object', stat: true, forced: fails(function () { getOwnPropertySymbolsModule.f(1); }) }, {
  4448. getOwnPropertySymbols: function getOwnPropertySymbols(it) {
  4449. return getOwnPropertySymbolsModule.f(toObject(it));
  4450. }
  4451. });
  4452. // `JSON.stringify` method behavior with symbols
  4453. // https://tc39.es/ecma262/#sec-json.stringify
  4454. if ($stringify) {
  4455. var FORCED_JSON_STRINGIFY = !NATIVE_SYMBOL || fails(function () {
  4456. var symbol = $Symbol();
  4457. // MS Edge converts symbol values to JSON as {}
  4458. return $stringify([symbol]) != '[null]'
  4459. // WebKit converts symbol values to JSON as null
  4460. || $stringify({ a: symbol }) != '{}'
  4461. // V8 throws on boxed symbols
  4462. || $stringify(Object(symbol)) != '{}';
  4463. });
  4464. $({ target: 'JSON', stat: true, forced: FORCED_JSON_STRINGIFY }, {
  4465. // eslint-disable-next-line no-unused-vars -- required for `.length`
  4466. stringify: function stringify(it, replacer, space) {
  4467. var args = [it];
  4468. var index = 1;
  4469. var $replacer;
  4470. while (arguments.length > index) args.push(arguments[index++]);
  4471. $replacer = replacer;
  4472. if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined
  4473. if (!isArray(replacer)) replacer = function (key, value) {
  4474. if (typeof $replacer == 'function') value = $replacer.call(this, key, value);
  4475. if (!isSymbol(value)) return value;
  4476. };
  4477. args[1] = replacer;
  4478. return $stringify.apply(null, args);
  4479. }
  4480. });
  4481. }
  4482. // `Symbol.prototype[@@toPrimitive]` method
  4483. // https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive
  4484. if (!$Symbol[PROTOTYPE][TO_PRIMITIVE]) {
  4485. createNonEnumerableProperty($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);
  4486. }
  4487. // `Symbol.prototype[@@toStringTag]` property
  4488. // https://tc39.es/ecma262/#sec-symbol.prototype-@@tostringtag
  4489. setToStringTag($Symbol, SYMBOL);
  4490. hiddenKeys[HIDDEN] = true;
  4491. /***/ }),
  4492. /***/ "a630":
  4493. /***/ (function(module, exports, __webpack_require__) {
  4494. var $ = __webpack_require__("23e7");
  4495. var from = __webpack_require__("4df4");
  4496. var checkCorrectnessOfIteration = __webpack_require__("1c7e");
  4497. var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function (iterable) {
  4498. Array.from(iterable);
  4499. });
  4500. // `Array.from` method
  4501. // https://tc39.es/ecma262/#sec-array.from
  4502. $({ target: 'Array', stat: true, forced: INCORRECT_ITERATION }, {
  4503. from: from
  4504. });
  4505. /***/ }),
  4506. /***/ "a640":
  4507. /***/ (function(module, exports, __webpack_require__) {
  4508. "use strict";
  4509. var fails = __webpack_require__("d039");
  4510. module.exports = function (METHOD_NAME, argument) {
  4511. var method = [][METHOD_NAME];
  4512. return !!method && fails(function () {
  4513. // eslint-disable-next-line no-useless-call,no-throw-literal -- required for testing
  4514. method.call(null, argument || function () { throw 1; }, 1);
  4515. });
  4516. };
  4517. /***/ }),
  4518. /***/ "a691":
  4519. /***/ (function(module, exports) {
  4520. var ceil = Math.ceil;
  4521. var floor = Math.floor;
  4522. // `ToInteger` abstract operation
  4523. // https://tc39.es/ecma262/#sec-tointeger
  4524. module.exports = function (argument) {
  4525. return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);
  4526. };
  4527. /***/ }),
  4528. /***/ "a9e3":
  4529. /***/ (function(module, exports, __webpack_require__) {
  4530. "use strict";
  4531. var DESCRIPTORS = __webpack_require__("83ab");
  4532. var global = __webpack_require__("da84");
  4533. var isForced = __webpack_require__("94ca");
  4534. var redefine = __webpack_require__("6eeb");
  4535. var has = __webpack_require__("5135");
  4536. var classof = __webpack_require__("c6b6");
  4537. var inheritIfRequired = __webpack_require__("7156");
  4538. var toPrimitive = __webpack_require__("c04e");
  4539. var fails = __webpack_require__("d039");
  4540. var create = __webpack_require__("7c73");
  4541. var getOwnPropertyNames = __webpack_require__("241c").f;
  4542. var getOwnPropertyDescriptor = __webpack_require__("06cf").f;
  4543. var defineProperty = __webpack_require__("9bf2").f;
  4544. var trim = __webpack_require__("58a8").trim;
  4545. var NUMBER = 'Number';
  4546. var NativeNumber = global[NUMBER];
  4547. var NumberPrototype = NativeNumber.prototype;
  4548. // Opera ~12 has broken Object#toString
  4549. var BROKEN_CLASSOF = classof(create(NumberPrototype)) == NUMBER;
  4550. // `ToNumber` abstract operation
  4551. // https://tc39.es/ecma262/#sec-tonumber
  4552. var toNumber = function (argument) {
  4553. var it = toPrimitive(argument, false);
  4554. var first, third, radix, maxCode, digits, length, index, code;
  4555. if (typeof it == 'string' && it.length > 2) {
  4556. it = trim(it);
  4557. first = it.charCodeAt(0);
  4558. if (first === 43 || first === 45) {
  4559. third = it.charCodeAt(2);
  4560. if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix
  4561. } else if (first === 48) {
  4562. switch (it.charCodeAt(1)) {
  4563. case 66: case 98: radix = 2; maxCode = 49; break; // fast equal of /^0b[01]+$/i
  4564. case 79: case 111: radix = 8; maxCode = 55; break; // fast equal of /^0o[0-7]+$/i
  4565. default: return +it;
  4566. }
  4567. digits = it.slice(2);
  4568. length = digits.length;
  4569. for (index = 0; index < length; index++) {
  4570. code = digits.charCodeAt(index);
  4571. // parseInt parses a string to a first unavailable symbol
  4572. // but ToNumber should return NaN if a string contains unavailable symbols
  4573. if (code < 48 || code > maxCode) return NaN;
  4574. } return parseInt(digits, radix);
  4575. }
  4576. } return +it;
  4577. };
  4578. // `Number` constructor
  4579. // https://tc39.es/ecma262/#sec-number-constructor
  4580. if (isForced(NUMBER, !NativeNumber(' 0o1') || !NativeNumber('0b1') || NativeNumber('+0x1'))) {
  4581. var NumberWrapper = function Number(value) {
  4582. var it = arguments.length < 1 ? 0 : value;
  4583. var dummy = this;
  4584. return dummy instanceof NumberWrapper
  4585. // check on 1..constructor(foo) case
  4586. && (BROKEN_CLASSOF ? fails(function () { NumberPrototype.valueOf.call(dummy); }) : classof(dummy) != NUMBER)
  4587. ? inheritIfRequired(new NativeNumber(toNumber(it)), dummy, NumberWrapper) : toNumber(it);
  4588. };
  4589. for (var keys = DESCRIPTORS ? getOwnPropertyNames(NativeNumber) : (
  4590. // ES3:
  4591. 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' +
  4592. // ES2015 (in case, if modules with ES2015 Number statics required before):
  4593. 'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' +
  4594. 'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger,' +
  4595. // ESNext
  4596. 'fromString,range'
  4597. ).split(','), j = 0, key; keys.length > j; j++) {
  4598. if (has(NativeNumber, key = keys[j]) && !has(NumberWrapper, key)) {
  4599. defineProperty(NumberWrapper, key, getOwnPropertyDescriptor(NativeNumber, key));
  4600. }
  4601. }
  4602. NumberWrapper.prototype = NumberPrototype;
  4603. NumberPrototype.constructor = NumberWrapper;
  4604. redefine(global, NUMBER, NumberWrapper);
  4605. }
  4606. /***/ }),
  4607. /***/ "ab13":
  4608. /***/ (function(module, exports, __webpack_require__) {
  4609. var wellKnownSymbol = __webpack_require__("b622");
  4610. var MATCH = wellKnownSymbol('match');
  4611. module.exports = function (METHOD_NAME) {
  4612. var regexp = /./;
  4613. try {
  4614. '/./'[METHOD_NAME](regexp);
  4615. } catch (error1) {
  4616. try {
  4617. regexp[MATCH] = false;
  4618. return '/./'[METHOD_NAME](regexp);
  4619. } catch (error2) { /* empty */ }
  4620. } return false;
  4621. };
  4622. /***/ }),
  4623. /***/ "ac1f":
  4624. /***/ (function(module, exports, __webpack_require__) {
  4625. "use strict";
  4626. var $ = __webpack_require__("23e7");
  4627. var exec = __webpack_require__("9263");
  4628. // `RegExp.prototype.exec` method
  4629. // https://tc39.es/ecma262/#sec-regexp.prototype.exec
  4630. $({ target: 'RegExp', proto: true, forced: /./.exec !== exec }, {
  4631. exec: exec
  4632. });
  4633. /***/ }),
  4634. /***/ "ad6d":
  4635. /***/ (function(module, exports, __webpack_require__) {
  4636. "use strict";
  4637. var anObject = __webpack_require__("825a");
  4638. // `RegExp.prototype.flags` getter implementation
  4639. // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
  4640. module.exports = function () {
  4641. var that = anObject(this);
  4642. var result = '';
  4643. if (that.global) result += 'g';
  4644. if (that.ignoreCase) result += 'i';
  4645. if (that.multiline) result += 'm';
  4646. if (that.dotAll) result += 's';
  4647. if (that.unicode) result += 'u';
  4648. if (that.sticky) result += 'y';
  4649. return result;
  4650. };
  4651. /***/ }),
  4652. /***/ "ae93":
  4653. /***/ (function(module, exports, __webpack_require__) {
  4654. "use strict";
  4655. var fails = __webpack_require__("d039");
  4656. var getPrototypeOf = __webpack_require__("e163");
  4657. var createNonEnumerableProperty = __webpack_require__("9112");
  4658. var has = __webpack_require__("5135");
  4659. var wellKnownSymbol = __webpack_require__("b622");
  4660. var IS_PURE = __webpack_require__("c430");
  4661. var ITERATOR = wellKnownSymbol('iterator');
  4662. var BUGGY_SAFARI_ITERATORS = false;
  4663. var returnThis = function () { return this; };
  4664. // `%IteratorPrototype%` object
  4665. // https://tc39.es/ecma262/#sec-%iteratorprototype%-object
  4666. var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;
  4667. if ([].keys) {
  4668. arrayIterator = [].keys();
  4669. // Safari 8 has buggy iterators w/o `next`
  4670. if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;
  4671. else {
  4672. PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator));
  4673. if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;
  4674. }
  4675. }
  4676. var NEW_ITERATOR_PROTOTYPE = IteratorPrototype == undefined || fails(function () {
  4677. var test = {};
  4678. // FF44- legacy iterators case
  4679. return IteratorPrototype[ITERATOR].call(test) !== test;
  4680. });
  4681. if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype = {};
  4682. // 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
  4683. if ((!IS_PURE || NEW_ITERATOR_PROTOTYPE) && !has(IteratorPrototype, ITERATOR)) {
  4684. createNonEnumerableProperty(IteratorPrototype, ITERATOR, returnThis);
  4685. }
  4686. module.exports = {
  4687. IteratorPrototype: IteratorPrototype,
  4688. BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS
  4689. };
  4690. /***/ }),
  4691. /***/ "af03":
  4692. /***/ (function(module, exports, __webpack_require__) {
  4693. var fails = __webpack_require__("d039");
  4694. // check the existence of a method, lowercase
  4695. // of a tag and escaping quotes in arguments
  4696. module.exports = function (METHOD_NAME) {
  4697. return fails(function () {
  4698. var test = ''[METHOD_NAME]('"');
  4699. return test !== test.toLowerCase() || test.split('"').length > 3;
  4700. });
  4701. };
  4702. /***/ }),
  4703. /***/ "b041":
  4704. /***/ (function(module, exports, __webpack_require__) {
  4705. "use strict";
  4706. var TO_STRING_TAG_SUPPORT = __webpack_require__("00ee");
  4707. var classof = __webpack_require__("f5df");
  4708. // `Object.prototype.toString` method implementation
  4709. // https://tc39.es/ecma262/#sec-object.prototype.tostring
  4710. module.exports = TO_STRING_TAG_SUPPORT ? {}.toString : function toString() {
  4711. return '[object ' + classof(this) + ']';
  4712. };
  4713. /***/ }),
  4714. /***/ "b0c0":
  4715. /***/ (function(module, exports, __webpack_require__) {
  4716. var DESCRIPTORS = __webpack_require__("83ab");
  4717. var defineProperty = __webpack_require__("9bf2").f;
  4718. var FunctionPrototype = Function.prototype;
  4719. var FunctionPrototypeToString = FunctionPrototype.toString;
  4720. var nameRE = /^\s*function ([^ (]*)/;
  4721. var NAME = 'name';
  4722. // Function instances `.name` property
  4723. // https://tc39.es/ecma262/#sec-function-instances-name
  4724. if (DESCRIPTORS && !(NAME in FunctionPrototype)) {
  4725. defineProperty(FunctionPrototype, NAME, {
  4726. configurable: true,
  4727. get: function () {
  4728. try {
  4729. return FunctionPrototypeToString.call(this).match(nameRE)[1];
  4730. } catch (error) {
  4731. return '';
  4732. }
  4733. }
  4734. });
  4735. }
  4736. /***/ }),
  4737. /***/ "b575":
  4738. /***/ (function(module, exports, __webpack_require__) {
  4739. var global = __webpack_require__("da84");
  4740. var getOwnPropertyDescriptor = __webpack_require__("06cf").f;
  4741. var macrotask = __webpack_require__("2cf4").set;
  4742. var IS_IOS = __webpack_require__("1cdc");
  4743. var IS_WEBOS_WEBKIT = __webpack_require__("a4b4");
  4744. var IS_NODE = __webpack_require__("605d");
  4745. var MutationObserver = global.MutationObserver || global.WebKitMutationObserver;
  4746. var document = global.document;
  4747. var process = global.process;
  4748. var Promise = global.Promise;
  4749. // Node.js 11 shows ExperimentalWarning on getting `queueMicrotask`
  4750. var queueMicrotaskDescriptor = getOwnPropertyDescriptor(global, 'queueMicrotask');
  4751. var queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;
  4752. var flush, head, last, notify, toggle, node, promise, then;
  4753. // modern engines have queueMicrotask method
  4754. if (!queueMicrotask) {
  4755. flush = function () {
  4756. var parent, fn;
  4757. if (IS_NODE && (parent = process.domain)) parent.exit();
  4758. while (head) {
  4759. fn = head.fn;
  4760. head = head.next;
  4761. try {
  4762. fn();
  4763. } catch (error) {
  4764. if (head) notify();
  4765. else last = undefined;
  4766. throw error;
  4767. }
  4768. } last = undefined;
  4769. if (parent) parent.enter();
  4770. };
  4771. // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339
  4772. // also except WebOS Webkit https://github.com/zloirock/core-js/issues/898
  4773. if (!IS_IOS && !IS_NODE && !IS_WEBOS_WEBKIT && MutationObserver && document) {
  4774. toggle = true;
  4775. node = document.createTextNode('');
  4776. new MutationObserver(flush).observe(node, { characterData: true });
  4777. notify = function () {
  4778. node.data = toggle = !toggle;
  4779. };
  4780. // environments with maybe non-completely correct, but existent Promise
  4781. } else if (Promise && Promise.resolve) {
  4782. // Promise.resolve without an argument throws an error in LG WebOS 2
  4783. promise = Promise.resolve(undefined);
  4784. then = promise.then;
  4785. notify = function () {
  4786. then.call(promise, flush);
  4787. };
  4788. // Node.js without promises
  4789. } else if (IS_NODE) {
  4790. notify = function () {
  4791. process.nextTick(flush);
  4792. };
  4793. // for other environments - macrotask based on:
  4794. // - setImmediate
  4795. // - MessageChannel
  4796. // - window.postMessag
  4797. // - onreadystatechange
  4798. // - setTimeout
  4799. } else {
  4800. notify = function () {
  4801. // strange IE + webpack dev server bug - use .call(global)
  4802. macrotask.call(global, flush);
  4803. };
  4804. }
  4805. }
  4806. module.exports = queueMicrotask || function (fn) {
  4807. var task = { fn: fn, next: undefined };
  4808. if (last) last.next = task;
  4809. if (!head) {
  4810. head = task;
  4811. notify();
  4812. } last = task;
  4813. };
  4814. /***/ }),
  4815. /***/ "b622":
  4816. /***/ (function(module, exports, __webpack_require__) {
  4817. var global = __webpack_require__("da84");
  4818. var shared = __webpack_require__("5692");
  4819. var has = __webpack_require__("5135");
  4820. var uid = __webpack_require__("90e3");
  4821. var NATIVE_SYMBOL = __webpack_require__("4930");
  4822. var USE_SYMBOL_AS_UID = __webpack_require__("fdbf");
  4823. var WellKnownSymbolsStore = shared('wks');
  4824. var Symbol = global.Symbol;
  4825. var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol : Symbol && Symbol.withoutSetter || uid;
  4826. module.exports = function (name) {
  4827. if (!has(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {
  4828. if (NATIVE_SYMBOL && has(Symbol, name)) {
  4829. WellKnownSymbolsStore[name] = Symbol[name];
  4830. } else {
  4831. WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);
  4832. }
  4833. } return WellKnownSymbolsStore[name];
  4834. };
  4835. /***/ }),
  4836. /***/ "b64b":
  4837. /***/ (function(module, exports, __webpack_require__) {
  4838. var $ = __webpack_require__("23e7");
  4839. var toObject = __webpack_require__("7b0b");
  4840. var nativeKeys = __webpack_require__("df75");
  4841. var fails = __webpack_require__("d039");
  4842. var FAILS_ON_PRIMITIVES = fails(function () { nativeKeys(1); });
  4843. // `Object.keys` method
  4844. // https://tc39.es/ecma262/#sec-object.keys
  4845. $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {
  4846. keys: function keys(it) {
  4847. return nativeKeys(toObject(it));
  4848. }
  4849. });
  4850. /***/ }),
  4851. /***/ "b680":
  4852. /***/ (function(module, exports, __webpack_require__) {
  4853. "use strict";
  4854. var $ = __webpack_require__("23e7");
  4855. var toInteger = __webpack_require__("a691");
  4856. var thisNumberValue = __webpack_require__("408a");
  4857. var repeat = __webpack_require__("1148");
  4858. var fails = __webpack_require__("d039");
  4859. var nativeToFixed = 1.0.toFixed;
  4860. var floor = Math.floor;
  4861. var pow = function (x, n, acc) {
  4862. return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc);
  4863. };
  4864. var log = function (x) {
  4865. var n = 0;
  4866. var x2 = x;
  4867. while (x2 >= 4096) {
  4868. n += 12;
  4869. x2 /= 4096;
  4870. }
  4871. while (x2 >= 2) {
  4872. n += 1;
  4873. x2 /= 2;
  4874. } return n;
  4875. };
  4876. var multiply = function (data, n, c) {
  4877. var index = -1;
  4878. var c2 = c;
  4879. while (++index < 6) {
  4880. c2 += n * data[index];
  4881. data[index] = c2 % 1e7;
  4882. c2 = floor(c2 / 1e7);
  4883. }
  4884. };
  4885. var divide = function (data, n) {
  4886. var index = 6;
  4887. var c = 0;
  4888. while (--index >= 0) {
  4889. c += data[index];
  4890. data[index] = floor(c / n);
  4891. c = (c % n) * 1e7;
  4892. }
  4893. };
  4894. var dataToString = function (data) {
  4895. var index = 6;
  4896. var s = '';
  4897. while (--index >= 0) {
  4898. if (s !== '' || index === 0 || data[index] !== 0) {
  4899. var t = String(data[index]);
  4900. s = s === '' ? t : s + repeat.call('0', 7 - t.length) + t;
  4901. }
  4902. } return s;
  4903. };
  4904. var FORCED = nativeToFixed && (
  4905. 0.00008.toFixed(3) !== '0.000' ||
  4906. 0.9.toFixed(0) !== '1' ||
  4907. 1.255.toFixed(2) !== '1.25' ||
  4908. 1000000000000000128.0.toFixed(0) !== '1000000000000000128'
  4909. ) || !fails(function () {
  4910. // V8 ~ Android 4.3-
  4911. nativeToFixed.call({});
  4912. });
  4913. // `Number.prototype.toFixed` method
  4914. // https://tc39.es/ecma262/#sec-number.prototype.tofixed
  4915. $({ target: 'Number', proto: true, forced: FORCED }, {
  4916. toFixed: function toFixed(fractionDigits) {
  4917. var number = thisNumberValue(this);
  4918. var fractDigits = toInteger(fractionDigits);
  4919. var data = [0, 0, 0, 0, 0, 0];
  4920. var sign = '';
  4921. var result = '0';
  4922. var e, z, j, k;
  4923. if (fractDigits < 0 || fractDigits > 20) throw RangeError('Incorrect fraction digits');
  4924. // eslint-disable-next-line no-self-compare -- NaN check
  4925. if (number != number) return 'NaN';
  4926. if (number <= -1e21 || number >= 1e21) return String(number);
  4927. if (number < 0) {
  4928. sign = '-';
  4929. number = -number;
  4930. }
  4931. if (number > 1e-21) {
  4932. e = log(number * pow(2, 69, 1)) - 69;
  4933. z = e < 0 ? number * pow(2, -e, 1) : number / pow(2, e, 1);
  4934. z *= 0x10000000000000;
  4935. e = 52 - e;
  4936. if (e > 0) {
  4937. multiply(data, 0, z);
  4938. j = fractDigits;
  4939. while (j >= 7) {
  4940. multiply(data, 1e7, 0);
  4941. j -= 7;
  4942. }
  4943. multiply(data, pow(10, j, 1), 0);
  4944. j = e - 1;
  4945. while (j >= 23) {
  4946. divide(data, 1 << 23);
  4947. j -= 23;
  4948. }
  4949. divide(data, 1 << j);
  4950. multiply(data, 1, 1);
  4951. divide(data, 2);
  4952. result = dataToString(data);
  4953. } else {
  4954. multiply(data, 0, z);
  4955. multiply(data, 1 << -e, 0);
  4956. result = dataToString(data) + repeat.call('0', fractDigits);
  4957. }
  4958. }
  4959. if (fractDigits > 0) {
  4960. k = result.length;
  4961. result = sign + (k <= fractDigits
  4962. ? '0.' + repeat.call('0', fractDigits - k) + result
  4963. : result.slice(0, k - fractDigits) + '.' + result.slice(k - fractDigits));
  4964. } else {
  4965. result = sign + result;
  4966. } return result;
  4967. }
  4968. });
  4969. /***/ }),
  4970. /***/ "b727":
  4971. /***/ (function(module, exports, __webpack_require__) {
  4972. var bind = __webpack_require__("0366");
  4973. var IndexedObject = __webpack_require__("44ad");
  4974. var toObject = __webpack_require__("7b0b");
  4975. var toLength = __webpack_require__("50c4");
  4976. var arraySpeciesCreate = __webpack_require__("65f0");
  4977. var push = [].push;
  4978. // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterOut }` methods implementation
  4979. var createMethod = function (TYPE) {
  4980. var IS_MAP = TYPE == 1;
  4981. var IS_FILTER = TYPE == 2;
  4982. var IS_SOME = TYPE == 3;
  4983. var IS_EVERY = TYPE == 4;
  4984. var IS_FIND_INDEX = TYPE == 6;
  4985. var IS_FILTER_OUT = TYPE == 7;
  4986. var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
  4987. return function ($this, callbackfn, that, specificCreate) {
  4988. var O = toObject($this);
  4989. var self = IndexedObject(O);
  4990. var boundFunction = bind(callbackfn, that, 3);
  4991. var length = toLength(self.length);
  4992. var index = 0;
  4993. var create = specificCreate || arraySpeciesCreate;
  4994. var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_OUT ? create($this, 0) : undefined;
  4995. var value, result;
  4996. for (;length > index; index++) if (NO_HOLES || index in self) {
  4997. value = self[index];
  4998. result = boundFunction(value, index, O);
  4999. if (TYPE) {
  5000. if (IS_MAP) target[index] = result; // map
  5001. else if (result) switch (TYPE) {
  5002. case 3: return true; // some
  5003. case 5: return value; // find
  5004. case 6: return index; // findIndex
  5005. case 2: push.call(target, value); // filter
  5006. } else switch (TYPE) {
  5007. case 4: return false; // every
  5008. case 7: push.call(target, value); // filterOut
  5009. }
  5010. }
  5011. }
  5012. return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
  5013. };
  5014. };
  5015. module.exports = {
  5016. // `Array.prototype.forEach` method
  5017. // https://tc39.es/ecma262/#sec-array.prototype.foreach
  5018. forEach: createMethod(0),
  5019. // `Array.prototype.map` method
  5020. // https://tc39.es/ecma262/#sec-array.prototype.map
  5021. map: createMethod(1),
  5022. // `Array.prototype.filter` method
  5023. // https://tc39.es/ecma262/#sec-array.prototype.filter
  5024. filter: createMethod(2),
  5025. // `Array.prototype.some` method
  5026. // https://tc39.es/ecma262/#sec-array.prototype.some
  5027. some: createMethod(3),
  5028. // `Array.prototype.every` method
  5029. // https://tc39.es/ecma262/#sec-array.prototype.every
  5030. every: createMethod(4),
  5031. // `Array.prototype.find` method
  5032. // https://tc39.es/ecma262/#sec-array.prototype.find
  5033. find: createMethod(5),
  5034. // `Array.prototype.findIndex` method
  5035. // https://tc39.es/ecma262/#sec-array.prototype.findIndex
  5036. findIndex: createMethod(6),
  5037. // `Array.prototype.filterOut` method
  5038. // https://github.com/tc39/proposal-array-filtering
  5039. filterOut: createMethod(7)
  5040. };
  5041. /***/ }),
  5042. /***/ "bb2f":
  5043. /***/ (function(module, exports, __webpack_require__) {
  5044. var fails = __webpack_require__("d039");
  5045. module.exports = !fails(function () {
  5046. return Object.isExtensible(Object.preventExtensions({}));
  5047. });
  5048. /***/ }),
  5049. /***/ "c04e":
  5050. /***/ (function(module, exports, __webpack_require__) {
  5051. var isObject = __webpack_require__("861d");
  5052. // `ToPrimitive` abstract operation
  5053. // https://tc39.es/ecma262/#sec-toprimitive
  5054. // instead of the ES6 spec version, we didn't implement @@toPrimitive case
  5055. // and the second argument - flag - preferred type is a string
  5056. module.exports = function (input, PREFERRED_STRING) {
  5057. if (!isObject(input)) return input;
  5058. var fn, val;
  5059. if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
  5060. if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;
  5061. if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
  5062. throw TypeError("Can't convert object to primitive value");
  5063. };
  5064. /***/ }),
  5065. /***/ "c430":
  5066. /***/ (function(module, exports) {
  5067. module.exports = false;
  5068. /***/ }),
  5069. /***/ "c6b6":
  5070. /***/ (function(module, exports) {
  5071. var toString = {}.toString;
  5072. module.exports = function (it) {
  5073. return toString.call(it).slice(8, -1);
  5074. };
  5075. /***/ }),
  5076. /***/ "c6cd":
  5077. /***/ (function(module, exports, __webpack_require__) {
  5078. var global = __webpack_require__("da84");
  5079. var setGlobal = __webpack_require__("ce4e");
  5080. var SHARED = '__core-js_shared__';
  5081. var store = global[SHARED] || setGlobal(SHARED, {});
  5082. module.exports = store;
  5083. /***/ }),
  5084. /***/ "c7cd":
  5085. /***/ (function(module, exports, __webpack_require__) {
  5086. "use strict";
  5087. var $ = __webpack_require__("23e7");
  5088. var createHTML = __webpack_require__("857a");
  5089. var forcedStringHTMLMethod = __webpack_require__("af03");
  5090. // `String.prototype.fixed` method
  5091. // https://tc39.es/ecma262/#sec-string.prototype.fixed
  5092. $({ target: 'String', proto: true, forced: forcedStringHTMLMethod('fixed') }, {
  5093. fixed: function fixed() {
  5094. return createHTML(this, 'tt', '', '');
  5095. }
  5096. });
  5097. /***/ }),
  5098. /***/ "c8ba":
  5099. /***/ (function(module, exports) {
  5100. var g;
  5101. // This works in non-strict mode
  5102. g = (function() {
  5103. return this;
  5104. })();
  5105. try {
  5106. // This works if eval is allowed (see CSP)
  5107. g = g || new Function("return this")();
  5108. } catch (e) {
  5109. // This works if the window reference is available
  5110. if (typeof window === "object") g = window;
  5111. }
  5112. // g can still be undefined, but nothing to do about it...
  5113. // We return undefined, instead of nothing here, so it's
  5114. // easier to handle this case. if(!global) { ...}
  5115. module.exports = g;
  5116. /***/ }),
  5117. /***/ "c8d2":
  5118. /***/ (function(module, exports, __webpack_require__) {
  5119. var fails = __webpack_require__("d039");
  5120. var whitespaces = __webpack_require__("5899");
  5121. var non = '\u200B\u0085\u180E';
  5122. // check that a method works with the correct list
  5123. // of whitespaces and has a correct name
  5124. module.exports = function (METHOD_NAME) {
  5125. return fails(function () {
  5126. return !!whitespaces[METHOD_NAME]() || non[METHOD_NAME]() != non || whitespaces[METHOD_NAME].name !== METHOD_NAME;
  5127. });
  5128. };
  5129. /***/ }),
  5130. /***/ "ca84":
  5131. /***/ (function(module, exports, __webpack_require__) {
  5132. var has = __webpack_require__("5135");
  5133. var toIndexedObject = __webpack_require__("fc6a");
  5134. var indexOf = __webpack_require__("4d64").indexOf;
  5135. var hiddenKeys = __webpack_require__("d012");
  5136. module.exports = function (object, names) {
  5137. var O = toIndexedObject(object);
  5138. var i = 0;
  5139. var result = [];
  5140. var key;
  5141. for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key);
  5142. // Don't enum bug & hidden keys
  5143. while (names.length > i) if (has(O, key = names[i++])) {
  5144. ~indexOf(result, key) || result.push(key);
  5145. }
  5146. return result;
  5147. };
  5148. /***/ }),
  5149. /***/ "caad":
  5150. /***/ (function(module, exports, __webpack_require__) {
  5151. "use strict";
  5152. var $ = __webpack_require__("23e7");
  5153. var $includes = __webpack_require__("4d64").includes;
  5154. var addToUnscopables = __webpack_require__("44d2");
  5155. // `Array.prototype.includes` method
  5156. // https://tc39.es/ecma262/#sec-array.prototype.includes
  5157. $({ target: 'Array', proto: true }, {
  5158. includes: function includes(el /* , fromIndex = 0 */) {
  5159. return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
  5160. }
  5161. });
  5162. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  5163. addToUnscopables('includes');
  5164. /***/ }),
  5165. /***/ "cc12":
  5166. /***/ (function(module, exports, __webpack_require__) {
  5167. var global = __webpack_require__("da84");
  5168. var isObject = __webpack_require__("861d");
  5169. var document = global.document;
  5170. // typeof document.createElement is 'object' in old IE
  5171. var EXISTS = isObject(document) && isObject(document.createElement);
  5172. module.exports = function (it) {
  5173. return EXISTS ? document.createElement(it) : {};
  5174. };
  5175. /***/ }),
  5176. /***/ "cca6":
  5177. /***/ (function(module, exports, __webpack_require__) {
  5178. var $ = __webpack_require__("23e7");
  5179. var assign = __webpack_require__("60da");
  5180. // `Object.assign` method
  5181. // https://tc39.es/ecma262/#sec-object.assign
  5182. $({ target: 'Object', stat: true, forced: Object.assign !== assign }, {
  5183. assign: assign
  5184. });
  5185. /***/ }),
  5186. /***/ "cdf9":
  5187. /***/ (function(module, exports, __webpack_require__) {
  5188. var anObject = __webpack_require__("825a");
  5189. var isObject = __webpack_require__("861d");
  5190. var newPromiseCapability = __webpack_require__("f069");
  5191. module.exports = function (C, x) {
  5192. anObject(C);
  5193. if (isObject(x) && x.constructor === C) return x;
  5194. var promiseCapability = newPromiseCapability.f(C);
  5195. var resolve = promiseCapability.resolve;
  5196. resolve(x);
  5197. return promiseCapability.promise;
  5198. };
  5199. /***/ }),
  5200. /***/ "ce4e":
  5201. /***/ (function(module, exports, __webpack_require__) {
  5202. var global = __webpack_require__("da84");
  5203. var createNonEnumerableProperty = __webpack_require__("9112");
  5204. module.exports = function (key, value) {
  5205. try {
  5206. createNonEnumerableProperty(global, key, value);
  5207. } catch (error) {
  5208. global[key] = value;
  5209. } return value;
  5210. };
  5211. /***/ }),
  5212. /***/ "d012":
  5213. /***/ (function(module, exports) {
  5214. module.exports = {};
  5215. /***/ }),
  5216. /***/ "d039":
  5217. /***/ (function(module, exports) {
  5218. module.exports = function (exec) {
  5219. try {
  5220. return !!exec();
  5221. } catch (error) {
  5222. return true;
  5223. }
  5224. };
  5225. /***/ }),
  5226. /***/ "d066":
  5227. /***/ (function(module, exports, __webpack_require__) {
  5228. var path = __webpack_require__("428f");
  5229. var global = __webpack_require__("da84");
  5230. var aFunction = function (variable) {
  5231. return typeof variable == 'function' ? variable : undefined;
  5232. };
  5233. module.exports = function (namespace, method) {
  5234. return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global[namespace])
  5235. : path[namespace] && path[namespace][method] || global[namespace] && global[namespace][method];
  5236. };
  5237. /***/ }),
  5238. /***/ "d1e7":
  5239. /***/ (function(module, exports, __webpack_require__) {
  5240. "use strict";
  5241. var nativePropertyIsEnumerable = {}.propertyIsEnumerable;
  5242. var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  5243. // Nashorn ~ JDK8 bug
  5244. var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1);
  5245. // `Object.prototype.propertyIsEnumerable` method implementation
  5246. // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
  5247. exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
  5248. var descriptor = getOwnPropertyDescriptor(this, V);
  5249. return !!descriptor && descriptor.enumerable;
  5250. } : nativePropertyIsEnumerable;
  5251. /***/ }),
  5252. /***/ "d28b":
  5253. /***/ (function(module, exports, __webpack_require__) {
  5254. var defineWellKnownSymbol = __webpack_require__("746f");
  5255. // `Symbol.iterator` well-known symbol
  5256. // https://tc39.es/ecma262/#sec-symbol.iterator
  5257. defineWellKnownSymbol('iterator');
  5258. /***/ }),
  5259. /***/ "d2bb":
  5260. /***/ (function(module, exports, __webpack_require__) {
  5261. /* eslint-disable no-proto -- safe */
  5262. var anObject = __webpack_require__("825a");
  5263. var aPossiblePrototype = __webpack_require__("3bbe");
  5264. // `Object.setPrototypeOf` method
  5265. // https://tc39.es/ecma262/#sec-object.setprototypeof
  5266. // Works with __proto__ only. Old v8 can't work with null proto objects.
  5267. module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () {
  5268. var CORRECT_SETTER = false;
  5269. var test = {};
  5270. var setter;
  5271. try {
  5272. setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set;
  5273. setter.call(test, []);
  5274. CORRECT_SETTER = test instanceof Array;
  5275. } catch (error) { /* empty */ }
  5276. return function setPrototypeOf(O, proto) {
  5277. anObject(O);
  5278. aPossiblePrototype(proto);
  5279. if (CORRECT_SETTER) setter.call(O, proto);
  5280. else O.__proto__ = proto;
  5281. return O;
  5282. };
  5283. }() : undefined);
  5284. /***/ }),
  5285. /***/ "d3b7":
  5286. /***/ (function(module, exports, __webpack_require__) {
  5287. var TO_STRING_TAG_SUPPORT = __webpack_require__("00ee");
  5288. var redefine = __webpack_require__("6eeb");
  5289. var toString = __webpack_require__("b041");
  5290. // `Object.prototype.toString` method
  5291. // https://tc39.es/ecma262/#sec-object.prototype.tostring
  5292. if (!TO_STRING_TAG_SUPPORT) {
  5293. redefine(Object.prototype, 'toString', toString, { unsafe: true });
  5294. }
  5295. /***/ }),
  5296. /***/ "d44e":
  5297. /***/ (function(module, exports, __webpack_require__) {
  5298. var defineProperty = __webpack_require__("9bf2").f;
  5299. var has = __webpack_require__("5135");
  5300. var wellKnownSymbol = __webpack_require__("b622");
  5301. var TO_STRING_TAG = wellKnownSymbol('toStringTag');
  5302. module.exports = function (it, TAG, STATIC) {
  5303. if (it && !has(it = STATIC ? it : it.prototype, TO_STRING_TAG)) {
  5304. defineProperty(it, TO_STRING_TAG, { configurable: true, value: TAG });
  5305. }
  5306. };
  5307. /***/ }),
  5308. /***/ "d58f":
  5309. /***/ (function(module, exports, __webpack_require__) {
  5310. var aFunction = __webpack_require__("1c0b");
  5311. var toObject = __webpack_require__("7b0b");
  5312. var IndexedObject = __webpack_require__("44ad");
  5313. var toLength = __webpack_require__("50c4");
  5314. // `Array.prototype.{ reduce, reduceRight }` methods implementation
  5315. var createMethod = function (IS_RIGHT) {
  5316. return function (that, callbackfn, argumentsLength, memo) {
  5317. aFunction(callbackfn);
  5318. var O = toObject(that);
  5319. var self = IndexedObject(O);
  5320. var length = toLength(O.length);
  5321. var index = IS_RIGHT ? length - 1 : 0;
  5322. var i = IS_RIGHT ? -1 : 1;
  5323. if (argumentsLength < 2) while (true) {
  5324. if (index in self) {
  5325. memo = self[index];
  5326. index += i;
  5327. break;
  5328. }
  5329. index += i;
  5330. if (IS_RIGHT ? index < 0 : length <= index) {
  5331. throw TypeError('Reduce of empty array with no initial value');
  5332. }
  5333. }
  5334. for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {
  5335. memo = callbackfn(memo, self[index], index, O);
  5336. }
  5337. return memo;
  5338. };
  5339. };
  5340. module.exports = {
  5341. // `Array.prototype.reduce` method
  5342. // https://tc39.es/ecma262/#sec-array.prototype.reduce
  5343. left: createMethod(false),
  5344. // `Array.prototype.reduceRight` method
  5345. // https://tc39.es/ecma262/#sec-array.prototype.reduceright
  5346. right: createMethod(true)
  5347. };
  5348. /***/ }),
  5349. /***/ "d784":
  5350. /***/ (function(module, exports, __webpack_require__) {
  5351. "use strict";
  5352. // TODO: Remove from `core-js@4` since it's moved to entry points
  5353. __webpack_require__("ac1f");
  5354. var redefine = __webpack_require__("6eeb");
  5355. var fails = __webpack_require__("d039");
  5356. var wellKnownSymbol = __webpack_require__("b622");
  5357. var regexpExec = __webpack_require__("9263");
  5358. var createNonEnumerableProperty = __webpack_require__("9112");
  5359. var SPECIES = wellKnownSymbol('species');
  5360. var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
  5361. // #replace needs built-in support for named groups.
  5362. // #match works fine because it just return the exec results, even if it has
  5363. // a "grops" property.
  5364. var re = /./;
  5365. re.exec = function () {
  5366. var result = [];
  5367. result.groups = { a: '7' };
  5368. return result;
  5369. };
  5370. return ''.replace(re, '$<a>') !== '7';
  5371. });
  5372. // IE <= 11 replaces $0 with the whole match, as if it was $&
  5373. // https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
  5374. var REPLACE_KEEPS_$0 = (function () {
  5375. return 'a'.replace(/./, '$0') === '$0';
  5376. })();
  5377. var REPLACE = wellKnownSymbol('replace');
  5378. // Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string
  5379. var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
  5380. if (/./[REPLACE]) {
  5381. return /./[REPLACE]('a', '$0') === '';
  5382. }
  5383. return false;
  5384. })();
  5385. // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
  5386. // Weex JS has frozen built-in prototypes, so use try / catch wrapper
  5387. var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
  5388. // eslint-disable-next-line regexp/no-empty-group -- required for testing
  5389. var re = /(?:)/;
  5390. var originalExec = re.exec;
  5391. re.exec = function () { return originalExec.apply(this, arguments); };
  5392. var result = 'ab'.split(re);
  5393. return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
  5394. });
  5395. module.exports = function (KEY, length, exec, sham) {
  5396. var SYMBOL = wellKnownSymbol(KEY);
  5397. var DELEGATES_TO_SYMBOL = !fails(function () {
  5398. // String methods call symbol-named RegEp methods
  5399. var O = {};
  5400. O[SYMBOL] = function () { return 7; };
  5401. return ''[KEY](O) != 7;
  5402. });
  5403. var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
  5404. // Symbol-named RegExp methods call .exec
  5405. var execCalled = false;
  5406. var re = /a/;
  5407. if (KEY === 'split') {
  5408. // We can't use real regex here since it causes deoptimization
  5409. // and serious performance degradation in V8
  5410. // https://github.com/zloirock/core-js/issues/306
  5411. re = {};
  5412. // RegExp[@@split] doesn't call the regex's exec method, but first creates
  5413. // a new one. We need to return the patched regex when creating the new one.
  5414. re.constructor = {};
  5415. re.constructor[SPECIES] = function () { return re; };
  5416. re.flags = '';
  5417. re[SYMBOL] = /./[SYMBOL];
  5418. }
  5419. re.exec = function () { execCalled = true; return null; };
  5420. re[SYMBOL]('');
  5421. return !execCalled;
  5422. });
  5423. if (
  5424. !DELEGATES_TO_SYMBOL ||
  5425. !DELEGATES_TO_EXEC ||
  5426. (KEY === 'replace' && !(
  5427. REPLACE_SUPPORTS_NAMED_GROUPS &&
  5428. REPLACE_KEEPS_$0 &&
  5429. !REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE
  5430. )) ||
  5431. (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)
  5432. ) {
  5433. var nativeRegExpMethod = /./[SYMBOL];
  5434. var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
  5435. if (regexp.exec === regexpExec) {
  5436. if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
  5437. // The native String method already delegates to @@method (this
  5438. // polyfilled function), leasing to infinite recursion.
  5439. // We avoid it by directly calling the native @@method method.
  5440. return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };
  5441. }
  5442. return { done: true, value: nativeMethod.call(str, regexp, arg2) };
  5443. }
  5444. return { done: false };
  5445. }, {
  5446. REPLACE_KEEPS_$0: REPLACE_KEEPS_$0,
  5447. REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE: REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE
  5448. });
  5449. var stringMethod = methods[0];
  5450. var regexMethod = methods[1];
  5451. redefine(String.prototype, KEY, stringMethod);
  5452. redefine(RegExp.prototype, SYMBOL, length == 2
  5453. // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)
  5454. // 21.2.5.11 RegExp.prototype[@@split](string, limit)
  5455. ? function (string, arg) { return regexMethod.call(string, this, arg); }
  5456. // 21.2.5.6 RegExp.prototype[@@match](string)
  5457. // 21.2.5.9 RegExp.prototype[@@search](string)
  5458. : function (string) { return regexMethod.call(string, this); }
  5459. );
  5460. }
  5461. if (sham) createNonEnumerableProperty(RegExp.prototype[SYMBOL], 'sham', true);
  5462. };
  5463. /***/ }),
  5464. /***/ "d81d":
  5465. /***/ (function(module, exports, __webpack_require__) {
  5466. "use strict";
  5467. var $ = __webpack_require__("23e7");
  5468. var $map = __webpack_require__("b727").map;
  5469. var arrayMethodHasSpeciesSupport = __webpack_require__("1dde");
  5470. var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('map');
  5471. // `Array.prototype.map` method
  5472. // https://tc39.es/ecma262/#sec-array.prototype.map
  5473. // with adding support of @@species
  5474. $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
  5475. map: function map(callbackfn /* , thisArg */) {
  5476. return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  5477. }
  5478. });
  5479. /***/ }),
  5480. /***/ "da84":
  5481. /***/ (function(module, exports, __webpack_require__) {
  5482. /* WEBPACK VAR INJECTION */(function(global) {var check = function (it) {
  5483. return it && it.Math == Math && it;
  5484. };
  5485. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  5486. module.exports =
  5487. /* global globalThis -- safe */
  5488. check(typeof globalThis == 'object' && globalThis) ||
  5489. check(typeof window == 'object' && window) ||
  5490. check(typeof self == 'object' && self) ||
  5491. check(typeof global == 'object' && global) ||
  5492. // eslint-disable-next-line no-new-func -- fallback
  5493. (function () { return this; })() || Function('return this')();
  5494. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("c8ba")))
  5495. /***/ }),
  5496. /***/ "dbb4":
  5497. /***/ (function(module, exports, __webpack_require__) {
  5498. var $ = __webpack_require__("23e7");
  5499. var DESCRIPTORS = __webpack_require__("83ab");
  5500. var ownKeys = __webpack_require__("56ef");
  5501. var toIndexedObject = __webpack_require__("fc6a");
  5502. var getOwnPropertyDescriptorModule = __webpack_require__("06cf");
  5503. var createProperty = __webpack_require__("8418");
  5504. // `Object.getOwnPropertyDescriptors` method
  5505. // https://tc39.es/ecma262/#sec-object.getownpropertydescriptors
  5506. $({ target: 'Object', stat: true, sham: !DESCRIPTORS }, {
  5507. getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) {
  5508. var O = toIndexedObject(object);
  5509. var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
  5510. var keys = ownKeys(O);
  5511. var result = {};
  5512. var index = 0;
  5513. var key, descriptor;
  5514. while (keys.length > index) {
  5515. descriptor = getOwnPropertyDescriptor(O, key = keys[index++]);
  5516. if (descriptor !== undefined) createProperty(result, key, descriptor);
  5517. }
  5518. return result;
  5519. }
  5520. });
  5521. /***/ }),
  5522. /***/ "ddb0":
  5523. /***/ (function(module, exports, __webpack_require__) {
  5524. var global = __webpack_require__("da84");
  5525. var DOMIterables = __webpack_require__("fdbc");
  5526. var ArrayIteratorMethods = __webpack_require__("e260");
  5527. var createNonEnumerableProperty = __webpack_require__("9112");
  5528. var wellKnownSymbol = __webpack_require__("b622");
  5529. var ITERATOR = wellKnownSymbol('iterator');
  5530. var TO_STRING_TAG = wellKnownSymbol('toStringTag');
  5531. var ArrayValues = ArrayIteratorMethods.values;
  5532. for (var COLLECTION_NAME in DOMIterables) {
  5533. var Collection = global[COLLECTION_NAME];
  5534. var CollectionPrototype = Collection && Collection.prototype;
  5535. if (CollectionPrototype) {
  5536. // some Chrome versions have non-configurable methods on DOMTokenList
  5537. if (CollectionPrototype[ITERATOR] !== ArrayValues) try {
  5538. createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues);
  5539. } catch (error) {
  5540. CollectionPrototype[ITERATOR] = ArrayValues;
  5541. }
  5542. if (!CollectionPrototype[TO_STRING_TAG]) {
  5543. createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME);
  5544. }
  5545. if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {
  5546. // some Chrome versions have non-configurable methods on DOMTokenList
  5547. if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try {
  5548. createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);
  5549. } catch (error) {
  5550. CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];
  5551. }
  5552. }
  5553. }
  5554. }
  5555. /***/ }),
  5556. /***/ "df75":
  5557. /***/ (function(module, exports, __webpack_require__) {
  5558. var internalObjectKeys = __webpack_require__("ca84");
  5559. var enumBugKeys = __webpack_require__("7839");
  5560. // `Object.keys` method
  5561. // https://tc39.es/ecma262/#sec-object.keys
  5562. module.exports = Object.keys || function keys(O) {
  5563. return internalObjectKeys(O, enumBugKeys);
  5564. };
  5565. /***/ }),
  5566. /***/ "e01a":
  5567. /***/ (function(module, exports, __webpack_require__) {
  5568. "use strict";
  5569. // `Symbol.prototype.description` getter
  5570. // https://tc39.es/ecma262/#sec-symbol.prototype.description
  5571. var $ = __webpack_require__("23e7");
  5572. var DESCRIPTORS = __webpack_require__("83ab");
  5573. var global = __webpack_require__("da84");
  5574. var has = __webpack_require__("5135");
  5575. var isObject = __webpack_require__("861d");
  5576. var defineProperty = __webpack_require__("9bf2").f;
  5577. var copyConstructorProperties = __webpack_require__("e893");
  5578. var NativeSymbol = global.Symbol;
  5579. if (DESCRIPTORS && typeof NativeSymbol == 'function' && (!('description' in NativeSymbol.prototype) ||
  5580. // Safari 12 bug
  5581. NativeSymbol().description !== undefined
  5582. )) {
  5583. var EmptyStringDescriptionStore = {};
  5584. // wrap Symbol constructor for correct work with undefined description
  5585. var SymbolWrapper = function Symbol() {
  5586. var description = arguments.length < 1 || arguments[0] === undefined ? undefined : String(arguments[0]);
  5587. var result = this instanceof SymbolWrapper
  5588. ? new NativeSymbol(description)
  5589. // in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)'
  5590. : description === undefined ? NativeSymbol() : NativeSymbol(description);
  5591. if (description === '') EmptyStringDescriptionStore[result] = true;
  5592. return result;
  5593. };
  5594. copyConstructorProperties(SymbolWrapper, NativeSymbol);
  5595. var symbolPrototype = SymbolWrapper.prototype = NativeSymbol.prototype;
  5596. symbolPrototype.constructor = SymbolWrapper;
  5597. var symbolToString = symbolPrototype.toString;
  5598. var native = String(NativeSymbol('test')) == 'Symbol(test)';
  5599. var regexp = /^Symbol\((.*)\)[^)]+$/;
  5600. defineProperty(symbolPrototype, 'description', {
  5601. configurable: true,
  5602. get: function description() {
  5603. var symbol = isObject(this) ? this.valueOf() : this;
  5604. var string = symbolToString.call(symbol);
  5605. if (has(EmptyStringDescriptionStore, symbol)) return '';
  5606. var desc = native ? string.slice(7, -1) : string.replace(regexp, '$1');
  5607. return desc === '' ? undefined : desc;
  5608. }
  5609. });
  5610. $({ global: true, forced: true }, {
  5611. Symbol: SymbolWrapper
  5612. });
  5613. }
  5614. /***/ }),
  5615. /***/ "e163":
  5616. /***/ (function(module, exports, __webpack_require__) {
  5617. var has = __webpack_require__("5135");
  5618. var toObject = __webpack_require__("7b0b");
  5619. var sharedKey = __webpack_require__("f772");
  5620. var CORRECT_PROTOTYPE_GETTER = __webpack_require__("e177");
  5621. var IE_PROTO = sharedKey('IE_PROTO');
  5622. var ObjectPrototype = Object.prototype;
  5623. // `Object.getPrototypeOf` method
  5624. // https://tc39.es/ecma262/#sec-object.getprototypeof
  5625. module.exports = CORRECT_PROTOTYPE_GETTER ? Object.getPrototypeOf : function (O) {
  5626. O = toObject(O);
  5627. if (has(O, IE_PROTO)) return O[IE_PROTO];
  5628. if (typeof O.constructor == 'function' && O instanceof O.constructor) {
  5629. return O.constructor.prototype;
  5630. } return O instanceof Object ? ObjectPrototype : null;
  5631. };
  5632. /***/ }),
  5633. /***/ "e177":
  5634. /***/ (function(module, exports, __webpack_require__) {
  5635. var fails = __webpack_require__("d039");
  5636. module.exports = !fails(function () {
  5637. function F() { /* empty */ }
  5638. F.prototype.constructor = null;
  5639. return Object.getPrototypeOf(new F()) !== F.prototype;
  5640. });
  5641. /***/ }),
  5642. /***/ "e260":
  5643. /***/ (function(module, exports, __webpack_require__) {
  5644. "use strict";
  5645. var toIndexedObject = __webpack_require__("fc6a");
  5646. var addToUnscopables = __webpack_require__("44d2");
  5647. var Iterators = __webpack_require__("3f8c");
  5648. var InternalStateModule = __webpack_require__("69f3");
  5649. var defineIterator = __webpack_require__("7dd0");
  5650. var ARRAY_ITERATOR = 'Array Iterator';
  5651. var setInternalState = InternalStateModule.set;
  5652. var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);
  5653. // `Array.prototype.entries` method
  5654. // https://tc39.es/ecma262/#sec-array.prototype.entries
  5655. // `Array.prototype.keys` method
  5656. // https://tc39.es/ecma262/#sec-array.prototype.keys
  5657. // `Array.prototype.values` method
  5658. // https://tc39.es/ecma262/#sec-array.prototype.values
  5659. // `Array.prototype[@@iterator]` method
  5660. // https://tc39.es/ecma262/#sec-array.prototype-@@iterator
  5661. // `CreateArrayIterator` internal method
  5662. // https://tc39.es/ecma262/#sec-createarrayiterator
  5663. module.exports = defineIterator(Array, 'Array', function (iterated, kind) {
  5664. setInternalState(this, {
  5665. type: ARRAY_ITERATOR,
  5666. target: toIndexedObject(iterated), // target
  5667. index: 0, // next index
  5668. kind: kind // kind
  5669. });
  5670. // `%ArrayIteratorPrototype%.next` method
  5671. // https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
  5672. }, function () {
  5673. var state = getInternalState(this);
  5674. var target = state.target;
  5675. var kind = state.kind;
  5676. var index = state.index++;
  5677. if (!target || index >= target.length) {
  5678. state.target = undefined;
  5679. return { value: undefined, done: true };
  5680. }
  5681. if (kind == 'keys') return { value: index, done: false };
  5682. if (kind == 'values') return { value: target[index], done: false };
  5683. return { value: [index, target[index]], done: false };
  5684. }, 'values');
  5685. // argumentsList[@@iterator] is %ArrayProto_values%
  5686. // https://tc39.es/ecma262/#sec-createunmappedargumentsobject
  5687. // https://tc39.es/ecma262/#sec-createmappedargumentsobject
  5688. Iterators.Arguments = Iterators.Array;
  5689. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  5690. addToUnscopables('keys');
  5691. addToUnscopables('values');
  5692. addToUnscopables('entries');
  5693. /***/ }),
  5694. /***/ "e2cc":
  5695. /***/ (function(module, exports, __webpack_require__) {
  5696. var redefine = __webpack_require__("6eeb");
  5697. module.exports = function (target, src, options) {
  5698. for (var key in src) redefine(target, key, src[key], options);
  5699. return target;
  5700. };
  5701. /***/ }),
  5702. /***/ "e439":
  5703. /***/ (function(module, exports, __webpack_require__) {
  5704. var $ = __webpack_require__("23e7");
  5705. var fails = __webpack_require__("d039");
  5706. var toIndexedObject = __webpack_require__("fc6a");
  5707. var nativeGetOwnPropertyDescriptor = __webpack_require__("06cf").f;
  5708. var DESCRIPTORS = __webpack_require__("83ab");
  5709. var FAILS_ON_PRIMITIVES = fails(function () { nativeGetOwnPropertyDescriptor(1); });
  5710. var FORCED = !DESCRIPTORS || FAILS_ON_PRIMITIVES;
  5711. // `Object.getOwnPropertyDescriptor` method
  5712. // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
  5713. $({ target: 'Object', stat: true, forced: FORCED, sham: !DESCRIPTORS }, {
  5714. getOwnPropertyDescriptor: function getOwnPropertyDescriptor(it, key) {
  5715. return nativeGetOwnPropertyDescriptor(toIndexedObject(it), key);
  5716. }
  5717. });
  5718. /***/ }),
  5719. /***/ "e538":
  5720. /***/ (function(module, exports, __webpack_require__) {
  5721. var wellKnownSymbol = __webpack_require__("b622");
  5722. exports.f = wellKnownSymbol;
  5723. /***/ }),
  5724. /***/ "e667":
  5725. /***/ (function(module, exports) {
  5726. module.exports = function (exec) {
  5727. try {
  5728. return { error: false, value: exec() };
  5729. } catch (error) {
  5730. return { error: true, value: error };
  5731. }
  5732. };
  5733. /***/ }),
  5734. /***/ "e6cf":
  5735. /***/ (function(module, exports, __webpack_require__) {
  5736. "use strict";
  5737. var $ = __webpack_require__("23e7");
  5738. var IS_PURE = __webpack_require__("c430");
  5739. var global = __webpack_require__("da84");
  5740. var getBuiltIn = __webpack_require__("d066");
  5741. var NativePromise = __webpack_require__("fea9");
  5742. var redefine = __webpack_require__("6eeb");
  5743. var redefineAll = __webpack_require__("e2cc");
  5744. var setToStringTag = __webpack_require__("d44e");
  5745. var setSpecies = __webpack_require__("2626");
  5746. var isObject = __webpack_require__("861d");
  5747. var aFunction = __webpack_require__("1c0b");
  5748. var anInstance = __webpack_require__("19aa");
  5749. var inspectSource = __webpack_require__("8925");
  5750. var iterate = __webpack_require__("2266");
  5751. var checkCorrectnessOfIteration = __webpack_require__("1c7e");
  5752. var speciesConstructor = __webpack_require__("4840");
  5753. var task = __webpack_require__("2cf4").set;
  5754. var microtask = __webpack_require__("b575");
  5755. var promiseResolve = __webpack_require__("cdf9");
  5756. var hostReportErrors = __webpack_require__("44de");
  5757. var newPromiseCapabilityModule = __webpack_require__("f069");
  5758. var perform = __webpack_require__("e667");
  5759. var InternalStateModule = __webpack_require__("69f3");
  5760. var isForced = __webpack_require__("94ca");
  5761. var wellKnownSymbol = __webpack_require__("b622");
  5762. var IS_NODE = __webpack_require__("605d");
  5763. var V8_VERSION = __webpack_require__("2d00");
  5764. var SPECIES = wellKnownSymbol('species');
  5765. var PROMISE = 'Promise';
  5766. var getInternalState = InternalStateModule.get;
  5767. var setInternalState = InternalStateModule.set;
  5768. var getInternalPromiseState = InternalStateModule.getterFor(PROMISE);
  5769. var PromiseConstructor = NativePromise;
  5770. var TypeError = global.TypeError;
  5771. var document = global.document;
  5772. var process = global.process;
  5773. var $fetch = getBuiltIn('fetch');
  5774. var newPromiseCapability = newPromiseCapabilityModule.f;
  5775. var newGenericPromiseCapability = newPromiseCapability;
  5776. var DISPATCH_EVENT = !!(document && document.createEvent && global.dispatchEvent);
  5777. var NATIVE_REJECTION_EVENT = typeof PromiseRejectionEvent == 'function';
  5778. var UNHANDLED_REJECTION = 'unhandledrejection';
  5779. var REJECTION_HANDLED = 'rejectionhandled';
  5780. var PENDING = 0;
  5781. var FULFILLED = 1;
  5782. var REJECTED = 2;
  5783. var HANDLED = 1;
  5784. var UNHANDLED = 2;
  5785. var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;
  5786. var FORCED = isForced(PROMISE, function () {
  5787. var GLOBAL_CORE_JS_PROMISE = inspectSource(PromiseConstructor) !== String(PromiseConstructor);
  5788. if (!GLOBAL_CORE_JS_PROMISE) {
  5789. // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
  5790. // https://bugs.chromium.org/p/chromium/issues/detail?id=830565
  5791. // We can't detect it synchronously, so just check versions
  5792. if (V8_VERSION === 66) return true;
  5793. // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test
  5794. if (!IS_NODE && !NATIVE_REJECTION_EVENT) return true;
  5795. }
  5796. // We need Promise#finally in the pure version for preventing prototype pollution
  5797. if (IS_PURE && !PromiseConstructor.prototype['finally']) return true;
  5798. // We can't use @@species feature detection in V8 since it causes
  5799. // deoptimization and performance degradation
  5800. // https://github.com/zloirock/core-js/issues/679
  5801. if (V8_VERSION >= 51 && /native code/.test(PromiseConstructor)) return false;
  5802. // Detect correctness of subclassing with @@species support
  5803. var promise = PromiseConstructor.resolve(1);
  5804. var FakePromise = function (exec) {
  5805. exec(function () { /* empty */ }, function () { /* empty */ });
  5806. };
  5807. var constructor = promise.constructor = {};
  5808. constructor[SPECIES] = FakePromise;
  5809. return !(promise.then(function () { /* empty */ }) instanceof FakePromise);
  5810. });
  5811. var INCORRECT_ITERATION = FORCED || !checkCorrectnessOfIteration(function (iterable) {
  5812. PromiseConstructor.all(iterable)['catch'](function () { /* empty */ });
  5813. });
  5814. // helpers
  5815. var isThenable = function (it) {
  5816. var then;
  5817. return isObject(it) && typeof (then = it.then) == 'function' ? then : false;
  5818. };
  5819. var notify = function (state, isReject) {
  5820. if (state.notified) return;
  5821. state.notified = true;
  5822. var chain = state.reactions;
  5823. microtask(function () {
  5824. var value = state.value;
  5825. var ok = state.state == FULFILLED;
  5826. var index = 0;
  5827. // variable length - can't use forEach
  5828. while (chain.length > index) {
  5829. var reaction = chain[index++];
  5830. var handler = ok ? reaction.ok : reaction.fail;
  5831. var resolve = reaction.resolve;
  5832. var reject = reaction.reject;
  5833. var domain = reaction.domain;
  5834. var result, then, exited;
  5835. try {
  5836. if (handler) {
  5837. if (!ok) {
  5838. if (state.rejection === UNHANDLED) onHandleUnhandled(state);
  5839. state.rejection = HANDLED;
  5840. }
  5841. if (handler === true) result = value;
  5842. else {
  5843. if (domain) domain.enter();
  5844. result = handler(value); // can throw
  5845. if (domain) {
  5846. domain.exit();
  5847. exited = true;
  5848. }
  5849. }
  5850. if (result === reaction.promise) {
  5851. reject(TypeError('Promise-chain cycle'));
  5852. } else if (then = isThenable(result)) {
  5853. then.call(result, resolve, reject);
  5854. } else resolve(result);
  5855. } else reject(value);
  5856. } catch (error) {
  5857. if (domain && !exited) domain.exit();
  5858. reject(error);
  5859. }
  5860. }
  5861. state.reactions = [];
  5862. state.notified = false;
  5863. if (isReject && !state.rejection) onUnhandled(state);
  5864. });
  5865. };
  5866. var dispatchEvent = function (name, promise, reason) {
  5867. var event, handler;
  5868. if (DISPATCH_EVENT) {
  5869. event = document.createEvent('Event');
  5870. event.promise = promise;
  5871. event.reason = reason;
  5872. event.initEvent(name, false, true);
  5873. global.dispatchEvent(event);
  5874. } else event = { promise: promise, reason: reason };
  5875. if (!NATIVE_REJECTION_EVENT && (handler = global['on' + name])) handler(event);
  5876. else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);
  5877. };
  5878. var onUnhandled = function (state) {
  5879. task.call(global, function () {
  5880. var promise = state.facade;
  5881. var value = state.value;
  5882. var IS_UNHANDLED = isUnhandled(state);
  5883. var result;
  5884. if (IS_UNHANDLED) {
  5885. result = perform(function () {
  5886. if (IS_NODE) {
  5887. process.emit('unhandledRejection', value, promise);
  5888. } else dispatchEvent(UNHANDLED_REJECTION, promise, value);
  5889. });
  5890. // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
  5891. state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED;
  5892. if (result.error) throw result.value;
  5893. }
  5894. });
  5895. };
  5896. var isUnhandled = function (state) {
  5897. return state.rejection !== HANDLED && !state.parent;
  5898. };
  5899. var onHandleUnhandled = function (state) {
  5900. task.call(global, function () {
  5901. var promise = state.facade;
  5902. if (IS_NODE) {
  5903. process.emit('rejectionHandled', promise);
  5904. } else dispatchEvent(REJECTION_HANDLED, promise, state.value);
  5905. });
  5906. };
  5907. var bind = function (fn, state, unwrap) {
  5908. return function (value) {
  5909. fn(state, value, unwrap);
  5910. };
  5911. };
  5912. var internalReject = function (state, value, unwrap) {
  5913. if (state.done) return;
  5914. state.done = true;
  5915. if (unwrap) state = unwrap;
  5916. state.value = value;
  5917. state.state = REJECTED;
  5918. notify(state, true);
  5919. };
  5920. var internalResolve = function (state, value, unwrap) {
  5921. if (state.done) return;
  5922. state.done = true;
  5923. if (unwrap) state = unwrap;
  5924. try {
  5925. if (state.facade === value) throw TypeError("Promise can't be resolved itself");
  5926. var then = isThenable(value);
  5927. if (then) {
  5928. microtask(function () {
  5929. var wrapper = { done: false };
  5930. try {
  5931. then.call(value,
  5932. bind(internalResolve, wrapper, state),
  5933. bind(internalReject, wrapper, state)
  5934. );
  5935. } catch (error) {
  5936. internalReject(wrapper, error, state);
  5937. }
  5938. });
  5939. } else {
  5940. state.value = value;
  5941. state.state = FULFILLED;
  5942. notify(state, false);
  5943. }
  5944. } catch (error) {
  5945. internalReject({ done: false }, error, state);
  5946. }
  5947. };
  5948. // constructor polyfill
  5949. if (FORCED) {
  5950. // 25.4.3.1 Promise(executor)
  5951. PromiseConstructor = function Promise(executor) {
  5952. anInstance(this, PromiseConstructor, PROMISE);
  5953. aFunction(executor);
  5954. Internal.call(this);
  5955. var state = getInternalState(this);
  5956. try {
  5957. executor(bind(internalResolve, state), bind(internalReject, state));
  5958. } catch (error) {
  5959. internalReject(state, error);
  5960. }
  5961. };
  5962. // eslint-disable-next-line no-unused-vars -- required for `.length`
  5963. Internal = function Promise(executor) {
  5964. setInternalState(this, {
  5965. type: PROMISE,
  5966. done: false,
  5967. notified: false,
  5968. parent: false,
  5969. reactions: [],
  5970. rejection: false,
  5971. state: PENDING,
  5972. value: undefined
  5973. });
  5974. };
  5975. Internal.prototype = redefineAll(PromiseConstructor.prototype, {
  5976. // `Promise.prototype.then` method
  5977. // https://tc39.es/ecma262/#sec-promise.prototype.then
  5978. then: function then(onFulfilled, onRejected) {
  5979. var state = getInternalPromiseState(this);
  5980. var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor));
  5981. reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;
  5982. reaction.fail = typeof onRejected == 'function' && onRejected;
  5983. reaction.domain = IS_NODE ? process.domain : undefined;
  5984. state.parent = true;
  5985. state.reactions.push(reaction);
  5986. if (state.state != PENDING) notify(state, false);
  5987. return reaction.promise;
  5988. },
  5989. // `Promise.prototype.catch` method
  5990. // https://tc39.es/ecma262/#sec-promise.prototype.catch
  5991. 'catch': function (onRejected) {
  5992. return this.then(undefined, onRejected);
  5993. }
  5994. });
  5995. OwnPromiseCapability = function () {
  5996. var promise = new Internal();
  5997. var state = getInternalState(promise);
  5998. this.promise = promise;
  5999. this.resolve = bind(internalResolve, state);
  6000. this.reject = bind(internalReject, state);
  6001. };
  6002. newPromiseCapabilityModule.f = newPromiseCapability = function (C) {
  6003. return C === PromiseConstructor || C === PromiseWrapper
  6004. ? new OwnPromiseCapability(C)
  6005. : newGenericPromiseCapability(C);
  6006. };
  6007. if (!IS_PURE && typeof NativePromise == 'function') {
  6008. nativeThen = NativePromise.prototype.then;
  6009. // wrap native Promise#then for native async functions
  6010. redefine(NativePromise.prototype, 'then', function then(onFulfilled, onRejected) {
  6011. var that = this;
  6012. return new PromiseConstructor(function (resolve, reject) {
  6013. nativeThen.call(that, resolve, reject);
  6014. }).then(onFulfilled, onRejected);
  6015. // https://github.com/zloirock/core-js/issues/640
  6016. }, { unsafe: true });
  6017. // wrap fetch result
  6018. if (typeof $fetch == 'function') $({ global: true, enumerable: true, forced: true }, {
  6019. // eslint-disable-next-line no-unused-vars -- required for `.length`
  6020. fetch: function fetch(input /* , init */) {
  6021. return promiseResolve(PromiseConstructor, $fetch.apply(global, arguments));
  6022. }
  6023. });
  6024. }
  6025. }
  6026. $({ global: true, wrap: true, forced: FORCED }, {
  6027. Promise: PromiseConstructor
  6028. });
  6029. setToStringTag(PromiseConstructor, PROMISE, false, true);
  6030. setSpecies(PROMISE);
  6031. PromiseWrapper = getBuiltIn(PROMISE);
  6032. // statics
  6033. $({ target: PROMISE, stat: true, forced: FORCED }, {
  6034. // `Promise.reject` method
  6035. // https://tc39.es/ecma262/#sec-promise.reject
  6036. reject: function reject(r) {
  6037. var capability = newPromiseCapability(this);
  6038. capability.reject.call(undefined, r);
  6039. return capability.promise;
  6040. }
  6041. });
  6042. $({ target: PROMISE, stat: true, forced: IS_PURE || FORCED }, {
  6043. // `Promise.resolve` method
  6044. // https://tc39.es/ecma262/#sec-promise.resolve
  6045. resolve: function resolve(x) {
  6046. return promiseResolve(IS_PURE && this === PromiseWrapper ? PromiseConstructor : this, x);
  6047. }
  6048. });
  6049. $({ target: PROMISE, stat: true, forced: INCORRECT_ITERATION }, {
  6050. // `Promise.all` method
  6051. // https://tc39.es/ecma262/#sec-promise.all
  6052. all: function all(iterable) {
  6053. var C = this;
  6054. var capability = newPromiseCapability(C);
  6055. var resolve = capability.resolve;
  6056. var reject = capability.reject;
  6057. var result = perform(function () {
  6058. var $promiseResolve = aFunction(C.resolve);
  6059. var values = [];
  6060. var counter = 0;
  6061. var remaining = 1;
  6062. iterate(iterable, function (promise) {
  6063. var index = counter++;
  6064. var alreadyCalled = false;
  6065. values.push(undefined);
  6066. remaining++;
  6067. $promiseResolve.call(C, promise).then(function (value) {
  6068. if (alreadyCalled) return;
  6069. alreadyCalled = true;
  6070. values[index] = value;
  6071. --remaining || resolve(values);
  6072. }, reject);
  6073. });
  6074. --remaining || resolve(values);
  6075. });
  6076. if (result.error) reject(result.value);
  6077. return capability.promise;
  6078. },
  6079. // `Promise.race` method
  6080. // https://tc39.es/ecma262/#sec-promise.race
  6081. race: function race(iterable) {
  6082. var C = this;
  6083. var capability = newPromiseCapability(C);
  6084. var reject = capability.reject;
  6085. var result = perform(function () {
  6086. var $promiseResolve = aFunction(C.resolve);
  6087. iterate(iterable, function (promise) {
  6088. $promiseResolve.call(C, promise).then(capability.resolve, reject);
  6089. });
  6090. });
  6091. if (result.error) reject(result.value);
  6092. return capability.promise;
  6093. }
  6094. });
  6095. /***/ }),
  6096. /***/ "e893":
  6097. /***/ (function(module, exports, __webpack_require__) {
  6098. var has = __webpack_require__("5135");
  6099. var ownKeys = __webpack_require__("56ef");
  6100. var getOwnPropertyDescriptorModule = __webpack_require__("06cf");
  6101. var definePropertyModule = __webpack_require__("9bf2");
  6102. module.exports = function (target, source) {
  6103. var keys = ownKeys(source);
  6104. var defineProperty = definePropertyModule.f;
  6105. var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
  6106. for (var i = 0; i < keys.length; i++) {
  6107. var key = keys[i];
  6108. if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
  6109. }
  6110. };
  6111. /***/ }),
  6112. /***/ "e8b5":
  6113. /***/ (function(module, exports, __webpack_require__) {
  6114. var classof = __webpack_require__("c6b6");
  6115. // `IsArray` abstract operation
  6116. // https://tc39.es/ecma262/#sec-isarray
  6117. module.exports = Array.isArray || function isArray(arg) {
  6118. return classof(arg) == 'Array';
  6119. };
  6120. /***/ }),
  6121. /***/ "e95a":
  6122. /***/ (function(module, exports, __webpack_require__) {
  6123. var wellKnownSymbol = __webpack_require__("b622");
  6124. var Iterators = __webpack_require__("3f8c");
  6125. var ITERATOR = wellKnownSymbol('iterator');
  6126. var ArrayPrototype = Array.prototype;
  6127. // check on default Array iterator
  6128. module.exports = function (it) {
  6129. return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);
  6130. };
  6131. /***/ }),
  6132. /***/ "f069":
  6133. /***/ (function(module, exports, __webpack_require__) {
  6134. "use strict";
  6135. var aFunction = __webpack_require__("1c0b");
  6136. var PromiseCapability = function (C) {
  6137. var resolve, reject;
  6138. this.promise = new C(function ($$resolve, $$reject) {
  6139. if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');
  6140. resolve = $$resolve;
  6141. reject = $$reject;
  6142. });
  6143. this.resolve = aFunction(resolve);
  6144. this.reject = aFunction(reject);
  6145. };
  6146. // 25.4.1.5 NewPromiseCapability(C)
  6147. module.exports.f = function (C) {
  6148. return new PromiseCapability(C);
  6149. };
  6150. /***/ }),
  6151. /***/ "f0af":
  6152. /***/ (function(module, exports) {
  6153. module.exports = __WEBPACK_EXTERNAL_MODULE_f0af__;
  6154. /***/ }),
  6155. /***/ "f183":
  6156. /***/ (function(module, exports, __webpack_require__) {
  6157. var hiddenKeys = __webpack_require__("d012");
  6158. var isObject = __webpack_require__("861d");
  6159. var has = __webpack_require__("5135");
  6160. var defineProperty = __webpack_require__("9bf2").f;
  6161. var uid = __webpack_require__("90e3");
  6162. var FREEZING = __webpack_require__("bb2f");
  6163. var METADATA = uid('meta');
  6164. var id = 0;
  6165. var isExtensible = Object.isExtensible || function () {
  6166. return true;
  6167. };
  6168. var setMetadata = function (it) {
  6169. defineProperty(it, METADATA, { value: {
  6170. objectID: 'O' + ++id, // object ID
  6171. weakData: {} // weak collections IDs
  6172. } });
  6173. };
  6174. var fastKey = function (it, create) {
  6175. // return a primitive with prefix
  6176. if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
  6177. if (!has(it, METADATA)) {
  6178. // can't set metadata to uncaught frozen object
  6179. if (!isExtensible(it)) return 'F';
  6180. // not necessary to add metadata
  6181. if (!create) return 'E';
  6182. // add missing metadata
  6183. setMetadata(it);
  6184. // return object ID
  6185. } return it[METADATA].objectID;
  6186. };
  6187. var getWeakData = function (it, create) {
  6188. if (!has(it, METADATA)) {
  6189. // can't set metadata to uncaught frozen object
  6190. if (!isExtensible(it)) return true;
  6191. // not necessary to add metadata
  6192. if (!create) return false;
  6193. // add missing metadata
  6194. setMetadata(it);
  6195. // return the store of weak collections IDs
  6196. } return it[METADATA].weakData;
  6197. };
  6198. // add metadata on freeze-family methods calling
  6199. var onFreeze = function (it) {
  6200. if (FREEZING && meta.REQUIRED && isExtensible(it) && !has(it, METADATA)) setMetadata(it);
  6201. return it;
  6202. };
  6203. var meta = module.exports = {
  6204. REQUIRED: false,
  6205. fastKey: fastKey,
  6206. getWeakData: getWeakData,
  6207. onFreeze: onFreeze
  6208. };
  6209. hiddenKeys[METADATA] = true;
  6210. /***/ }),
  6211. /***/ "f5df":
  6212. /***/ (function(module, exports, __webpack_require__) {
  6213. var TO_STRING_TAG_SUPPORT = __webpack_require__("00ee");
  6214. var classofRaw = __webpack_require__("c6b6");
  6215. var wellKnownSymbol = __webpack_require__("b622");
  6216. var TO_STRING_TAG = wellKnownSymbol('toStringTag');
  6217. // ES3 wrong here
  6218. var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
  6219. // fallback for IE11 Script Access Denied error
  6220. var tryGet = function (it, key) {
  6221. try {
  6222. return it[key];
  6223. } catch (error) { /* empty */ }
  6224. };
  6225. // getting tag from ES6+ `Object.prototype.toString`
  6226. module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
  6227. var O, tag, result;
  6228. return it === undefined ? 'Undefined' : it === null ? 'Null'
  6229. // @@toStringTag case
  6230. : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG)) == 'string' ? tag
  6231. // builtinTag case
  6232. : CORRECT_ARGUMENTS ? classofRaw(O)
  6233. // ES3 arguments fallback
  6234. : (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result;
  6235. };
  6236. /***/ }),
  6237. /***/ "f772":
  6238. /***/ (function(module, exports, __webpack_require__) {
  6239. var shared = __webpack_require__("5692");
  6240. var uid = __webpack_require__("90e3");
  6241. var keys = shared('keys');
  6242. module.exports = function (key) {
  6243. return keys[key] || (keys[key] = uid(key));
  6244. };
  6245. /***/ }),
  6246. /***/ "fb15":
  6247. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6248. "use strict";
  6249. // ESM COMPAT FLAG
  6250. __webpack_require__.r(__webpack_exports__);
  6251. // EXPORTS
  6252. __webpack_require__.d(__webpack_exports__, "install", function() { return /* reexport */ all_install; });
  6253. __webpack_require__.d(__webpack_exports__, "use", function() { return /* reexport */ use; });
  6254. __webpack_require__.d(__webpack_exports__, "config", function() { return /* reexport */ v_x_e_table_config; });
  6255. __webpack_require__.d(__webpack_exports__, "t", function() { return /* reexport */ t; });
  6256. __webpack_require__.d(__webpack_exports__, "_t", function() { return /* reexport */ _t; });
  6257. __webpack_require__.d(__webpack_exports__, "v", function() { return /* reexport */ v; });
  6258. __webpack_require__.d(__webpack_exports__, "VXETable", function() { return /* reexport */ VXETable; });
  6259. __webpack_require__.d(__webpack_exports__, "interceptor", function() { return /* reexport */ interceptor; });
  6260. __webpack_require__.d(__webpack_exports__, "renderer", function() { return /* reexport */ renderer; });
  6261. __webpack_require__.d(__webpack_exports__, "commands", function() { return /* reexport */ commands; });
  6262. __webpack_require__.d(__webpack_exports__, "menus", function() { return /* reexport */ menus; });
  6263. __webpack_require__.d(__webpack_exports__, "formats", function() { return /* reexport */ formats; });
  6264. __webpack_require__.d(__webpack_exports__, "setup", function() { return /* reexport */ setup; });
  6265. __webpack_require__.d(__webpack_exports__, "Icon", function() { return /* reexport */ Icon; });
  6266. __webpack_require__.d(__webpack_exports__, "Filter", function() { return /* reexport */ Filter; });
  6267. __webpack_require__.d(__webpack_exports__, "Edit", function() { return /* reexport */ Edit; });
  6268. __webpack_require__.d(__webpack_exports__, "saveFile", function() { return /* reexport */ saveLocalFile; });
  6269. __webpack_require__.d(__webpack_exports__, "readFile", function() { return /* reexport */ readLocalFile; });
  6270. __webpack_require__.d(__webpack_exports__, "print", function() { return /* reexport */ print; });
  6271. __webpack_require__.d(__webpack_exports__, "Export", function() { return /* reexport */ Export; });
  6272. __webpack_require__.d(__webpack_exports__, "Keyboard", function() { return /* reexport */ Keyboard; });
  6273. __webpack_require__.d(__webpack_exports__, "Validator", function() { return /* reexport */ Validator; });
  6274. __webpack_require__.d(__webpack_exports__, "Header", function() { return /* reexport */ Header; });
  6275. __webpack_require__.d(__webpack_exports__, "Footer", function() { return /* reexport */ Footer; });
  6276. __webpack_require__.d(__webpack_exports__, "Column", function() { return /* reexport */ Column; });
  6277. __webpack_require__.d(__webpack_exports__, "Colgroup", function() { return /* reexport */ Colgroup; });
  6278. __webpack_require__.d(__webpack_exports__, "Grid", function() { return /* reexport */ Grid; });
  6279. __webpack_require__.d(__webpack_exports__, "Menu", function() { return /* reexport */ Menu; });
  6280. __webpack_require__.d(__webpack_exports__, "Toolbar", function() { return /* reexport */ Toolbar; });
  6281. __webpack_require__.d(__webpack_exports__, "Pager", function() { return /* reexport */ Pager; });
  6282. __webpack_require__.d(__webpack_exports__, "Checkbox", function() { return /* reexport */ Checkbox; });
  6283. __webpack_require__.d(__webpack_exports__, "CheckboxGroup", function() { return /* reexport */ CheckboxGroup; });
  6284. __webpack_require__.d(__webpack_exports__, "Radio", function() { return /* reexport */ Radio; });
  6285. __webpack_require__.d(__webpack_exports__, "RadioGroup", function() { return /* reexport */ RadioGroup; });
  6286. __webpack_require__.d(__webpack_exports__, "RadioButton", function() { return /* reexport */ RadioButton; });
  6287. __webpack_require__.d(__webpack_exports__, "Input", function() { return /* reexport */ Input; });
  6288. __webpack_require__.d(__webpack_exports__, "Textarea", function() { return /* reexport */ Textarea; });
  6289. __webpack_require__.d(__webpack_exports__, "Button", function() { return /* reexport */ Button; });
  6290. __webpack_require__.d(__webpack_exports__, "modal", function() { return /* reexport */ modal_modal; });
  6291. __webpack_require__.d(__webpack_exports__, "Modal", function() { return /* reexport */ Modal; });
  6292. __webpack_require__.d(__webpack_exports__, "Tooltip", function() { return /* reexport */ Tooltip; });
  6293. __webpack_require__.d(__webpack_exports__, "Form", function() { return /* reexport */ Form; });
  6294. __webpack_require__.d(__webpack_exports__, "FormItem", function() { return /* reexport */ FormItem; });
  6295. __webpack_require__.d(__webpack_exports__, "FormGather", function() { return /* reexport */ FormGather; });
  6296. __webpack_require__.d(__webpack_exports__, "Select", function() { return /* reexport */ Select; });
  6297. __webpack_require__.d(__webpack_exports__, "Optgroup", function() { return /* reexport */ Optgroup; });
  6298. __webpack_require__.d(__webpack_exports__, "Option", function() { return /* reexport */ Option; });
  6299. __webpack_require__.d(__webpack_exports__, "Switch", function() { return /* reexport */ Switch; });
  6300. __webpack_require__.d(__webpack_exports__, "List", function() { return /* reexport */ List; });
  6301. __webpack_require__.d(__webpack_exports__, "Pulldown", function() { return /* reexport */ Pulldown; });
  6302. __webpack_require__.d(__webpack_exports__, "Table", function() { return /* reexport */ Table; });
  6303. // NAMESPACE OBJECT: ./packages/all.js
  6304. var all_namespaceObject = {};
  6305. __webpack_require__.r(all_namespaceObject);
  6306. __webpack_require__.d(all_namespaceObject, "install", function() { return all_install; });
  6307. __webpack_require__.d(all_namespaceObject, "use", function() { return use; });
  6308. __webpack_require__.d(all_namespaceObject, "config", function() { return v_x_e_table_config; });
  6309. __webpack_require__.d(all_namespaceObject, "t", function() { return t; });
  6310. __webpack_require__.d(all_namespaceObject, "_t", function() { return _t; });
  6311. __webpack_require__.d(all_namespaceObject, "v", function() { return v; });
  6312. __webpack_require__.d(all_namespaceObject, "VXETable", function() { return VXETable; });
  6313. __webpack_require__.d(all_namespaceObject, "interceptor", function() { return interceptor; });
  6314. __webpack_require__.d(all_namespaceObject, "renderer", function() { return renderer; });
  6315. __webpack_require__.d(all_namespaceObject, "commands", function() { return commands; });
  6316. __webpack_require__.d(all_namespaceObject, "menus", function() { return menus; });
  6317. __webpack_require__.d(all_namespaceObject, "formats", function() { return formats; });
  6318. __webpack_require__.d(all_namespaceObject, "setup", function() { return setup; });
  6319. __webpack_require__.d(all_namespaceObject, "Icon", function() { return Icon; });
  6320. __webpack_require__.d(all_namespaceObject, "Filter", function() { return Filter; });
  6321. __webpack_require__.d(all_namespaceObject, "Edit", function() { return Edit; });
  6322. __webpack_require__.d(all_namespaceObject, "saveFile", function() { return saveLocalFile; });
  6323. __webpack_require__.d(all_namespaceObject, "readFile", function() { return readLocalFile; });
  6324. __webpack_require__.d(all_namespaceObject, "print", function() { return print; });
  6325. __webpack_require__.d(all_namespaceObject, "Export", function() { return Export; });
  6326. __webpack_require__.d(all_namespaceObject, "Keyboard", function() { return Keyboard; });
  6327. __webpack_require__.d(all_namespaceObject, "Validator", function() { return Validator; });
  6328. __webpack_require__.d(all_namespaceObject, "Header", function() { return Header; });
  6329. __webpack_require__.d(all_namespaceObject, "Footer", function() { return Footer; });
  6330. __webpack_require__.d(all_namespaceObject, "Column", function() { return Column; });
  6331. __webpack_require__.d(all_namespaceObject, "Colgroup", function() { return Colgroup; });
  6332. __webpack_require__.d(all_namespaceObject, "Grid", function() { return Grid; });
  6333. __webpack_require__.d(all_namespaceObject, "Menu", function() { return Menu; });
  6334. __webpack_require__.d(all_namespaceObject, "Toolbar", function() { return Toolbar; });
  6335. __webpack_require__.d(all_namespaceObject, "Pager", function() { return Pager; });
  6336. __webpack_require__.d(all_namespaceObject, "Checkbox", function() { return Checkbox; });
  6337. __webpack_require__.d(all_namespaceObject, "CheckboxGroup", function() { return CheckboxGroup; });
  6338. __webpack_require__.d(all_namespaceObject, "Radio", function() { return Radio; });
  6339. __webpack_require__.d(all_namespaceObject, "RadioGroup", function() { return RadioGroup; });
  6340. __webpack_require__.d(all_namespaceObject, "RadioButton", function() { return RadioButton; });
  6341. __webpack_require__.d(all_namespaceObject, "Input", function() { return Input; });
  6342. __webpack_require__.d(all_namespaceObject, "Textarea", function() { return Textarea; });
  6343. __webpack_require__.d(all_namespaceObject, "Button", function() { return Button; });
  6344. __webpack_require__.d(all_namespaceObject, "modal", function() { return modal_modal; });
  6345. __webpack_require__.d(all_namespaceObject, "Modal", function() { return Modal; });
  6346. __webpack_require__.d(all_namespaceObject, "Tooltip", function() { return Tooltip; });
  6347. __webpack_require__.d(all_namespaceObject, "Form", function() { return Form; });
  6348. __webpack_require__.d(all_namespaceObject, "FormItem", function() { return FormItem; });
  6349. __webpack_require__.d(all_namespaceObject, "FormGather", function() { return FormGather; });
  6350. __webpack_require__.d(all_namespaceObject, "Select", function() { return Select; });
  6351. __webpack_require__.d(all_namespaceObject, "Optgroup", function() { return Optgroup; });
  6352. __webpack_require__.d(all_namespaceObject, "Option", function() { return Option; });
  6353. __webpack_require__.d(all_namespaceObject, "Switch", function() { return Switch; });
  6354. __webpack_require__.d(all_namespaceObject, "List", function() { return List; });
  6355. __webpack_require__.d(all_namespaceObject, "Pulldown", function() { return Pulldown; });
  6356. __webpack_require__.d(all_namespaceObject, "Table", function() { return Table; });
  6357. // CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js
  6358. // This file is imported into lib/wc client bundles.
  6359. if (typeof window !== 'undefined') {
  6360. var currentScript = window.document.currentScript
  6361. if (true) {
  6362. var getCurrentScript = __webpack_require__("8875")
  6363. currentScript = getCurrentScript()
  6364. // for backward compatibility, because previously we directly included the polyfill
  6365. if (!('currentScript' in document)) {
  6366. Object.defineProperty(document, 'currentScript', { get: getCurrentScript })
  6367. }
  6368. }
  6369. var src = currentScript && currentScript.src.match(/(.+\/)[^/]+\.js(\?.*)?$/)
  6370. if (src) {
  6371. __webpack_require__.p = src[1] // eslint-disable-line
  6372. }
  6373. }
  6374. // Indicate to webpack that this file can be concatenated
  6375. /* harmony default export */ var setPublicPath = (null);
  6376. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.map.js
  6377. var es_array_map = __webpack_require__("d81d");
  6378. // EXTERNAL MODULE: external {"root":"XEUtils","commonjs":"xe-utils","commonjs2":"xe-utils","amd":"xe-utils"}
  6379. var external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_ = __webpack_require__("f0af");
  6380. var external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default = /*#__PURE__*/__webpack_require__.n(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_);
  6381. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js
  6382. function _classCallCheck(instance, Constructor) {
  6383. if (!(instance instanceof Constructor)) {
  6384. throw new TypeError("Cannot call a class as a function");
  6385. }
  6386. }
  6387. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js
  6388. function _defineProperties(target, props) {
  6389. for (var i = 0; i < props.length; i++) {
  6390. var descriptor = props[i];
  6391. descriptor.enumerable = descriptor.enumerable || false;
  6392. descriptor.configurable = true;
  6393. if ("value" in descriptor) descriptor.writable = true;
  6394. Object.defineProperty(target, descriptor.key, descriptor);
  6395. }
  6396. }
  6397. function _createClass(Constructor, protoProps, staticProps) {
  6398. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  6399. if (staticProps) _defineProperties(Constructor, staticProps);
  6400. return Constructor;
  6401. }
  6402. // CONCATENATED MODULE: ./packages/v-x-e-table/src/conf.js
  6403. var iconPrefix = 'vxe-icon--';
  6404. var GlobalConfig = {
  6405. size: null,
  6406. // 全局尺寸
  6407. zIndex: 100,
  6408. // 全局 zIndex 起始值,如果项目的的 z-index 样式值过大时就需要跟随设置更大,避免被遮挡
  6409. version: 0,
  6410. // 版本号,对于某些带数据缓存的功能有用到,上升版本号可以用于重置数据
  6411. // resizeInterval: 500,
  6412. emptyCell: ' ',
  6413. table: {
  6414. fit: true,
  6415. showHeader: true,
  6416. delayHover: 250,
  6417. // keepSource: false,
  6418. // showOverflow: null,
  6419. // showHeaderOverflow: null,
  6420. // showFooterOverflow: null,
  6421. // resizeInterval: 500,
  6422. // size: null,
  6423. // zIndex: null,
  6424. // resizable: false,
  6425. // autoResize: false,
  6426. // stripe: false,
  6427. // border: false,
  6428. // round: false,
  6429. // emptyRender: {
  6430. // name: ''
  6431. // },
  6432. // radioConfig: {
  6433. // trigger: 'default'
  6434. // },
  6435. // checkboxConfig: {
  6436. // trigger: 'default'
  6437. // },
  6438. // tooltipConfig: {
  6439. // theme: 'dark',
  6440. // enterable: false
  6441. // },
  6442. validConfig: {
  6443. showMessage: true,
  6444. message: 'default'
  6445. },
  6446. // menuConfig: {
  6447. // visibleMethod () {}
  6448. // },
  6449. // customConfig: {
  6450. // storage: false,
  6451. // checkMethod () {}
  6452. // },
  6453. // rowId: '_XID', // 行数据的唯一主键字段名
  6454. sortConfig: {
  6455. // remote: false,
  6456. // trigger: 'default',
  6457. // orders: ['asc', 'desc', null],
  6458. // sortMethod: null,
  6459. showIcon: true
  6460. },
  6461. filterConfig: {
  6462. // remote: false,
  6463. // filterMethod: null,
  6464. showIcon: true
  6465. },
  6466. treeConfig: {
  6467. children: 'children',
  6468. hasChild: 'hasChild',
  6469. indent: 20,
  6470. showIcon: true
  6471. },
  6472. expandConfig: {
  6473. // trigger: 'default',
  6474. showIcon: true
  6475. },
  6476. editConfig: {
  6477. // mode: 'cell',
  6478. showIcon: true,
  6479. showAsterisk: true
  6480. },
  6481. importConfig: {
  6482. modes: ['insert', 'covering']
  6483. },
  6484. exportConfig: {
  6485. modes: ['current', 'selected']
  6486. },
  6487. printConfig: {
  6488. modes: ['current', 'selected']
  6489. },
  6490. mouseConfig: {
  6491. extension: true
  6492. },
  6493. areaConfig: {
  6494. selectCellByHeader: true
  6495. },
  6496. clipConfig: {
  6497. isCopy: true,
  6498. isCut: true,
  6499. isPaste: true
  6500. },
  6501. fnrConfig: {
  6502. isFind: true,
  6503. isReplace: true
  6504. },
  6505. scrollX: {
  6506. enabled: true,
  6507. gt: 60 // oSize: 0
  6508. },
  6509. scrollY: {
  6510. enabled: true,
  6511. gt: 100 // oSize: 0
  6512. }
  6513. },
  6514. export: {
  6515. types: {}
  6516. },
  6517. icon: {
  6518. // table
  6519. TABLE_SORT_ASC: iconPrefix + 'caret-top',
  6520. TABLE_SORT_DESC: iconPrefix + 'caret-bottom',
  6521. TABLE_FILTER_NONE: iconPrefix + 'funnel',
  6522. TABLE_FILTER_MATCH: iconPrefix + 'funnel',
  6523. TABLE_EDIT: iconPrefix + 'edit-outline',
  6524. TABLE_HELP: iconPrefix + 'question',
  6525. TABLE_TREE_LOADED: iconPrefix + 'refresh roll',
  6526. TABLE_TREE_OPEN: iconPrefix + 'caret-right rotate90',
  6527. TABLE_TREE_CLOSE: iconPrefix + 'caret-right',
  6528. TABLE_EXPAND_LOADED: iconPrefix + 'refresh roll',
  6529. TABLE_EXPAND_OPEN: iconPrefix + 'arrow-right rotate90',
  6530. TABLE_EXPAND_CLOSE: iconPrefix + 'arrow-right',
  6531. // button
  6532. BUTTON_DROPDOWN: iconPrefix + 'arrow-bottom',
  6533. BUTTON_LOADING: iconPrefix + 'refresh roll',
  6534. // select
  6535. SELECT_OPEN: iconPrefix + 'caret-bottom rotate180',
  6536. SELECT_CLOSE: iconPrefix + 'caret-bottom',
  6537. // pager
  6538. PAGER_JUMP_PREV: iconPrefix + 'd-arrow-left',
  6539. PAGER_JUMP_NEXT: iconPrefix + 'd-arrow-right',
  6540. PAGER_PREV_PAGE: iconPrefix + 'arrow-left',
  6541. PAGER_NEXT_PAGE: iconPrefix + 'arrow-right',
  6542. PAGER_JUMP_MORE: iconPrefix + 'more',
  6543. // input
  6544. INPUT_CLEAR: iconPrefix + 'close',
  6545. INPUT_PWD: iconPrefix + 'eye-slash',
  6546. INPUT_SHOW_PWD: iconPrefix + 'eye',
  6547. INPUT_PREV_NUM: iconPrefix + 'caret-top',
  6548. INPUT_NEXT_NUM: iconPrefix + 'caret-bottom',
  6549. INPUT_DATE: iconPrefix + 'calendar',
  6550. INPUT_SEARCH: iconPrefix + 'search',
  6551. // modal
  6552. MODAL_ZOOM_IN: iconPrefix + 'square',
  6553. MODAL_ZOOM_OUT: iconPrefix + 'zoomout',
  6554. MODAL_CLOSE: iconPrefix + 'close',
  6555. MODAL_INFO: iconPrefix + 'info',
  6556. MODAL_SUCCESS: iconPrefix + 'success',
  6557. MODAL_WARNING: iconPrefix + 'warning',
  6558. MODAL_ERROR: iconPrefix + 'error',
  6559. MODAL_QUESTION: iconPrefix + 'question',
  6560. MODAL_LOADING: iconPrefix + 'refresh roll',
  6561. // toolbar
  6562. TOOLBAR_TOOLS_REFRESH: iconPrefix + 'refresh',
  6563. TOOLBAR_TOOLS_REFRESH_LOADING: iconPrefix + 'refresh roll',
  6564. TOOLBAR_TOOLS_IMPORT: iconPrefix + 'upload',
  6565. TOOLBAR_TOOLS_EXPORT: iconPrefix + 'download',
  6566. TOOLBAR_TOOLS_PRINT: iconPrefix + 'print',
  6567. TOOLBAR_TOOLS_ZOOM_IN: iconPrefix + 'zoomin',
  6568. TOOLBAR_TOOLS_ZOOM_OUT: iconPrefix + 'zoomout',
  6569. TOOLBAR_TOOLS_CUSTOM: iconPrefix + 'menu',
  6570. // form
  6571. FORM_PREFIX: iconPrefix + 'question',
  6572. FORM_SUFFIX: iconPrefix + 'question',
  6573. FORM_FOLDING: iconPrefix + 'arrow-top rotate180',
  6574. FORM_UNFOLDING: iconPrefix + 'arrow-top'
  6575. },
  6576. grid: {
  6577. // size: null,
  6578. // zoomConfig: {
  6579. // escRestore: true
  6580. // },
  6581. formConfig: {
  6582. enabled: true
  6583. },
  6584. pagerConfig: {
  6585. enabled: true // perfect: false
  6586. },
  6587. toolbarConfig: {
  6588. enabled: true // perfect: false
  6589. },
  6590. proxyConfig: {
  6591. enabled: true,
  6592. autoLoad: true,
  6593. message: true,
  6594. props: {
  6595. list: null,
  6596. result: 'result',
  6597. total: 'page.total',
  6598. message: 'message'
  6599. } // beforeItem: null,
  6600. // beforeColumn: null,
  6601. // beforeQuery: null,
  6602. // afterQuery: null,
  6603. // beforeDelete: null,
  6604. // afterDelete: null,
  6605. // beforeSave: null,
  6606. // afterSave: null
  6607. }
  6608. },
  6609. tooltip: {
  6610. // size: null,
  6611. trigger: 'hover',
  6612. theme: 'dark',
  6613. leaveDelay: 300
  6614. },
  6615. pager: {// size: null,
  6616. // autoHidden: false,
  6617. // perfect: true,
  6618. // pageSize: 10,
  6619. // pagerCount: 7,
  6620. // pageSizes: [10, 15, 20, 50, 100],
  6621. // layouts: ['PrevJump', 'PrevPage', 'Jump', 'PageCount', 'NextPage', 'NextJump', 'Sizes', 'Total']
  6622. },
  6623. form: {
  6624. // preventSubmit: false,
  6625. validConfig: {
  6626. showMessage: true,
  6627. autoPos: true
  6628. },
  6629. // size: null,
  6630. // colon: false,
  6631. titleAsterisk: true
  6632. },
  6633. input: {
  6634. // size: null,
  6635. // transfer: false
  6636. // parseFormat: 'yyyy-MM-dd HH:mm:ss.SSS',
  6637. // labelFormat: '',
  6638. // valueFormat: '',
  6639. minDate: new Date(1900, 0, 1),
  6640. maxDate: new Date(2100, 0, 1),
  6641. startWeek: 1,
  6642. digits: 2,
  6643. controls: true
  6644. },
  6645. textarea: {// size: null,
  6646. // autosize: {
  6647. // minRows: 1,
  6648. // maxRows: 10
  6649. // }
  6650. },
  6651. select: {
  6652. // size: null,
  6653. // transfer: false,
  6654. multiCharOverflow: 8
  6655. },
  6656. toolbar: {// size: null,
  6657. // import: {
  6658. // mode: 'covering'
  6659. // },
  6660. // export: {
  6661. // types: ['csv', 'html', 'xml', 'txt']
  6662. // },
  6663. // custom: {
  6664. // isFooter: true
  6665. // },
  6666. // buttons: []
  6667. },
  6668. button: {// size: null,
  6669. // transfer: false
  6670. },
  6671. radio: {// size: null
  6672. },
  6673. checkbox: {// size: null
  6674. },
  6675. switch: {// size: null
  6676. },
  6677. modal: {
  6678. // size: null,
  6679. top: 15,
  6680. showHeader: true,
  6681. minWidth: 340,
  6682. minHeight: 140,
  6683. lockView: true,
  6684. mask: true,
  6685. duration: 3000,
  6686. marginSize: 0,
  6687. dblclickZoom: true,
  6688. showTitleOverflow: true,
  6689. animat: true,
  6690. // storage: false,
  6691. storageKey: 'VXE_MODAL_POSITION'
  6692. },
  6693. list: {
  6694. // size: null,
  6695. scrollY: {
  6696. enabled: true,
  6697. gt: 100 // oSize: 0
  6698. }
  6699. },
  6700. i18n: function i18n(key) {
  6701. return key;
  6702. }
  6703. };
  6704. /* harmony default export */ var conf = (GlobalConfig);
  6705. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.replace.js
  6706. var es_string_replace = __webpack_require__("5319");
  6707. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.regexp.exec.js
  6708. var es_regexp_exec = __webpack_require__("ac1f");
  6709. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.split.js
  6710. var es_string_split = __webpack_require__("1276");
  6711. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.join.js
  6712. var es_array_join = __webpack_require__("a15b");
  6713. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
  6714. function _arrayLikeToArray(arr, len) {
  6715. if (len == null || len > arr.length) len = arr.length;
  6716. for (var i = 0, arr2 = new Array(len); i < len; i++) {
  6717. arr2[i] = arr[i];
  6718. }
  6719. return arr2;
  6720. }
  6721. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
  6722. function _arrayWithoutHoles(arr) {
  6723. if (Array.isArray(arr)) return _arrayLikeToArray(arr);
  6724. }
  6725. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.symbol.js
  6726. var es_symbol = __webpack_require__("a4d3");
  6727. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.symbol.description.js
  6728. var es_symbol_description = __webpack_require__("e01a");
  6729. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.object.to-string.js
  6730. var es_object_to_string = __webpack_require__("d3b7");
  6731. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.symbol.iterator.js
  6732. var es_symbol_iterator = __webpack_require__("d28b");
  6733. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.iterator.js
  6734. var es_string_iterator = __webpack_require__("3ca3");
  6735. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.iterator.js
  6736. var es_array_iterator = __webpack_require__("e260");
  6737. // EXTERNAL MODULE: ./node_modules/core-js/modules/web.dom-collections.iterator.js
  6738. var web_dom_collections_iterator = __webpack_require__("ddb0");
  6739. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.from.js
  6740. var es_array_from = __webpack_require__("a630");
  6741. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js
  6742. function _iterableToArray(iter) {
  6743. if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
  6744. }
  6745. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.slice.js
  6746. var es_array_slice = __webpack_require__("fb6a");
  6747. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.function.name.js
  6748. var es_function_name = __webpack_require__("b0c0");
  6749. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
  6750. function _unsupportedIterableToArray(o, minLen) {
  6751. if (!o) return;
  6752. if (typeof o === "string") return _arrayLikeToArray(o, minLen);
  6753. var n = Object.prototype.toString.call(o).slice(8, -1);
  6754. if (n === "Object" && o.constructor) n = o.constructor.name;
  6755. if (n === "Map" || n === "Set") return Array.from(o);
  6756. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
  6757. }
  6758. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
  6759. function _nonIterableSpread() {
  6760. throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  6761. }
  6762. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
  6763. function _toConsumableArray(arr) {
  6764. return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
  6765. }
  6766. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.object.assign.js
  6767. var es_object_assign = __webpack_require__("cca6");
  6768. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.fixed.js
  6769. var es_string_fixed = __webpack_require__("c7cd");
  6770. // EXTERNAL MODULE: ./node_modules/core-js/modules/web.dom-collections.for-each.js
  6771. var web_dom_collections_for_each = __webpack_require__("159b");
  6772. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.splice.js
  6773. var es_array_splice = __webpack_require__("a434");
  6774. // CONCATENATED MODULE: ./packages/v-x-e-table/src/store.js
  6775. /**
  6776. * 创建数据仓库
  6777. */
  6778. var store_Store = /*#__PURE__*/function () {
  6779. function Store() {
  6780. _classCallCheck(this, Store);
  6781. this.store = {};
  6782. }
  6783. _createClass(Store, [{
  6784. key: "mixin",
  6785. value: function mixin(map) {
  6786. Object.assign(this.store, map);
  6787. return Store;
  6788. }
  6789. }, {
  6790. key: "get",
  6791. value: function get(name) {
  6792. return this.store[name];
  6793. }
  6794. }, {
  6795. key: "add",
  6796. value: function add(name, render) {
  6797. // 检测是否覆盖
  6798. if (false) {}
  6799. this.store[name] = render;
  6800. return Store;
  6801. }
  6802. }, {
  6803. key: "delete",
  6804. value: function _delete(name) {
  6805. delete this.store[name];
  6806. return Store;
  6807. }
  6808. }]);
  6809. return Store;
  6810. }();
  6811. /* harmony default export */ var store = (store_Store);
  6812. // CONCATENATED MODULE: ./packages/v-x-e-table/src/formats.js
  6813. var formats = new store();
  6814. if (false) {}
  6815. // CONCATENATED MODULE: ./packages/tools/src/utils.js
  6816. var zindexIndex = 0;
  6817. var lastZindex = 1;
  6818. var utils_ColumnInfo = /*#__PURE__*/function () {
  6819. /* eslint-disable @typescript-eslint/no-use-before-define */
  6820. function ColumnInfo($xetable, _vm) {
  6821. var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
  6822. renderHeader = _ref.renderHeader,
  6823. renderCell = _ref.renderCell,
  6824. renderFooter = _ref.renderFooter,
  6825. renderData = _ref.renderData;
  6826. _classCallCheck(this, ColumnInfo);
  6827. var $xegrid = $xetable.$xegrid;
  6828. var proxyOpts = $xegrid ? $xegrid.proxyOpts : null;
  6829. var formatter = _vm.formatter;
  6830. var visible = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isBoolean(_vm.visible) ? _vm.visible : true;
  6831. if (false) { var _globalFunc, globalFunc, types; }
  6832. Object.assign(this, {
  6833. // 基本属性
  6834. type: _vm.type,
  6835. property: _vm.field,
  6836. title: _vm.title,
  6837. width: _vm.width,
  6838. minWidth: _vm.minWidth,
  6839. resizable: _vm.resizable,
  6840. fixed: _vm.fixed,
  6841. align: _vm.align,
  6842. headerAlign: _vm.headerAlign,
  6843. footerAlign: _vm.footerAlign,
  6844. showOverflow: _vm.showOverflow,
  6845. showHeaderOverflow: _vm.showHeaderOverflow,
  6846. showFooterOverflow: _vm.showFooterOverflow,
  6847. className: _vm.className,
  6848. headerClassName: _vm.headerClassName,
  6849. footerClassName: _vm.footerClassName,
  6850. formatter: formatter,
  6851. sortable: _vm.sortable,
  6852. sortBy: _vm.sortBy,
  6853. sortType: _vm.sortType,
  6854. sortMethod: _vm.sortMethod,
  6855. remoteSort: _vm.remoteSort,
  6856. filters: UtilTools.getFilters(_vm.filters),
  6857. filterMultiple: external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isBoolean(_vm.filterMultiple) ? _vm.filterMultiple : true,
  6858. filterMethod: _vm.filterMethod,
  6859. filterResetMethod: _vm.filterResetMethod,
  6860. filterRecoverMethod: _vm.filterRecoverMethod,
  6861. filterRender: _vm.filterRender,
  6862. treeNode: _vm.treeNode,
  6863. cellType: _vm.cellType,
  6864. cellRender: _vm.cellRender,
  6865. editRender: _vm.editRender,
  6866. contentRender: _vm.contentRender,
  6867. exportMethod: _vm.exportMethod,
  6868. footerExportMethod: _vm.footerExportMethod,
  6869. titleHelp: _vm.titleHelp,
  6870. // 自定义参数
  6871. params: _vm.params,
  6872. // 渲染属性
  6873. id: _vm.colId || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.uniqueId('col_'),
  6874. parentId: null,
  6875. visible: visible,
  6876. halfVisible: false,
  6877. defaultVisible: visible,
  6878. checked: false,
  6879. halfChecked: false,
  6880. disabled: false,
  6881. level: 1,
  6882. rowSpan: 1,
  6883. colSpan: 1,
  6884. order: null,
  6885. renderWidth: 0,
  6886. renderHeight: 0,
  6887. resizeWidth: 0,
  6888. renderLeft: 0,
  6889. renderArgs: [],
  6890. // 渲染参数可用于扩展
  6891. model: {},
  6892. renderHeader: renderHeader || _vm.renderHeader,
  6893. renderCell: renderCell || _vm.renderCell,
  6894. renderFooter: renderFooter || _vm.renderFooter,
  6895. renderData: renderData,
  6896. // 单元格插槽,只对 grid 有效
  6897. slots: _vm.slots
  6898. });
  6899. if (proxyOpts && proxyOpts.beforeColumn) {
  6900. proxyOpts.beforeColumn({
  6901. $grid: $xegrid,
  6902. column: this
  6903. });
  6904. }
  6905. }
  6906. _createClass(ColumnInfo, [{
  6907. key: "getTitle",
  6908. value: function getTitle() {
  6909. return UtilTools.getFuncText(this.title || (this.type === 'seq' ? conf.i18n('vxe.table.seqTitle') : ''));
  6910. }
  6911. }, {
  6912. key: "getKey",
  6913. value: function getKey() {
  6914. return this.property || (this.type ? "type=".concat(this.type) : null);
  6915. }
  6916. }, {
  6917. key: "update",
  6918. value: function update(name, value) {
  6919. // 不支持双向的属性
  6920. if (name !== 'filters') {
  6921. if (name === 'field') {
  6922. this.property = value;
  6923. } else {
  6924. this[name] = value;
  6925. }
  6926. }
  6927. }
  6928. }]);
  6929. return ColumnInfo;
  6930. }();
  6931. function isEnableConf(conf) {
  6932. return conf && conf.enabled !== false;
  6933. }
  6934. function outLog(type) {
  6935. return function (message, params) {
  6936. var msg = UtilTools.getLog(message, params);
  6937. console[type](msg);
  6938. return msg;
  6939. };
  6940. }
  6941. var UtilTools = {
  6942. warn: outLog('warn'),
  6943. error: outLog('error'),
  6944. getLog: function getLog(message, args) {
  6945. return "[vxe-table] ".concat(conf.i18n(message, args));
  6946. },
  6947. getFuncText: function getFuncText(content) {
  6948. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(content) ? content() : conf.translate ? conf.translate(content) : content;
  6949. },
  6950. nextZIndex: function nextZIndex() {
  6951. lastZindex = conf.zIndex + zindexIndex++;
  6952. return lastZindex;
  6953. },
  6954. getLastZIndex: function getLastZIndex() {
  6955. return lastZindex;
  6956. },
  6957. // 行主键 key
  6958. getRowkey: function getRowkey($xetable) {
  6959. return $xetable.rowId || '_XID';
  6960. },
  6961. // 行主键 value
  6962. getRowid: function getRowid($xetable, row) {
  6963. var rowId = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, UtilTools.getRowkey($xetable));
  6964. return rowId ? encodeURIComponent(rowId) : '';
  6965. },
  6966. // 获取所有的列,排除分组
  6967. getColumnList: function getColumnList(columns) {
  6968. var result = [];
  6969. columns.forEach(function (column) {
  6970. result.push.apply(result, _toConsumableArray(column.children && column.children.length ? UtilTools.getColumnList(column.children) : [column]));
  6971. });
  6972. return result;
  6973. },
  6974. getClass: function getClass(property, params) {
  6975. return property ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(property) ? property(params) : property : '';
  6976. },
  6977. getFilters: function getFilters(filters) {
  6978. if (filters && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(filters)) {
  6979. return filters.map(function (_ref2) {
  6980. var label = _ref2.label,
  6981. value = _ref2.value,
  6982. data = _ref2.data,
  6983. resetValue = _ref2.resetValue,
  6984. checked = _ref2.checked;
  6985. return {
  6986. label: label,
  6987. value: value,
  6988. data: data,
  6989. resetValue: resetValue,
  6990. checked: !!checked,
  6991. _checked: !!checked
  6992. };
  6993. });
  6994. }
  6995. return filters;
  6996. },
  6997. formatText: function formatText(value, placeholder) {
  6998. return '' + (value === '' || value === null || value === undefined ? placeholder ? conf.emptyCell : '' : value);
  6999. },
  7000. getCellValue: function getCellValue(row, column) {
  7001. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, column.property);
  7002. },
  7003. setCellValue: function setCellValue(row, column, value) {
  7004. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.set(row, column.property, value);
  7005. },
  7006. isColumn: function isColumn(column) {
  7007. return column instanceof utils_ColumnInfo;
  7008. },
  7009. getColumnConfig: function getColumnConfig($xetable, _vm, options) {
  7010. return UtilTools.isColumn(_vm) ? _vm : new utils_ColumnInfo($xetable, _vm, options);
  7011. },
  7012. // 组装列配置
  7013. assemColumn: function assemColumn(_vm) {
  7014. var $el = _vm.$el,
  7015. $xetable = _vm.$xetable,
  7016. $xecolumn = _vm.$xecolumn,
  7017. columnConfig = _vm.columnConfig;
  7018. var groupConfig = $xecolumn ? $xecolumn.columnConfig : null;
  7019. columnConfig.slots = _vm.$scopedSlots;
  7020. if (groupConfig) {
  7021. if (false) {}
  7022. if (!groupConfig.children) {
  7023. groupConfig.children = [];
  7024. }
  7025. groupConfig.children.splice([].indexOf.call($xecolumn.$el.children, $el), 0, columnConfig);
  7026. } else {
  7027. $xetable.staticColumns.splice([].indexOf.call($xetable.$refs.hideColumn.children, $el), 0, columnConfig);
  7028. }
  7029. },
  7030. // 销毁列
  7031. destroyColumn: function destroyColumn(_vm) {
  7032. var $xetable = _vm.$xetable,
  7033. columnConfig = _vm.columnConfig;
  7034. var matchObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.findTree($xetable.staticColumns, function (column) {
  7035. return column === columnConfig;
  7036. });
  7037. if (matchObj) {
  7038. matchObj.items.splice(matchObj.index, 1);
  7039. }
  7040. },
  7041. hasChildrenList: function hasChildrenList(item) {
  7042. return item && item.children && item.children.length > 0;
  7043. },
  7044. parseFile: function parseFile(file) {
  7045. var name = file.name;
  7046. var tIndex = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.lastIndexOf(name, '.');
  7047. var type = name.substring(tIndex + 1, name.length);
  7048. var filename = name.substring(0, tIndex);
  7049. return {
  7050. filename: filename,
  7051. type: type
  7052. };
  7053. },
  7054. isNumVal: function isNumVal(num) {
  7055. return !isNaN(parseFloat('' + num));
  7056. }
  7057. };
  7058. /* harmony default export */ var utils = (UtilTools);
  7059. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.regexp.constructor.js
  7060. var es_regexp_constructor = __webpack_require__("4d63");
  7061. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.regexp.to-string.js
  7062. var es_regexp_to_string = __webpack_require__("25f0");
  7063. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.match.js
  7064. var es_string_match = __webpack_require__("466d");
  7065. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.concat.js
  7066. var es_array_concat = __webpack_require__("99af");
  7067. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.promise.js
  7068. var es_promise = __webpack_require__("e6cf");
  7069. // CONCATENATED MODULE: ./packages/tools/src/dom.js
  7070. var dom_getRowid = utils.getRowid;
  7071. var browse = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.browse();
  7072. var reClsMap = {};
  7073. function getClsRE(cls) {
  7074. if (!reClsMap[cls]) {
  7075. reClsMap[cls] = new RegExp("(?:^|\\s)".concat(cls, "(?!\\S)"), 'g');
  7076. }
  7077. return reClsMap[cls];
  7078. }
  7079. function getNodeOffset(elem, container, rest) {
  7080. if (elem) {
  7081. var parentElem = elem.parentNode;
  7082. rest.top += elem.offsetTop;
  7083. rest.left += elem.offsetLeft;
  7084. if (parentElem && parentElem !== document.documentElement && parentElem !== document.body) {
  7085. rest.top -= parentElem.scrollTop;
  7086. rest.left -= parentElem.scrollLeft;
  7087. }
  7088. if (container && (elem === container || elem.offsetParent === container) ? 0 : elem.offsetParent) {
  7089. return getNodeOffset(elem.offsetParent, container, rest);
  7090. }
  7091. }
  7092. return rest;
  7093. }
  7094. function isScale(val) {
  7095. return val && /^\d+%$/.test(val);
  7096. }
  7097. function hasClass(elem, cls) {
  7098. return elem && elem.className && elem.className.match && elem.className.match(getClsRE(cls));
  7099. }
  7100. function removeClass(elem, cls) {
  7101. if (elem && hasClass(elem, cls)) {
  7102. elem.className = elem.className.replace(getClsRE(cls), '');
  7103. }
  7104. }
  7105. function getDomNode() {
  7106. var documentElement = document.documentElement;
  7107. var bodyElem = document.body;
  7108. return {
  7109. scrollTop: documentElement.scrollTop || bodyElem.scrollTop,
  7110. scrollLeft: documentElement.scrollLeft || bodyElem.scrollLeft,
  7111. visibleHeight: documentElement.clientHeight || bodyElem.clientHeight,
  7112. visibleWidth: documentElement.clientWidth || bodyElem.clientWidth
  7113. };
  7114. }
  7115. var DomTools = {
  7116. browse: browse,
  7117. isPx: function isPx(val) {
  7118. return val && /^\d+(px)?$/.test(val);
  7119. },
  7120. isScale: isScale,
  7121. hasClass: hasClass,
  7122. removeClass: removeClass,
  7123. addClass: function addClass(elem, cls) {
  7124. if (elem && !hasClass(elem, cls)) {
  7125. removeClass(elem, cls);
  7126. elem.className = "".concat(elem.className, " ").concat(cls);
  7127. }
  7128. },
  7129. updateCellTitle: function updateCellTitle(overflowElem, column) {
  7130. var content = column.type === 'html' ? overflowElem.innerText : overflowElem.textContent;
  7131. if (overflowElem.getAttribute('title') !== content) {
  7132. overflowElem.setAttribute('title', content);
  7133. }
  7134. },
  7135. rowToVisible: function rowToVisible($xetable, row) {
  7136. var bodyElem = $xetable.$refs.tableBody.$el;
  7137. var trElem = bodyElem.querySelector("[rowid=\"".concat(dom_getRowid($xetable, row), "\"]"));
  7138. if (trElem) {
  7139. var bodyHeight = bodyElem.clientHeight;
  7140. var bodySrcollTop = bodyElem.scrollTop;
  7141. var trOffsetTop = trElem.offsetTop + (trElem.offsetParent ? trElem.offsetParent.offsetTop : 0);
  7142. var trHeight = trElem.clientHeight; // 检测行是否在可视区中
  7143. if (trOffsetTop < bodySrcollTop || trOffsetTop > bodySrcollTop + bodyHeight) {
  7144. // 向上定位
  7145. return $xetable.scrollTo(null, trOffsetTop);
  7146. } else if (trOffsetTop + trHeight >= bodyHeight + bodySrcollTop) {
  7147. // 向下定位
  7148. return $xetable.scrollTo(null, bodySrcollTop + trHeight);
  7149. }
  7150. } else {
  7151. // 如果是虚拟渲染跨行滚动
  7152. if ($xetable.scrollYLoad) {
  7153. return $xetable.scrollTo(null, ($xetable.afterFullData.indexOf(row) - 1) * $xetable.scrollYStore.rowHeight);
  7154. }
  7155. }
  7156. return Promise.resolve();
  7157. },
  7158. colToVisible: function colToVisible($xetable, column) {
  7159. var bodyElem = $xetable.$refs.tableBody.$el;
  7160. var tdElem = bodyElem.querySelector(".".concat(column.id));
  7161. if (tdElem) {
  7162. var bodyWidth = bodyElem.clientWidth;
  7163. var bodySrcollLeft = bodyElem.scrollLeft;
  7164. var tdOffsetLeft = tdElem.offsetLeft + (tdElem.offsetParent ? tdElem.offsetParent.offsetLeft : 0);
  7165. var tdWidth = tdElem.clientWidth; // 检测行是否在可视区中
  7166. if (tdOffsetLeft < bodySrcollLeft || tdOffsetLeft > bodySrcollLeft + bodyWidth) {
  7167. // 向左定位
  7168. return $xetable.scrollTo(tdOffsetLeft);
  7169. } else if (tdOffsetLeft + tdWidth >= bodyWidth + bodySrcollLeft) {
  7170. // 向右定位
  7171. return $xetable.scrollTo(bodySrcollLeft + tdWidth);
  7172. }
  7173. } else {
  7174. // 如果是虚拟渲染跨行滚动
  7175. if ($xetable.scrollXLoad) {
  7176. var visibleColumn = $xetable.visibleColumn;
  7177. var scrollLeft = 0;
  7178. for (var index = 0; index < visibleColumn.length; index++) {
  7179. if (visibleColumn[index] === column) {
  7180. break;
  7181. }
  7182. scrollLeft += visibleColumn[index].renderWidth;
  7183. }
  7184. return $xetable.scrollTo(scrollLeft);
  7185. }
  7186. }
  7187. return Promise.resolve();
  7188. },
  7189. getDomNode: getDomNode,
  7190. /**
  7191. * 检查触发源是否属于目标节点
  7192. */
  7193. getEventTargetNode: function getEventTargetNode(evnt, container, queryCls, queryMethod) {
  7194. var targetElem;
  7195. var target = evnt.target;
  7196. while (target && target.nodeType && target !== document) {
  7197. if (queryCls && hasClass(target, queryCls) && (!queryMethod || queryMethod(target))) {
  7198. targetElem = target;
  7199. } else if (target === container) {
  7200. return {
  7201. flag: queryCls ? !!targetElem : true,
  7202. container: container,
  7203. targetElem: targetElem
  7204. };
  7205. }
  7206. target = target.parentNode;
  7207. }
  7208. return {
  7209. flag: false
  7210. };
  7211. },
  7212. /**
  7213. * 获取元素相对于 document 的位置
  7214. */
  7215. getOffsetPos: function getOffsetPos(elem, container) {
  7216. return getNodeOffset(elem, container, {
  7217. left: 0,
  7218. top: 0
  7219. });
  7220. },
  7221. getAbsolutePos: function getAbsolutePos(elem) {
  7222. var bounding = elem.getBoundingClientRect();
  7223. var boundingTop = bounding.top;
  7224. var boundingLeft = bounding.left;
  7225. var _getDomNode = getDomNode(),
  7226. scrollTop = _getDomNode.scrollTop,
  7227. scrollLeft = _getDomNode.scrollLeft,
  7228. visibleHeight = _getDomNode.visibleHeight,
  7229. visibleWidth = _getDomNode.visibleWidth;
  7230. return {
  7231. boundingTop: boundingTop,
  7232. top: scrollTop + boundingTop,
  7233. boundingLeft: boundingLeft,
  7234. left: scrollLeft + boundingLeft,
  7235. visibleHeight: visibleHeight,
  7236. visibleWidth: visibleWidth
  7237. };
  7238. },
  7239. toView: function toView(elem) {
  7240. var scrollIntoViewIfNeeded = 'scrollIntoViewIfNeeded';
  7241. var scrollIntoView = 'scrollIntoView';
  7242. if (elem) {
  7243. if (elem[scrollIntoViewIfNeeded]) {
  7244. elem[scrollIntoViewIfNeeded]();
  7245. } else if (elem[scrollIntoView]) {
  7246. elem[scrollIntoView]();
  7247. }
  7248. }
  7249. },
  7250. triggerEvent: function triggerEvent(targetElem, type) {
  7251. var evnt;
  7252. if (typeof Event === 'function') {
  7253. evnt = new Event(type);
  7254. } else {
  7255. evnt = document.createEvent('Event');
  7256. evnt.initEvent(type, true, true);
  7257. }
  7258. targetElem.dispatchEvent(evnt);
  7259. },
  7260. calcHeight: function calcHeight($xetable, key) {
  7261. var val = $xetable[key];
  7262. var num = 0;
  7263. if (val) {
  7264. if (val === 'auto') {
  7265. num = $xetable.parentHeight;
  7266. } else {
  7267. var excludeHeight = $xetable.getExcludeHeight();
  7268. if (isScale(val)) {
  7269. num = Math.floor((external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toInteger(val) || 1) / 100 * $xetable.parentHeight);
  7270. } else {
  7271. num = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(val);
  7272. }
  7273. num = Math.max(40, num - excludeHeight);
  7274. }
  7275. }
  7276. return num;
  7277. }
  7278. };
  7279. /* harmony default export */ var dom = (DomTools);
  7280. // CONCATENATED MODULE: ./packages/tools/src/event.js
  7281. // 监听全局事件
  7282. var event_browse = dom.browse;
  7283. var wheelName = event_browse.firefox ? 'DOMMouseScroll' : 'mousewheel';
  7284. var eventStore = [];
  7285. var GlobalEvent = {
  7286. on: function on(comp, type, cb) {
  7287. if (cb) {
  7288. eventStore.push({
  7289. comp: comp,
  7290. type: type,
  7291. cb: cb
  7292. });
  7293. }
  7294. },
  7295. off: function off(comp, type) {
  7296. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.remove(eventStore, function (item) {
  7297. return item.comp === comp && item.type === type;
  7298. });
  7299. },
  7300. trigger: function trigger(evnt) {
  7301. var isWheel = evnt.type === wheelName;
  7302. eventStore.forEach(function (_ref) {
  7303. var comp = _ref.comp,
  7304. type = _ref.type,
  7305. cb = _ref.cb;
  7306. if (type === evnt.type || isWheel && type === 'mousewheel') {
  7307. cb.call(comp, evnt);
  7308. }
  7309. });
  7310. },
  7311. eqKeypad: function eqKeypad(evnt, keyVal) {
  7312. var key = evnt.key;
  7313. if (keyVal.toLowerCase() === key.toLowerCase()) {
  7314. return true;
  7315. }
  7316. return false;
  7317. }
  7318. };
  7319. if (event_browse.isDoc) {
  7320. if (!event_browse.msie) {
  7321. document.addEventListener('copy', GlobalEvent.trigger, false);
  7322. document.addEventListener('cut', GlobalEvent.trigger, false);
  7323. document.addEventListener('paste', GlobalEvent.trigger, false);
  7324. }
  7325. document.addEventListener('keydown', GlobalEvent.trigger, false);
  7326. document.addEventListener('contextmenu', GlobalEvent.trigger, false);
  7327. window.addEventListener('mousedown', GlobalEvent.trigger, false);
  7328. window.addEventListener('blur', GlobalEvent.trigger, false);
  7329. window.addEventListener('resize', GlobalEvent.trigger, false);
  7330. window.addEventListener(wheelName, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.throttle(GlobalEvent.trigger, 100, {
  7331. leading: true,
  7332. trailing: false
  7333. }), false);
  7334. }
  7335. /* harmony default export */ var src_event = (GlobalEvent);
  7336. // CONCATENATED MODULE: ./packages/tools/src/resize.js
  7337. /**
  7338. * 监听 resize 事件
  7339. * 如果项目中已使用了 resize-observer-polyfill,那么只需要将方法定义全局,该组件就会自动使用
  7340. */
  7341. var resizeTimeout;
  7342. var resize_eventStore = [];
  7343. var defaultInterval = 500;
  7344. function eventHandle() {
  7345. if (resize_eventStore.length) {
  7346. resize_eventStore.forEach(function (item) {
  7347. item.tarList.forEach(function (observer) {
  7348. var target = observer.target,
  7349. width = observer.width,
  7350. heighe = observer.heighe;
  7351. var clientWidth = target.clientWidth;
  7352. var clientHeight = target.clientHeight;
  7353. var rWidth = clientWidth && width !== clientWidth;
  7354. var rHeight = clientHeight && heighe !== clientHeight;
  7355. if (rWidth || rHeight) {
  7356. observer.width = clientWidth;
  7357. observer.heighe = clientHeight;
  7358. setTimeout(item.callback);
  7359. }
  7360. });
  7361. });
  7362. /* eslint-disable @typescript-eslint/no-use-before-define */
  7363. eventListener();
  7364. }
  7365. }
  7366. function eventListener() {
  7367. clearTimeout(resizeTimeout);
  7368. resizeTimeout = setTimeout(eventHandle, conf.resizeInterval || defaultInterval);
  7369. }
  7370. var resize_ResizeObserverPolyfill = /*#__PURE__*/function () {
  7371. function ResizeObserverPolyfill(callback) {
  7372. _classCallCheck(this, ResizeObserverPolyfill);
  7373. this.tarList = [];
  7374. this.callback = callback;
  7375. }
  7376. _createClass(ResizeObserverPolyfill, [{
  7377. key: "observe",
  7378. value: function observe(target) {
  7379. var _this = this;
  7380. if (target) {
  7381. if (!this.tarList.some(function (observer) {
  7382. return observer.target === target;
  7383. })) {
  7384. this.tarList.push({
  7385. target: target,
  7386. width: target.clientWidth,
  7387. heighe: target.clientHeight
  7388. });
  7389. }
  7390. if (!resize_eventStore.length) {
  7391. eventListener();
  7392. }
  7393. if (!resize_eventStore.some(function (item) {
  7394. return item === _this;
  7395. })) {
  7396. resize_eventStore.push(this);
  7397. }
  7398. }
  7399. }
  7400. }, {
  7401. key: "unobserve",
  7402. value: function unobserve(target) {
  7403. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.remove(resize_eventStore, function (item) {
  7404. return item.tarList.some(function (observer) {
  7405. return observer.target === target;
  7406. });
  7407. });
  7408. }
  7409. }, {
  7410. key: "disconnect",
  7411. value: function disconnect() {
  7412. var _this2 = this;
  7413. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.remove(resize_eventStore, function (item) {
  7414. return item === _this2;
  7415. });
  7416. }
  7417. }]);
  7418. return ResizeObserverPolyfill;
  7419. }();
  7420. function createResizeEvent(callback) {
  7421. if (window.ResizeObserver) {
  7422. return new window.ResizeObserver(callback);
  7423. }
  7424. return new resize_ResizeObserverPolyfill(callback);
  7425. }
  7426. // CONCATENATED MODULE: ./packages/tools/index.js
  7427. /* harmony default export */ var tools = ({
  7428. UtilTools: utils,
  7429. DomTools: dom,
  7430. GlobalEvent: src_event
  7431. });
  7432. // CONCATENATED MODULE: ./packages/v-x-e-table/src/interceptor.js
  7433. function toType(type) {
  7434. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toValueString(type).replace('_', '').toLowerCase();
  7435. }
  7436. var eventTypes = 'created,mounted,activated,beforeDestroy,destroyed,event.clearActived,event.clearFilter,event.clearAreas,event.showMenu,event.keydown,event.export,event.import'.split(',').map(toType);
  7437. var storeMap = {};
  7438. var interceptor = {
  7439. mixin: function mixin(map) {
  7440. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.each(map, function (callback, type) {
  7441. return interceptor.add(type, callback);
  7442. });
  7443. return interceptor;
  7444. },
  7445. get: function get(type) {
  7446. return storeMap[toType(type)] || [];
  7447. },
  7448. add: function add(type, callback) {
  7449. type = toType(type); // 检测类型
  7450. if (false) {}
  7451. if (callback && eventTypes.indexOf(type) > -1) {
  7452. var eList = storeMap[type];
  7453. if (!eList) {
  7454. eList = storeMap[type] = [];
  7455. } // 检测重复
  7456. if (false) {}
  7457. eList.push(callback);
  7458. }
  7459. return interceptor;
  7460. },
  7461. delete: function _delete(type, callback) {
  7462. var eList = storeMap[toType(type)];
  7463. if (eList) {
  7464. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.remove(eList, function (fn) {
  7465. return fn === callback;
  7466. });
  7467. }
  7468. return interceptor;
  7469. }
  7470. };
  7471. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
  7472. function _defineProperty(obj, key, value) {
  7473. if (key in obj) {
  7474. Object.defineProperty(obj, key, {
  7475. value: value,
  7476. enumerable: true,
  7477. configurable: true,
  7478. writable: true
  7479. });
  7480. } else {
  7481. obj[key] = value;
  7482. }
  7483. return obj;
  7484. }
  7485. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.find.js
  7486. var es_array_find = __webpack_require__("7db0");
  7487. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.number.to-fixed.js
  7488. var es_number_to_fixed = __webpack_require__("b680");
  7489. // CONCATENATED MODULE: ./packages/v-x-e-table/src/renderer.js
  7490. var defaultCompProps = {
  7491. transfer: true
  7492. };
  7493. var componentDefaultModelProp = 'value';
  7494. function isEmptyValue(cellValue) {
  7495. return cellValue === null || cellValue === undefined || cellValue === '';
  7496. }
  7497. function getChangeEvent(renderOpts) {
  7498. switch (renderOpts.name) {
  7499. case 'input':
  7500. case 'textarea':
  7501. case '$input':
  7502. case '$textarea':
  7503. return 'input';
  7504. }
  7505. return 'change';
  7506. }
  7507. function parseDate(value, props) {
  7508. return value && props.valueFormat ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toStringDate(value, props.valueFormat) : value;
  7509. }
  7510. function getFormatDate(value, props, defaultFormat) {
  7511. var _props$dateConfig = props.dateConfig,
  7512. dateConfig = _props$dateConfig === void 0 ? {} : _props$dateConfig;
  7513. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toDateString(parseDate(value, props), dateConfig.labelFormat || defaultFormat);
  7514. }
  7515. function getLabelFormatDate(value, props) {
  7516. return getFormatDate(value, props, conf.i18n("vxe.input.date.labelFormat.".concat(props.type)));
  7517. }
  7518. function getDefaultComponentName(_ref) {
  7519. var name = _ref.name;
  7520. return "vxe-".concat(name.replace('$', ''));
  7521. }
  7522. function handleConfirmFilter(params, checked, option) {
  7523. var $panel = params.$panel;
  7524. $panel.changeOption({}, checked, option);
  7525. }
  7526. function getNativeAttrs(_ref2) {
  7527. var name = _ref2.name,
  7528. attrs = _ref2.attrs;
  7529. if (name === 'input') {
  7530. attrs = Object.assign({
  7531. type: 'text'
  7532. }, attrs);
  7533. }
  7534. return attrs;
  7535. }
  7536. function getInputImmediateModel(renderOpts) {
  7537. var name = renderOpts.name,
  7538. immediate = renderOpts.immediate,
  7539. props = renderOpts.props;
  7540. if (!immediate) {
  7541. if (name === '$input') {
  7542. var _ref3 = props || {},
  7543. type = _ref3.type;
  7544. return !(!type || type === 'text' || type === 'number' || type === 'integer' || type === 'float');
  7545. }
  7546. if (name === 'input' || name === 'textarea' || name === '$textarea') {
  7547. return false;
  7548. }
  7549. return true;
  7550. }
  7551. return immediate;
  7552. }
  7553. function isImmediateCell(renderOpts, params) {
  7554. return params.$type === 'cell' || getInputImmediateModel(renderOpts);
  7555. }
  7556. function getCellEditProps(renderOpts, params, value, defaultProps) {
  7557. var vSize = params.$table.vSize;
  7558. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.assign({
  7559. immediate: getInputImmediateModel(renderOpts)
  7560. }, vSize ? {
  7561. size: vSize
  7562. } : {}, defaultCompProps, defaultProps, renderOpts.props, _defineProperty({}, componentDefaultModelProp, value));
  7563. }
  7564. function getFilterProps(renderOpts, params, value, defaultProps) {
  7565. var vSize = params.$table.vSize;
  7566. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.assign(vSize ? {
  7567. size: vSize
  7568. } : {}, defaultCompProps, defaultProps, renderOpts.props, _defineProperty({}, componentDefaultModelProp, value));
  7569. }
  7570. function getItemProps(renderOpts, params, value, defaultProps) {
  7571. var vSize = params.$form.vSize;
  7572. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.assign(vSize ? {
  7573. size: vSize
  7574. } : {}, defaultCompProps, defaultProps, renderOpts.props, _defineProperty({}, componentDefaultModelProp, value));
  7575. }
  7576. function getCellLabelVNs(h, renderOpts, params, cellLabel) {
  7577. var placeholder = renderOpts.placeholder;
  7578. return [h('span', {
  7579. class: 'vxe-cell--label'
  7580. }, placeholder && isEmptyValue(cellLabel) ? [h('span', {
  7581. class: 'vxe-cell--placeholder'
  7582. }, UtilTools.formatText(UtilTools.getFuncText(placeholder), 1))] : UtilTools.formatText(cellLabel, 1))];
  7583. }
  7584. function getNativeOns(renderOpts, params) {
  7585. var nativeEvents = renderOpts.nativeEvents;
  7586. var nativeOns = {};
  7587. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.objectEach(nativeEvents, function (func, key) {
  7588. nativeOns[key] = function () {
  7589. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  7590. args[_key] = arguments[_key];
  7591. }
  7592. func.apply(void 0, [params].concat(args));
  7593. };
  7594. });
  7595. return nativeOns;
  7596. }
  7597. function getOns(renderOpts, params, inputFunc, changeFunc) {
  7598. var name = renderOpts.name,
  7599. events = renderOpts.events;
  7600. var modelEvent = 'input';
  7601. var changeEvent = getChangeEvent(renderOpts);
  7602. var isSameEvent = changeEvent === modelEvent;
  7603. var ons = {};
  7604. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.objectEach(events, function (func, key) {
  7605. ons[key] = function () {
  7606. for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  7607. args[_key2] = arguments[_key2];
  7608. }
  7609. func.apply(void 0, [params].concat(args));
  7610. };
  7611. });
  7612. if (inputFunc) {
  7613. ons[modelEvent] = function (targetEvnt) {
  7614. // 对输入框进行优化
  7615. inputFunc(name === '$input' || name === '$textarea' ? targetEvnt.value : targetEvnt);
  7616. if (events && events[modelEvent]) {
  7617. events[modelEvent](params, targetEvnt);
  7618. }
  7619. if (isSameEvent && changeFunc) {
  7620. changeFunc(targetEvnt);
  7621. }
  7622. };
  7623. }
  7624. if (!isSameEvent && changeFunc) {
  7625. ons[changeEvent] = function () {
  7626. for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
  7627. args[_key3] = arguments[_key3];
  7628. }
  7629. changeFunc.apply(void 0, args);
  7630. if (events && events[changeEvent]) {
  7631. events[changeEvent].apply(events, [params].concat(args));
  7632. }
  7633. };
  7634. }
  7635. return ons;
  7636. }
  7637. function getEditOns(renderOpts, params) {
  7638. var $table = params.$table,
  7639. row = params.row,
  7640. column = params.column;
  7641. var name = renderOpts.name;
  7642. var model = column.model;
  7643. var isImmediate = isImmediateCell(renderOpts, params);
  7644. return getOns(renderOpts, params, function (cellValue) {
  7645. // 处理 model 值双向绑定
  7646. if (isImmediate) {
  7647. UtilTools.setCellValue(row, column, cellValue);
  7648. } else {
  7649. model.update = true;
  7650. model.value = cellValue;
  7651. }
  7652. }, function (eventParams) {
  7653. // 处理 change 事件相关逻辑
  7654. if (!isImmediate && (name === '$input' || name === '$textarea')) {
  7655. $table.updateStatus(params, eventParams.value);
  7656. } else {
  7657. $table.updateStatus(params);
  7658. }
  7659. });
  7660. }
  7661. function getFilterOns(renderOpts, params, option) {
  7662. return getOns(renderOpts, params, function (value) {
  7663. // 处理 model 值双向绑定
  7664. option.data = value;
  7665. }, function () {
  7666. handleConfirmFilter(params, !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eqNull(option.data), option);
  7667. });
  7668. }
  7669. function getItemOns(renderOpts, params) {
  7670. var $form = params.$form,
  7671. data = params.data,
  7672. property = params.property;
  7673. return getOns(renderOpts, params, function (value) {
  7674. // 处理 model 值双向绑定
  7675. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.set(data, property, value);
  7676. }, function () {
  7677. // 处理 change 事件相关逻辑
  7678. $form.updateStatus(params);
  7679. });
  7680. }
  7681. function getNativeEditOns(renderOpts, params) {
  7682. var $table = params.$table,
  7683. row = params.row,
  7684. column = params.column;
  7685. var model = column.model;
  7686. return getOns(renderOpts, params, function (evnt) {
  7687. // 处理 model 值双向绑定
  7688. var cellValue = evnt.target.value;
  7689. if (isImmediateCell(renderOpts, params)) {
  7690. UtilTools.setCellValue(row, column, cellValue);
  7691. } else {
  7692. model.update = true;
  7693. model.value = cellValue;
  7694. }
  7695. }, function (evnt) {
  7696. // 处理 change 事件相关逻辑
  7697. var cellValue = evnt.target.value;
  7698. $table.updateStatus(params, cellValue);
  7699. });
  7700. }
  7701. function getNativeFilterOns(renderOpts, params, option) {
  7702. return getOns(renderOpts, params, function (evnt) {
  7703. // 处理 model 值双向绑定
  7704. option.data = evnt.target.value;
  7705. }, function () {
  7706. handleConfirmFilter(params, !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eqNull(option.data), option);
  7707. });
  7708. }
  7709. function getNativeItemOns(renderOpts, params) {
  7710. var $form = params.$form,
  7711. data = params.data,
  7712. property = params.property;
  7713. return getOns(renderOpts, params, function (evnt) {
  7714. // 处理 model 值双向绑定
  7715. var itemValue = evnt.target.value;
  7716. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.set(data, property, itemValue);
  7717. }, function () {
  7718. // 处理 change 事件相关逻辑
  7719. $form.updateStatus(params);
  7720. });
  7721. }
  7722. /**
  7723. * 单元格可编辑渲染-原生的标签
  7724. * input、textarea、select
  7725. */
  7726. function nativeEditRender(h, renderOpts, params) {
  7727. var row = params.row,
  7728. column = params.column;
  7729. var name = renderOpts.name;
  7730. var attrs = getNativeAttrs(renderOpts);
  7731. var cellValue = isImmediateCell(renderOpts, params) ? UtilTools.getCellValue(row, column) : column.model.value;
  7732. return [h(name, {
  7733. class: "vxe-default-".concat(name),
  7734. attrs: attrs,
  7735. domProps: {
  7736. value: cellValue
  7737. },
  7738. on: getNativeEditOns(renderOpts, params)
  7739. })];
  7740. }
  7741. function defaultEditRender(h, renderOpts, params) {
  7742. var row = params.row,
  7743. column = params.column;
  7744. var cellValue = UtilTools.getCellValue(row, column);
  7745. return [h(getDefaultComponentName(renderOpts), {
  7746. props: getCellEditProps(renderOpts, params, cellValue),
  7747. on: getEditOns(renderOpts, params),
  7748. nativeOn: getNativeOns(renderOpts, params)
  7749. })];
  7750. }
  7751. function defaultButtonEditRender(h, renderOpts, params) {
  7752. return [h('vxe-button', {
  7753. props: getCellEditProps(renderOpts, params),
  7754. on: getOns(renderOpts, params),
  7755. nativeOn: getNativeOns(renderOpts, params)
  7756. })];
  7757. }
  7758. function defaultButtonsEditRender(h, renderOpts, params) {
  7759. return renderOpts.children.map(function (childRenderOpts) {
  7760. return defaultButtonEditRender(h, childRenderOpts, params)[0];
  7761. });
  7762. }
  7763. function renderNativeOptgroups(h, renderOpts, params, renderOptionsMethods) {
  7764. var optionGroups = renderOpts.optionGroups,
  7765. _renderOpts$optionGro = renderOpts.optionGroupProps,
  7766. optionGroupProps = _renderOpts$optionGro === void 0 ? {} : _renderOpts$optionGro;
  7767. var groupOptions = optionGroupProps.options || 'options';
  7768. var groupLabel = optionGroupProps.label || 'label';
  7769. return optionGroups.map(function (group, gIndex) {
  7770. return h('optgroup', {
  7771. key: gIndex,
  7772. domProps: {
  7773. label: group[groupLabel]
  7774. }
  7775. }, renderOptionsMethods(h, group[groupOptions], renderOpts, params));
  7776. });
  7777. }
  7778. /**
  7779. * 渲染原生的 option 标签
  7780. */
  7781. function renderNativeOptions(h, options, renderOpts, params) {
  7782. var _renderOpts$optionPro = renderOpts.optionProps,
  7783. optionProps = _renderOpts$optionPro === void 0 ? {} : _renderOpts$optionPro;
  7784. var row = params.row,
  7785. column = params.column;
  7786. var labelProp = optionProps.label || 'label';
  7787. var valueProp = optionProps.value || 'value';
  7788. var disabledProp = optionProps.disabled || 'disabled';
  7789. var cellValue = isImmediateCell(renderOpts, params) ? UtilTools.getCellValue(row, column) : column.model.value;
  7790. return options.map(function (option, oIndex) {
  7791. return h('option', {
  7792. key: oIndex,
  7793. attrs: {
  7794. value: option[valueProp],
  7795. disabled: option[disabledProp]
  7796. },
  7797. domProps: {
  7798. /* eslint-disable eqeqeq */
  7799. selected: option[valueProp] == cellValue
  7800. }
  7801. }, option[labelProp]);
  7802. });
  7803. }
  7804. function nativeFilterRender(h, renderOpts, params) {
  7805. var column = params.column;
  7806. var name = renderOpts.name;
  7807. var attrs = getNativeAttrs(renderOpts);
  7808. return column.filters.map(function (option, oIndex) {
  7809. return h(name, {
  7810. key: oIndex,
  7811. class: "vxe-default-".concat(name),
  7812. attrs: attrs,
  7813. domProps: {
  7814. value: option.data
  7815. },
  7816. on: getNativeFilterOns(renderOpts, params, option)
  7817. });
  7818. });
  7819. }
  7820. function defaultFilterRender(h, renderOpts, params) {
  7821. var column = params.column;
  7822. return column.filters.map(function (option, oIndex) {
  7823. var optionValue = option.data;
  7824. return h(getDefaultComponentName(renderOpts), {
  7825. key: oIndex,
  7826. props: getFilterProps(renderOpts, renderOpts, optionValue),
  7827. on: getFilterOns(renderOpts, params, option)
  7828. });
  7829. });
  7830. }
  7831. function handleFilterMethod(_ref4) {
  7832. var option = _ref4.option,
  7833. row = _ref4.row,
  7834. column = _ref4.column;
  7835. var data = option.data;
  7836. var cellValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, column.property);
  7837. /* eslint-disable eqeqeq */
  7838. return cellValue == data;
  7839. }
  7840. function nativeSelectEditRender(h, renderOpts, params) {
  7841. return [h('select', {
  7842. class: 'vxe-default-select',
  7843. attrs: getNativeAttrs(renderOpts),
  7844. on: getNativeEditOns(renderOpts, params)
  7845. }, renderOpts.optionGroups ? renderNativeOptgroups(h, renderOpts, params, renderNativeOptions) : renderNativeOptions(h, renderOpts.options, renderOpts, params))];
  7846. }
  7847. function defaultSelectEditRender(h, renderOpts, params) {
  7848. var row = params.row,
  7849. column = params.column;
  7850. var options = renderOpts.options,
  7851. optionProps = renderOpts.optionProps,
  7852. optionGroups = renderOpts.optionGroups,
  7853. optionGroupProps = renderOpts.optionGroupProps;
  7854. var cellValue = UtilTools.getCellValue(row, column);
  7855. return [h(getDefaultComponentName(renderOpts), {
  7856. props: getCellEditProps(renderOpts, params, cellValue, {
  7857. options: options,
  7858. optionProps: optionProps,
  7859. optionGroups: optionGroups,
  7860. optionGroupProps: optionGroupProps
  7861. }),
  7862. on: getEditOns(renderOpts, params)
  7863. })];
  7864. }
  7865. function getSelectCellValue(renderOpts, _ref5) {
  7866. var row = _ref5.row,
  7867. column = _ref5.column;
  7868. var _renderOpts$props = renderOpts.props,
  7869. props = _renderOpts$props === void 0 ? {} : _renderOpts$props,
  7870. options = renderOpts.options,
  7871. optionGroups = renderOpts.optionGroups,
  7872. _renderOpts$optionPro2 = renderOpts.optionProps,
  7873. optionProps = _renderOpts$optionPro2 === void 0 ? {} : _renderOpts$optionPro2,
  7874. _renderOpts$optionGro2 = renderOpts.optionGroupProps,
  7875. optionGroupProps = _renderOpts$optionGro2 === void 0 ? {} : _renderOpts$optionGro2;
  7876. var cellValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, column.property);
  7877. var selectItem;
  7878. var labelProp = optionProps.label || 'label';
  7879. var valueProp = optionProps.value || 'value';
  7880. if (!isEmptyValue(cellValue)) {
  7881. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.map(props.multiple ? cellValue : [cellValue], optionGroups ? function (value) {
  7882. var groupOptions = optionGroupProps.options || 'options';
  7883. for (var index = 0; index < optionGroups.length; index++) {
  7884. /* eslint-disable eqeqeq */
  7885. selectItem = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.find(optionGroups[index][groupOptions], function (item) {
  7886. return item[valueProp] == value;
  7887. });
  7888. if (selectItem) {
  7889. break;
  7890. }
  7891. }
  7892. return selectItem ? selectItem[labelProp] : value;
  7893. } : function (value) {
  7894. /* eslint-disable eqeqeq */
  7895. selectItem = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.find(options, function (item) {
  7896. return item[valueProp] == value;
  7897. });
  7898. return selectItem ? selectItem[labelProp] : value;
  7899. }).join(', ');
  7900. }
  7901. return null;
  7902. }
  7903. /**
  7904. * 渲染表单-项
  7905. * 用于渲染原生的标签
  7906. */
  7907. function nativeItemRender(h, renderOpts, params) {
  7908. var data = params.data,
  7909. property = params.property;
  7910. var name = renderOpts.name;
  7911. var attrs = getNativeAttrs(renderOpts);
  7912. var itemValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(data, property);
  7913. return [h(name, {
  7914. class: "vxe-default-".concat(name),
  7915. attrs: attrs,
  7916. domProps: attrs && name === 'input' && (attrs.type === 'submit' || attrs.type === 'reset') ? null : {
  7917. value: itemValue
  7918. },
  7919. on: getNativeItemOns(renderOpts, params)
  7920. })];
  7921. }
  7922. function defaultItemRender(h, renderOpts, params) {
  7923. var data = params.data,
  7924. property = params.property;
  7925. var itemValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(data, property);
  7926. return [h(getDefaultComponentName(renderOpts), {
  7927. props: getItemProps(renderOpts, params, itemValue),
  7928. on: getItemOns(renderOpts, params),
  7929. nativeOn: getNativeOns(renderOpts, params)
  7930. })];
  7931. }
  7932. function defaultButtonItemRender(h, renderOpts, params) {
  7933. return [h('vxe-button', {
  7934. props: getItemProps(renderOpts, params),
  7935. on: getOns(renderOpts, params),
  7936. nativeOn: getNativeOns(renderOpts, params)
  7937. })];
  7938. }
  7939. function defaultButtonsItemRender(h, renderOpts, params) {
  7940. return renderOpts.children.map(function (childRenderOpts) {
  7941. return defaultButtonItemRender(h, childRenderOpts, params)[0];
  7942. });
  7943. }
  7944. /**
  7945. * 渲染原生的 select 标签
  7946. */
  7947. function renderNativeFormOptions(h, options, renderOpts, params) {
  7948. var data = params.data,
  7949. property = params.property;
  7950. var _renderOpts$optionPro3 = renderOpts.optionProps,
  7951. optionProps = _renderOpts$optionPro3 === void 0 ? {} : _renderOpts$optionPro3;
  7952. var labelProp = optionProps.label || 'label';
  7953. var valueProp = optionProps.value || 'value';
  7954. var disabledProp = optionProps.disabled || 'disabled';
  7955. var cellValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(data, property);
  7956. return options.map(function (item, oIndex) {
  7957. return h('option', {
  7958. key: oIndex,
  7959. attrs: {
  7960. value: item[valueProp],
  7961. disabled: item[disabledProp]
  7962. },
  7963. domProps: {
  7964. /* eslint-disable eqeqeq */
  7965. selected: item[valueProp] == cellValue
  7966. }
  7967. }, item[labelProp]);
  7968. });
  7969. }
  7970. function handleExportSelectMethod(params) {
  7971. var row = params.row,
  7972. column = params.column,
  7973. options = params.options;
  7974. return options.original ? UtilTools.getCellValue(row, column) : getSelectCellValue(column.editRender || column.cellRender, params);
  7975. }
  7976. /**
  7977. * 渲染表单-项中
  7978. * 单选框和复选框
  7979. */
  7980. function defaultFormItemRadioAndCheckboxRender(h, renderOpts, params) {
  7981. var options = renderOpts.options,
  7982. _renderOpts$optionPro4 = renderOpts.optionProps,
  7983. optionProps = _renderOpts$optionPro4 === void 0 ? {} : _renderOpts$optionPro4;
  7984. var data = params.data,
  7985. property = params.property;
  7986. var labelProp = optionProps.label || 'label';
  7987. var valueProp = optionProps.value || 'value';
  7988. var disabledProp = optionProps.disabled || 'disabled';
  7989. var itemValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(data, property);
  7990. var name = getDefaultComponentName(renderOpts);
  7991. return [h("".concat(name, "-group"), {
  7992. props: getItemProps(renderOpts, params, itemValue),
  7993. on: getItemOns(renderOpts, params),
  7994. nativeOn: getNativeOns(renderOpts, params)
  7995. }, options.map(function (item, index) {
  7996. return h(name, {
  7997. key: index,
  7998. props: {
  7999. label: item[valueProp],
  8000. content: item[labelProp],
  8001. disabled: item[disabledProp]
  8002. }
  8003. });
  8004. }))];
  8005. }
  8006. /**
  8007. * 内置的组件渲染
  8008. */
  8009. var renderMap = {
  8010. input: {
  8011. autofocus: 'input',
  8012. renderEdit: nativeEditRender,
  8013. renderDefault: nativeEditRender,
  8014. renderFilter: nativeFilterRender,
  8015. filterMethod: handleFilterMethod,
  8016. renderItemContent: nativeItemRender
  8017. },
  8018. textarea: {
  8019. autofocus: 'textarea',
  8020. renderEdit: nativeEditRender,
  8021. renderItemContent: nativeItemRender
  8022. },
  8023. select: {
  8024. renderEdit: nativeSelectEditRender,
  8025. renderDefault: nativeSelectEditRender,
  8026. renderCell: function renderCell(h, renderOpts, params) {
  8027. return getCellLabelVNs(h, renderOpts, params, getSelectCellValue(renderOpts, params));
  8028. },
  8029. renderFilter: function renderFilter(h, renderOpts, params) {
  8030. var column = params.column;
  8031. return column.filters.map(function (option, oIndex) {
  8032. return h('select', {
  8033. key: oIndex,
  8034. class: 'vxe-default-select',
  8035. attrs: getNativeAttrs(renderOpts),
  8036. on: getNativeFilterOns(renderOpts, params, option)
  8037. }, renderOpts.optionGroups ? renderNativeOptgroups(h, renderOpts, params, renderNativeOptions) : renderNativeOptions(h, renderOpts.options, renderOpts, params));
  8038. });
  8039. },
  8040. filterMethod: handleFilterMethod,
  8041. renderItemContent: function renderItemContent(h, renderOpts, params) {
  8042. return [h('select', {
  8043. class: 'vxe-default-select',
  8044. attrs: getNativeAttrs(renderOpts),
  8045. on: getNativeItemOns(renderOpts, params)
  8046. }, renderOpts.optionGroups ? renderNativeOptgroups(h, renderOpts, params, renderNativeFormOptions) : renderNativeFormOptions(h, renderOpts.options, renderOpts, params))];
  8047. },
  8048. cellExportMethod: handleExportSelectMethod
  8049. },
  8050. $input: {
  8051. autofocus: '.vxe-input--inner',
  8052. renderEdit: defaultEditRender,
  8053. renderCell: function renderCell(h, renderOpts, params) {
  8054. var _renderOpts$props2 = renderOpts.props,
  8055. props = _renderOpts$props2 === void 0 ? {} : _renderOpts$props2;
  8056. var row = params.row,
  8057. column = params.column;
  8058. var digits = props.digits || conf.input.digits;
  8059. var cellValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, column.property);
  8060. if (cellValue) {
  8061. switch (props.type) {
  8062. case 'date':
  8063. case 'week':
  8064. case 'month':
  8065. case 'year':
  8066. cellValue = getLabelFormatDate(cellValue, props);
  8067. break;
  8068. case 'float':
  8069. cellValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toFixed(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.floor(cellValue, digits), digits);
  8070. break;
  8071. }
  8072. }
  8073. return getCellLabelVNs(h, renderOpts, params, cellValue);
  8074. },
  8075. renderDefault: defaultEditRender,
  8076. renderFilter: defaultFilterRender,
  8077. filterMethod: handleFilterMethod,
  8078. renderItemContent: defaultItemRender
  8079. },
  8080. $textarea: {
  8081. autofocus: '.vxe-textarea--inner',
  8082. renderItemContent: defaultItemRender
  8083. },
  8084. $button: {
  8085. renderDefault: defaultButtonEditRender,
  8086. renderItemContent: defaultButtonItemRender
  8087. },
  8088. $buttons: {
  8089. renderDefault: defaultButtonsEditRender,
  8090. renderItemContent: defaultButtonsItemRender
  8091. },
  8092. $select: {
  8093. autofocus: '.vxe-input--inner',
  8094. renderEdit: defaultSelectEditRender,
  8095. renderDefault: defaultSelectEditRender,
  8096. renderCell: function renderCell(h, renderOpts, params) {
  8097. return getCellLabelVNs(h, renderOpts, params, getSelectCellValue(renderOpts, params));
  8098. },
  8099. renderFilter: function renderFilter(h, renderOpts, params) {
  8100. var column = params.column;
  8101. var options = renderOpts.options,
  8102. optionProps = renderOpts.optionProps,
  8103. optionGroups = renderOpts.optionGroups,
  8104. optionGroupProps = renderOpts.optionGroupProps;
  8105. var nativeOn = getNativeOns(renderOpts, params);
  8106. return column.filters.map(function (option, oIndex) {
  8107. var optionValue = option.data;
  8108. return h(getDefaultComponentName(renderOpts), {
  8109. key: oIndex,
  8110. props: getFilterProps(renderOpts, params, optionValue, {
  8111. options: options,
  8112. optionProps: optionProps,
  8113. optionGroups: optionGroups,
  8114. optionGroupProps: optionGroupProps
  8115. }),
  8116. on: getFilterOns(renderOpts, params, option),
  8117. nativeOn: nativeOn
  8118. });
  8119. });
  8120. },
  8121. filterMethod: handleFilterMethod,
  8122. renderItemContent: function renderItemContent(h, renderOpts, params) {
  8123. var data = params.data,
  8124. property = params.property;
  8125. var options = renderOpts.options,
  8126. optionProps = renderOpts.optionProps,
  8127. optionGroups = renderOpts.optionGroups,
  8128. optionGroupProps = renderOpts.optionGroupProps;
  8129. var itemValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(data, property);
  8130. return [h(getDefaultComponentName(renderOpts), {
  8131. props: getItemProps(renderOpts, params, itemValue, {
  8132. options: options,
  8133. optionProps: optionProps,
  8134. optionGroups: optionGroups,
  8135. optionGroupProps: optionGroupProps
  8136. }),
  8137. on: getItemOns(renderOpts, params),
  8138. nativeOn: getNativeOns(renderOpts, params)
  8139. })];
  8140. },
  8141. cellExportMethod: handleExportSelectMethod
  8142. },
  8143. $radio: {
  8144. autofocus: '.vxe-radio--input',
  8145. renderItemContent: defaultFormItemRadioAndCheckboxRender
  8146. },
  8147. $checkbox: {
  8148. autofocus: '.vxe-checkbox--input',
  8149. renderItemContent: defaultFormItemRadioAndCheckboxRender
  8150. },
  8151. $switch: {
  8152. autofocus: '.vxe-switch--button',
  8153. renderEdit: defaultEditRender,
  8154. renderDefault: defaultEditRender,
  8155. renderItemContent: defaultItemRender
  8156. }
  8157. };
  8158. /**
  8159. * 全局渲染器
  8160. */
  8161. var renderer = {
  8162. mixin: function mixin(map) {
  8163. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.each(map, function (options, name) {
  8164. return renderer.add(name, options);
  8165. });
  8166. return renderer;
  8167. },
  8168. get: function get(name) {
  8169. return renderMap[name] || null;
  8170. },
  8171. add: function add(name, options) {
  8172. if (name && options) {
  8173. var renders = renderMap[name];
  8174. if (renders) {
  8175. // 检测是否覆盖
  8176. if (false) {}
  8177. Object.assign(renders, options);
  8178. } else {
  8179. renderMap[name] = options;
  8180. }
  8181. }
  8182. return renderer;
  8183. },
  8184. delete: function _delete(name) {
  8185. delete renderMap[name];
  8186. return renderer;
  8187. }
  8188. };
  8189. // CONCATENATED MODULE: ./packages/v-x-e-table/src/commands.js
  8190. var commands = new store();
  8191. if (false) {}
  8192. // CONCATENATED MODULE: ./packages/v-x-e-table/src/menus.js
  8193. var menus = new store();
  8194. if (false) {}
  8195. // CONCATENATED MODULE: ./packages/v-x-e-table/src/setup.js
  8196. /**
  8197. * 全局参数设置
  8198. */
  8199. function setup(options) {
  8200. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.merge(conf, options);
  8201. }
  8202. // CONCATENATED MODULE: ./packages/v-x-e-table/index.js
  8203. var installedPlugins = [];
  8204. function use(Plugin, options) {
  8205. /* eslint-disable @typescript-eslint/no-use-before-define */
  8206. if (Plugin && Plugin.install) {
  8207. if (installedPlugins.indexOf(Plugin) === -1) {
  8208. Plugin.install(VXETable, options);
  8209. installedPlugins.push(Plugin);
  8210. }
  8211. }
  8212. return VXETable;
  8213. }
  8214. /**
  8215. * 检测模块的安装顺序是否正确
  8216. */
  8217. function reg(key) {
  8218. /* eslint-disable @typescript-eslint/no-use-before-define */
  8219. // 检测安装顺序是否正确
  8220. if (false) {}
  8221. VXETable["_".concat(key)] = 1;
  8222. }
  8223. function getExportOrImpotType(types, flag) {
  8224. var rest = [];
  8225. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.objectEach(types, function (val, type) {
  8226. if (val === 0 || val === flag) {
  8227. rest.push(type);
  8228. }
  8229. });
  8230. return rest;
  8231. }
  8232. var v_x_e_table_VXETableConfig = /*#__PURE__*/function () {
  8233. function VXETableConfig() {
  8234. _classCallCheck(this, VXETableConfig);
  8235. }
  8236. _createClass(VXETableConfig, [{
  8237. key: "zIndex",
  8238. get:
  8239. /**
  8240. * 获取当前的 zIndex
  8241. */
  8242. function get() {
  8243. return UtilTools.getLastZIndex();
  8244. }
  8245. /**
  8246. * 获取下一个 zIndex
  8247. */
  8248. }, {
  8249. key: "nextZIndex",
  8250. get: function get() {
  8251. return UtilTools.nextZIndex();
  8252. }
  8253. /**
  8254. * 获取所有导出类型
  8255. */
  8256. }, {
  8257. key: "exportTypes",
  8258. get: function get() {
  8259. return getExportOrImpotType(conf.export.types, 1);
  8260. }
  8261. /**
  8262. * 获取所有导入类型
  8263. */
  8264. }, {
  8265. key: "importTypes",
  8266. get: function get() {
  8267. return getExportOrImpotType(conf.export.types, 2);
  8268. }
  8269. }]);
  8270. return VXETableConfig;
  8271. }();
  8272. var v_x_e_table_config = new v_x_e_table_VXETableConfig();
  8273. function t(key, args) {
  8274. return conf.i18n(key, args);
  8275. }
  8276. function _t(key, args) {
  8277. return key ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toValueString(conf.translate ? conf.translate(key, args) : key) : '';
  8278. }
  8279. var v = 'v3';
  8280. var VXETable = {
  8281. v: v,
  8282. reg: reg,
  8283. use: use,
  8284. setup: setup,
  8285. interceptor: interceptor,
  8286. renderer: renderer,
  8287. commands: commands,
  8288. formats: formats,
  8289. menus: menus,
  8290. config: v_x_e_table_config,
  8291. t: t,
  8292. _t: _t
  8293. };
  8294. /* harmony default export */ var v_x_e_table = (VXETable);
  8295. // CONCATENATED MODULE: ./packages/icon/index.js
  8296. var Icon = {
  8297. /* eslint-disable @typescript-eslint/no-empty-function */
  8298. install: function install() {}
  8299. };
  8300. /* harmony default export */ var packages_icon = (Icon);
  8301. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.number.constructor.js
  8302. var es_number_constructor = __webpack_require__("a9e3");
  8303. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.map.js
  8304. var es_map = __webpack_require__("4ec9");
  8305. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.filter.js
  8306. var es_array_filter = __webpack_require__("4de4");
  8307. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.includes.js
  8308. var es_array_includes = __webpack_require__("caad");
  8309. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.includes.js
  8310. var es_string_includes = __webpack_require__("2532");
  8311. // CONCATENATED MODULE: ./packages/table/src/util.js
  8312. var lineOffsetSizes = {
  8313. mini: 3,
  8314. small: 2,
  8315. medium: 1
  8316. };
  8317. function getPaddingLeftRightSize(elem) {
  8318. if (elem) {
  8319. var computedStyle = getComputedStyle(elem);
  8320. var paddingLeft = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(computedStyle.paddingLeft);
  8321. var paddingRight = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(computedStyle.paddingRight);
  8322. return paddingLeft + paddingRight;
  8323. }
  8324. return 0;
  8325. }
  8326. function getElemenMarginWidth(elem) {
  8327. if (elem) {
  8328. var computedStyle = getComputedStyle(elem);
  8329. var marginLeft = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(computedStyle.marginLeft);
  8330. var marginRight = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(computedStyle.marginRight);
  8331. return elem.offsetWidth + marginLeft + marginRight;
  8332. }
  8333. return 0;
  8334. }
  8335. function handleFieldOrColumn(_vm, fieldOrColumn) {
  8336. if (fieldOrColumn) {
  8337. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isString(fieldOrColumn) ? _vm.getColumnByField(fieldOrColumn) : fieldOrColumn;
  8338. }
  8339. return null;
  8340. }
  8341. function queryCellElement(cell, selector) {
  8342. return cell.querySelector('.vxe-cell' + selector);
  8343. }
  8344. function getColMinWidth(params) {
  8345. var $table = params.$table,
  8346. column = params.column,
  8347. cell = params.cell;
  8348. var allColumnHeaderOverflow = $table.showHeaderOverflow,
  8349. resizableOpts = $table.resizableOpts;
  8350. var minWidth = resizableOpts.minWidth;
  8351. if (minWidth) {
  8352. var customMinWidth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(minWidth) ? minWidth(params) : minWidth;
  8353. if (customMinWidth !== 'auto') {
  8354. return Math.max(1, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(customMinWidth));
  8355. }
  8356. }
  8357. var showHeaderOverflow = column.showHeaderOverflow;
  8358. var headOverflow = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isUndefined(showHeaderOverflow) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow;
  8359. var showEllipsis = headOverflow === 'ellipsis';
  8360. var showTitle = headOverflow === 'title';
  8361. var showTooltip = headOverflow === true || headOverflow === 'tooltip';
  8362. var hasEllipsis = showTitle || showTooltip || showEllipsis;
  8363. var minTitleWidth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.floor((external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(getComputedStyle(cell).fontSize) || 14) * 1.6);
  8364. var paddingLeftRight = getPaddingLeftRightSize(cell) + getPaddingLeftRightSize(queryCellElement(cell, ''));
  8365. var colMinWidth = minTitleWidth + paddingLeftRight;
  8366. if (hasEllipsis) {
  8367. var checkboxIconWidth = getPaddingLeftRightSize(queryCellElement(cell, '--title>.vxe-cell--checkbox'));
  8368. var requiredIconWidth = getElemenMarginWidth(queryCellElement(cell, '>.vxe-cell--required-icon'));
  8369. var editIconWidth = getElemenMarginWidth(queryCellElement(cell, '>.vxe-cell--edit-icon'));
  8370. var helpIconWidth = getElemenMarginWidth(queryCellElement(cell, '>.vxe-cell-help-icon'));
  8371. var sortIconWidth = getElemenMarginWidth(queryCellElement(cell, '>.vxe-cell--sort'));
  8372. var filterIconWidth = getElemenMarginWidth(queryCellElement(cell, '>.vxe-cell--filter'));
  8373. colMinWidth += checkboxIconWidth + requiredIconWidth + editIconWidth + helpIconWidth + filterIconWidth + sortIconWidth;
  8374. }
  8375. return colMinWidth;
  8376. }
  8377. function countTreeExpand(prevRow, params) {
  8378. var $table = params.$table;
  8379. var rowChildren = prevRow[$table.treeOpts.children];
  8380. var count = 1;
  8381. if ($table.isTreeExpandByRow(prevRow)) {
  8382. for (var index = 0; index < rowChildren.length; index++) {
  8383. count += countTreeExpand(rowChildren[index], params);
  8384. }
  8385. }
  8386. return count;
  8387. }
  8388. function getOffsetSize($xetable) {
  8389. return lineOffsetSizes[$xetable.vSize] || 0;
  8390. }
  8391. function calcTreeLine(params, items) {
  8392. var $table = params.$table,
  8393. $rowIndex = params.$rowIndex;
  8394. var expandSize = 1;
  8395. if ($rowIndex) {
  8396. expandSize = countTreeExpand(items[$rowIndex - 1], params);
  8397. }
  8398. return $table.rowHeight * expandSize - ($rowIndex ? 1 : 12 - getOffsetSize($table));
  8399. }
  8400. function mergeBodyMethod(mergeList, _rowIndex, _columnIndex) {
  8401. for (var mIndex = 0; mIndex < mergeList.length; mIndex++) {
  8402. var _mergeList$mIndex = mergeList[mIndex],
  8403. mergeRowIndex = _mergeList$mIndex.row,
  8404. mergeColIndex = _mergeList$mIndex.col,
  8405. mergeRowspan = _mergeList$mIndex.rowspan,
  8406. mergeColspan = _mergeList$mIndex.colspan;
  8407. if (mergeColIndex > -1 && mergeRowIndex > -1 && mergeRowspan && mergeColspan) {
  8408. if (mergeRowIndex === _rowIndex && mergeColIndex === _columnIndex) {
  8409. return {
  8410. rowspan: mergeRowspan,
  8411. colspan: mergeColspan
  8412. };
  8413. }
  8414. if (_rowIndex >= mergeRowIndex && _rowIndex < mergeRowIndex + mergeRowspan && _columnIndex >= mergeColIndex && _columnIndex < mergeColIndex + mergeColspan) {
  8415. return {
  8416. rowspan: 0,
  8417. colspan: 0
  8418. };
  8419. }
  8420. }
  8421. }
  8422. }
  8423. function clearTableDefaultStatus(_vm) {
  8424. _vm.initStatus = false;
  8425. _vm.clearSort();
  8426. _vm.clearCurrentRow();
  8427. _vm.clearCurrentColumn();
  8428. _vm.clearRadioRow();
  8429. _vm.clearRadioReserve();
  8430. _vm.clearCheckboxRow();
  8431. _vm.clearCheckboxReserve();
  8432. _vm.clearRowExpand();
  8433. _vm.clearTreeExpand();
  8434. _vm.clearTreeExpandReserve();
  8435. if (_vm.clearActived && v_x_e_table._edit) {
  8436. _vm.clearActived();
  8437. }
  8438. if (_vm.clearSelected && (_vm.keyboardConfig || _vm.mouseConfig)) {
  8439. _vm.clearSelected();
  8440. }
  8441. if (_vm.clearCellAreas && _vm.mouseConfig) {
  8442. _vm.clearCellAreas();
  8443. _vm.clearCopyCellArea();
  8444. }
  8445. return _vm.clearScroll();
  8446. }
  8447. function clearTableAllStatus(_vm) {
  8448. if (_vm.clearFilter && v_x_e_table._filter) {
  8449. _vm.clearFilter();
  8450. }
  8451. return clearTableDefaultStatus(_vm);
  8452. }
  8453. // CONCATENATED MODULE: ./packages/table/src/body.js
  8454. var cellType = 'body'; // 滚动、拖动过程中不需要触发
  8455. function isOperateMouse($xetable) {
  8456. return $xetable._isResize || $xetable.lastScrollTime && Date.now() < $xetable.lastScrollTime + $xetable.delayHover;
  8457. }
  8458. function renderLine(h, _vm, $xetable, rowLevel, items, params) {
  8459. var column = params.column;
  8460. var treeOpts = $xetable.treeOpts,
  8461. treeConfig = $xetable.treeConfig;
  8462. var slots = column.slots,
  8463. treeNode = column.treeNode;
  8464. if (slots && slots.line) {
  8465. return $xetable.callSlot(slots.line, params, h);
  8466. }
  8467. if (treeConfig && treeNode && treeOpts.line) {
  8468. return [h('div', {
  8469. class: 'vxe-tree--line-wrapper'
  8470. }, [h('div', {
  8471. class: 'vxe-tree--line',
  8472. style: {
  8473. height: "".concat(calcTreeLine(params, items), "px"),
  8474. left: "".concat(rowLevel * treeOpts.indent + (rowLevel ? 2 - getOffsetSize($xetable) : 0) + 16, "px")
  8475. }
  8476. })])];
  8477. }
  8478. return [];
  8479. }
  8480. /**
  8481. * 渲染列
  8482. */
  8483. function renderColumn(h, _vm, $xetable, $seq, seq, rowid, fixedType, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, columns, items) {
  8484. var _ref2;
  8485. var tableListeners = $xetable.$listeners,
  8486. afterFullData = $xetable.afterFullData,
  8487. tableData = $xetable.tableData,
  8488. height = $xetable.height,
  8489. columnKey = $xetable.columnKey,
  8490. overflowX = $xetable.overflowX,
  8491. scrollXLoad = $xetable.scrollXLoad,
  8492. scrollYLoad = $xetable.scrollYLoad,
  8493. highlightCurrentRow = $xetable.highlightCurrentRow,
  8494. allColumnOverflow = $xetable.showOverflow,
  8495. isAllOverflow = $xetable.isAllOverflow,
  8496. allAlign = $xetable.align,
  8497. currentColumn = $xetable.currentColumn,
  8498. cellClassName = $xetable.cellClassName,
  8499. cellStyle = $xetable.cellStyle,
  8500. mergeList = $xetable.mergeList,
  8501. spanMethod = $xetable.spanMethod,
  8502. radioOpts = $xetable.radioOpts,
  8503. checkboxOpts = $xetable.checkboxOpts,
  8504. expandOpts = $xetable.expandOpts,
  8505. treeOpts = $xetable.treeOpts,
  8506. tooltipOpts = $xetable.tooltipOpts,
  8507. mouseConfig = $xetable.mouseConfig,
  8508. editConfig = $xetable.editConfig,
  8509. editOpts = $xetable.editOpts,
  8510. editRules = $xetable.editRules,
  8511. validOpts = $xetable.validOpts,
  8512. editStore = $xetable.editStore,
  8513. validStore = $xetable.validStore,
  8514. tooltipConfig = $xetable.tooltipConfig;
  8515. var type = column.type,
  8516. cellRender = column.cellRender,
  8517. editRender = column.editRender,
  8518. align = column.align,
  8519. showOverflow = column.showOverflow,
  8520. className = column.className,
  8521. treeNode = column.treeNode;
  8522. var actived = editStore.actived;
  8523. var showAllTip = tooltipOpts.showAll || tooltipOpts.enabled;
  8524. var columnIndex = $xetable.getColumnIndex(column);
  8525. var _columnIndex = $xetable.getVTColumnIndex(column);
  8526. var isEdit = isEnableConf(editRender);
  8527. var fixedHiddenColumn = fixedType ? column.fixed !== fixedType : column.fixed && overflowX;
  8528. var cellOverflow = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isUndefined(showOverflow) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNull(showOverflow) ? allColumnOverflow : showOverflow;
  8529. var showEllipsis = cellOverflow === 'ellipsis';
  8530. var showTitle = cellOverflow === 'title';
  8531. var showTooltip = cellOverflow === true || cellOverflow === 'tooltip';
  8532. var hasEllipsis = showTitle || showTooltip || showEllipsis;
  8533. var isDirty;
  8534. var tdOns = {};
  8535. var cellAlign = align || allAlign;
  8536. var hasValidError = validStore.row === row && validStore.column === column;
  8537. var showValidTip = editRules && validOpts.showMessage && (validOpts.message === 'default' ? height || tableData.length > 1 : validOpts.message === 'inline');
  8538. var attrs = {
  8539. colid: column.id
  8540. };
  8541. var bindMouseenter = tableListeners['cell-mouseenter'];
  8542. var bindMouseleave = tableListeners['cell-mouseleave'];
  8543. var triggerDblclick = editRender && editConfig && editOpts.trigger === 'dblclick';
  8544. var params = {
  8545. $table: $xetable,
  8546. $seq: $seq,
  8547. seq: seq,
  8548. rowid: rowid,
  8549. row: row,
  8550. rowIndex: rowIndex,
  8551. $rowIndex: $rowIndex,
  8552. _rowIndex: _rowIndex,
  8553. column: column,
  8554. columnIndex: columnIndex,
  8555. $columnIndex: $columnIndex,
  8556. _columnIndex: _columnIndex,
  8557. fixed: fixedType,
  8558. type: cellType,
  8559. isHidden: fixedHiddenColumn,
  8560. level: rowLevel,
  8561. visibleData: afterFullData,
  8562. data: tableData,
  8563. items: items
  8564. }; // 虚拟滚动不支持动态高度
  8565. if ((scrollXLoad || scrollYLoad) && !hasEllipsis) {
  8566. showEllipsis = hasEllipsis = true;
  8567. } // hover 进入事件
  8568. if (showTitle || showTooltip || showAllTip || bindMouseenter || tooltipConfig) {
  8569. tdOns.mouseenter = function (evnt) {
  8570. if (isOperateMouse($xetable)) {
  8571. return;
  8572. }
  8573. if (showTitle) {
  8574. DomTools.updateCellTitle(evnt.currentTarget, column);
  8575. } else if (showTooltip || showAllTip) {
  8576. // 如果配置了显示 tooltip
  8577. $xetable.triggerBodyTooltipEvent(evnt, params);
  8578. }
  8579. if (bindMouseenter) {
  8580. $xetable.emitEvent('cell-mouseenter', Object.assign({
  8581. cell: evnt.currentTarget
  8582. }, params), evnt);
  8583. }
  8584. };
  8585. } // hover 退出事件
  8586. if (showTooltip || showAllTip || bindMouseleave || tooltipConfig) {
  8587. tdOns.mouseleave = function (evnt) {
  8588. if (isOperateMouse($xetable)) {
  8589. return;
  8590. }
  8591. if (showTooltip || showAllTip) {
  8592. $xetable.handleTargetLeaveEvent(evnt);
  8593. }
  8594. if (bindMouseleave) {
  8595. $xetable.emitEvent('cell-mouseleave', Object.assign({
  8596. cell: evnt.currentTarget
  8597. }, params), evnt);
  8598. }
  8599. };
  8600. } // 按下事件处理
  8601. if (checkboxOpts.range || mouseConfig) {
  8602. tdOns.mousedown = function (evnt) {
  8603. $xetable.triggerCellMousedownEvent(evnt, params);
  8604. };
  8605. } // 点击事件处理
  8606. if (highlightCurrentRow || tableListeners['cell-click'] || editRender && editConfig || expandOpts.trigger === 'row' || expandOpts.trigger === 'cell' || radioOpts.trigger === 'row' || column.type === 'radio' && radioOpts.trigger === 'cell' || checkboxOpts.trigger === 'row' || column.type === 'checkbox' && checkboxOpts.trigger === 'cell' || treeOpts.trigger === 'row' || column.treeNode && treeOpts.trigger === 'cell') {
  8607. tdOns.click = function (evnt) {
  8608. $xetable.triggerCellClickEvent(evnt, params);
  8609. };
  8610. } // 双击事件处理
  8611. if (triggerDblclick || tableListeners['cell-dblclick']) {
  8612. tdOns.dblclick = function (evnt) {
  8613. $xetable.triggerCellDBLClickEvent(evnt, params);
  8614. };
  8615. } // 合并行或列
  8616. if (mergeList.length) {
  8617. var spanRest = mergeBodyMethod(mergeList, _rowIndex, _columnIndex);
  8618. if (spanRest) {
  8619. var rowspan = spanRest.rowspan,
  8620. colspan = spanRest.colspan;
  8621. if (!rowspan || !colspan) {
  8622. return null;
  8623. }
  8624. if (rowspan > 1) {
  8625. attrs.rowspan = rowspan;
  8626. }
  8627. if (colspan > 1) {
  8628. attrs.colspan = colspan;
  8629. }
  8630. }
  8631. } else if (spanMethod) {
  8632. // 自定义合并行或列的方法
  8633. var _ref = spanMethod(params) || {},
  8634. _ref$rowspan = _ref.rowspan,
  8635. _rowspan = _ref$rowspan === void 0 ? 1 : _ref$rowspan,
  8636. _ref$colspan = _ref.colspan,
  8637. _colspan = _ref$colspan === void 0 ? 1 : _ref$colspan;
  8638. if (!_rowspan || !_colspan) {
  8639. return null;
  8640. }
  8641. if (_rowspan > 1) {
  8642. attrs.rowspan = _rowspan;
  8643. }
  8644. if (_colspan > 1) {
  8645. attrs.colspan = _colspan;
  8646. }
  8647. } // 如果被合并不可隐藏
  8648. if (fixedHiddenColumn && mergeList) {
  8649. if (attrs.colspan > 1 || attrs.rowspan > 1) {
  8650. fixedHiddenColumn = false;
  8651. }
  8652. } // 如果编辑列开启显示状态
  8653. if (!fixedHiddenColumn && editConfig && (editRender || cellRender) && (editOpts.showStatus || editOpts.showUpdateStatus)) {
  8654. isDirty = $xetable.isUpdateByRow(row, column.property);
  8655. }
  8656. var tdVNs = [];
  8657. if (fixedHiddenColumn && (allColumnOverflow ? isAllOverflow : allColumnOverflow)) {
  8658. tdVNs.push(h('div', {
  8659. class: ['vxe-cell', {
  8660. 'c--title': showTitle,
  8661. 'c--tooltip': showTooltip,
  8662. 'c--ellipsis': showEllipsis
  8663. }]
  8664. }));
  8665. } else {
  8666. // 渲染单元格
  8667. tdVNs.push.apply(tdVNs, _toConsumableArray(renderLine(h, _vm, $xetable, rowLevel, items, params)).concat([h('div', {
  8668. class: ['vxe-cell', {
  8669. 'c--title': showTitle,
  8670. 'c--tooltip': showTooltip,
  8671. 'c--ellipsis': showEllipsis
  8672. }],
  8673. attrs: {
  8674. title: showTitle ? $xetable.getCellLabel(row, column) : null
  8675. }
  8676. }, column.renderCell(h, params))]));
  8677. if (showValidTip && hasValidError) {
  8678. tdVNs.push(h('div', {
  8679. class: 'vxe-cell--valid',
  8680. style: validStore.rule && validStore.rule.maxWidth ? {
  8681. width: "".concat(validStore.rule.maxWidth, "px")
  8682. } : null
  8683. }, [h('span', {
  8684. class: 'vxe-cell--valid-msg'
  8685. }, validStore.content)]));
  8686. }
  8687. }
  8688. return h('td', {
  8689. 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)],
  8690. key: columnKey ? column.id : $columnIndex,
  8691. attrs: attrs,
  8692. style: cellStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(cellStyle) ? cellStyle(params) : cellStyle : null,
  8693. on: tdOns
  8694. }, tdVNs);
  8695. }
  8696. function renderRows(h, _vm, $xetable, $seq, rowLevel, fixedType, tableData, tableColumn) {
  8697. var stripe = $xetable.stripe,
  8698. rowKey = $xetable.rowKey,
  8699. highlightHoverRow = $xetable.highlightHoverRow,
  8700. rowClassName = $xetable.rowClassName,
  8701. rowStyle = $xetable.rowStyle,
  8702. editConfig = $xetable.editConfig,
  8703. allColumnOverflow = $xetable.showOverflow,
  8704. treeConfig = $xetable.treeConfig,
  8705. treeOpts = $xetable.treeOpts,
  8706. editOpts = $xetable.editOpts,
  8707. treeExpandeds = $xetable.treeExpandeds,
  8708. scrollYLoad = $xetable.scrollYLoad,
  8709. scrollYStore = $xetable.scrollYStore,
  8710. editStore = $xetable.editStore,
  8711. rowExpandeds = $xetable.rowExpandeds,
  8712. radioOpts = $xetable.radioOpts,
  8713. checkboxOpts = $xetable.checkboxOpts,
  8714. expandColumn = $xetable.expandColumn,
  8715. hasFixedColumn = $xetable.hasFixedColumn;
  8716. var rows = [];
  8717. tableData.forEach(function (row, $rowIndex) {
  8718. var trOn = {};
  8719. var rowIndex = $rowIndex;
  8720. var seq = rowIndex + 1;
  8721. if (scrollYLoad) {
  8722. seq += scrollYStore.startIndex;
  8723. }
  8724. var _rowIndex = $xetable.getVTRowIndex(row); // 确保任何情况下 rowIndex 都精准指向真实 data 索引
  8725. rowIndex = $xetable.getRowIndex(row); // 事件绑定
  8726. if (highlightHoverRow) {
  8727. trOn.mouseenter = function (evnt) {
  8728. if (isOperateMouse($xetable)) {
  8729. return;
  8730. }
  8731. $xetable.triggerHoverEvent(evnt, {
  8732. row: row,
  8733. rowIndex: rowIndex
  8734. });
  8735. };
  8736. trOn.mouseleave = function () {
  8737. if (isOperateMouse($xetable)) {
  8738. return;
  8739. }
  8740. $xetable.clearHoverRow();
  8741. };
  8742. }
  8743. var rowid = UtilTools.getRowid($xetable, row);
  8744. var params = {
  8745. $table: $xetable,
  8746. $seq: $seq,
  8747. seq: seq,
  8748. rowid: rowid,
  8749. fixed: fixedType,
  8750. type: cellType,
  8751. level: rowLevel,
  8752. row: row,
  8753. rowIndex: rowIndex,
  8754. $rowIndex: $rowIndex
  8755. };
  8756. var isNewRow = false;
  8757. if (editConfig) {
  8758. isNewRow = editStore.insertList.indexOf(row) > -1;
  8759. }
  8760. rows.push(h('tr', {
  8761. class: ['vxe-body--row', {
  8762. 'row--stripe': stripe && ($xetable.getVTRowIndex(row) + 1) % 2 === 0,
  8763. 'is--new': isNewRow,
  8764. 'row--new': isNewRow && (editOpts.showStatus || editOpts.showInsertStatus),
  8765. 'row--radio': radioOpts.highlight && $xetable.selectRow === row,
  8766. 'row--checked': checkboxOpts.highlight && $xetable.isCheckedByCheckboxRow(row)
  8767. }, rowClassName ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(rowClassName) ? rowClassName(params) : rowClassName : ''],
  8768. attrs: {
  8769. rowid: rowid
  8770. },
  8771. style: rowStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(rowStyle) ? rowStyle(params) : rowStyle : null,
  8772. key: rowKey || treeConfig ? rowid : $rowIndex,
  8773. on: trOn
  8774. }, tableColumn.map(function (column, $columnIndex) {
  8775. return renderColumn(h, _vm, $xetable, $seq, seq, rowid, fixedType, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, tableColumn, tableData);
  8776. }))); // 如果行被展开了
  8777. if (expandColumn && rowExpandeds.length && rowExpandeds.indexOf(row) > -1) {
  8778. var cellStyle;
  8779. if (treeConfig) {
  8780. cellStyle = {
  8781. paddingLeft: "".concat(rowLevel * treeOpts.indent + 30, "px")
  8782. };
  8783. }
  8784. var showOverflow = expandColumn.showOverflow;
  8785. var hasEllipsis = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isUndefined(showOverflow) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNull(showOverflow) ? allColumnOverflow : showOverflow;
  8786. var expandParams = {
  8787. $table: $xetable,
  8788. $seq: $seq,
  8789. seq: seq,
  8790. column: expandColumn,
  8791. fixed: fixedType,
  8792. type: cellType,
  8793. level: rowLevel,
  8794. row: row,
  8795. rowIndex: rowIndex,
  8796. $rowIndex: $rowIndex
  8797. };
  8798. rows.push(h('tr', {
  8799. class: 'vxe-body--expanded-row',
  8800. key: "expand_".concat(rowid),
  8801. style: rowStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(rowStyle) ? rowStyle(expandParams) : rowStyle : null,
  8802. on: trOn
  8803. }, [h('td', {
  8804. class: ['vxe-body--expanded-column', {
  8805. 'fixed--hidden': fixedType && !hasFixedColumn,
  8806. 'col--ellipsis': hasEllipsis
  8807. }],
  8808. attrs: {
  8809. colspan: tableColumn.length
  8810. }
  8811. }, [h('div', {
  8812. class: 'vxe-body--expanded-cell',
  8813. style: cellStyle
  8814. }, [expandColumn.renderData(h, expandParams)])])]));
  8815. } // 如果是树形表格
  8816. if (treeConfig && treeExpandeds.length) {
  8817. var rowChildren = row[treeOpts.children];
  8818. if (rowChildren && rowChildren.length && treeExpandeds.indexOf(row) > -1) {
  8819. rows.push.apply(rows, _toConsumableArray(renderRows(h, _vm, $xetable, $seq ? "".concat($seq, ".").concat(seq) : "".concat(seq), rowLevel + 1, fixedType, rowChildren, tableColumn)));
  8820. }
  8821. }
  8822. });
  8823. return rows;
  8824. }
  8825. /**
  8826. * 同步滚动条
  8827. */
  8828. var scrollProcessTimeout;
  8829. function syncBodyScroll(scrollTop, elem1, elem2) {
  8830. if (elem1 || elem2) {
  8831. if (elem1) {
  8832. elem1.onscroll = null;
  8833. elem1.scrollTop = scrollTop;
  8834. }
  8835. if (elem2) {
  8836. elem2.onscroll = null;
  8837. elem2.scrollTop = scrollTop;
  8838. }
  8839. clearTimeout(scrollProcessTimeout);
  8840. scrollProcessTimeout = setTimeout(function () {
  8841. if (elem1) {
  8842. elem1.onscroll = elem1._onscroll;
  8843. }
  8844. if (elem2) {
  8845. elem2.onscroll = elem2._onscroll;
  8846. }
  8847. }, 300);
  8848. }
  8849. }
  8850. /* harmony default export */ var src_body = ({
  8851. name: 'VxeTableBody',
  8852. props: {
  8853. tableData: Array,
  8854. tableColumn: Array,
  8855. fixedColumn: Array,
  8856. size: String,
  8857. fixedType: String
  8858. },
  8859. mounted: function mounted() {
  8860. var $xetable = this.$parent,
  8861. $el = this.$el,
  8862. $refs = this.$refs,
  8863. fixedType = this.fixedType;
  8864. var elemStore = $xetable.elemStore;
  8865. var prefix = "".concat(fixedType || 'main', "-body-");
  8866. elemStore["".concat(prefix, "wrapper")] = $el;
  8867. elemStore["".concat(prefix, "table")] = $refs.table;
  8868. elemStore["".concat(prefix, "colgroup")] = $refs.colgroup;
  8869. elemStore["".concat(prefix, "list")] = $refs.tbody;
  8870. elemStore["".concat(prefix, "xSpace")] = $refs.xSpace;
  8871. elemStore["".concat(prefix, "ySpace")] = $refs.ySpace;
  8872. elemStore["".concat(prefix, "emptyBlock")] = $refs.emptyBlock;
  8873. this.$el.onscroll = this.scrollEvent;
  8874. this.$el._onscroll = this.scrollEvent;
  8875. },
  8876. beforeDestroy: function beforeDestroy() {
  8877. this.$el._onscroll = null;
  8878. this.$el.onscroll = null;
  8879. },
  8880. render: function render(h) {
  8881. var _e = this._e,
  8882. $xetable = this.$parent,
  8883. fixedColumn = this.fixedColumn,
  8884. fixedType = this.fixedType;
  8885. var $scopedSlots = $xetable.$scopedSlots,
  8886. tId = $xetable.tId,
  8887. tableData = $xetable.tableData,
  8888. tableColumn = $xetable.tableColumn,
  8889. allColumnOverflow = $xetable.showOverflow,
  8890. keyboardConfig = $xetable.keyboardConfig,
  8891. keyboardOpts = $xetable.keyboardOpts,
  8892. mergeList = $xetable.mergeList,
  8893. spanMethod = $xetable.spanMethod,
  8894. scrollXLoad = $xetable.scrollXLoad,
  8895. scrollYLoad = $xetable.scrollYLoad,
  8896. isAllOverflow = $xetable.isAllOverflow,
  8897. emptyRender = $xetable.emptyRender,
  8898. emptyOpts = $xetable.emptyOpts,
  8899. mouseConfig = $xetable.mouseConfig,
  8900. mouseOpts = $xetable.mouseOpts; // 如果是使用优化模式
  8901. if (fixedType) {
  8902. if (!mergeList.length && !spanMethod && !(keyboardConfig && keyboardOpts.isMerge) && (scrollXLoad || scrollYLoad || (allColumnOverflow ? isAllOverflow : allColumnOverflow))) {
  8903. tableColumn = fixedColumn;
  8904. }
  8905. }
  8906. var emptyContent;
  8907. if ($scopedSlots.empty) {
  8908. emptyContent = $scopedSlots.empty.call(this, {
  8909. $table: $xetable
  8910. }, h);
  8911. } else {
  8912. var compConf = emptyRender ? v_x_e_table.renderer.get(emptyOpts.name) : null;
  8913. if (compConf && compConf.renderEmpty) {
  8914. emptyContent = compConf.renderEmpty.call(this, h, emptyOpts, {
  8915. $table: $xetable
  8916. });
  8917. } else {
  8918. emptyContent = $xetable.emptyText || conf.i18n('vxe.table.emptyText');
  8919. }
  8920. }
  8921. return h('div', {
  8922. class: ['vxe-table--body-wrapper', fixedType ? "fixed-".concat(fixedType, "--wrapper") : 'body--wrapper'],
  8923. attrs: {
  8924. xid: tId
  8925. }
  8926. }, [fixedType ? _e() : h('div', {
  8927. class: 'vxe-body--x-space',
  8928. ref: 'xSpace'
  8929. }), h('div', {
  8930. class: 'vxe-body--y-space',
  8931. ref: 'ySpace'
  8932. }), h('table', {
  8933. class: 'vxe-table--body',
  8934. attrs: {
  8935. xid: tId,
  8936. cellspacing: 0,
  8937. cellpadding: 0,
  8938. border: 0
  8939. },
  8940. ref: 'table'
  8941. }, [
  8942. /**
  8943. * 列宽
  8944. */
  8945. h('colgroup', {
  8946. ref: 'colgroup'
  8947. }, tableColumn.map(function (column, $columnIndex) {
  8948. return h('col', {
  8949. attrs: {
  8950. name: column.id
  8951. },
  8952. key: $columnIndex
  8953. });
  8954. })),
  8955. /**
  8956. * 内容
  8957. */
  8958. h('tbody', {
  8959. ref: 'tbody'
  8960. }, renderRows(h, this, $xetable, '', 0, fixedType, tableData, tableColumn))]), h('div', {
  8961. class: 'vxe-table--checkbox-range'
  8962. }), mouseConfig && mouseOpts.area ? h('div', {
  8963. class: 'vxe-table--cell-area'
  8964. }, [h('span', {
  8965. class: 'vxe-table--cell-main-area'
  8966. }, mouseOpts.extension ? [h('span', {
  8967. class: 'vxe-table--cell-main-area-btn',
  8968. on: {
  8969. mousedown: function mousedown(evnt) {
  8970. $xetable.triggerCellExtendMousedownEvent(evnt, {
  8971. $table: $xetable,
  8972. fixed: fixedType,
  8973. type: cellType
  8974. });
  8975. }
  8976. }
  8977. })] : null), h('span', {
  8978. class: 'vxe-table--cell-copy-area'
  8979. }), h('span', {
  8980. class: 'vxe-table--cell-extend-area'
  8981. }), h('span', {
  8982. class: 'vxe-table--cell-multi-area'
  8983. }), h('span', {
  8984. class: 'vxe-table--cell-active-area'
  8985. })]) : null, !fixedType ? h('div', {
  8986. class: 'vxe-table--empty-block',
  8987. ref: 'emptyBlock'
  8988. }, [h('div', {
  8989. class: 'vxe-table--empty-content'
  8990. }, emptyContent)]) : null]);
  8991. },
  8992. methods: {
  8993. /**
  8994. * 滚动处理
  8995. * 如果存在列固定左侧,同步更新滚动状态
  8996. * 如果存在列固定右侧,同步更新滚动状态
  8997. */
  8998. scrollEvent: function scrollEvent(evnt) {
  8999. var $el = this.$el,
  9000. $xetable = this.$parent,
  9001. fixedType = this.fixedType;
  9002. var $refs = $xetable.$refs,
  9003. highlightHoverRow = $xetable.highlightHoverRow,
  9004. scrollXLoad = $xetable.scrollXLoad,
  9005. scrollYLoad = $xetable.scrollYLoad,
  9006. lastScrollTop = $xetable.lastScrollTop,
  9007. lastScrollLeft = $xetable.lastScrollLeft;
  9008. var tableHeader = $refs.tableHeader,
  9009. tableBody = $refs.tableBody,
  9010. leftBody = $refs.leftBody,
  9011. rightBody = $refs.rightBody,
  9012. tableFooter = $refs.tableFooter,
  9013. validTip = $refs.validTip;
  9014. var headerElem = tableHeader ? tableHeader.$el : null;
  9015. var footerElem = tableFooter ? tableFooter.$el : null;
  9016. var bodyElem = tableBody.$el;
  9017. var leftElem = leftBody ? leftBody.$el : null;
  9018. var rightElem = rightBody ? rightBody.$el : null;
  9019. var scrollTop = $el.scrollTop;
  9020. var scrollLeft = bodyElem.scrollLeft;
  9021. var isX = scrollLeft !== lastScrollLeft;
  9022. var isY = scrollTop !== lastScrollTop;
  9023. $xetable.lastScrollTop = scrollTop;
  9024. $xetable.lastScrollLeft = scrollLeft;
  9025. $xetable.lastScrollTime = Date.now();
  9026. if (highlightHoverRow) {
  9027. $xetable.clearHoverRow();
  9028. }
  9029. if (leftElem && fixedType === 'left') {
  9030. scrollTop = leftElem.scrollTop;
  9031. syncBodyScroll(scrollTop, bodyElem, rightElem);
  9032. } else if (rightElem && fixedType === 'right') {
  9033. scrollTop = rightElem.scrollTop;
  9034. syncBodyScroll(scrollTop, bodyElem, leftElem);
  9035. } else {
  9036. if (isX) {
  9037. if (headerElem) {
  9038. headerElem.scrollLeft = bodyElem.scrollLeft;
  9039. }
  9040. if (footerElem) {
  9041. footerElem.scrollLeft = bodyElem.scrollLeft;
  9042. }
  9043. }
  9044. if (leftElem || rightElem) {
  9045. $xetable.checkScrolling();
  9046. if (isY) {
  9047. syncBodyScroll(scrollTop, leftElem, rightElem);
  9048. }
  9049. }
  9050. }
  9051. if (scrollXLoad && isX) {
  9052. $xetable.triggerScrollXEvent(evnt);
  9053. }
  9054. if (scrollYLoad && isY) {
  9055. $xetable.triggerScrollYEvent(evnt);
  9056. }
  9057. if (isX && validTip && validTip.visible) {
  9058. validTip.updatePlacement();
  9059. }
  9060. $xetable.emitEvent('scroll', {
  9061. type: cellType,
  9062. fixed: fixedType,
  9063. scrollTop: scrollTop,
  9064. scrollLeft: scrollLeft,
  9065. isX: isX,
  9066. isY: isY
  9067. }, evnt);
  9068. }
  9069. }
  9070. });
  9071. // CONCATENATED MODULE: ./packages/mixins/size.js
  9072. /* harmony default export */ var size = ({
  9073. computed: {
  9074. vSize: function vSize() {
  9075. var $parent = this.$parent,
  9076. size = this.size;
  9077. return size || $parent && ($parent.size || $parent.vSize);
  9078. }
  9079. }
  9080. });
  9081. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.reduce.js
  9082. var es_array_reduce = __webpack_require__("13d5");
  9083. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.trim.js
  9084. var es_string_trim = __webpack_require__("498a");
  9085. // CONCATENATED MODULE: ./packages/table/src/cell.js
  9086. function renderHelpIcon(h, params) {
  9087. var $table = params.$table,
  9088. column = params.column;
  9089. var titleHelp = column.titleHelp;
  9090. return titleHelp ? [h('i', {
  9091. class: ['vxe-cell-help-icon', titleHelp.icon || conf.icon.TABLE_HELP],
  9092. on: {
  9093. mouseenter: function mouseenter(evnt) {
  9094. $table.triggerHeaderHelpEvent(evnt, params);
  9095. },
  9096. mouseleave: function mouseleave(evnt) {
  9097. $table.handleTargetLeaveEvent(evnt);
  9098. }
  9099. }
  9100. })] : [];
  9101. }
  9102. function renderTitleContent(h, params, content) {
  9103. var $table = params.$table,
  9104. column = params.column;
  9105. var showHeaderOverflow = column.showHeaderOverflow;
  9106. var allColumnHeaderOverflow = $table.showHeaderOverflow,
  9107. tooltipOpts = $table.tooltipOpts;
  9108. var showAllTip = tooltipOpts.showAll || tooltipOpts.enabled;
  9109. var headOverflow = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isUndefined(showHeaderOverflow) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow;
  9110. var showTitle = headOverflow === 'title';
  9111. var showTooltip = headOverflow === true || headOverflow === 'tooltip';
  9112. var ons = {};
  9113. if (showTitle || showTooltip || showAllTip) {
  9114. ons.mouseenter = function (evnt) {
  9115. if ($table._isResize) {
  9116. return;
  9117. }
  9118. if (showTitle) {
  9119. DomTools.updateCellTitle(evnt.currentTarget, column);
  9120. } else if (showTooltip || showAllTip) {
  9121. $table.triggerHeaderTooltipEvent(evnt, params);
  9122. }
  9123. };
  9124. }
  9125. if (showTooltip || showAllTip) {
  9126. ons.mouseleave = function (evnt) {
  9127. if ($table._isResize) {
  9128. return;
  9129. }
  9130. if (showTooltip || showAllTip) {
  9131. $table.handleTargetLeaveEvent(evnt);
  9132. }
  9133. };
  9134. }
  9135. return [h('span', {
  9136. class: 'vxe-cell--title',
  9137. on: ons
  9138. }, content)];
  9139. }
  9140. function getFooterContent(h, params) {
  9141. var $table = params.$table,
  9142. column = params.column,
  9143. _columnIndex = params._columnIndex,
  9144. items = params.items;
  9145. var slots = column.slots,
  9146. editRender = column.editRender,
  9147. cellRender = column.cellRender;
  9148. var renderOpts = editRender || cellRender;
  9149. if (slots && slots.footer) {
  9150. return $table.callSlot(slots.footer, params, h);
  9151. }
  9152. if (renderOpts) {
  9153. var compConf = v_x_e_table.renderer.get(renderOpts.name);
  9154. if (compConf && compConf.renderFooter) {
  9155. return compConf.renderFooter.call($table, h, renderOpts, params);
  9156. }
  9157. }
  9158. return [UtilTools.formatText(items[_columnIndex], 1)];
  9159. }
  9160. function getDefaultCellLabel(params) {
  9161. var $table = params.$table,
  9162. row = params.row,
  9163. column = params.column;
  9164. return UtilTools.formatText($table.getCellLabel(row, column), 1);
  9165. }
  9166. var Cell = {
  9167. createColumn: function createColumn($xetable, _vm) {
  9168. var type = _vm.type,
  9169. sortable = _vm.sortable,
  9170. remoteSort = _vm.remoteSort,
  9171. filters = _vm.filters,
  9172. editRender = _vm.editRender,
  9173. treeNode = _vm.treeNode;
  9174. var editConfig = $xetable.editConfig,
  9175. editOpts = $xetable.editOpts,
  9176. checkboxOpts = $xetable.checkboxOpts;
  9177. var renMaps = {
  9178. renderHeader: this.renderDefaultHeader,
  9179. renderCell: treeNode ? this.renderTreeCell : this.renderDefaultCell,
  9180. renderFooter: this.renderDefaultFooter
  9181. };
  9182. switch (type) {
  9183. case 'seq':
  9184. renMaps.renderHeader = this.renderIndexHeader;
  9185. renMaps.renderCell = treeNode ? this.renderTreeIndexCell : this.renderIndexCell;
  9186. break;
  9187. case 'radio':
  9188. renMaps.renderHeader = this.renderRadioHeader;
  9189. renMaps.renderCell = treeNode ? this.renderTreeRadioCell : this.renderRadioCell;
  9190. break;
  9191. case 'checkbox':
  9192. renMaps.renderHeader = this.renderSelectionHeader;
  9193. renMaps.renderCell = checkboxOpts.checkField ? treeNode ? this.renderTreeSelectionCellByProp : this.renderSelectionCellByProp : treeNode ? this.renderTreeSelectionCell : this.renderSelectionCell;
  9194. break;
  9195. case 'expand':
  9196. renMaps.renderCell = this.renderExpandCell;
  9197. renMaps.renderData = this.renderExpandData;
  9198. break;
  9199. case 'html':
  9200. renMaps.renderCell = treeNode ? this.renderTreeHTMLCell : this.renderHTMLCell;
  9201. if (filters && (sortable || remoteSort)) {
  9202. renMaps.renderHeader = this.renderSortAndFilterHeader;
  9203. } else if (sortable || remoteSort) {
  9204. renMaps.renderHeader = this.renderSortHeader;
  9205. } else if (filters) {
  9206. renMaps.renderHeader = this.renderFilterHeader;
  9207. }
  9208. break;
  9209. default:
  9210. if (editConfig && editRender) {
  9211. renMaps.renderHeader = this.renderEditHeader;
  9212. renMaps.renderCell = editOpts.mode === 'cell' ? treeNode ? this.renderTreeCellEdit : this.renderCellEdit : treeNode ? this.renderTreeRowEdit : this.renderRowEdit;
  9213. } else if (filters && (sortable || remoteSort)) {
  9214. renMaps.renderHeader = this.renderSortAndFilterHeader;
  9215. } else if (sortable || remoteSort) {
  9216. renMaps.renderHeader = this.renderSortHeader;
  9217. } else if (filters) {
  9218. renMaps.renderHeader = this.renderFilterHeader;
  9219. }
  9220. }
  9221. return UtilTools.getColumnConfig($xetable, _vm, renMaps);
  9222. },
  9223. /**
  9224. * 单元格
  9225. */
  9226. renderHeaderTitle: function renderHeaderTitle(h, params) {
  9227. var $table = params.$table,
  9228. column = params.column;
  9229. var slots = column.slots,
  9230. editRender = column.editRender,
  9231. cellRender = column.cellRender;
  9232. var renderOpts = editRender || cellRender;
  9233. if (slots && slots.header) {
  9234. return renderTitleContent(h, params, $table.callSlot(slots.header, params, h));
  9235. }
  9236. if (renderOpts) {
  9237. var compConf = v_x_e_table.renderer.get(renderOpts.name);
  9238. if (compConf && compConf.renderHeader) {
  9239. return renderTitleContent(h, params, compConf.renderHeader.call($table, h, renderOpts, params));
  9240. }
  9241. }
  9242. return renderTitleContent(h, params, UtilTools.formatText(column.getTitle(), 1));
  9243. },
  9244. renderDefaultHeader: function renderDefaultHeader(h, params) {
  9245. return renderHelpIcon(h, params).concat(Cell.renderHeaderTitle(h, params));
  9246. },
  9247. renderDefaultCell: function renderDefaultCell(h, params) {
  9248. var $table = params.$table,
  9249. row = params.row,
  9250. column = params.column;
  9251. var slots = column.slots,
  9252. editRender = column.editRender,
  9253. cellRender = column.cellRender;
  9254. var renderOpts = editRender || cellRender;
  9255. if (slots && slots.default) {
  9256. return $table.callSlot(slots.default, params, h);
  9257. }
  9258. if (renderOpts) {
  9259. var funName = editRender ? 'renderCell' : 'renderDefault';
  9260. var compConf = v_x_e_table.renderer.get(renderOpts.name);
  9261. if (compConf && compConf[funName]) {
  9262. return compConf[funName].call($table, h, renderOpts, Object.assign({
  9263. $type: editRender ? 'edit' : 'cell'
  9264. }, params));
  9265. }
  9266. }
  9267. var cellValue = $table.getCellLabel(row, column);
  9268. var cellPlaceholder = editRender ? editRender.placeholder : '';
  9269. return [h('span', {
  9270. class: 'vxe-cell--label'
  9271. }, editRender && !cellValue ? [// 如果设置占位符
  9272. h('span', {
  9273. class: 'vxe-cell--placeholder'
  9274. }, UtilTools.formatText(UtilTools.getFuncText(cellPlaceholder), 1))] : UtilTools.formatText(cellValue, 1))];
  9275. },
  9276. renderTreeCell: function renderTreeCell(h, params) {
  9277. return Cell.renderTreeIcon(h, params, Cell.renderDefaultCell.call(this, h, params));
  9278. },
  9279. renderDefaultFooter: function renderDefaultFooter(h, params) {
  9280. return [h('span', {
  9281. class: 'vxe-cell--item'
  9282. }, getFooterContent(h, params))];
  9283. },
  9284. /**
  9285. * 树节点
  9286. */
  9287. renderTreeIcon: function renderTreeIcon(h, params, cellVNodes) {
  9288. var $table = params.$table,
  9289. isHidden = params.isHidden;
  9290. var treeOpts = $table.treeOpts,
  9291. treeExpandeds = $table.treeExpandeds,
  9292. treeLazyLoadeds = $table.treeLazyLoadeds;
  9293. var row = params.row,
  9294. column = params.column,
  9295. level = params.level;
  9296. var slots = column.slots;
  9297. var children = treeOpts.children,
  9298. hasChild = treeOpts.hasChild,
  9299. indent = treeOpts.indent,
  9300. lazy = treeOpts.lazy,
  9301. trigger = treeOpts.trigger,
  9302. iconLoaded = treeOpts.iconLoaded,
  9303. showIcon = treeOpts.showIcon,
  9304. iconOpen = treeOpts.iconOpen,
  9305. iconClose = treeOpts.iconClose;
  9306. var rowChilds = row[children];
  9307. var hasLazyChilds = false;
  9308. var isAceived = false;
  9309. var isLazyLoaded = false;
  9310. var on = {};
  9311. if (slots && slots.icon) {
  9312. return $table.callSlot(slots.icon, params, h, cellVNodes);
  9313. }
  9314. if (!isHidden) {
  9315. isAceived = treeExpandeds.indexOf(row) > -1;
  9316. if (lazy) {
  9317. isLazyLoaded = treeLazyLoadeds.indexOf(row) > -1;
  9318. hasLazyChilds = row[hasChild];
  9319. }
  9320. }
  9321. if (!trigger || trigger === 'default') {
  9322. on.click = function (evnt) {
  9323. return $table.triggerTreeExpandEvent(evnt, params);
  9324. };
  9325. }
  9326. return [h('div', {
  9327. class: ['vxe-cell--tree-node', {
  9328. 'is--active': isAceived
  9329. }],
  9330. style: {
  9331. paddingLeft: "".concat(level * indent, "px")
  9332. }
  9333. }, [showIcon && (rowChilds && rowChilds.length || hasLazyChilds) ? [h('div', {
  9334. class: 'vxe-tree--btn-wrapper',
  9335. on: on
  9336. }, [h('i', {
  9337. 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]
  9338. })])] : null, h('div', {
  9339. class: 'vxe-tree-cell'
  9340. }, cellVNodes)])];
  9341. },
  9342. /**
  9343. * 索引
  9344. */
  9345. renderIndexHeader: function renderIndexHeader(h, params) {
  9346. var $table = params.$table,
  9347. column = params.column;
  9348. var slots = column.slots;
  9349. return renderTitleContent(h, params, slots && slots.header ? $table.callSlot(slots.header, params, h) : UtilTools.formatText(column.getTitle(), 1));
  9350. },
  9351. renderIndexCell: function renderIndexCell(h, params) {
  9352. var $table = params.$table,
  9353. column = params.column;
  9354. var seqOpts = $table.seqOpts;
  9355. var slots = column.slots;
  9356. if (slots && slots.default) {
  9357. return $table.callSlot(slots.default, params, h);
  9358. }
  9359. var $seq = params.$seq,
  9360. seq = params.seq,
  9361. level = params.level;
  9362. var seqMethod = seqOpts.seqMethod;
  9363. return [UtilTools.formatText(seqMethod ? seqMethod(params) : level ? "".concat($seq, ".").concat(seq) : seqOpts.startIndex + seq, 1)];
  9364. },
  9365. renderTreeIndexCell: function renderTreeIndexCell(h, params) {
  9366. return Cell.renderTreeIcon(h, params, Cell.renderIndexCell(h, params));
  9367. },
  9368. /**
  9369. * 单选
  9370. */
  9371. renderRadioHeader: function renderRadioHeader(h, params) {
  9372. var $table = params.$table,
  9373. column = params.column;
  9374. var slots = column.slots;
  9375. return renderTitleContent(h, params, slots && slots.header ? $table.callSlot(slots.header, params, h) : [h('span', {
  9376. class: 'vxe-radio--label'
  9377. }, UtilTools.formatText(column.getTitle(), 1))]);
  9378. },
  9379. renderRadioCell: function renderRadioCell(h, params) {
  9380. var $table = params.$table,
  9381. column = params.column,
  9382. isHidden = params.isHidden;
  9383. var radioOpts = $table.radioOpts,
  9384. selectRow = $table.selectRow;
  9385. var slots = column.slots;
  9386. var labelField = radioOpts.labelField,
  9387. checkMethod = radioOpts.checkMethod;
  9388. var row = params.row;
  9389. var isChecked = row === selectRow;
  9390. var isDisabled = !!checkMethod;
  9391. var on;
  9392. if (!isHidden) {
  9393. on = {
  9394. click: function click(evnt) {
  9395. if (!isDisabled) {
  9396. $table.triggerRadioRowEvent(evnt, params);
  9397. }
  9398. }
  9399. };
  9400. if (checkMethod) {
  9401. isDisabled = !checkMethod({
  9402. row: row
  9403. });
  9404. }
  9405. }
  9406. return [h('span', {
  9407. class: ['vxe-cell--radio', {
  9408. 'is--checked': isChecked,
  9409. 'is--disabled': isDisabled
  9410. }],
  9411. on: on
  9412. }, [h('span', {
  9413. class: 'vxe-radio--icon vxe-radio--checked-icon'
  9414. }), h('span', {
  9415. class: 'vxe-radio--icon vxe-radio--unchecked-icon'
  9416. })].concat(slots && slots.default ? $table.callSlot(slots.default, params, h) : labelField ? [h('span', {
  9417. class: 'vxe-radio--label'
  9418. }, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, labelField))] : []))];
  9419. },
  9420. renderTreeRadioCell: function renderTreeRadioCell(h, params) {
  9421. return Cell.renderTreeIcon(h, params, Cell.renderRadioCell(h, params));
  9422. },
  9423. /**
  9424. * 多选
  9425. */
  9426. renderSelectionHeader: function renderSelectionHeader(h, params) {
  9427. var $table = params.$table,
  9428. column = params.column,
  9429. isHidden = params.isHidden;
  9430. var isIndeterminate = $table.isIndeterminate,
  9431. isAllCheckboxDisabled = $table.isAllCheckboxDisabled;
  9432. var slots = column.slots;
  9433. var checkboxOpts = $table.checkboxOpts;
  9434. var headerTitle = column.getTitle();
  9435. var isChecked = false;
  9436. var on;
  9437. if (checkboxOpts.checkStrictly ? !checkboxOpts.showHeader : checkboxOpts.showHeader === false) {
  9438. return renderTitleContent(h, params, slots && slots.header ? $table.callSlot(slots.header, params, h) : [h('span', {
  9439. class: 'vxe-checkbox--label'
  9440. }, headerTitle)]);
  9441. }
  9442. if (!isHidden) {
  9443. isChecked = isAllCheckboxDisabled ? false : $table.isAllSelected;
  9444. on = {
  9445. click: function click(evnt) {
  9446. if (!isAllCheckboxDisabled) {
  9447. $table.triggerCheckAllEvent(evnt, !isChecked);
  9448. }
  9449. }
  9450. };
  9451. }
  9452. return renderTitleContent(h, params, [h('span', {
  9453. class: ['vxe-cell--checkbox', {
  9454. 'is--checked': isChecked,
  9455. 'is--disabled': isAllCheckboxDisabled,
  9456. 'is--indeterminate': isIndeterminate
  9457. }],
  9458. attrs: {
  9459. title: conf.i18n('vxe.table.allTitle')
  9460. },
  9461. on: on
  9462. }, [h('span', {
  9463. class: 'vxe-checkbox--icon vxe-checkbox--checked-icon'
  9464. }), h('span', {
  9465. class: 'vxe-checkbox--icon vxe-checkbox--unchecked-icon'
  9466. }), h('span', {
  9467. class: 'vxe-checkbox--icon vxe-checkbox--indeterminate-icon'
  9468. })].concat(slots && slots.header ? $table.callSlot(slots.header, params, h) : headerTitle ? [h('span', {
  9469. class: 'vxe-checkbox--label'
  9470. }, headerTitle)] : []))]);
  9471. },
  9472. renderSelectionCell: function renderSelectionCell(h, params) {
  9473. var $table = params.$table,
  9474. row = params.row,
  9475. column = params.column,
  9476. isHidden = params.isHidden;
  9477. var treeConfig = $table.treeConfig,
  9478. treeIndeterminates = $table.treeIndeterminates;
  9479. var _$table$checkboxOpts = $table.checkboxOpts,
  9480. labelField = _$table$checkboxOpts.labelField,
  9481. checkMethod = _$table$checkboxOpts.checkMethod;
  9482. var slots = column.slots;
  9483. var indeterminate = false;
  9484. var isChecked = false;
  9485. var isDisabled = !!checkMethod;
  9486. var on;
  9487. if (!isHidden) {
  9488. isChecked = $table.selection.indexOf(row) > -1;
  9489. on = {
  9490. click: function click(evnt) {
  9491. if (!isDisabled) {
  9492. $table.triggerCheckRowEvent(evnt, params, !isChecked);
  9493. }
  9494. }
  9495. };
  9496. if (checkMethod) {
  9497. isDisabled = !checkMethod({
  9498. row: row
  9499. });
  9500. }
  9501. if (treeConfig) {
  9502. indeterminate = treeIndeterminates.indexOf(row) > -1;
  9503. }
  9504. }
  9505. return [h('span', {
  9506. class: ['vxe-cell--checkbox', {
  9507. 'is--checked': isChecked,
  9508. 'is--disabled': isDisabled,
  9509. 'is--indeterminate': indeterminate
  9510. }],
  9511. on: on
  9512. }, [h('span', {
  9513. class: 'vxe-checkbox--icon vxe-checkbox--checked-icon'
  9514. }), h('span', {
  9515. class: 'vxe-checkbox--icon vxe-checkbox--unchecked-icon'
  9516. }), h('span', {
  9517. class: 'vxe-checkbox--icon vxe-checkbox--indeterminate-icon'
  9518. })].concat(slots && slots.default ? $table.callSlot(slots.default, params, h) : labelField ? [h('span', {
  9519. class: 'vxe-checkbox--label'
  9520. }, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, labelField))] : []))];
  9521. },
  9522. renderTreeSelectionCell: function renderTreeSelectionCell(h, params) {
  9523. return Cell.renderTreeIcon(h, params, Cell.renderSelectionCell(h, params));
  9524. },
  9525. renderSelectionCellByProp: function renderSelectionCellByProp(h, params) {
  9526. var $table = params.$table,
  9527. row = params.row,
  9528. column = params.column,
  9529. isHidden = params.isHidden;
  9530. var treeConfig = $table.treeConfig,
  9531. treeIndeterminates = $table.treeIndeterminates;
  9532. var _$table$checkboxOpts2 = $table.checkboxOpts,
  9533. labelField = _$table$checkboxOpts2.labelField,
  9534. property = _$table$checkboxOpts2.checkField,
  9535. halfField = _$table$checkboxOpts2.halfField,
  9536. checkMethod = _$table$checkboxOpts2.checkMethod;
  9537. var slots = column.slots;
  9538. var indeterminate = false;
  9539. var isChecked = false;
  9540. var isDisabled = !!checkMethod;
  9541. var on;
  9542. if (!isHidden) {
  9543. isChecked = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, property);
  9544. on = {
  9545. click: function click(evnt) {
  9546. if (!isDisabled) {
  9547. $table.triggerCheckRowEvent(evnt, params, !isChecked);
  9548. }
  9549. }
  9550. };
  9551. if (checkMethod) {
  9552. isDisabled = !checkMethod({
  9553. row: row
  9554. });
  9555. }
  9556. if (treeConfig) {
  9557. indeterminate = treeIndeterminates.indexOf(row) > -1;
  9558. }
  9559. }
  9560. return [h('span', {
  9561. class: ['vxe-cell--checkbox', {
  9562. 'is--checked': isChecked,
  9563. 'is--disabled': isDisabled,
  9564. 'is--indeterminate': halfField && !isChecked ? row[halfField] : indeterminate
  9565. }],
  9566. on: on
  9567. }, [h('span', {
  9568. class: 'vxe-checkbox--icon vxe-checkbox--checked-icon'
  9569. }), h('span', {
  9570. class: 'vxe-checkbox--icon vxe-checkbox--unchecked-icon'
  9571. }), h('span', {
  9572. class: 'vxe-checkbox--icon vxe-checkbox--indeterminate-icon'
  9573. })].concat(slots && slots.default ? $table.callSlot(slots.default, params, h) : labelField ? [h('span', {
  9574. class: 'vxe-checkbox--label'
  9575. }, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, labelField))] : []))];
  9576. },
  9577. renderTreeSelectionCellByProp: function renderTreeSelectionCellByProp(h, params) {
  9578. return Cell.renderTreeIcon(h, params, Cell.renderSelectionCellByProp(h, params));
  9579. },
  9580. /**
  9581. * 展开行
  9582. */
  9583. renderExpandCell: function renderExpandCell(h, params) {
  9584. var $table = params.$table,
  9585. isHidden = params.isHidden,
  9586. row = params.row,
  9587. column = params.column;
  9588. var expandOpts = $table.expandOpts,
  9589. rowExpandeds = $table.rowExpandeds,
  9590. expandLazyLoadeds = $table.expandLazyLoadeds;
  9591. var lazy = expandOpts.lazy,
  9592. labelField = expandOpts.labelField,
  9593. iconLoaded = expandOpts.iconLoaded,
  9594. showIcon = expandOpts.showIcon,
  9595. iconOpen = expandOpts.iconOpen,
  9596. iconClose = expandOpts.iconClose,
  9597. visibleMethod = expandOpts.visibleMethod;
  9598. var slots = column.slots;
  9599. var isAceived = false;
  9600. var isLazyLoaded = false;
  9601. if (slots && slots.icon) {
  9602. return $table.callSlot(slots.icon, params, h);
  9603. }
  9604. if (!isHidden) {
  9605. isAceived = rowExpandeds.indexOf(params.row) > -1;
  9606. if (lazy) {
  9607. isLazyLoaded = expandLazyLoadeds.indexOf(row) > -1;
  9608. }
  9609. }
  9610. return [showIcon && (!visibleMethod || visibleMethod(params)) ? h('span', {
  9611. class: ['vxe-table--expanded', {
  9612. 'is--active': isAceived
  9613. }],
  9614. on: {
  9615. click: function click(evnt) {
  9616. $table.triggerRowExpandEvent(evnt, params);
  9617. }
  9618. }
  9619. }, [h('i', {
  9620. 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]
  9621. })]) : null, slots && slots.default || labelField ? h('span', {
  9622. class: 'vxe-table--expand-label'
  9623. }, slots.default ? $table.callSlot(slots.default, params, h) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, labelField)) : null];
  9624. },
  9625. renderExpandData: function renderExpandData(h, params) {
  9626. var $table = params.$table,
  9627. column = params.column;
  9628. var slots = column.slots,
  9629. contentRender = column.contentRender;
  9630. if (slots && slots.content) {
  9631. return $table.callSlot(slots.content, params, h);
  9632. }
  9633. if (contentRender) {
  9634. var compConf = v_x_e_table.renderer.get(contentRender.name);
  9635. if (compConf && compConf.renderExpand) {
  9636. return compConf.renderExpand.call($table, h, contentRender, params);
  9637. }
  9638. }
  9639. return [];
  9640. },
  9641. /**
  9642. * HTML 标签
  9643. */
  9644. renderHTMLCell: function renderHTMLCell(h, params) {
  9645. var $table = params.$table,
  9646. column = params.column;
  9647. var slots = column.slots;
  9648. if (slots && slots.default) {
  9649. return $table.callSlot(slots.default, params, h);
  9650. }
  9651. return [h('span', {
  9652. class: 'vxe-cell--html',
  9653. domProps: {
  9654. innerHTML: getDefaultCellLabel(params)
  9655. }
  9656. })];
  9657. },
  9658. renderTreeHTMLCell: function renderTreeHTMLCell(h, params) {
  9659. return Cell.renderTreeIcon(h, params, Cell.renderHTMLCell(h, params));
  9660. },
  9661. /**
  9662. * 排序和筛选
  9663. */
  9664. renderSortAndFilterHeader: function renderSortAndFilterHeader(h, params) {
  9665. return Cell.renderDefaultHeader(h, params).concat(Cell.renderSortIcon(h, params)).concat(Cell.renderFilterIcon(h, params));
  9666. },
  9667. /**
  9668. * 排序
  9669. */
  9670. renderSortHeader: function renderSortHeader(h, params) {
  9671. return Cell.renderDefaultHeader(h, params).concat(Cell.renderSortIcon(h, params));
  9672. },
  9673. renderSortIcon: function renderSortIcon(h, params) {
  9674. var $table = params.$table,
  9675. column = params.column;
  9676. var _$table$sortOpts = $table.sortOpts,
  9677. showIcon = _$table$sortOpts.showIcon,
  9678. iconAsc = _$table$sortOpts.iconAsc,
  9679. iconDesc = _$table$sortOpts.iconDesc;
  9680. return showIcon ? [h('span', {
  9681. class: 'vxe-cell--sort'
  9682. }, [h('i', {
  9683. class: ['vxe-sort--asc-btn', iconAsc || conf.icon.TABLE_SORT_ASC, {
  9684. 'sort--active': column.order === 'asc'
  9685. }],
  9686. attrs: {
  9687. title: conf.i18n('vxe.table.sortAsc')
  9688. },
  9689. on: {
  9690. click: function click(evnt) {
  9691. $table.triggerSortEvent(evnt, column, 'asc');
  9692. }
  9693. }
  9694. }), h('i', {
  9695. class: ['vxe-sort--desc-btn', iconDesc || conf.icon.TABLE_SORT_DESC, {
  9696. 'sort--active': column.order === 'desc'
  9697. }],
  9698. attrs: {
  9699. title: conf.i18n('vxe.table.sortDesc')
  9700. },
  9701. on: {
  9702. click: function click(evnt) {
  9703. $table.triggerSortEvent(evnt, column, 'desc');
  9704. }
  9705. }
  9706. })])] : [];
  9707. },
  9708. /**
  9709. * 筛选
  9710. */
  9711. renderFilterHeader: function renderFilterHeader(h, params) {
  9712. return Cell.renderDefaultHeader(h, params).concat(Cell.renderFilterIcon(h, params));
  9713. },
  9714. renderFilterIcon: function renderFilterIcon(h, params) {
  9715. var $table = params.$table,
  9716. column = params.column,
  9717. hasFilter = params.hasFilter;
  9718. var filterStore = $table.filterStore,
  9719. filterOpts = $table.filterOpts;
  9720. var showIcon = filterOpts.showIcon,
  9721. iconNone = filterOpts.iconNone,
  9722. iconMatch = filterOpts.iconMatch;
  9723. return showIcon ? [h('span', {
  9724. class: ['vxe-cell--filter', {
  9725. 'is--active': filterStore.visible && filterStore.column === column
  9726. }]
  9727. }, [h('i', {
  9728. class: ['vxe-filter--btn', hasFilter ? iconMatch || conf.icon.TABLE_FILTER_MATCH : iconNone || conf.icon.TABLE_FILTER_NONE],
  9729. attrs: {
  9730. title: conf.i18n('vxe.table.filter')
  9731. },
  9732. on: {
  9733. click: function click(evnt) {
  9734. $table.triggerFilterEvent(evnt, params.column, params);
  9735. }
  9736. }
  9737. })])] : [];
  9738. },
  9739. /**
  9740. * 可编辑
  9741. */
  9742. renderEditHeader: function renderEditHeader(h, params) {
  9743. var $table = params.$table,
  9744. column = params.column;
  9745. var editRules = $table.editRules,
  9746. editOpts = $table.editOpts;
  9747. var sortable = column.sortable,
  9748. remoteSort = column.remoteSort,
  9749. filters = column.filters,
  9750. editRender = column.editRender;
  9751. var isRequired;
  9752. if (editRules) {
  9753. var columnRules = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(editRules, params.column.property);
  9754. if (columnRules) {
  9755. isRequired = columnRules.some(function (rule) {
  9756. return rule.required;
  9757. });
  9758. }
  9759. }
  9760. return [isRequired && editOpts.showAsterisk ? h('i', {
  9761. class: 'vxe-cell--required-icon'
  9762. }) : null, isEnableConf(editRender) && editOpts.showIcon ? h('i', {
  9763. class: ['vxe-cell--edit-icon', editOpts.icon || conf.icon.TABLE_EDIT]
  9764. }) : null].concat(Cell.renderDefaultHeader(h, params)).concat(sortable || remoteSort ? Cell.renderSortIcon(h, params) : []).concat(filters ? Cell.renderFilterIcon(h, params) : []);
  9765. },
  9766. // 行格编辑模式
  9767. renderRowEdit: function renderRowEdit(h, params) {
  9768. var $table = params.$table,
  9769. column = params.column;
  9770. var editRender = column.editRender;
  9771. var actived = $table.editStore.actived;
  9772. return Cell.runRenderer(h, params, this, isEnableConf(editRender) && actived && actived.row === params.row);
  9773. },
  9774. renderTreeRowEdit: function renderTreeRowEdit(h, params) {
  9775. return Cell.renderTreeIcon(h, params, Cell.renderRowEdit(h, params));
  9776. },
  9777. // 单元格编辑模式
  9778. renderCellEdit: function renderCellEdit(h, params) {
  9779. var $table = params.$table,
  9780. column = params.column;
  9781. var editRender = column.editRender;
  9782. var actived = $table.editStore.actived;
  9783. return Cell.runRenderer(h, params, this, isEnableConf(editRender) && actived && actived.row === params.row && actived.column === params.column);
  9784. },
  9785. renderTreeCellEdit: function renderTreeCellEdit(h, params) {
  9786. return Cell.renderTreeIcon(h, params, Cell.renderCellEdit(h, params));
  9787. },
  9788. runRenderer: function runRenderer(h, params, _vm, isEdit) {
  9789. var $table = params.$table,
  9790. column = params.column;
  9791. var slots = column.slots,
  9792. editRender = column.editRender,
  9793. formatter = column.formatter;
  9794. var compConf = v_x_e_table.renderer.get(editRender.name);
  9795. if (isEdit) {
  9796. if (slots && slots.edit) {
  9797. return $table.callSlot(slots.edit, params, h);
  9798. }
  9799. return compConf && compConf.renderEdit ? compConf.renderEdit.call($table, h, editRender, Object.assign({
  9800. $type: 'edit'
  9801. }, params)) : [];
  9802. }
  9803. if (slots && slots.default) {
  9804. return $table.callSlot(slots.default, params, h);
  9805. }
  9806. if (formatter) {
  9807. return [h('span', {
  9808. class: 'vxe-cell--label'
  9809. }, [getDefaultCellLabel(params)])];
  9810. }
  9811. return Cell.renderDefaultCell.call(_vm, h, params);
  9812. }
  9813. };
  9814. /* harmony default export */ var src_cell = (Cell);
  9815. // CONCATENATED MODULE: ./packages/table/src/methods.js
  9816. var methods_getRowid = UtilTools.getRowid,
  9817. getRowkey = UtilTools.getRowkey,
  9818. methods_setCellValue = UtilTools.setCellValue,
  9819. hasChildrenList = UtilTools.hasChildrenList,
  9820. methods_getColumnList = UtilTools.getColumnList;
  9821. var methods_browse = DomTools.browse,
  9822. methods_calcHeight = DomTools.calcHeight,
  9823. methods_hasClass = DomTools.hasClass,
  9824. addClass = DomTools.addClass,
  9825. methods_removeClass = DomTools.removeClass,
  9826. getEventTargetNode = DomTools.getEventTargetNode;
  9827. var isWebkit = methods_browse['-webkit'] && !methods_browse.edge;
  9828. var debounceScrollYDuration = methods_browse.msie ? 40 : 20;
  9829. var resizableStorageKey = 'VXE_TABLE_CUSTOM_COLUMN_WIDTH';
  9830. var visibleStorageKey = 'VXE_TABLE_CUSTOM_COLUMN_VISIBLE';
  9831. /**
  9832. * 生成行的唯一主键
  9833. */
  9834. function getRowUniqueId() {
  9835. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.uniqueId('row_');
  9836. }
  9837. /**
  9838. * 单元格的值为:'' | null | undefined 时都属于空值
  9839. */
  9840. function eqCellNull(cellValue) {
  9841. return cellValue === '' || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eqNull(cellValue);
  9842. }
  9843. function eqCellValue(row1, row2, field) {
  9844. var val1 = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row1, field);
  9845. var val2 = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row2, field);
  9846. if (eqCellNull(val1) && eqCellNull(val2)) {
  9847. return true;
  9848. }
  9849. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isString(val1) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNumber(val1)) {
  9850. /* eslint-disable eqeqeq */
  9851. return val1 == val2;
  9852. }
  9853. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isEqual(val1, val2);
  9854. }
  9855. function getNextSortOrder(_vm, column) {
  9856. var orders = _vm.sortOpts.orders;
  9857. var currOrder = column.order || null;
  9858. var oIndex = orders.indexOf(currOrder) + 1;
  9859. return orders[oIndex < orders.length ? oIndex : 0];
  9860. }
  9861. function getCustomStorageMap(key) {
  9862. var version = conf.version;
  9863. var rest = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toStringJSON(localStorage.getItem(key));
  9864. return rest && rest._v === version ? rest : {
  9865. _v: version
  9866. };
  9867. }
  9868. function getRecoverRow(_vm, list) {
  9869. var fullAllDataRowMap = _vm.fullAllDataRowMap;
  9870. return list.filter(function (row) {
  9871. return fullAllDataRowMap.has(row);
  9872. });
  9873. }
  9874. function handleReserveRow(_vm, reserveRowMap) {
  9875. var fullDataRowIdData = _vm.fullDataRowIdData;
  9876. var reserveList = [];
  9877. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.each(reserveRowMap, function (item, rowid) {
  9878. if (fullDataRowIdData[rowid] && reserveList.indexOf(fullDataRowIdData[rowid].row) === -1) {
  9879. reserveList.push(fullDataRowIdData[rowid].row);
  9880. }
  9881. });
  9882. return reserveList;
  9883. }
  9884. function restoreScroll(_vm, scrollLeft, scrollTop) {
  9885. return _vm.clearScroll().then(function () {
  9886. if (scrollLeft || scrollTop) {
  9887. // 重置最后滚动状态
  9888. _vm.lastScrollLeft = 0;
  9889. _vm.lastScrollTop = 0; // 还原滚动状态
  9890. return _vm.scrollTo(scrollLeft, scrollTop);
  9891. }
  9892. });
  9893. }
  9894. function computeVirtualX(_vm) {
  9895. var $refs = _vm.$refs,
  9896. visibleColumn = _vm.visibleColumn;
  9897. var tableBody = $refs.tableBody;
  9898. var tableBodyElem = tableBody ? tableBody.$el : null;
  9899. if (tableBodyElem) {
  9900. var scrollLeft = tableBodyElem.scrollLeft,
  9901. clientWidth = tableBodyElem.clientWidth;
  9902. var endWidth = scrollLeft + clientWidth;
  9903. var toVisibleIndex = -1;
  9904. var cWidth = 0;
  9905. var visibleSize = 0;
  9906. for (var colIndex = 0, colLen = visibleColumn.length; colIndex < colLen; colIndex++) {
  9907. cWidth += visibleColumn[colIndex].renderWidth;
  9908. if (toVisibleIndex === -1 && scrollLeft < cWidth) {
  9909. toVisibleIndex = colIndex;
  9910. }
  9911. if (toVisibleIndex >= 0) {
  9912. visibleSize++;
  9913. if (cWidth > endWidth) {
  9914. break;
  9915. }
  9916. }
  9917. }
  9918. return {
  9919. toVisibleIndex: Math.max(0, toVisibleIndex),
  9920. visibleSize: Math.max(8, visibleSize)
  9921. };
  9922. }
  9923. return {
  9924. toVisibleIndex: 0,
  9925. visibleSize: 8
  9926. };
  9927. }
  9928. function computeVirtualY(_vm) {
  9929. var $refs = _vm.$refs,
  9930. vSize = _vm.vSize,
  9931. rowHeightMaps = _vm.rowHeightMaps;
  9932. var tableHeader = $refs.tableHeader,
  9933. tableBody = $refs.tableBody;
  9934. var tableBodyElem = tableBody ? tableBody.$el : null;
  9935. if (tableBodyElem) {
  9936. var tableHeaderElem = tableHeader ? tableHeader.$el : null;
  9937. var rowHeight = 0;
  9938. var firstTrElem;
  9939. firstTrElem = tableBodyElem.querySelector('tr');
  9940. if (!firstTrElem && tableHeaderElem) {
  9941. firstTrElem = tableHeaderElem.querySelector('tr');
  9942. }
  9943. if (firstTrElem) {
  9944. rowHeight = firstTrElem.clientHeight;
  9945. }
  9946. if (!rowHeight) {
  9947. rowHeight = rowHeightMaps[vSize || 'default'];
  9948. }
  9949. var visibleSize = Math.max(8, Math.ceil(tableBodyElem.clientHeight / rowHeight) + 2);
  9950. return {
  9951. rowHeight: rowHeight,
  9952. visibleSize: visibleSize
  9953. };
  9954. }
  9955. return {
  9956. rowHeight: 0,
  9957. visibleSize: 8
  9958. };
  9959. }
  9960. function calculateMergerOffserIndex(list, offsetItem, type) {
  9961. for (var mcIndex = 0, len = list.length; mcIndex < len; mcIndex++) {
  9962. var mergeItem = list[mcIndex];
  9963. var startIndex = offsetItem.startIndex,
  9964. endIndex = offsetItem.endIndex;
  9965. var mergeStartIndex = mergeItem[type];
  9966. var mergeSpanNumber = mergeItem[type + 'span'];
  9967. var mergeEndIndex = mergeStartIndex + mergeSpanNumber;
  9968. if (mergeStartIndex < startIndex && startIndex < mergeEndIndex) {
  9969. offsetItem.startIndex = mergeStartIndex;
  9970. }
  9971. if (mergeStartIndex < endIndex && endIndex < mergeEndIndex) {
  9972. offsetItem.endIndex = mergeEndIndex;
  9973. }
  9974. if (offsetItem.startIndex !== startIndex || offsetItem.endIndex !== endIndex) {
  9975. mcIndex = -1;
  9976. }
  9977. }
  9978. }
  9979. function setMerges(_vm, merges, mList, rowList) {
  9980. if (merges) {
  9981. var treeConfig = _vm.treeConfig,
  9982. visibleColumn = _vm.visibleColumn;
  9983. if (treeConfig) {
  9984. throw new Error(UtilTools.getLog('vxe.error.noTree', ['merge-footer-items']));
  9985. }
  9986. if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(merges)) {
  9987. merges = [merges];
  9988. }
  9989. merges.forEach(function (item) {
  9990. var row = item.row,
  9991. col = item.col,
  9992. rowspan = item.rowspan,
  9993. colspan = item.colspan;
  9994. if (rowList && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNumber(row)) {
  9995. row = rowList[row];
  9996. }
  9997. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNumber(col)) {
  9998. col = visibleColumn[col];
  9999. }
  10000. if ((rowList ? row : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNumber(row)) && col && (rowspan || colspan)) {
  10001. rowspan = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(rowspan) || 1;
  10002. colspan = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(colspan) || 1;
  10003. if (rowspan > 1 || colspan > 1) {
  10004. var mcIndex = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.findIndexOf(mList, function (item) {
  10005. return item._row === row && item._col === col;
  10006. });
  10007. var mergeItem = mList[mcIndex];
  10008. if (mergeItem) {
  10009. mergeItem.rowspan = rowspan;
  10010. mergeItem.colspan = colspan;
  10011. mergeItem._rowspan = rowspan;
  10012. mergeItem._colspan = colspan;
  10013. } else {
  10014. var mergeRowIndex = rowList ? rowList.indexOf(row) : row;
  10015. var mergeColIndex = visibleColumn.indexOf(col);
  10016. mList.push({
  10017. row: mergeRowIndex,
  10018. col: mergeColIndex,
  10019. rowspan: rowspan,
  10020. colspan: colspan,
  10021. _row: row,
  10022. _col: col,
  10023. _rowspan: rowspan,
  10024. _colspan: colspan
  10025. });
  10026. }
  10027. }
  10028. }
  10029. });
  10030. }
  10031. }
  10032. function removeMerges(_vm, merges, mList, rowList) {
  10033. var rest = [];
  10034. if (merges) {
  10035. var treeConfig = _vm.treeConfig,
  10036. visibleColumn = _vm.visibleColumn;
  10037. if (treeConfig) {
  10038. throw new Error(UtilTools.getLog('vxe.error.noTree', ['merge-cells']));
  10039. }
  10040. if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(merges)) {
  10041. merges = [merges];
  10042. }
  10043. merges.forEach(function (item) {
  10044. var row = item.row,
  10045. col = item.col;
  10046. if (rowList && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNumber(row)) {
  10047. row = rowList[row];
  10048. }
  10049. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNumber(col)) {
  10050. col = visibleColumn[col];
  10051. }
  10052. var mcIndex = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.findIndexOf(mList, function (item) {
  10053. return item._row === row && item._col === col;
  10054. });
  10055. if (mcIndex > -1) {
  10056. var rItems = mList.splice(mcIndex, 1);
  10057. rest.push(rItems[0]);
  10058. }
  10059. });
  10060. }
  10061. return rest;
  10062. }
  10063. function clearAllSort(_vm) {
  10064. _vm.tableFullColumn.forEach(function (column) {
  10065. column.order = null;
  10066. });
  10067. }
  10068. function getOrderField(_vm, column) {
  10069. var sortBy = column.sortBy,
  10070. sortType = column.sortType;
  10071. return function (row) {
  10072. var cellValue;
  10073. if (sortBy) {
  10074. cellValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(sortBy) ? sortBy({
  10075. row: row,
  10076. column: column
  10077. }) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, sortBy);
  10078. } else {
  10079. cellValue = _vm.getCellLabel(row, column);
  10080. }
  10081. if (!sortType || sortType === 'auto') {
  10082. return isNaN(cellValue) ? cellValue : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(cellValue);
  10083. } else if (sortType === 'number') {
  10084. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(cellValue);
  10085. } else if (sortType === 'string') {
  10086. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toValueString(cellValue);
  10087. }
  10088. return cellValue;
  10089. };
  10090. }
  10091. var Methods = {
  10092. callSlot: function callSlot(slotFunc, params, h, vNodes) {
  10093. if (slotFunc) {
  10094. var $xegrid = this.$xegrid;
  10095. if ($xegrid) {
  10096. return $xegrid.callSlot(slotFunc, params, h, vNodes);
  10097. }
  10098. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(slotFunc)) {
  10099. return slotFunc.call(this, params, h, vNodes);
  10100. }
  10101. }
  10102. return [];
  10103. },
  10104. /**
  10105. * 获取父容器元素
  10106. */
  10107. getParentElem: function getParentElem() {
  10108. var $el = this.$el,
  10109. $xegrid = this.$xegrid;
  10110. return $xegrid ? $xegrid.$el.parentNode : $el.parentNode;
  10111. },
  10112. /**
  10113. * 获取父容器的高度
  10114. */
  10115. getParentHeight: function getParentHeight() {
  10116. var $el = this.$el,
  10117. $xegrid = this.$xegrid;
  10118. return Math.floor($xegrid ? $xegrid.getParentHeight() : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(getComputedStyle($el.parentNode).height));
  10119. },
  10120. /**
  10121. * 获取需要排除的高度
  10122. * 但渲染表格高度时,需要排除工具栏或分页等相关组件的高度
  10123. * 如果存在表尾合计滚动条,则需要排除滚动条高度
  10124. */
  10125. getExcludeHeight: function getExcludeHeight() {
  10126. var $xegrid = this.$xegrid;
  10127. return $xegrid ? $xegrid.getExcludeHeight() : 0;
  10128. },
  10129. /**
  10130. * 重置表格的一切数据状态
  10131. */
  10132. clearAll: function clearAll() {
  10133. return clearTableAllStatus(this);
  10134. },
  10135. /**
  10136. * 同步 data 数据
  10137. * 如果用了该方法,那么组件将不再记录增删改的状态,只能自行实现对应逻辑
  10138. * 对于某些特殊的场景,比如深层树节点元素发生变动时可能会用到
  10139. */
  10140. syncData: function syncData() {
  10141. var _this = this;
  10142. return this.$nextTick().then(function () {
  10143. _this.tableData = [];
  10144. return _this.$nextTick().then(function () {
  10145. return _this.loadTableData(_this.tableFullData);
  10146. });
  10147. });
  10148. },
  10149. /**
  10150. * 手动处理数据
  10151. * 对于手动更改了排序、筛选...等条件后需要重新处理数据时可能会用到
  10152. */
  10153. updateData: function updateData() {
  10154. return this.handleTableData(true).then(this.updateFooter).then(this.recalculate);
  10155. },
  10156. handleTableData: function handleTableData(force) {
  10157. var scrollYLoad = this.scrollYLoad,
  10158. scrollYStore = this.scrollYStore;
  10159. var fullData = force ? this.updateAfterFullData() : this.afterFullData;
  10160. this.tableData = scrollYLoad ? fullData.slice(scrollYStore.startIndex, scrollYStore.endIndex) : fullData.slice(0);
  10161. return this.$nextTick();
  10162. },
  10163. /**
  10164. * 加载表格数据
  10165. * @param {Array} datas 数据
  10166. */
  10167. loadTableData: function loadTableData(datas) {
  10168. var _this2 = this;
  10169. var keepSource = this.keepSource,
  10170. treeConfig = this.treeConfig,
  10171. editStore = this.editStore,
  10172. sYOpts = this.sYOpts,
  10173. scrollYStore = this.scrollYStore,
  10174. scrollXStore = this.scrollXStore,
  10175. lastScrollLeft = this.lastScrollLeft,
  10176. lastScrollTop = this.lastScrollTop;
  10177. var tableFullData = datas ? datas.slice(0) : [];
  10178. var scrollYLoad = !treeConfig && sYOpts.enabled && sYOpts.gt > -1 && sYOpts.gt < tableFullData.length;
  10179. scrollYStore.startIndex = 0;
  10180. scrollYStore.endIndex = 1;
  10181. scrollXStore.startIndex = 0;
  10182. scrollXStore.endIndex = 1;
  10183. editStore.insertList = [];
  10184. editStore.removeList = []; // 全量数据
  10185. this.tableFullData = tableFullData; // 缓存数据
  10186. this.updateCache(true); // 原始数据
  10187. this.tableSynchData = datas;
  10188. if (keepSource) {
  10189. this.tableSourceData = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.clone(tableFullData, true);
  10190. }
  10191. this.scrollYLoad = scrollYLoad;
  10192. if (false) {}
  10193. this.clearMergeCells();
  10194. this.clearMergeFooterItems();
  10195. this.handleTableData(true);
  10196. this.updateFooter();
  10197. return this.$nextTick().then(function () {
  10198. _this2.updateHeight();
  10199. _this2.updateStyle();
  10200. }).then(function () {
  10201. _this2.computeScrollLoad();
  10202. }).then(function () {
  10203. // 是否加载了数据
  10204. if (scrollYLoad) {
  10205. scrollYStore.endIndex = scrollYStore.visibleSize;
  10206. }
  10207. _this2.handleReserveStatus();
  10208. _this2.checkSelectionStatus();
  10209. return _this2.$nextTick().then(function () {
  10210. return _this2.recalculate();
  10211. }).then(function () {
  10212. return restoreScroll(_this2, lastScrollLeft, lastScrollTop);
  10213. });
  10214. });
  10215. },
  10216. /**
  10217. * 重新加载数据,不会清空表格状态
  10218. * @param {Array} datas 数据
  10219. */
  10220. loadData: function loadData(datas) {
  10221. var _this3 = this;
  10222. var inited = this.inited,
  10223. initStatus = this.initStatus;
  10224. return this.loadTableData(datas).then(function () {
  10225. _this3.inited = true;
  10226. _this3.initStatus = true;
  10227. if (!initStatus) {
  10228. _this3.handleLoadDefaults();
  10229. }
  10230. if (!inited) {
  10231. _this3.handleInitDefaults();
  10232. }
  10233. return _this3.recalculate();
  10234. });
  10235. },
  10236. /**
  10237. * 重新加载数据,会清空表格状态
  10238. * @param {Array} datas 数据
  10239. */
  10240. reloadData: function reloadData(datas) {
  10241. var _this4 = this;
  10242. var inited = this.inited;
  10243. return this.clearAll().then(function () {
  10244. _this4.inited = true;
  10245. _this4.initStatus = true;
  10246. return _this4.loadTableData(datas);
  10247. }).then(function () {
  10248. _this4.handleLoadDefaults();
  10249. if (!inited) {
  10250. _this4.handleInitDefaults();
  10251. }
  10252. return _this4.recalculate();
  10253. });
  10254. },
  10255. /**
  10256. * 局部加载行数据并恢复到初始状态
  10257. * 对于行数据需要局部更改的场景中可能会用到
  10258. * @param {Row} row 行对象
  10259. * @param {Object} record 新数据
  10260. * @param {String} field 字段名
  10261. */
  10262. reloadRow: function reloadRow(row, record, field) {
  10263. var keepSource = this.keepSource,
  10264. tableSourceData = this.tableSourceData,
  10265. tableData = this.tableData;
  10266. if (keepSource) {
  10267. var rowIndex = this.getRowIndex(row);
  10268. var oRow = tableSourceData[rowIndex];
  10269. if (oRow && row) {
  10270. if (field) {
  10271. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.set(oRow, field, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(record || row, field));
  10272. } else {
  10273. if (record) {
  10274. tableSourceData[rowIndex] = record;
  10275. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.clear(row, undefined);
  10276. Object.assign(row, this.defineField(Object.assign({}, record)));
  10277. this.updateCache(true);
  10278. } else {
  10279. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.destructuring(oRow, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.clone(row, true));
  10280. }
  10281. }
  10282. }
  10283. this.tableData = tableData.slice(0);
  10284. } else {
  10285. if (false) {}
  10286. }
  10287. return this.$nextTick();
  10288. },
  10289. /**
  10290. * 加载列配置
  10291. * 对于表格列需要重载、局部递增场景下可能会用到
  10292. * @param {ColumnInfo} columns 列配置
  10293. */
  10294. loadColumn: function loadColumn(columns) {
  10295. var _this5 = this;
  10296. var collectColumn = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.mapTree(columns, function (column) {
  10297. return src_cell.createColumn(_this5, column);
  10298. });
  10299. this.handleColumn(collectColumn);
  10300. return this.$nextTick();
  10301. },
  10302. /**
  10303. * 加载列配置并恢复到初始状态
  10304. * 对于表格列需要重载、局部递增场景下可能会用到
  10305. * @param {ColumnInfo} columns 列配置
  10306. */
  10307. reloadColumn: function reloadColumn(columns) {
  10308. var _this6 = this;
  10309. return this.clearAll().then(function () {
  10310. return _this6.loadColumn(columns);
  10311. });
  10312. },
  10313. handleColumn: function handleColumn(collectColumn) {
  10314. var _this7 = this;
  10315. this.collectColumn = collectColumn;
  10316. var tableFullColumn = methods_getColumnList(collectColumn);
  10317. this.tableFullColumn = tableFullColumn;
  10318. this.cacheColumnMap();
  10319. this.restoreCustomStorage();
  10320. this.refreshColumn().then(function () {
  10321. if (_this7.scrollXLoad) {
  10322. _this7.loadScrollXData(true);
  10323. }
  10324. });
  10325. this.clearMergeCells();
  10326. this.clearMergeFooterItems();
  10327. this.handleTableData(true);
  10328. if (false) {}
  10329. this.$nextTick(function () {
  10330. if (_this7.$toolbar) {
  10331. _this7.$toolbar.syncUpdate({
  10332. collectColumn: collectColumn,
  10333. $table: _this7
  10334. });
  10335. }
  10336. });
  10337. },
  10338. /**
  10339. * 更新数据行的 Map
  10340. * 牺牲数据组装的耗时,用来换取使用过程中的流畅
  10341. */
  10342. updateCache: function updateCache(source) {
  10343. var _this8 = this;
  10344. var treeConfig = this.treeConfig,
  10345. treeOpts = this.treeOpts,
  10346. tableFullData = this.tableFullData,
  10347. fullDataRowMap = this.fullDataRowMap,
  10348. fullAllDataRowMap = this.fullAllDataRowMap;
  10349. var fullDataRowIdData = this.fullDataRowIdData,
  10350. fullAllDataRowIdData = this.fullAllDataRowIdData;
  10351. var rowkey = getRowkey(this);
  10352. var isLazy = treeConfig && treeOpts.lazy;
  10353. var handleCache = function handleCache(row, index, items, path, parent) {
  10354. var rowid = methods_getRowid(_this8, row);
  10355. if (!rowid) {
  10356. rowid = getRowUniqueId();
  10357. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.set(row, rowkey, rowid);
  10358. }
  10359. if (isLazy && row[treeOpts.hasChild] && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isUndefined(row[treeOpts.children])) {
  10360. row[treeOpts.children] = null;
  10361. }
  10362. var rest = {
  10363. row: row,
  10364. rowid: rowid,
  10365. index: treeConfig && parent ? -1 : index,
  10366. items: items,
  10367. parent: parent
  10368. };
  10369. if (source) {
  10370. fullDataRowIdData[rowid] = rest;
  10371. fullDataRowMap.set(row, rest);
  10372. }
  10373. fullAllDataRowIdData[rowid] = rest;
  10374. fullAllDataRowMap.set(row, rest);
  10375. };
  10376. if (source) {
  10377. fullDataRowIdData = this.fullDataRowIdData = {};
  10378. fullDataRowMap.clear();
  10379. }
  10380. fullAllDataRowIdData = this.fullAllDataRowIdData = {};
  10381. fullAllDataRowMap.clear();
  10382. if (treeConfig) {
  10383. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(tableFullData, handleCache, treeOpts);
  10384. } else {
  10385. tableFullData.forEach(handleCache);
  10386. }
  10387. },
  10388. loadChildren: function loadChildren(row, childRecords) {
  10389. var _this9 = this;
  10390. return this.createData(childRecords).then(function (rows) {
  10391. var keepSource = _this9.keepSource,
  10392. tableSourceData = _this9.tableSourceData,
  10393. treeOpts = _this9.treeOpts,
  10394. fullDataRowIdData = _this9.fullDataRowIdData,
  10395. fullDataRowMap = _this9.fullDataRowMap,
  10396. fullAllDataRowMap = _this9.fullAllDataRowMap,
  10397. fullAllDataRowIdData = _this9.fullAllDataRowIdData;
  10398. var children = treeOpts.children;
  10399. if (keepSource) {
  10400. var rowid = methods_getRowid(_this9, row);
  10401. var matchObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.findTree(tableSourceData, function (item) {
  10402. return rowid === methods_getRowid(_this9, item);
  10403. }, treeOpts);
  10404. if (matchObj) {
  10405. matchObj.item[children] = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.clone(rows, true);
  10406. }
  10407. }
  10408. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(rows, function (childRow, index, items, path, parent) {
  10409. var rowid = methods_getRowid(_this9, childRow);
  10410. var rest = {
  10411. row: childRow,
  10412. rowid: rowid,
  10413. index: -1,
  10414. items: items,
  10415. parent: parent
  10416. };
  10417. fullDataRowIdData[rowid] = rest;
  10418. fullDataRowMap.set(childRow, rest);
  10419. fullAllDataRowIdData[rowid] = rest;
  10420. fullAllDataRowMap.set(childRow, rest);
  10421. }, treeOpts);
  10422. row[children] = rows;
  10423. return rows;
  10424. });
  10425. },
  10426. /**
  10427. * 更新数据列的 Map
  10428. * 牺牲数据组装的耗时,用来换取使用过程中的流畅
  10429. */
  10430. cacheColumnMap: function cacheColumnMap() {
  10431. var _this10 = this;
  10432. var tableFullColumn = this.tableFullColumn,
  10433. collectColumn = this.collectColumn,
  10434. fullColumnMap = this.fullColumnMap,
  10435. showOverflow = this.showOverflow;
  10436. var fullColumnIdData = this.fullColumnIdData = {};
  10437. var fullColumnFieldData = this.fullColumnFieldData = {};
  10438. var isGroup = collectColumn.some(hasChildrenList);
  10439. var isAllOverflow = !!showOverflow;
  10440. var expandColumn;
  10441. var treeNodeColumn;
  10442. var checkboxColumn;
  10443. var radioColumn;
  10444. var hasFixed;
  10445. var handleFunc = function handleFunc(column, index, items, path, parent) {
  10446. var colid = column.id,
  10447. property = column.property,
  10448. fixed = column.fixed,
  10449. type = column.type,
  10450. treeNode = column.treeNode;
  10451. var rest = {
  10452. column: column,
  10453. colid: colid,
  10454. index: index,
  10455. items: items,
  10456. parent: parent
  10457. };
  10458. if (property) {
  10459. if (false) {}
  10460. fullColumnFieldData[property] = rest;
  10461. }
  10462. if (!hasFixed && fixed) {
  10463. hasFixed = fixed;
  10464. }
  10465. if (treeNode) {
  10466. if (false) {}
  10467. if (!treeNodeColumn) {
  10468. treeNodeColumn = column;
  10469. }
  10470. } else if (type === 'expand') {
  10471. if (false) {}
  10472. if (!expandColumn) {
  10473. expandColumn = column;
  10474. }
  10475. }
  10476. if (false) {}
  10477. if (false) {}
  10478. if (isAllOverflow && column.showOverflow === false) {
  10479. isAllOverflow = false;
  10480. }
  10481. if (fullColumnIdData[colid]) {
  10482. UtilTools.error('vxe.error.colRepet', ['colId', colid]);
  10483. }
  10484. fullColumnIdData[colid] = rest;
  10485. fullColumnMap.set(column, rest);
  10486. };
  10487. fullColumnMap.clear();
  10488. if (isGroup) {
  10489. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(collectColumn, function (column, index, items, path, parent, nodes) {
  10490. column.level = nodes.length;
  10491. handleFunc(column, index, items, path, parent);
  10492. });
  10493. } else {
  10494. tableFullColumn.forEach(handleFunc);
  10495. }
  10496. if (false) {}
  10497. this.isGroup = isGroup;
  10498. this.treeNodeColumn = treeNodeColumn;
  10499. this.expandColumn = expandColumn;
  10500. this.isAllOverflow = isAllOverflow;
  10501. },
  10502. /**
  10503. * 根据 tr 元素获取对应的 row 信息
  10504. * @param {Element} tr 元素
  10505. */
  10506. getRowNode: function getRowNode(tr) {
  10507. if (tr) {
  10508. var fullAllDataRowIdData = this.fullAllDataRowIdData;
  10509. var rowid = tr.getAttribute('rowid');
  10510. var rest = fullAllDataRowIdData[rowid];
  10511. if (rest) {
  10512. return {
  10513. rowid: rest.rowid,
  10514. item: rest.row,
  10515. index: rest.index,
  10516. items: rest.items,
  10517. parent: rest.parent
  10518. };
  10519. }
  10520. }
  10521. return null;
  10522. },
  10523. /**
  10524. * 根据 th/td 元素获取对应的 column 信息
  10525. * @param {Element} cell 元素
  10526. */
  10527. getColumnNode: function getColumnNode(cell) {
  10528. if (cell) {
  10529. var fullColumnIdData = this.fullColumnIdData;
  10530. var colid = cell.getAttribute('colid');
  10531. var rest = fullColumnIdData[colid];
  10532. if (rest) {
  10533. return {
  10534. colid: rest.colid,
  10535. item: rest.column,
  10536. index: rest.index,
  10537. items: rest.items,
  10538. parent: rest.parent
  10539. };
  10540. }
  10541. }
  10542. return null;
  10543. },
  10544. /**
  10545. * 根据 row 获取相对于 data 中的索引
  10546. * @param {Row} row 行对象
  10547. */
  10548. getRowIndex: function getRowIndex(row) {
  10549. return this.fullDataRowMap.has(row) ? this.fullDataRowMap.get(row).index : -1;
  10550. },
  10551. /**
  10552. * 根据 row 获取相对于当前数据中的索引
  10553. * @param {Row} row 行对象
  10554. */
  10555. getVTRowIndex: function getVTRowIndex(row) {
  10556. return this.afterFullData.indexOf(row);
  10557. },
  10558. // 在 v3 中废弃
  10559. _getRowIndex: function _getRowIndex(row) {
  10560. if (false) {}
  10561. return this.getVTRowIndex(row);
  10562. },
  10563. /**
  10564. * 根据 row 获取渲染中的虚拟索引
  10565. * @param {Row} row 行对象
  10566. */
  10567. getVMRowIndex: function getVMRowIndex(row) {
  10568. return this.tableData.indexOf(row);
  10569. },
  10570. // 在 v3 中废弃
  10571. $getRowIndex: function $getRowIndex(row) {
  10572. if (false) {}
  10573. return this.getVMRowIndex(row);
  10574. },
  10575. /**
  10576. * 根据 column 获取相对于 columns 中的索引
  10577. * @param {ColumnInfo} column 列配置
  10578. */
  10579. getColumnIndex: function getColumnIndex(column) {
  10580. return this.fullColumnMap.has(column) ? this.fullColumnMap.get(column).index : -1;
  10581. },
  10582. /**
  10583. * 根据 column 获取相对于当前表格列中的索引
  10584. * @param {ColumnInfo} column 列配置
  10585. */
  10586. getVTColumnIndex: function getVTColumnIndex(column) {
  10587. return this.visibleColumn.indexOf(column);
  10588. },
  10589. // 在 v3 中废弃
  10590. _getColumnIndex: function _getColumnIndex(column) {
  10591. if (false) {}
  10592. return this.getVTColumnIndex(column);
  10593. },
  10594. /**
  10595. * 根据 column 获取渲染中的虚拟索引
  10596. * @param {ColumnInfo} column 列配置
  10597. */
  10598. getVMColumnIndex: function getVMColumnIndex(column) {
  10599. return this.tableColumn.indexOf(column);
  10600. },
  10601. // 在 v3 中废弃
  10602. $getColumnIndex: function $getColumnIndex(column) {
  10603. if (false) {}
  10604. return this.getVMColumnIndex(column);
  10605. },
  10606. /**
  10607. * 判断是否为索引列
  10608. * @param {ColumnInfo} column 列配置
  10609. */
  10610. isSeqColumn: function isSeqColumn(column) {
  10611. return column && column.type === 'seq';
  10612. },
  10613. /**
  10614. * 定义行数据中的列属性,如果不存在则定义
  10615. * @param {Row} record 行数据
  10616. */
  10617. defineField: function defineField(record) {
  10618. var radioOpts = this.radioOpts,
  10619. checkboxOpts = this.checkboxOpts,
  10620. treeConfig = this.treeConfig,
  10621. treeOpts = this.treeOpts,
  10622. expandOpts = this.expandOpts;
  10623. var rowkey = getRowkey(this);
  10624. this.visibleColumn.forEach(function (_ref) {
  10625. var property = _ref.property,
  10626. editRender = _ref.editRender;
  10627. if (property && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.has(record, property)) {
  10628. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.set(record, property, editRender && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isUndefined(editRender.defaultValue) ? editRender.defaultValue : null);
  10629. }
  10630. });
  10631. var ohterFields = [radioOpts.labelField, checkboxOpts.checkField, checkboxOpts.labelField, expandOpts.labelField];
  10632. ohterFields.forEach(function (key) {
  10633. if (key && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(record, key)) {
  10634. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.set(record, key, null);
  10635. }
  10636. });
  10637. if (treeConfig && treeOpts.lazy && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isUndefined(record[treeOpts.children])) {
  10638. record[treeOpts.children] = null;
  10639. } // 必须有行数据的唯一主键,可以自行设置;也可以默认生成一个随机数
  10640. if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(record, rowkey)) {
  10641. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.set(record, rowkey, getRowUniqueId());
  10642. }
  10643. return record;
  10644. },
  10645. /**
  10646. * 创建 data 对象
  10647. * 对于某些特殊场景可能会用到,会自动对数据的字段名进行检测,如果不存在就自动定义
  10648. * @param {Array} records 新数据
  10649. */
  10650. createData: function createData(records) {
  10651. var _this11 = this;
  10652. var treeConfig = this.treeConfig,
  10653. treeOpts = this.treeOpts;
  10654. var handleRrecord = function handleRrecord(record) {
  10655. return _this11.defineField(Object.assign({}, record));
  10656. };
  10657. var rows = treeConfig ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.mapTree(records, handleRrecord, treeOpts) : records.map(handleRrecord);
  10658. return this.$nextTick().then(function () {
  10659. return rows;
  10660. });
  10661. },
  10662. /**
  10663. * 创建 Row|Rows 对象
  10664. * 对于某些特殊场景需要对数据进行手动插入时可能会用到
  10665. * @param {Array/Object} records 新数据
  10666. */
  10667. createRow: function createRow(records) {
  10668. var _this12 = this;
  10669. var isArr = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(records);
  10670. if (!isArr) {
  10671. records = [records];
  10672. }
  10673. return this.$nextTick().then(function () {
  10674. return _this12.createData(records).then(function (rows) {
  10675. return isArr ? rows : rows[0];
  10676. });
  10677. });
  10678. },
  10679. /**
  10680. * 还原数据
  10681. * 如果不传任何参数,则还原整个表格
  10682. * 如果传 row 则还原一行
  10683. * 如果传 rows 则还原多行
  10684. * 如果还额外传了 field 则还原指定的单元格数据
  10685. */
  10686. revertData: function revertData(rows, field) {
  10687. var _this13 = this;
  10688. var keepSource = this.keepSource,
  10689. tableSourceData = this.tableSourceData,
  10690. treeConfig = this.treeConfig;
  10691. if (keepSource) {
  10692. if (arguments.length) {
  10693. if (rows && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(rows)) {
  10694. rows = [rows];
  10695. }
  10696. rows.forEach(function (row) {
  10697. if (!_this13.isInsertByRow(row)) {
  10698. var rowIndex = _this13.getRowIndex(row);
  10699. if (treeConfig && rowIndex === -1) {
  10700. throw new Error(UtilTools.getLog('vxe.error.noTree', ['revertData']));
  10701. }
  10702. var oRow = tableSourceData[rowIndex];
  10703. if (oRow && row) {
  10704. if (field) {
  10705. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.set(row, field, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.clone(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(oRow, field), true));
  10706. } else {
  10707. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.destructuring(row, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.clone(oRow, true));
  10708. }
  10709. }
  10710. }
  10711. });
  10712. return this.$nextTick();
  10713. }
  10714. return this.reloadData(tableSourceData);
  10715. } else {
  10716. if (false) {}
  10717. }
  10718. return this.$nextTick();
  10719. },
  10720. /**
  10721. * 清空单元格内容
  10722. * 如果不创参数,则清空整个表格内容
  10723. * 如果传 row 则清空一行内容
  10724. * 如果传 rows 则清空多行内容
  10725. * 如果还额外传了 field 则清空指定单元格内容
  10726. * @param {Array/Row} rows 行数据
  10727. * @param {String} field 字段名
  10728. */
  10729. clearData: function clearData(rows, field) {
  10730. var tableFullData = this.tableFullData,
  10731. visibleColumn = this.visibleColumn;
  10732. if (!arguments.length) {
  10733. rows = tableFullData;
  10734. } else if (rows && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(rows)) {
  10735. rows = [rows];
  10736. }
  10737. if (field) {
  10738. rows.forEach(function (row) {
  10739. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.set(row, field, null);
  10740. });
  10741. } else {
  10742. rows.forEach(function (row) {
  10743. visibleColumn.forEach(function (column) {
  10744. if (column.property) {
  10745. methods_setCellValue(row, column, null);
  10746. }
  10747. });
  10748. });
  10749. }
  10750. return this.$nextTick();
  10751. },
  10752. /**
  10753. * 检查是否为临时行数据
  10754. * @param {Row} row 行对象
  10755. */
  10756. isInsertByRow: function isInsertByRow(row) {
  10757. return this.editStore.insertList.indexOf(row) > -1;
  10758. },
  10759. /**
  10760. * 检查行或列数据是否发生改变
  10761. * @param {Row} row 行对象
  10762. * @param {String} field 字段名
  10763. */
  10764. isUpdateByRow: function isUpdateByRow(row, field) {
  10765. var _this14 = this;
  10766. var visibleColumn = this.visibleColumn,
  10767. keepSource = this.keepSource,
  10768. treeConfig = this.treeConfig,
  10769. treeOpts = this.treeOpts,
  10770. tableSourceData = this.tableSourceData,
  10771. fullDataRowIdData = this.fullDataRowIdData;
  10772. if (keepSource) {
  10773. var oRow, property;
  10774. var rowid = methods_getRowid(this, row); // 新增的数据不需要检测
  10775. if (!fullDataRowIdData[rowid]) {
  10776. return false;
  10777. }
  10778. if (treeConfig) {
  10779. var children = treeOpts.children;
  10780. var matchObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.findTree(tableSourceData, function (item) {
  10781. return rowid === methods_getRowid(_this14, item);
  10782. }, treeOpts);
  10783. row = Object.assign({}, row, _defineProperty({}, children, null));
  10784. if (matchObj) {
  10785. oRow = Object.assign({}, matchObj.item, _defineProperty({}, children, null));
  10786. }
  10787. } else {
  10788. var oRowIndex = fullDataRowIdData[rowid].index;
  10789. oRow = tableSourceData[oRowIndex];
  10790. }
  10791. if (oRow) {
  10792. if (arguments.length > 1) {
  10793. return !eqCellValue(oRow, row, field);
  10794. }
  10795. for (var index = 0, len = visibleColumn.length; index < len; index++) {
  10796. property = visibleColumn[index].property;
  10797. if (property && !eqCellValue(oRow, row, property)) {
  10798. return true;
  10799. }
  10800. }
  10801. }
  10802. }
  10803. return false;
  10804. },
  10805. /**
  10806. * 获取表格的可视列,也可以指定索引获取列
  10807. * @param {Number} columnIndex 索引
  10808. */
  10809. getColumns: function getColumns(columnIndex) {
  10810. var columns = this.visibleColumn;
  10811. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isUndefined(columnIndex) ? columns.slice(0) : columns[columnIndex];
  10812. },
  10813. /**
  10814. * 根据列的唯一主键获取列
  10815. * @param {String} colid 列主键
  10816. */
  10817. getColumnById: function getColumnById(colid) {
  10818. var fullColumnIdData = this.fullColumnIdData;
  10819. return fullColumnIdData[colid] ? fullColumnIdData[colid].column : null;
  10820. },
  10821. /**
  10822. * 根据列的字段名获取列
  10823. * @param {String} field 字段名
  10824. */
  10825. getColumnByField: function getColumnByField(field) {
  10826. var fullColumnFieldData = this.fullColumnFieldData;
  10827. return fullColumnFieldData[field] ? fullColumnFieldData[field].column : null;
  10828. },
  10829. /**
  10830. * 获取当前表格的列
  10831. * 收集到的全量列、全量表头列、处理条件之后的全量表头列、当前渲染中的表头列
  10832. */
  10833. getTableColumn: function getTableColumn() {
  10834. return {
  10835. collectColumn: this.collectColumn.slice(0),
  10836. fullColumn: this.tableFullColumn.slice(0),
  10837. visibleColumn: this.visibleColumn.slice(0),
  10838. tableColumn: this.tableColumn.slice(0)
  10839. };
  10840. },
  10841. /**
  10842. * 获取数据,和 data 的行为一致,也可以指定索引获取数据
  10843. */
  10844. getData: function getData(rowIndex) {
  10845. var tableSynchData = this.data || this.tableSynchData;
  10846. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isUndefined(rowIndex) ? tableSynchData.slice(0) : tableSynchData[rowIndex];
  10847. },
  10848. /**
  10849. * 用于多选行,获取已选中的数据
  10850. */
  10851. getCheckboxRecords: function getCheckboxRecords() {
  10852. var tableFullData = this.tableFullData,
  10853. treeConfig = this.treeConfig,
  10854. treeOpts = this.treeOpts,
  10855. checkboxOpts = this.checkboxOpts;
  10856. var property = checkboxOpts.checkField;
  10857. var rowList = [];
  10858. if (property) {
  10859. if (treeConfig) {
  10860. rowList = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.filterTree(tableFullData, function (row) {
  10861. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, property);
  10862. }, treeOpts);
  10863. } else {
  10864. rowList = tableFullData.filter(function (row) {
  10865. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, property);
  10866. });
  10867. }
  10868. } else {
  10869. var selection = this.selection;
  10870. if (treeConfig) {
  10871. rowList = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.filterTree(tableFullData, function (row) {
  10872. return selection.indexOf(row) > -1;
  10873. }, treeOpts);
  10874. } else {
  10875. rowList = tableFullData.filter(function (row) {
  10876. return selection.indexOf(row) > -1;
  10877. });
  10878. }
  10879. }
  10880. return rowList;
  10881. },
  10882. /**
  10883. * 获取处理后全量的表格数据
  10884. * 如果存在筛选条件,继续处理
  10885. */
  10886. updateAfterFullData: function updateAfterFullData() {
  10887. var _this15 = this;
  10888. var visibleColumn = this.visibleColumn,
  10889. tableFullData = this.tableFullData,
  10890. filterOpts = this.filterOpts,
  10891. sortOpts = this.sortOpts;
  10892. var allRemoteFilter = filterOpts.remote,
  10893. allFilterMethod = filterOpts.filterMethod;
  10894. var allRemoteSort = sortOpts.remote,
  10895. allSortMethod = sortOpts.sortMethod,
  10896. sortMultiple = sortOpts.multiple;
  10897. var tableData = tableFullData.slice(0);
  10898. var filterColumns = [];
  10899. var orderColumns = [];
  10900. visibleColumn.forEach(function (column) {
  10901. var sortable = column.sortable,
  10902. order = column.order,
  10903. filters = column.filters;
  10904. if (!allRemoteFilter && filters && filters.length) {
  10905. var valueList = [];
  10906. var itemList = [];
  10907. filters.forEach(function (item) {
  10908. if (item.checked) {
  10909. itemList.push(item);
  10910. valueList.push(item.value);
  10911. }
  10912. });
  10913. if (itemList.length) {
  10914. filterColumns.push({
  10915. column: column,
  10916. valueList: valueList,
  10917. itemList: itemList
  10918. });
  10919. }
  10920. }
  10921. if (!allRemoteSort && sortable && order) {
  10922. orderColumns.push({
  10923. column: column,
  10924. sortBy: column.sortBy,
  10925. property: column.property,
  10926. order: order
  10927. });
  10928. }
  10929. });
  10930. if (filterColumns.length) {
  10931. tableData = tableData.filter(function (row) {
  10932. return filterColumns.every(function (_ref2) {
  10933. var column = _ref2.column,
  10934. valueList = _ref2.valueList,
  10935. itemList = _ref2.itemList;
  10936. if (valueList.length && !allRemoteFilter) {
  10937. var filterMethod = column.filterMethod,
  10938. filterRender = column.filterRender;
  10939. var compConf = filterRender ? v_x_e_table.renderer.get(filterRender.name) : null;
  10940. var compFilterMethod = compConf && compConf.renderFilter ? compConf.filterMethod : null;
  10941. if (filterMethod) {
  10942. return itemList.some(function (item) {
  10943. return filterMethod({
  10944. value: item.value,
  10945. option: item,
  10946. row: row,
  10947. column: column,
  10948. $table: _this15
  10949. });
  10950. });
  10951. } else if (compFilterMethod) {
  10952. return itemList.some(function (item) {
  10953. return compFilterMethod({
  10954. value: item.value,
  10955. option: item,
  10956. row: row,
  10957. column: column,
  10958. $table: _this15
  10959. });
  10960. });
  10961. } else if (allFilterMethod) {
  10962. return allFilterMethod({
  10963. options: itemList,
  10964. values: valueList,
  10965. row: row,
  10966. column: column
  10967. });
  10968. }
  10969. return valueList.indexOf(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, column.property)) > -1;
  10970. }
  10971. return true;
  10972. });
  10973. });
  10974. }
  10975. var firstOrderColumn = orderColumns[0];
  10976. if (!allRemoteSort && firstOrderColumn) {
  10977. if (allSortMethod) {
  10978. var sortRests = allSortMethod({
  10979. data: tableData,
  10980. column: firstOrderColumn.column,
  10981. property: firstOrderColumn.property,
  10982. order: firstOrderColumn.order,
  10983. sortList: orderColumns,
  10984. $table: this
  10985. });
  10986. tableData = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(sortRests) ? sortRests : tableData;
  10987. } else {
  10988. // 兼容 v4
  10989. if (sortMultiple) {
  10990. tableData = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.orderBy(tableData, orderColumns.map(function (_ref3) {
  10991. var column = _ref3.column,
  10992. order = _ref3.order;
  10993. return [getOrderField(_this15, column), order];
  10994. }));
  10995. } else {
  10996. // 兼容 v2,在 v4 中废弃, sortBy 不能为数组
  10997. var sortByConfs;
  10998. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(firstOrderColumn.sortBy)) {
  10999. sortByConfs = firstOrderColumn.sortBy.map(function (item) {
  11000. return [item, firstOrderColumn.order];
  11001. });
  11002. }
  11003. tableData = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.orderBy(tableData, sortByConfs || [firstOrderColumn].map(function (_ref4) {
  11004. var column = _ref4.column,
  11005. order = _ref4.order;
  11006. return [getOrderField(_this15, column), order];
  11007. }));
  11008. }
  11009. }
  11010. }
  11011. this.afterFullData = tableData;
  11012. return tableData;
  11013. },
  11014. /**
  11015. * 根据行的唯一主键获取行
  11016. * @param {String/Number} rowid 行主键
  11017. */
  11018. getRowById: function getRowById(rowid) {
  11019. var fullDataRowIdData = this.fullDataRowIdData;
  11020. return fullDataRowIdData[rowid] ? fullDataRowIdData[rowid].row : null;
  11021. },
  11022. /**
  11023. * 根据行获取行的唯一主键
  11024. * @param {Row} row 行对象
  11025. */
  11026. getRowid: function getRowid(row) {
  11027. var fullAllDataRowMap = this.fullAllDataRowMap;
  11028. return fullAllDataRowMap.has(row) ? fullAllDataRowMap.get(row).rowid : null;
  11029. },
  11030. /**
  11031. * 获取处理后的表格数据
  11032. * 如果存在筛选条件,继续处理
  11033. * 如果存在排序,继续处理
  11034. */
  11035. getTableData: function getTableData() {
  11036. var tableFullData = this.tableFullData,
  11037. afterFullData = this.afterFullData,
  11038. tableData = this.tableData,
  11039. footerTableData = this.footerTableData;
  11040. return {
  11041. fullData: tableFullData.slice(0),
  11042. visibleData: afterFullData.slice(0),
  11043. tableData: tableData.slice(0),
  11044. footerData: footerTableData.slice(0)
  11045. };
  11046. },
  11047. /**
  11048. * 处理数据加载默认行为
  11049. * 默认执行一次,除非被重置
  11050. */
  11051. handleLoadDefaults: function handleLoadDefaults() {
  11052. var _this16 = this;
  11053. if (this.checkboxConfig) {
  11054. this.handleDefaultSelectionChecked();
  11055. }
  11056. if (this.radioConfig) {
  11057. this.handleDefaultRadioChecked();
  11058. }
  11059. if (this.expandConfig) {
  11060. this.handleDefaultRowExpand();
  11061. }
  11062. if (this.treeConfig) {
  11063. this.handleDefaultTreeExpand();
  11064. }
  11065. if (this.mergeCells) {
  11066. this.handleDefaultMergeCells();
  11067. }
  11068. if (this.mergeFooterItems) {
  11069. this.handleDefaultMergeFooterItems();
  11070. }
  11071. this.$nextTick(function () {
  11072. return setTimeout(_this16.recalculate);
  11073. });
  11074. },
  11075. /**
  11076. * 处理初始化的默认行为
  11077. * 只会执行一次
  11078. */
  11079. handleInitDefaults: function handleInitDefaults() {
  11080. var sortConfig = this.sortConfig;
  11081. if (sortConfig) {
  11082. this.handleDefaultSort();
  11083. }
  11084. },
  11085. /**
  11086. * 隐藏指定列
  11087. */
  11088. hideColumn: function hideColumn(fieldOrColumn) {
  11089. var column = handleFieldOrColumn(this, fieldOrColumn);
  11090. if (column) {
  11091. column.visible = false;
  11092. }
  11093. return this.handleCustom();
  11094. },
  11095. /**
  11096. * 显示指定列
  11097. */
  11098. showColumn: function showColumn(fieldOrColumn) {
  11099. var column = handleFieldOrColumn(this, fieldOrColumn);
  11100. if (column) {
  11101. column.visible = true;
  11102. }
  11103. return this.handleCustom();
  11104. },
  11105. /**
  11106. * 手动重置列的显示隐藏、列宽拖动的状态;
  11107. * 如果为 true 则重置所有状态
  11108. * 如果已关联工具栏,则会同步更新
  11109. */
  11110. resetColumn: function resetColumn(options) {
  11111. var customOpts = this.customOpts;
  11112. var checkMethod = customOpts.checkMethod;
  11113. var opts = Object.assign({
  11114. visible: true,
  11115. resizable: options === true
  11116. }, options);
  11117. this.tableFullColumn.forEach(function (column) {
  11118. if (opts.resizable) {
  11119. column.resizeWidth = 0;
  11120. }
  11121. if (!checkMethod || checkMethod({
  11122. column: column
  11123. })) {
  11124. column.visible = column.defaultVisible;
  11125. }
  11126. });
  11127. if (opts.resizable) {
  11128. this.saveCustomResizable(true);
  11129. }
  11130. return this.handleCustom();
  11131. },
  11132. handleCustom: function handleCustom() {
  11133. this.saveCustomVisible();
  11134. this.analyColumnWidth();
  11135. return this.refreshColumn();
  11136. },
  11137. /**
  11138. * 还原自定义列操作状态
  11139. */
  11140. restoreCustomStorage: function restoreCustomStorage() {
  11141. var id = this.id,
  11142. collectColumn = this.collectColumn,
  11143. customConfig = this.customConfig,
  11144. customOpts = this.customOpts;
  11145. var storage = customOpts.storage;
  11146. var isAllStorage = customOpts.storage === true;
  11147. var isResizable = isAllStorage || storage && storage.resizable;
  11148. var isVisible = isAllStorage || storage && storage.visible;
  11149. if (customConfig && (isResizable || isVisible)) {
  11150. var customMap = {};
  11151. if (!id) {
  11152. UtilTools.error('vxe.error.reqProp', ['id']);
  11153. return;
  11154. }
  11155. if (isResizable) {
  11156. var columnWidthStorage = getCustomStorageMap(resizableStorageKey)[id];
  11157. if (columnWidthStorage) {
  11158. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.each(columnWidthStorage, function (resizeWidth, field) {
  11159. customMap[field] = {
  11160. field: field,
  11161. resizeWidth: resizeWidth
  11162. };
  11163. });
  11164. }
  11165. }
  11166. if (isVisible) {
  11167. var columnVisibleStorage = getCustomStorageMap(visibleStorageKey)[id];
  11168. if (columnVisibleStorage) {
  11169. var colVisibles = columnVisibleStorage.split('|');
  11170. var colHides = colVisibles[0] ? colVisibles[0].split(',') : [];
  11171. var colShows = colVisibles[1] ? colVisibles[1].split(',') : [];
  11172. colHides.forEach(function (field) {
  11173. if (customMap[field]) {
  11174. customMap[field].visible = false;
  11175. } else {
  11176. customMap[field] = {
  11177. field: field,
  11178. visible: false
  11179. };
  11180. }
  11181. });
  11182. colShows.forEach(function (field) {
  11183. if (customMap[field]) {
  11184. customMap[field].visible = true;
  11185. } else {
  11186. customMap[field] = {
  11187. field: field,
  11188. visible: true
  11189. };
  11190. }
  11191. });
  11192. }
  11193. }
  11194. var keyMap = {};
  11195. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(collectColumn, function (column) {
  11196. var colKey = column.getKey();
  11197. if (colKey) {
  11198. keyMap[colKey] = column;
  11199. }
  11200. });
  11201. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.each(customMap, function (_ref5, field) {
  11202. var visible = _ref5.visible,
  11203. resizeWidth = _ref5.resizeWidth;
  11204. var column = keyMap[field];
  11205. if (column) {
  11206. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNumber(resizeWidth)) {
  11207. column.resizeWidth = resizeWidth;
  11208. }
  11209. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isBoolean(visible)) {
  11210. column.visible = visible;
  11211. }
  11212. }
  11213. });
  11214. }
  11215. },
  11216. saveCustomVisible: function saveCustomVisible() {
  11217. var id = this.id,
  11218. collectColumn = this.collectColumn,
  11219. customConfig = this.customConfig,
  11220. customOpts = this.customOpts;
  11221. var checkMethod = customOpts.checkMethod,
  11222. storage = customOpts.storage;
  11223. var isAllStorage = customOpts.storage === true;
  11224. var isVisible = isAllStorage || storage && storage.visible;
  11225. if (customConfig && isVisible) {
  11226. var columnVisibleStorageMap = getCustomStorageMap(visibleStorageKey);
  11227. var colHides = [];
  11228. var colShows = [];
  11229. if (!id) {
  11230. UtilTools.error('vxe.error.reqProp', ['id']);
  11231. return;
  11232. }
  11233. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(collectColumn, function (column) {
  11234. if (!checkMethod || checkMethod({
  11235. column: column
  11236. })) {
  11237. if (!column.visible && column.defaultVisible) {
  11238. var colKey = column.getKey();
  11239. if (colKey) {
  11240. colHides.push(colKey);
  11241. }
  11242. } else if (column.visible && !column.defaultVisible) {
  11243. var _colKey = column.getKey();
  11244. if (_colKey) {
  11245. colShows.push(_colKey);
  11246. }
  11247. }
  11248. }
  11249. });
  11250. columnVisibleStorageMap[id] = [colHides.join(',')].concat(colShows.length ? [colShows.join(',')] : []).join('|') || undefined;
  11251. localStorage.setItem(visibleStorageKey, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toJSONString(columnVisibleStorageMap));
  11252. }
  11253. },
  11254. saveCustomResizable: function saveCustomResizable(isReset) {
  11255. var id = this.id,
  11256. collectColumn = this.collectColumn,
  11257. customConfig = this.customConfig,
  11258. customOpts = this.customOpts;
  11259. var storage = customOpts.storage;
  11260. var isAllStorage = customOpts.storage === true;
  11261. var isResizable = isAllStorage || storage && storage.resizable;
  11262. if (customConfig && isResizable) {
  11263. var columnWidthStorageMap = getCustomStorageMap(resizableStorageKey);
  11264. var columnWidthStorage;
  11265. if (!id) {
  11266. UtilTools.error('vxe.error.reqProp', ['id']);
  11267. return;
  11268. }
  11269. if (!isReset) {
  11270. columnWidthStorage = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isPlainObject(columnWidthStorageMap[id]) ? columnWidthStorageMap[id] : {};
  11271. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(collectColumn, function (column) {
  11272. if (column.resizeWidth) {
  11273. var colKey = column.getKey();
  11274. if (colKey) {
  11275. columnWidthStorage[colKey] = column.renderWidth;
  11276. }
  11277. }
  11278. });
  11279. }
  11280. columnWidthStorageMap[id] = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isEmpty(columnWidthStorage) ? undefined : columnWidthStorage;
  11281. localStorage.setItem(resizableStorageKey, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toJSONString(columnWidthStorageMap));
  11282. }
  11283. },
  11284. /**
  11285. * 刷新列信息
  11286. * 将固定的列左边、右边分别靠边
  11287. */
  11288. refreshColumn: function refreshColumn() {
  11289. var _this17 = this;
  11290. var leftList = [];
  11291. var centerList = [];
  11292. var rightList = [];
  11293. var collectColumn = this.collectColumn,
  11294. tableFullColumn = this.tableFullColumn,
  11295. isGroup = this.isGroup,
  11296. columnStore = this.columnStore,
  11297. sXOpts = this.sXOpts,
  11298. scrollXStore = this.scrollXStore; // 如果是分组表头,如果子列全部被隐藏,则根列也隐藏
  11299. if (isGroup) {
  11300. var leftGroupList = [];
  11301. var centerGroupList = [];
  11302. var rightGroupList = [];
  11303. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(collectColumn, function (column, index, items, path, parent) {
  11304. var isColGroup = hasChildrenList(column); // 如果是分组,必须按组设置固定列,不允许给子列设置固定
  11305. if (parent && parent.fixed) {
  11306. column.fixed = parent.fixed;
  11307. }
  11308. if (parent && column.fixed !== parent.fixed) {
  11309. UtilTools.error('vxe.error.groupFixed');
  11310. }
  11311. if (isColGroup) {
  11312. column.visible = !!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.findTree(column.children, function (subColumn) {
  11313. return hasChildrenList(subColumn) ? null : subColumn.visible;
  11314. });
  11315. } else if (column.visible) {
  11316. if (column.fixed === 'left') {
  11317. leftList.push(column);
  11318. } else if (column.fixed === 'right') {
  11319. rightList.push(column);
  11320. } else {
  11321. centerList.push(column);
  11322. }
  11323. }
  11324. });
  11325. collectColumn.forEach(function (column) {
  11326. if (column.visible) {
  11327. if (column.fixed === 'left') {
  11328. leftGroupList.push(column);
  11329. } else if (column.fixed === 'right') {
  11330. rightGroupList.push(column);
  11331. } else {
  11332. centerGroupList.push(column);
  11333. }
  11334. }
  11335. });
  11336. this.tableGroupColumn = leftGroupList.concat(centerGroupList).concat(rightGroupList);
  11337. } else {
  11338. // 重新分配列
  11339. tableFullColumn.forEach(function (column) {
  11340. if (column.visible) {
  11341. if (column.fixed === 'left') {
  11342. leftList.push(column);
  11343. } else if (column.fixed === 'right') {
  11344. rightList.push(column);
  11345. } else {
  11346. centerList.push(column);
  11347. }
  11348. }
  11349. });
  11350. }
  11351. var visibleColumn = leftList.concat(centerList).concat(rightList);
  11352. var scrollXLoad = sXOpts.enabled && sXOpts.gt > -1 && sXOpts.gt < tableFullColumn.length;
  11353. this.hasFixedColumn = leftList.length > 0 || rightList.length > 0;
  11354. Object.assign(columnStore, {
  11355. leftList: leftList,
  11356. centerList: centerList,
  11357. rightList: rightList
  11358. });
  11359. if (scrollXLoad && isGroup) {
  11360. scrollXLoad = false;
  11361. if (false) {}
  11362. }
  11363. if (scrollXLoad) {
  11364. if (false) {}
  11365. var _computeVirtualX = computeVirtualX(this),
  11366. visibleSize = _computeVirtualX.visibleSize;
  11367. scrollXStore.startIndex = 0;
  11368. scrollXStore.endIndex = visibleSize;
  11369. scrollXStore.visibleSize = visibleSize;
  11370. } // 如果列被显示/隐藏,则清除合并状态
  11371. // 如果列被设置为固定,则清除合并状态
  11372. if (visibleColumn.length !== this.visibleColumn.length || !this.visibleColumn.every(function (column, index) {
  11373. return column === visibleColumn[index];
  11374. })) {
  11375. this.clearMergeCells();
  11376. this.clearMergeFooterItems();
  11377. }
  11378. this.scrollXLoad = scrollXLoad;
  11379. this.visibleColumn = visibleColumn;
  11380. this.handleTableColumn();
  11381. return this.$nextTick().then(function () {
  11382. _this17.updateFooter();
  11383. return _this17.recalculate(true);
  11384. }).then(function () {
  11385. _this17.updateCellAreas();
  11386. return _this17.$nextTick().then(function () {
  11387. return _this17.recalculate();
  11388. });
  11389. });
  11390. },
  11391. /**
  11392. * 指定列宽的列进行拆分
  11393. */
  11394. analyColumnWidth: function analyColumnWidth() {
  11395. var columnOpts = this.columnOpts;
  11396. var defaultWidth = columnOpts.width,
  11397. defaultMinWidth = columnOpts.minWidth;
  11398. var resizeList = [];
  11399. var pxList = [];
  11400. var pxMinList = [];
  11401. var scaleList = [];
  11402. var scaleMinList = [];
  11403. var autoList = [];
  11404. this.tableFullColumn.forEach(function (column) {
  11405. if (defaultWidth && !column.width) {
  11406. column.width = defaultWidth;
  11407. }
  11408. if (defaultMinWidth && !column.minWidth) {
  11409. column.minWidth = defaultMinWidth;
  11410. }
  11411. if (column.visible) {
  11412. if (column.resizeWidth) {
  11413. resizeList.push(column);
  11414. } else if (DomTools.isPx(column.width)) {
  11415. pxList.push(column);
  11416. } else if (DomTools.isScale(column.width)) {
  11417. scaleList.push(column);
  11418. } else if (DomTools.isPx(column.minWidth)) {
  11419. pxMinList.push(column);
  11420. } else if (DomTools.isScale(column.minWidth)) {
  11421. scaleMinList.push(column);
  11422. } else {
  11423. autoList.push(column);
  11424. }
  11425. }
  11426. });
  11427. Object.assign(this.columnStore, {
  11428. resizeList: resizeList,
  11429. pxList: pxList,
  11430. pxMinList: pxMinList,
  11431. scaleList: scaleList,
  11432. scaleMinList: scaleMinList,
  11433. autoList: autoList
  11434. });
  11435. },
  11436. /**
  11437. * 刷新滚动操作,手动同步滚动相关位置(对于某些特殊的操作,比如滚动条错位、固定列不同步)
  11438. */
  11439. refreshScroll: function refreshScroll() {
  11440. var lastScrollLeft = this.lastScrollLeft,
  11441. lastScrollTop = this.lastScrollTop;
  11442. return restoreScroll(this, lastScrollLeft, lastScrollTop);
  11443. },
  11444. /**
  11445. * 计算单元格列宽,动态分配可用剩余空间
  11446. * 支持 width=? width=?px width=?% min-width=? min-width=?px min-width=?%
  11447. */
  11448. recalculate: function recalculate(refull) {
  11449. var _this18 = this;
  11450. var $refs = this.$refs;
  11451. var tableBody = $refs.tableBody,
  11452. tableHeader = $refs.tableHeader,
  11453. tableFooter = $refs.tableFooter;
  11454. var bodyElem = tableBody ? tableBody.$el : null;
  11455. var headerElem = tableHeader ? tableHeader.$el : null;
  11456. var footerElem = tableFooter ? tableFooter.$el : null;
  11457. if (bodyElem) {
  11458. this.autoCellWidth(headerElem, bodyElem, footerElem);
  11459. if (refull === true) {
  11460. // 初始化时需要在列计算之后再执行优化运算,达到最优显示效果
  11461. return this.computeScrollLoad().then(function () {
  11462. _this18.autoCellWidth(headerElem, bodyElem, footerElem);
  11463. return _this18.computeScrollLoad();
  11464. });
  11465. }
  11466. }
  11467. return this.computeScrollLoad();
  11468. },
  11469. /**
  11470. * 列宽算法
  11471. * 支持 px、%、固定 混合分配
  11472. * 支持动态列表调整分配
  11473. * 支持自动分配偏移量
  11474. * @param {Element} headerElem
  11475. * @param {Element} bodyElem
  11476. * @param {Element} footerElem
  11477. * @param {Number} bodyWidth
  11478. */
  11479. autoCellWidth: function autoCellWidth(headerElem, bodyElem, footerElem) {
  11480. var tableWidth = 0;
  11481. var minCellWidth = 40; // 列宽最少限制 40px
  11482. var bodyWidth = bodyElem.clientWidth - 1;
  11483. var remainWidth = bodyWidth;
  11484. var meanWidth = remainWidth / 100;
  11485. var fit = this.fit,
  11486. columnStore = this.columnStore;
  11487. var resizeList = columnStore.resizeList,
  11488. pxMinList = columnStore.pxMinList,
  11489. pxList = columnStore.pxList,
  11490. scaleList = columnStore.scaleList,
  11491. scaleMinList = columnStore.scaleMinList,
  11492. autoList = columnStore.autoList; // 最小宽
  11493. pxMinList.forEach(function (column) {
  11494. var minWidth = parseInt(column.minWidth);
  11495. tableWidth += minWidth;
  11496. column.renderWidth = minWidth;
  11497. }); // 最小百分比
  11498. scaleMinList.forEach(function (column) {
  11499. var scaleWidth = Math.floor(parseInt(column.minWidth) * meanWidth);
  11500. tableWidth += scaleWidth;
  11501. column.renderWidth = scaleWidth;
  11502. }); // 固定百分比
  11503. scaleList.forEach(function (column) {
  11504. var scaleWidth = Math.floor(parseInt(column.width) * meanWidth);
  11505. tableWidth += scaleWidth;
  11506. column.renderWidth = scaleWidth;
  11507. }); // 固定宽
  11508. pxList.forEach(function (column) {
  11509. var width = parseInt(column.width);
  11510. tableWidth += width;
  11511. column.renderWidth = width;
  11512. }); // 调整了列宽
  11513. resizeList.forEach(function (column) {
  11514. var width = parseInt(column.resizeWidth);
  11515. tableWidth += width;
  11516. column.renderWidth = width;
  11517. });
  11518. remainWidth -= tableWidth;
  11519. meanWidth = remainWidth > 0 ? Math.floor(remainWidth / (scaleMinList.length + pxMinList.length + autoList.length)) : 0;
  11520. if (fit) {
  11521. if (remainWidth > 0) {
  11522. scaleMinList.concat(pxMinList).forEach(function (column) {
  11523. tableWidth += meanWidth;
  11524. column.renderWidth += meanWidth;
  11525. });
  11526. }
  11527. } else {
  11528. meanWidth = minCellWidth;
  11529. } // 自适应
  11530. autoList.forEach(function (column) {
  11531. var width = Math.max(meanWidth, minCellWidth);
  11532. column.renderWidth = width;
  11533. tableWidth += width;
  11534. });
  11535. if (fit) {
  11536. /**
  11537. * 偏移量算法
  11538. * 如果所有列足够放的情况下,从最后动态列开始分配
  11539. */
  11540. var dynamicList = scaleList.concat(scaleMinList).concat(pxMinList).concat(autoList);
  11541. var dynamicSize = dynamicList.length - 1;
  11542. if (dynamicSize > 0) {
  11543. var odiffer = bodyWidth - tableWidth;
  11544. if (odiffer > 0) {
  11545. while (odiffer > 0 && dynamicSize >= 0) {
  11546. odiffer--;
  11547. dynamicList[dynamicSize--].renderWidth++;
  11548. }
  11549. tableWidth = bodyWidth;
  11550. }
  11551. }
  11552. }
  11553. var tableHeight = bodyElem.offsetHeight;
  11554. var overflowY = bodyElem.scrollHeight > bodyElem.clientHeight;
  11555. this.scrollbarWidth = overflowY ? bodyElem.offsetWidth - bodyElem.clientWidth : 0;
  11556. this.overflowY = overflowY;
  11557. this.tableWidth = tableWidth;
  11558. this.tableHeight = tableHeight;
  11559. if (headerElem) {
  11560. this.headerHeight = headerElem.clientHeight; // 检测是否同步滚动
  11561. if (headerElem.scrollLeft !== bodyElem.scrollLeft) {
  11562. headerElem.scrollLeft = bodyElem.scrollLeft;
  11563. }
  11564. } else {
  11565. this.headerHeight = 0;
  11566. }
  11567. if (footerElem) {
  11568. var footerHeight = footerElem.offsetHeight;
  11569. this.scrollbarHeight = Math.max(footerHeight - footerElem.clientHeight, 0);
  11570. this.overflowX = tableWidth > footerElem.clientWidth;
  11571. this.footerHeight = footerHeight;
  11572. } else {
  11573. this.footerHeight = 0;
  11574. this.scrollbarHeight = Math.max(tableHeight - bodyElem.clientHeight, 0);
  11575. this.overflowX = tableWidth > bodyWidth;
  11576. }
  11577. this.updateHeight();
  11578. this.parentHeight = Math.max(this.headerHeight + this.footerHeight + 20, this.getParentHeight());
  11579. if (this.overflowX) {
  11580. this.checkScrolling();
  11581. }
  11582. },
  11583. updateHeight: function updateHeight() {
  11584. this.customHeight = methods_calcHeight(this, 'height');
  11585. this.customMaxHeight = methods_calcHeight(this, 'maxHeight');
  11586. },
  11587. updateStyle: function updateStyle() {
  11588. var _this19 = this;
  11589. var $refs = this.$refs,
  11590. isGroup = this.isGroup,
  11591. fullColumnIdData = this.fullColumnIdData,
  11592. tableColumn = this.tableColumn,
  11593. customHeight = this.customHeight,
  11594. customMaxHeight = this.customMaxHeight,
  11595. border = this.border,
  11596. headerHeight = this.headerHeight,
  11597. showFooter = this.showFooter,
  11598. allColumnOverflow = this.showOverflow,
  11599. allColumnHeaderOverflow = this.showHeaderOverflow,
  11600. allColumnFooterOverflow = this.showFooterOverflow,
  11601. footerHeight = this.footerHeight,
  11602. tableHeight = this.tableHeight,
  11603. tableWidth = this.tableWidth,
  11604. scrollbarHeight = this.scrollbarHeight,
  11605. scrollbarWidth = this.scrollbarWidth,
  11606. scrollXLoad = this.scrollXLoad,
  11607. scrollYLoad = this.scrollYLoad,
  11608. cellOffsetWidth = this.cellOffsetWidth,
  11609. columnStore = this.columnStore,
  11610. elemStore = this.elemStore,
  11611. editStore = this.editStore,
  11612. currentRow = this.currentRow,
  11613. mouseConfig = this.mouseConfig,
  11614. keyboardConfig = this.keyboardConfig,
  11615. keyboardOpts = this.keyboardOpts,
  11616. spanMethod = this.spanMethod,
  11617. mergeList = this.mergeList,
  11618. mergeFooterList = this.mergeFooterList,
  11619. footerSpanMethod = this.footerSpanMethod,
  11620. isAllOverflow = this.isAllOverflow;
  11621. var containerList = ['main', 'left', 'right'];
  11622. var emptyPlaceholderElem = $refs.emptyPlaceholder;
  11623. var bodyWrapperElem = elemStore['main-body-wrapper'];
  11624. if (emptyPlaceholderElem) {
  11625. emptyPlaceholderElem.style.top = "".concat(headerHeight, "px");
  11626. emptyPlaceholderElem.style.height = bodyWrapperElem ? "".concat(bodyWrapperElem.offsetHeight - scrollbarHeight, "px") : '';
  11627. }
  11628. if (customHeight > 0) {
  11629. if (showFooter) {
  11630. customHeight += scrollbarHeight;
  11631. }
  11632. }
  11633. containerList.forEach(function (name, index) {
  11634. var fixedType = index > 0 ? name : '';
  11635. var layoutList = ['header', 'body', 'footer'];
  11636. var fixedColumn = columnStore["".concat(fixedType, "List")];
  11637. var fixedWrapperElem = $refs["".concat(fixedType, "Container")];
  11638. layoutList.forEach(function (layout) {
  11639. var wrapperElem = elemStore["".concat(name, "-").concat(layout, "-wrapper")];
  11640. var tableElem = elemStore["".concat(name, "-").concat(layout, "-table")];
  11641. if (layout === 'header') {
  11642. // 表头体样式处理
  11643. // 横向滚动渲染
  11644. var tWidth = tableWidth; // 如果是使用优化模式
  11645. var isOptimize = false;
  11646. if (!isGroup) {
  11647. if (fixedType) {
  11648. if (scrollXLoad || allColumnHeaderOverflow) {
  11649. isOptimize = true;
  11650. }
  11651. }
  11652. }
  11653. if (isOptimize) {
  11654. tableColumn = fixedColumn;
  11655. }
  11656. if (isOptimize || scrollXLoad) {
  11657. tWidth = tableColumn.reduce(function (previous, column) {
  11658. return previous + column.renderWidth;
  11659. }, 0);
  11660. }
  11661. if (tableElem) {
  11662. tableElem.style.width = tWidth ? "".concat(tWidth + scrollbarWidth, "px") : ''; // 修复 IE 中高度无法自适应问题
  11663. if (methods_browse.msie) {
  11664. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.arrayEach(tableElem.querySelectorAll('.vxe-resizable'), function (resizeElem) {
  11665. resizeElem.style.height = "".concat(resizeElem.parentNode.offsetHeight, "px");
  11666. });
  11667. }
  11668. }
  11669. var repairElem = elemStore["".concat(name, "-").concat(layout, "-repair")];
  11670. if (repairElem) {
  11671. repairElem.style.width = "".concat(tableWidth, "px");
  11672. }
  11673. var listElem = elemStore["".concat(name, "-").concat(layout, "-list")];
  11674. if (isGroup && listElem) {
  11675. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.arrayEach(listElem.querySelectorAll('.col--group'), function (thElem) {
  11676. var colNode = _this19.getColumnNode(thElem);
  11677. if (colNode) {
  11678. var column = colNode.item;
  11679. var showHeaderOverflow = column.showHeaderOverflow;
  11680. var cellOverflow = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isBoolean(showHeaderOverflow) ? showHeaderOverflow : allColumnHeaderOverflow;
  11681. var showEllipsis = cellOverflow === 'ellipsis';
  11682. var showTitle = cellOverflow === 'title';
  11683. var showTooltip = cellOverflow === true || cellOverflow === 'tooltip';
  11684. var hasEllipsis = showTitle || showTooltip || showEllipsis;
  11685. var childWidth = 0;
  11686. var countChild = 0;
  11687. if (hasEllipsis) {
  11688. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(column.children, function (item) {
  11689. if (!item.children || !column.children.length) {
  11690. countChild++;
  11691. }
  11692. childWidth += item.renderWidth;
  11693. });
  11694. }
  11695. thElem.style.width = hasEllipsis ? "".concat(childWidth - countChild - (border ? 2 : 0), "px") : '';
  11696. }
  11697. });
  11698. }
  11699. } else if (layout === 'body') {
  11700. var emptyBlockElem = elemStore["".concat(name, "-").concat(layout, "-emptyBlock")];
  11701. if (wrapperElem) {
  11702. if (customMaxHeight) {
  11703. wrapperElem.style.maxHeight = "".concat(fixedType ? customMaxHeight - headerHeight - (showFooter ? 0 : scrollbarHeight) : customMaxHeight - headerHeight, "px");
  11704. } else {
  11705. if (customHeight > 0) {
  11706. wrapperElem.style.height = "".concat(fixedType ? (customHeight > 0 ? customHeight - headerHeight - footerHeight : tableHeight) - (showFooter ? 0 : scrollbarHeight) : customHeight - headerHeight - footerHeight, "px");
  11707. } else {
  11708. wrapperElem.style.height = '';
  11709. }
  11710. }
  11711. } // 如果是固定列
  11712. if (fixedWrapperElem) {
  11713. var isRightFixed = fixedType === 'right';
  11714. var _fixedColumn = columnStore["".concat(fixedType, "List")];
  11715. if (wrapperElem) {
  11716. wrapperElem.style.top = "".concat(headerHeight, "px");
  11717. }
  11718. fixedWrapperElem.style.height = "".concat((customHeight > 0 ? customHeight - headerHeight - footerHeight : tableHeight) + headerHeight + footerHeight - scrollbarHeight * (showFooter ? 2 : 1), "px");
  11719. fixedWrapperElem.style.width = "".concat(_fixedColumn.reduce(function (previous, column) {
  11720. return previous + column.renderWidth;
  11721. }, isRightFixed ? scrollbarWidth : 0), "px");
  11722. }
  11723. var _tWidth = tableWidth; // 如果是使用优化模式
  11724. var _isOptimize = false;
  11725. if (fixedType) {
  11726. if (!mergeList.length && !spanMethod && !(keyboardConfig && keyboardOpts.isMerge) && (scrollXLoad || scrollYLoad || (allColumnOverflow ? isAllOverflow : allColumnOverflow))) {
  11727. _isOptimize = true;
  11728. }
  11729. }
  11730. if (_isOptimize) {
  11731. tableColumn = fixedColumn;
  11732. }
  11733. if (_isOptimize || scrollXLoad) {
  11734. _tWidth = tableColumn.reduce(function (previous, column) {
  11735. return previous + column.renderWidth;
  11736. }, 0);
  11737. }
  11738. if (tableElem) {
  11739. tableElem.style.width = _tWidth ? "".concat(_tWidth, "px") : ''; // 兼容性处理
  11740. tableElem.style.paddingRight = scrollbarWidth && fixedType && (methods_browse['-moz'] || methods_browse.safari) ? "".concat(scrollbarWidth, "px") : '';
  11741. }
  11742. if (emptyBlockElem) {
  11743. emptyBlockElem.style.width = _tWidth ? "".concat(_tWidth, "px") : '';
  11744. }
  11745. } else if (layout === 'footer') {
  11746. var _tWidth2 = tableWidth; // 如果是使用优化模式
  11747. var _isOptimize2 = false;
  11748. if (fixedType) {
  11749. if ((!mergeFooterList.length || !footerSpanMethod) && (scrollXLoad || allColumnFooterOverflow)) {
  11750. _isOptimize2 = true;
  11751. }
  11752. }
  11753. if (_isOptimize2) {
  11754. tableColumn = fixedColumn;
  11755. }
  11756. if (_isOptimize2 || scrollXLoad) {
  11757. _tWidth2 = tableColumn.reduce(function (previous, column) {
  11758. return previous + column.renderWidth;
  11759. }, 0);
  11760. }
  11761. if (wrapperElem) {
  11762. // 如果是固定列
  11763. if (fixedWrapperElem) {
  11764. wrapperElem.style.top = "".concat(customHeight > 0 ? customHeight - footerHeight : tableHeight + headerHeight, "px");
  11765. }
  11766. wrapperElem.style.marginTop = "".concat(-scrollbarHeight, "px");
  11767. }
  11768. if (tableElem) {
  11769. tableElem.style.width = _tWidth2 ? "".concat(_tWidth2 + scrollbarWidth, "px") : '';
  11770. }
  11771. }
  11772. var colgroupElem = elemStore["".concat(name, "-").concat(layout, "-colgroup")];
  11773. if (colgroupElem) {
  11774. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.arrayEach(colgroupElem.children, function (colElem) {
  11775. var colid = colElem.getAttribute('name');
  11776. if (colid === 'col_gutter') {
  11777. colElem.style.width = "".concat(scrollbarWidth, "px");
  11778. }
  11779. if (fullColumnIdData[colid]) {
  11780. var column = fullColumnIdData[colid].column;
  11781. var showHeaderOverflow = column.showHeaderOverflow,
  11782. showFooterOverflow = column.showFooterOverflow,
  11783. showOverflow = column.showOverflow;
  11784. var cellOverflow;
  11785. colElem.style.width = "".concat(column.renderWidth, "px");
  11786. if (layout === 'header') {
  11787. cellOverflow = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isUndefined(showHeaderOverflow) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow;
  11788. } else if (layout === 'footer') {
  11789. cellOverflow = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isUndefined(showFooterOverflow) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNull(showFooterOverflow) ? allColumnFooterOverflow : showFooterOverflow;
  11790. } else {
  11791. cellOverflow = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isUndefined(showOverflow) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNull(showOverflow) ? allColumnOverflow : showOverflow;
  11792. }
  11793. var showEllipsis = cellOverflow === 'ellipsis';
  11794. var showTitle = cellOverflow === 'title';
  11795. var showTooltip = cellOverflow === true || cellOverflow === 'tooltip';
  11796. var hasEllipsis = showTitle || showTooltip || showEllipsis;
  11797. var _listElem = elemStore["".concat(name, "-").concat(layout, "-list")]; // 滚动的渲染不支持动态行高
  11798. if (layout === 'header' || layout === 'footer') {
  11799. if (scrollXLoad && !hasEllipsis) {
  11800. hasEllipsis = true;
  11801. }
  11802. } else {
  11803. if ((scrollXLoad || scrollYLoad) && !hasEllipsis) {
  11804. hasEllipsis = true;
  11805. }
  11806. }
  11807. if (_listElem) {
  11808. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.arrayEach(_listElem.querySelectorAll(".".concat(column.id)), function (elem) {
  11809. var colspan = parseInt(elem.getAttribute('colspan') || 1);
  11810. var cellElem = elem.querySelector('.vxe-cell');
  11811. var colWidth = column.renderWidth;
  11812. if (cellElem) {
  11813. if (colspan > 1) {
  11814. var columnIndex = _this19.getColumnIndex(column);
  11815. for (var _index = 1; _index < colspan; _index++) {
  11816. var nextColumn = _this19.getColumns(columnIndex + _index);
  11817. if (nextColumn) {
  11818. colWidth += nextColumn.renderWidth;
  11819. }
  11820. }
  11821. }
  11822. cellElem.style.width = hasEllipsis ? "".concat(colWidth - cellOffsetWidth * colspan, "px") : '';
  11823. }
  11824. });
  11825. }
  11826. }
  11827. });
  11828. }
  11829. });
  11830. });
  11831. if (currentRow) {
  11832. this.setCurrentRow(currentRow);
  11833. }
  11834. if (mouseConfig && mouseConfig.selected && editStore.selected.row && editStore.selected.column) {
  11835. this.addColSdCls();
  11836. }
  11837. return this.$nextTick();
  11838. },
  11839. /**
  11840. * 处理固定列的显示状态
  11841. */
  11842. checkScrolling: function checkScrolling() {
  11843. var _this$$refs = this.$refs,
  11844. tableBody = _this$$refs.tableBody,
  11845. leftContainer = _this$$refs.leftContainer,
  11846. rightContainer = _this$$refs.rightContainer;
  11847. var bodyElem = tableBody ? tableBody.$el : null;
  11848. if (bodyElem) {
  11849. if (leftContainer) {
  11850. DomTools[bodyElem.scrollLeft > 0 ? 'addClass' : 'removeClass'](leftContainer, 'scrolling--middle');
  11851. }
  11852. if (rightContainer) {
  11853. DomTools[bodyElem.clientWidth < bodyElem.scrollWidth - Math.ceil(bodyElem.scrollLeft) ? 'addClass' : 'removeClass'](rightContainer, 'scrolling--middle');
  11854. }
  11855. }
  11856. },
  11857. preventEvent: function preventEvent(evnt, type, args, next, end) {
  11858. var _this20 = this;
  11859. var evntList = v_x_e_table.interceptor.get(type);
  11860. var rest;
  11861. if (!evntList.some(function (func) {
  11862. return func(Object.assign({
  11863. $grid: _this20.$xegrid,
  11864. $table: _this20,
  11865. $event: evnt
  11866. }, args)) === false;
  11867. })) {
  11868. if (next) {
  11869. rest = next();
  11870. }
  11871. }
  11872. if (end) {
  11873. end();
  11874. }
  11875. return rest;
  11876. },
  11877. /**
  11878. * 全局按下事件处理
  11879. */
  11880. handleGlobalMousedownEvent: function handleGlobalMousedownEvent(evnt) {
  11881. var _this21 = this;
  11882. var $el = this.$el,
  11883. $refs = this.$refs,
  11884. $xegrid = this.$xegrid,
  11885. $toolbar = this.$toolbar,
  11886. mouseConfig = this.mouseConfig,
  11887. editStore = this.editStore,
  11888. ctxMenuStore = this.ctxMenuStore,
  11889. editOpts = this.editOpts,
  11890. filterStore = this.filterStore,
  11891. getRowNode = this.getRowNode;
  11892. var actived = editStore.actived;
  11893. var ctxWrapper = $refs.ctxWrapper,
  11894. filterWrapper = $refs.filterWrapper,
  11895. validTip = $refs.validTip;
  11896. if (filterWrapper) {
  11897. if (getEventTargetNode(evnt, $el, 'vxe-cell--filter').flag) {// 如果点击了筛选按钮
  11898. } else if (getEventTargetNode(evnt, filterWrapper.$el).flag) {// 如果点击筛选容器
  11899. } else {
  11900. if (!getEventTargetNode(evnt, document.body, 'vxe-table--ignore-clear').flag) {
  11901. this.preventEvent(evnt, 'event.clearFilter', filterStore.args, this.closeFilter);
  11902. }
  11903. }
  11904. } // 如果已激活了编辑状态
  11905. if (actived.row) {
  11906. if (!(editOpts.autoClear === false)) {
  11907. // 如果是激活状态,点击了单元格之外
  11908. var cell = actived.args.cell;
  11909. if (!cell || !getEventTargetNode(evnt, cell).flag) {
  11910. if (validTip && getEventTargetNode(evnt, validTip.$el).flag) {// 如果是激活状态,且点击了校验提示框
  11911. } else if (!this.lastCallTime || this.lastCallTime + 50 < Date.now()) {
  11912. if (!getEventTargetNode(evnt, document.body, 'vxe-table--ignore-clear').flag) {
  11913. // 如果手动调用了激活单元格,避免触发源被移除后导致重复关闭
  11914. this.preventEvent(evnt, 'event.clearActived', actived.args, function () {
  11915. var isClearActived;
  11916. if (editOpts.mode === 'row') {
  11917. var rowNode = getEventTargetNode(evnt, $el, 'vxe-body--row'); // row 方式,如果点击了不同行
  11918. isClearActived = rowNode.flag ? getRowNode(rowNode.targetElem).item !== actived.args.row : false;
  11919. } else {
  11920. // cell 方式,如果是非编辑列
  11921. isClearActived = !getEventTargetNode(evnt, $el, 'col--edit').flag;
  11922. } // 如果点击表头行,则清除激活状态
  11923. if (!isClearActived) {
  11924. isClearActived = getEventTargetNode(evnt, $el, 'vxe-header--row').flag;
  11925. } // 如果点击表尾行,则清除激活状态
  11926. if (!isClearActived) {
  11927. isClearActived = getEventTargetNode(evnt, $el, 'vxe-footer--row').flag;
  11928. } // 如果固定了高度且点击了行之外的空白处,则清除激活状态
  11929. if (!isClearActived && _this21.height && !_this21.overflowY) {
  11930. var bodyWrapperElem = evnt.target;
  11931. if (methods_hasClass(bodyWrapperElem, 'vxe-table--body-wrapper')) {
  11932. isClearActived = evnt.offsetY < bodyWrapperElem.clientHeight;
  11933. }
  11934. }
  11935. if (isClearActived || // 如果点击了当前表格之外
  11936. !getEventTargetNode(evnt, $el).flag) {
  11937. setTimeout(function () {
  11938. return _this21.clearActived(evnt);
  11939. });
  11940. }
  11941. });
  11942. }
  11943. }
  11944. }
  11945. }
  11946. } else if (mouseConfig) {
  11947. if (!getEventTargetNode(evnt, $el).flag && !($xegrid && getEventTargetNode(evnt, $xegrid.$el).flag) && !(ctxWrapper && getEventTargetNode(evnt, ctxWrapper.$el).flag) && !($toolbar && getEventTargetNode(evnt, $toolbar.$el).flag)) {
  11948. this.clearSelected();
  11949. if (!getEventTargetNode(evnt, document.body, 'vxe-table--ignore-areas-clear').flag) {
  11950. this.preventEvent(evnt, 'event.clearAreas', {}, function () {
  11951. _this21.clearCellAreas();
  11952. _this21.clearCopyCellArea();
  11953. });
  11954. }
  11955. }
  11956. } // 如果配置了快捷菜单且,点击了其他地方则关闭
  11957. if (ctxMenuStore.visible && ctxWrapper && !getEventTargetNode(evnt, ctxWrapper.$el).flag) {
  11958. this.closeMenu();
  11959. } // 最后激活的表格
  11960. this.isActivated = getEventTargetNode(evnt, ($xegrid || this).$el).flag;
  11961. },
  11962. /**
  11963. * 窗口失焦事件处理
  11964. */
  11965. handleGlobalBlurEvent: function handleGlobalBlurEvent() {
  11966. this.closeFilter();
  11967. this.closeMenu();
  11968. },
  11969. /**
  11970. * 全局滚动事件
  11971. */
  11972. handleGlobalMousewheelEvent: function handleGlobalMousewheelEvent() {
  11973. this.closeTooltip();
  11974. this.closeMenu();
  11975. },
  11976. /**
  11977. * 全局键盘事件
  11978. */
  11979. handleGlobalKeydownEvent: function handleGlobalKeydownEvent(evnt) {
  11980. var _this22 = this;
  11981. // 该行为只对当前激活的表格有效
  11982. if (this.isActivated) {
  11983. this.preventEvent(evnt, 'event.keydown', null, function () {
  11984. var filterStore = _this22.filterStore,
  11985. isCtxMenu = _this22.isCtxMenu,
  11986. ctxMenuStore = _this22.ctxMenuStore,
  11987. editStore = _this22.editStore,
  11988. editOpts = _this22.editOpts,
  11989. editConfig = _this22.editConfig,
  11990. mouseConfig = _this22.mouseConfig,
  11991. mouseOpts = _this22.mouseOpts,
  11992. keyboardConfig = _this22.keyboardConfig,
  11993. keyboardOpts = _this22.keyboardOpts,
  11994. treeConfig = _this22.treeConfig,
  11995. treeOpts = _this22.treeOpts,
  11996. highlightCurrentRow = _this22.highlightCurrentRow,
  11997. currentRow = _this22.currentRow,
  11998. bodyCtxMenu = _this22.bodyCtxMenu;
  11999. var selected = editStore.selected,
  12000. actived = editStore.actived;
  12001. var keyCode = evnt.keyCode;
  12002. var isBack = keyCode === 8;
  12003. var isTab = keyCode === 9;
  12004. var isEnter = keyCode === 13;
  12005. var isEsc = keyCode === 27;
  12006. var isSpacebar = keyCode === 32;
  12007. var isLeftArrow = keyCode === 37;
  12008. var isUpArrow = keyCode === 38;
  12009. var isRightArrow = keyCode === 39;
  12010. var isDwArrow = keyCode === 40;
  12011. var isDel = keyCode === 46;
  12012. var isF2 = keyCode === 113;
  12013. var isContextMenu = keyCode === 93;
  12014. var hasMetaKey = evnt.metaKey;
  12015. var hasCtrlKey = evnt.ctrlKey;
  12016. var hasShiftKey = evnt.shiftKey;
  12017. var hasAltKey = evnt.altKey;
  12018. var operArrow = isLeftArrow || isUpArrow || isRightArrow || isDwArrow;
  12019. var operCtxMenu = isCtxMenu && ctxMenuStore.visible && (isEnter || isSpacebar || operArrow);
  12020. var isEditStatus = editConfig && actived.column && actived.row;
  12021. var params;
  12022. if (filterStore.visible) {
  12023. if (isEsc) {
  12024. _this22.closeFilter();
  12025. }
  12026. return;
  12027. }
  12028. if (operCtxMenu) {
  12029. // 如果配置了右键菜单; 支持方向键操作、回车
  12030. evnt.preventDefault();
  12031. if (ctxMenuStore.showChild && hasChildrenList(ctxMenuStore.selected)) {
  12032. _this22.moveCtxMenu(evnt, keyCode, ctxMenuStore, 'selectChild', 37, false, ctxMenuStore.selected.children);
  12033. } else {
  12034. _this22.moveCtxMenu(evnt, keyCode, ctxMenuStore, 'selected', 39, true, _this22.ctxMenuList);
  12035. }
  12036. } else if (keyboardConfig && mouseConfig && mouseOpts.area && _this22.handleKeyboardEvent) {
  12037. _this22.handleKeyboardEvent(evnt);
  12038. } else if (keyboardConfig && isSpacebar && keyboardOpts.isChecked && selected.row && selected.column && (selected.column.type === 'checkbox' || selected.column.type === 'radio')) {
  12039. // 空格键支持选中复选框
  12040. evnt.preventDefault();
  12041. if (selected.column.type === 'checkbox') {
  12042. _this22.handleToggleCheckRowEvent(evnt, selected.args);
  12043. } else {
  12044. _this22.triggerRadioRowEvent(evnt, selected.args);
  12045. }
  12046. } else if (isEsc) {
  12047. // 如果按下了 Esc 键,关闭快捷菜单、筛选
  12048. _this22.closeMenu();
  12049. _this22.closeFilter(); // 如果是激活编辑状态,则取消编辑
  12050. if (actived.row) {
  12051. params = actived.args;
  12052. _this22.clearActived(evnt); // 如果配置了选中功能,则为选中状态
  12053. if (mouseConfig && mouseOpts.selected) {
  12054. _this22.$nextTick(function () {
  12055. return _this22.handleSelected(params, evnt);
  12056. });
  12057. }
  12058. }
  12059. } else if (isF2) {
  12060. if (!isEditStatus) {
  12061. // 如果按下了 F2 键
  12062. if (selected.row && selected.column) {
  12063. evnt.preventDefault();
  12064. _this22.handleActived(selected.args, evnt);
  12065. }
  12066. }
  12067. } else if (isContextMenu) {
  12068. // 如果按下上下文键
  12069. _this22._keyCtx = selected.row && selected.column && bodyCtxMenu.length;
  12070. clearTimeout(_this22.keyCtxTimeout);
  12071. _this22.keyCtxTimeout = setTimeout(function () {
  12072. _this22._keyCtx = false;
  12073. }, 1000);
  12074. } else if (isEnter && !hasAltKey && keyboardConfig && keyboardOpts.isEnter && (selected.row || actived.row || treeConfig && highlightCurrentRow && currentRow)) {
  12075. // 退出选中
  12076. if (hasCtrlKey) {
  12077. // 如果是激活编辑状态,则取消编辑
  12078. if (actived.row) {
  12079. params = actived.args;
  12080. _this22.clearActived(evnt); // 如果配置了选中功能,则为选中状态
  12081. if (mouseConfig && mouseOpts.selected) {
  12082. _this22.$nextTick(function () {
  12083. return _this22.handleSelected(params, evnt);
  12084. });
  12085. }
  12086. }
  12087. } else {
  12088. // 如果是激活状态,退则出到上一行/下一行
  12089. if (selected.row || actived.row) {
  12090. var targetArgs = selected.row ? selected.args : actived.args;
  12091. if (hasShiftKey) {
  12092. if (keyboardOpts.enterToTab) {
  12093. _this22.moveTabSelected(targetArgs, hasShiftKey, evnt);
  12094. } else {
  12095. _this22.moveSelected(targetArgs, isLeftArrow, true, isRightArrow, false, evnt);
  12096. }
  12097. } else {
  12098. if (keyboardOpts.enterToTab) {
  12099. _this22.moveTabSelected(targetArgs, hasShiftKey, evnt);
  12100. } else {
  12101. _this22.moveSelected(targetArgs, isLeftArrow, false, isRightArrow, true, evnt);
  12102. }
  12103. }
  12104. } else if (treeConfig && highlightCurrentRow && currentRow) {
  12105. // 如果是树形表格当前行回车移动到子节点
  12106. var childrens = currentRow[treeOpts.children];
  12107. if (childrens && childrens.length) {
  12108. evnt.preventDefault();
  12109. var targetRow = childrens[0];
  12110. params = {
  12111. $table: _this22,
  12112. row: targetRow
  12113. };
  12114. _this22.setTreeExpand(currentRow, true).then(function () {
  12115. return _this22.scrollToRow(targetRow);
  12116. }).then(function () {
  12117. return _this22.triggerCurrentRowEvent(evnt, params);
  12118. });
  12119. }
  12120. }
  12121. }
  12122. } else if (operArrow && keyboardConfig && keyboardOpts.isArrow) {
  12123. if (!isEditStatus) {
  12124. // 如果按下了方向键
  12125. if (selected.row && selected.column) {
  12126. _this22.moveSelected(selected.args, isLeftArrow, isUpArrow, isRightArrow, isDwArrow, evnt);
  12127. } else if ((isUpArrow || isDwArrow) && highlightCurrentRow) {
  12128. // 当前行按键上下移动
  12129. _this22.moveCurrentRow(isUpArrow, isDwArrow, evnt);
  12130. }
  12131. }
  12132. } else if (isTab && keyboardConfig && keyboardOpts.isTab) {
  12133. // 如果按下了 Tab 键切换
  12134. if (selected.row || selected.column) {
  12135. _this22.moveTabSelected(selected.args, hasShiftKey, evnt);
  12136. } else if (actived.row || actived.column) {
  12137. _this22.moveTabSelected(actived.args, hasShiftKey, evnt);
  12138. }
  12139. } else if (keyboardConfig && (isDel || (treeConfig && highlightCurrentRow && currentRow ? isBack && keyboardOpts.isArrow : isBack))) {
  12140. if (!isEditStatus) {
  12141. var delMethod = keyboardOpts.delMethod,
  12142. backMethod = keyboardOpts.backMethod; // 如果是删除键
  12143. if (keyboardOpts.isDel && (selected.row || selected.column)) {
  12144. if (delMethod) {
  12145. delMethod({
  12146. row: selected.row,
  12147. rowIndex: _this22.getRowIndex(selected.row),
  12148. column: selected.column,
  12149. columnIndex: _this22.getColumnIndex(selected.column),
  12150. $table: _this22
  12151. });
  12152. } else {
  12153. methods_setCellValue(selected.row, selected.column, null);
  12154. }
  12155. if (isBack) {
  12156. if (backMethod) {
  12157. backMethod({
  12158. row: selected.row,
  12159. rowIndex: _this22.getRowIndex(selected.row),
  12160. column: selected.column,
  12161. columnIndex: _this22.getColumnIndex(selected.column),
  12162. $table: _this22
  12163. });
  12164. } else {
  12165. _this22.handleActived(selected.args, evnt);
  12166. }
  12167. }
  12168. } else if (isBack && keyboardOpts.isArrow && treeConfig && highlightCurrentRow && currentRow) {
  12169. // 如果树形表格回退键关闭当前行返回父节点
  12170. var _XEUtils$findTree = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.findTree(_this22.afterFullData, function (item) {
  12171. return item === currentRow;
  12172. }, treeOpts),
  12173. parentRow = _XEUtils$findTree.parent;
  12174. if (parentRow) {
  12175. evnt.preventDefault();
  12176. params = {
  12177. $table: _this22,
  12178. row: parentRow
  12179. };
  12180. _this22.setTreeExpand(parentRow, false).then(function () {
  12181. return _this22.scrollToRow(parentRow);
  12182. }).then(function () {
  12183. return _this22.triggerCurrentRowEvent(evnt, params);
  12184. });
  12185. }
  12186. }
  12187. }
  12188. } 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)) {
  12189. var editMethod = keyboardOpts.editMethod; // 启用编辑后,空格键功能将失效
  12190. // if (isSpacebar) {
  12191. // evnt.preventDefault()
  12192. // }
  12193. // 如果是按下非功能键之外允许直接编辑
  12194. if (selected.column && selected.row && isEnableConf(selected.column.editRender)) {
  12195. if (!editOpts.activeMethod || editOpts.activeMethod(selected.args)) {
  12196. if (editMethod) {
  12197. editMethod({
  12198. row: selected.row,
  12199. rowIndex: _this22.getRowIndex(selected.row),
  12200. column: selected.column,
  12201. columnIndex: _this22.getColumnIndex(selected.column),
  12202. $table: _this22
  12203. });
  12204. } else {
  12205. methods_setCellValue(selected.row, selected.column, null);
  12206. _this22.handleActived(selected.args, evnt);
  12207. }
  12208. }
  12209. }
  12210. }
  12211. _this22.emitEvent('keydown', {}, evnt);
  12212. });
  12213. }
  12214. },
  12215. handleGlobalPasteEvent: function handleGlobalPasteEvent(evnt) {
  12216. var isActivated = this.isActivated,
  12217. keyboardConfig = this.keyboardConfig,
  12218. keyboardOpts = this.keyboardOpts,
  12219. mouseConfig = this.mouseConfig,
  12220. mouseOpts = this.mouseOpts,
  12221. editStore = this.editStore,
  12222. filterStore = this.filterStore;
  12223. var actived = editStore.actived;
  12224. if (isActivated && !filterStore.visible) {
  12225. if (!(actived.row || actived.column)) {
  12226. if (keyboardConfig && keyboardOpts.isClip && mouseConfig && mouseOpts.area && this.handlePasteCellAreaEvent) {
  12227. this.handlePasteCellAreaEvent(evnt);
  12228. }
  12229. }
  12230. this.emitEvent('paste', {}, evnt);
  12231. }
  12232. },
  12233. handleGlobalCopyEvent: function handleGlobalCopyEvent(evnt) {
  12234. var isActivated = this.isActivated,
  12235. keyboardConfig = this.keyboardConfig,
  12236. keyboardOpts = this.keyboardOpts,
  12237. mouseConfig = this.mouseConfig,
  12238. mouseOpts = this.mouseOpts,
  12239. editStore = this.editStore,
  12240. filterStore = this.filterStore;
  12241. var actived = editStore.actived;
  12242. if (isActivated && !filterStore.visible) {
  12243. if (!(actived.row || actived.column)) {
  12244. if (keyboardConfig && keyboardOpts.isClip && mouseConfig && mouseOpts.area && this.handleCopyCellAreaEvent) {
  12245. this.handleCopyCellAreaEvent(evnt);
  12246. }
  12247. }
  12248. this.emitEvent('copy', {}, evnt);
  12249. }
  12250. },
  12251. handleGlobalCutEvent: function handleGlobalCutEvent(evnt) {
  12252. var isActivated = this.isActivated,
  12253. keyboardConfig = this.keyboardConfig,
  12254. keyboardOpts = this.keyboardOpts,
  12255. mouseConfig = this.mouseConfig,
  12256. mouseOpts = this.mouseOpts,
  12257. editStore = this.editStore,
  12258. filterStore = this.filterStore;
  12259. var actived = editStore.actived;
  12260. if (isActivated && !filterStore.visible) {
  12261. if (!(actived.row || actived.column)) {
  12262. if (keyboardConfig && keyboardOpts.isClip && mouseConfig && mouseOpts.area && this.handleCutCellAreaEvent) {
  12263. this.handleCutCellAreaEvent(evnt);
  12264. }
  12265. }
  12266. this.emitEvent('cut', {}, evnt);
  12267. }
  12268. },
  12269. handleGlobalResizeEvent: function handleGlobalResizeEvent() {
  12270. this.closeMenu();
  12271. this.updateCellAreas();
  12272. this.recalculate(true);
  12273. },
  12274. handleTooltipLeaveMethod: function handleTooltipLeaveMethod() {
  12275. var _this23 = this;
  12276. var tooltipOpts = this.tooltipOpts;
  12277. setTimeout(function () {
  12278. if (!_this23.tooltipActive) {
  12279. _this23.closeTooltip();
  12280. }
  12281. }, tooltipOpts.leaveDelay);
  12282. return false;
  12283. },
  12284. handleTargetEnterEvent: function handleTargetEnterEvent() {
  12285. clearTimeout(this.tooltipTimeout);
  12286. this.tooltipActive = true;
  12287. this.closeTooltip();
  12288. },
  12289. handleTargetLeaveEvent: function handleTargetLeaveEvent() {
  12290. var _this24 = this;
  12291. var tooltipOpts = this.tooltipOpts;
  12292. this.tooltipActive = false;
  12293. if (tooltipOpts.enterable) {
  12294. this.tooltipTimeout = setTimeout(function () {
  12295. if (!_this24.$refs.tooltip.isHover) {
  12296. _this24.closeTooltip();
  12297. }
  12298. }, tooltipOpts.leaveDelay);
  12299. } else {
  12300. this.closeTooltip();
  12301. }
  12302. },
  12303. triggerHeaderHelpEvent: function triggerHeaderHelpEvent(evnt, params) {
  12304. var column = params.column;
  12305. var titleHelp = column.titleHelp;
  12306. if (titleHelp.message) {
  12307. var $refs = this.$refs,
  12308. tooltipStore = this.tooltipStore;
  12309. var tooltip = $refs.tooltip;
  12310. var content = UtilTools.getFuncText(titleHelp.message);
  12311. this.handleTargetEnterEvent();
  12312. tooltipStore.visible = true;
  12313. if (tooltip) {
  12314. tooltip.open(evnt.currentTarget, content);
  12315. }
  12316. }
  12317. },
  12318. /**
  12319. * 触发表头 tooltip 事件
  12320. */
  12321. triggerHeaderTooltipEvent: function triggerHeaderTooltipEvent(evnt, params) {
  12322. var tooltipStore = this.tooltipStore;
  12323. var column = params.column;
  12324. var titleElem = evnt.currentTarget;
  12325. this.handleTargetEnterEvent();
  12326. if (tooltipStore.column !== column || !tooltipStore.visible) {
  12327. this.handleTooltip(evnt, titleElem, titleElem, null, params);
  12328. }
  12329. },
  12330. /**
  12331. * 触发单元格 tooltip 事件
  12332. */
  12333. triggerBodyTooltipEvent: function triggerBodyTooltipEvent(evnt, params) {
  12334. var editConfig = this.editConfig,
  12335. editOpts = this.editOpts,
  12336. editStore = this.editStore,
  12337. tooltipStore = this.tooltipStore;
  12338. var actived = editStore.actived;
  12339. var row = params.row,
  12340. column = params.column;
  12341. var cell = evnt.currentTarget;
  12342. this.handleTargetEnterEvent();
  12343. if (editConfig) {
  12344. if (editOpts.mode === 'row' && actived.row === row || actived.row === row && actived.column === column) {
  12345. return;
  12346. }
  12347. }
  12348. if (tooltipStore.column !== column || tooltipStore.row !== row || !tooltipStore.visible) {
  12349. var overflowElem;
  12350. var tipElem;
  12351. if (column.treeNode) {
  12352. overflowElem = cell.querySelector('.vxe-tree-cell');
  12353. if (column.type === 'html') {
  12354. tipElem = cell.querySelector('.vxe-cell--html');
  12355. }
  12356. } else {
  12357. tipElem = cell.querySelector(column.type === 'html' ? '.vxe-cell--html' : '.vxe-cell--label');
  12358. }
  12359. this.handleTooltip(evnt, cell, overflowElem || cell.children[0], tipElem, params);
  12360. }
  12361. },
  12362. /**
  12363. * 触发表尾 tooltip 事件
  12364. */
  12365. triggerFooterTooltipEvent: function triggerFooterTooltipEvent(evnt, params) {
  12366. var column = params.column;
  12367. var tooltipStore = this.tooltipStore;
  12368. var cell = evnt.currentTarget;
  12369. this.handleTargetEnterEvent();
  12370. if (tooltipStore.column !== column || !tooltipStore.visible) {
  12371. this.handleTooltip(evnt, cell, cell.querySelector('.vxe-cell--item') || cell.children[0], null, params);
  12372. }
  12373. },
  12374. /**
  12375. * 处理显示 tooltip
  12376. * @param {Event} evnt 事件
  12377. * @param {ColumnInfo} column 列配置
  12378. * @param {Row} row 行对象
  12379. */
  12380. handleTooltip: function handleTooltip(evnt, cell, overflowElem, tipElem, params) {
  12381. params.cell = cell;
  12382. var $refs = this.$refs,
  12383. tooltipOpts = this.tooltipOpts,
  12384. tooltipStore = this.tooltipStore;
  12385. var column = params.column,
  12386. row = params.row;
  12387. var enabled = tooltipOpts.enabled,
  12388. contentMethod = tooltipOpts.contentMethod;
  12389. var tooltip = $refs.tooltip;
  12390. var customContent = contentMethod ? contentMethod(params) : null;
  12391. var useCustom = contentMethod && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eqNull(customContent);
  12392. var content = useCustom ? customContent : (column.type === 'html' ? overflowElem.innerText : overflowElem.textContent).trim();
  12393. var isCellOverflow = overflowElem.scrollWidth > overflowElem.clientWidth;
  12394. if (content && (enabled || useCustom || isCellOverflow)) {
  12395. Object.assign(tooltipStore, {
  12396. row: row,
  12397. column: column,
  12398. visible: true
  12399. });
  12400. if (tooltip) {
  12401. tooltip.open(isCellOverflow ? overflowElem : tipElem || overflowElem, UtilTools.formatText(content));
  12402. }
  12403. }
  12404. return this.$nextTick();
  12405. },
  12406. openTooltip: function openTooltip(target, content) {
  12407. var $refs = this.$refs;
  12408. var commTip = $refs.commTip;
  12409. if (commTip) {
  12410. return commTip.open(target, content);
  12411. }
  12412. return this.$nextTick();
  12413. },
  12414. /**
  12415. * 关闭 tooltip
  12416. */
  12417. closeTooltip: function closeTooltip() {
  12418. var $refs = this.$refs,
  12419. tooltipStore = this.tooltipStore;
  12420. var tooltip = $refs.tooltip;
  12421. var commTip = $refs.commTip;
  12422. if (tooltipStore.visible) {
  12423. Object.assign(tooltipStore, {
  12424. row: null,
  12425. column: null,
  12426. content: null,
  12427. visible: false
  12428. });
  12429. if (tooltip) {
  12430. tooltip.close();
  12431. }
  12432. }
  12433. if (commTip) {
  12434. commTip.close();
  12435. }
  12436. return this.$nextTick();
  12437. },
  12438. /**
  12439. * 判断复选框是否全选
  12440. */
  12441. isAllCheckboxChecked: function isAllCheckboxChecked() {
  12442. return this.isAllSelected;
  12443. },
  12444. /**
  12445. * 判断复选框是否全选
  12446. */
  12447. isCheckboxIndeterminate: function isCheckboxIndeterminate() {
  12448. return !this.isAllSelected && this.isIndeterminate;
  12449. },
  12450. /**
  12451. * 获取复选框半选状态的行数据
  12452. */
  12453. getCheckboxIndeterminateRecords: function getCheckboxIndeterminateRecords() {
  12454. var treeConfig = this.treeConfig,
  12455. treeIndeterminates = this.treeIndeterminates;
  12456. if (treeConfig) {
  12457. return treeIndeterminates.slice(0);
  12458. }
  12459. return [];
  12460. },
  12461. /**
  12462. * 处理默认勾选
  12463. */
  12464. handleDefaultSelectionChecked: function handleDefaultSelectionChecked() {
  12465. var fullDataRowIdData = this.fullDataRowIdData,
  12466. checkboxOpts = this.checkboxOpts;
  12467. var checkAll = checkboxOpts.checkAll,
  12468. checkRowKeys = checkboxOpts.checkRowKeys;
  12469. if (checkAll) {
  12470. this.setAllCheckboxRow(true);
  12471. } else if (checkRowKeys) {
  12472. var defSelection = [];
  12473. checkRowKeys.forEach(function (rowid) {
  12474. if (fullDataRowIdData[rowid]) {
  12475. defSelection.push(fullDataRowIdData[rowid].row);
  12476. }
  12477. });
  12478. this.setCheckboxRow(defSelection, true);
  12479. }
  12480. },
  12481. /**
  12482. * 用于多选行,设置行为选中状态,第二个参数为选中与否
  12483. * @param {Array/Row} rows 行数据
  12484. * @param {Boolean} value 是否选中
  12485. */
  12486. setCheckboxRow: function setCheckboxRow(rows, value) {
  12487. var _this25 = this;
  12488. if (rows && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(rows)) {
  12489. rows = [rows];
  12490. }
  12491. rows.forEach(function (row) {
  12492. return _this25.handleSelectRow({
  12493. row: row
  12494. }, !!value);
  12495. });
  12496. return this.$nextTick();
  12497. },
  12498. isCheckedByCheckboxRow: function isCheckedByCheckboxRow(row) {
  12499. var property = this.checkboxOpts.checkField;
  12500. if (property) {
  12501. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, property);
  12502. }
  12503. return this.selection.indexOf(row) > -1;
  12504. },
  12505. /**
  12506. * 多选,行选中事件
  12507. * value 选中true 不选false 不确定-1
  12508. */
  12509. handleSelectRow: function handleSelectRow(_ref6, value) {
  12510. var _this26 = this;
  12511. var row = _ref6.row;
  12512. var selection = this.selection,
  12513. afterFullData = this.afterFullData,
  12514. treeConfig = this.treeConfig,
  12515. treeOpts = this.treeOpts,
  12516. treeIndeterminates = this.treeIndeterminates,
  12517. checkboxOpts = this.checkboxOpts;
  12518. var property = checkboxOpts.checkField,
  12519. checkStrictly = checkboxOpts.checkStrictly,
  12520. checkMethod = checkboxOpts.checkMethod;
  12521. if (property) {
  12522. if (treeConfig && !checkStrictly) {
  12523. if (value === -1) {
  12524. if (treeIndeterminates.indexOf(row) === -1) {
  12525. treeIndeterminates.push(row);
  12526. }
  12527. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.set(row, property, false);
  12528. } else {
  12529. // 更新子节点状态
  12530. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree([row], function (item) {
  12531. if (row === item || !checkMethod || checkMethod({
  12532. row: item
  12533. })) {
  12534. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.set(item, property, value);
  12535. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.remove(treeIndeterminates, function (half) {
  12536. return half === item;
  12537. });
  12538. _this26.handleCheckboxReserveRow(row, value);
  12539. }
  12540. }, treeOpts);
  12541. } // 如果存在父节点,更新父节点状态
  12542. var matchObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.findTree(afterFullData, function (item) {
  12543. return item === row;
  12544. }, treeOpts);
  12545. if (matchObj && matchObj.parent) {
  12546. var parentStatus;
  12547. var vItems = checkMethod ? matchObj.items.filter(function (item) {
  12548. return checkMethod({
  12549. row: item
  12550. });
  12551. }) : matchObj.items;
  12552. var indeterminatesItem = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.find(matchObj.items, function (item) {
  12553. return treeIndeterminates.indexOf(item) > -1;
  12554. });
  12555. if (indeterminatesItem) {
  12556. parentStatus = -1;
  12557. } else {
  12558. var selectItems = matchObj.items.filter(function (item) {
  12559. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(item, property);
  12560. });
  12561. parentStatus = selectItems.filter(function (item) {
  12562. return vItems.indexOf(item) > -1;
  12563. }).length === vItems.length ? true : selectItems.length || value === -1 ? -1 : false;
  12564. }
  12565. return this.handleSelectRow({
  12566. row: matchObj.parent
  12567. }, parentStatus);
  12568. }
  12569. } else {
  12570. if (!checkMethod || checkMethod({
  12571. row: row
  12572. })) {
  12573. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.set(row, property, value);
  12574. this.handleCheckboxReserveRow(row, value);
  12575. }
  12576. }
  12577. } else {
  12578. if (treeConfig && !checkStrictly) {
  12579. if (value === -1) {
  12580. if (treeIndeterminates.indexOf(row) === -1) {
  12581. treeIndeterminates.push(row);
  12582. }
  12583. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.remove(selection, function (item) {
  12584. return item === row;
  12585. });
  12586. } else {
  12587. // 更新子节点状态
  12588. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree([row], function (item) {
  12589. if (row === item || !checkMethod || checkMethod({
  12590. row: item
  12591. })) {
  12592. if (value) {
  12593. selection.push(item);
  12594. } else {
  12595. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.remove(selection, function (select) {
  12596. return select === item;
  12597. });
  12598. }
  12599. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.remove(treeIndeterminates, function (half) {
  12600. return half === item;
  12601. });
  12602. _this26.handleCheckboxReserveRow(row, value);
  12603. }
  12604. }, treeOpts);
  12605. } // 如果存在父节点,更新父节点状态
  12606. var _matchObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.findTree(afterFullData, function (item) {
  12607. return item === row;
  12608. }, treeOpts);
  12609. if (_matchObj && _matchObj.parent) {
  12610. var _parentStatus;
  12611. var _vItems = checkMethod ? _matchObj.items.filter(function (item) {
  12612. return checkMethod({
  12613. row: item
  12614. });
  12615. }) : _matchObj.items;
  12616. var _indeterminatesItem = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.find(_matchObj.items, function (item) {
  12617. return treeIndeterminates.indexOf(item) > -1;
  12618. });
  12619. if (_indeterminatesItem) {
  12620. _parentStatus = -1;
  12621. } else {
  12622. var _selectItems = _matchObj.items.filter(function (item) {
  12623. return selection.indexOf(item) > -1;
  12624. });
  12625. _parentStatus = _selectItems.filter(function (item) {
  12626. return _vItems.indexOf(item) > -1;
  12627. }).length === _vItems.length ? true : _selectItems.length || value === -1 ? -1 : false;
  12628. }
  12629. return this.handleSelectRow({
  12630. row: _matchObj.parent
  12631. }, _parentStatus);
  12632. }
  12633. } else {
  12634. if (!checkMethod || checkMethod({
  12635. row: row
  12636. })) {
  12637. if (value) {
  12638. if (selection.indexOf(row) === -1) {
  12639. selection.push(row);
  12640. }
  12641. } else {
  12642. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.remove(selection, function (item) {
  12643. return item === row;
  12644. });
  12645. }
  12646. this.handleCheckboxReserveRow(row, value);
  12647. }
  12648. }
  12649. }
  12650. this.checkSelectionStatus();
  12651. },
  12652. handleToggleCheckRowEvent: function handleToggleCheckRowEvent(evnt, params) {
  12653. var selection = this.selection,
  12654. checkboxOpts = this.checkboxOpts;
  12655. var property = checkboxOpts.checkField;
  12656. var row = params.row;
  12657. var value = property ? !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, property) : selection.indexOf(row) === -1;
  12658. if (evnt) {
  12659. this.triggerCheckRowEvent(evnt, params, value);
  12660. } else {
  12661. this.handleSelectRow(params, value);
  12662. }
  12663. },
  12664. triggerCheckRowEvent: function triggerCheckRowEvent(evnt, params, value) {
  12665. var checkMethod = this.checkboxOpts.checkMethod;
  12666. if (!checkMethod || checkMethod({
  12667. row: params.row
  12668. })) {
  12669. this.handleSelectRow(params, value);
  12670. this.emitEvent('checkbox-change', Object.assign({
  12671. records: this.getCheckboxRecords(),
  12672. reserves: this.getCheckboxReserveRecords(),
  12673. indeterminates: this.getCheckboxIndeterminateRecords(),
  12674. checked: value
  12675. }, params), evnt);
  12676. }
  12677. },
  12678. /**
  12679. * 多选,切换某一行的选中状态
  12680. */
  12681. toggleCheckboxRow: function toggleCheckboxRow(row) {
  12682. this.handleToggleCheckRowEvent(null, {
  12683. row: row
  12684. });
  12685. return this.$nextTick();
  12686. },
  12687. /**
  12688. * 用于多选行,设置所有行的选中状态
  12689. * @param {Boolean} value 是否选中
  12690. */
  12691. setAllCheckboxRow: function setAllCheckboxRow(value) {
  12692. var _this27 = this;
  12693. var afterFullData = this.afterFullData,
  12694. treeConfig = this.treeConfig,
  12695. treeOpts = this.treeOpts,
  12696. selection = this.selection,
  12697. checkboxReserveRowMap = this.checkboxReserveRowMap,
  12698. checkboxOpts = this.checkboxOpts;
  12699. var property = checkboxOpts.checkField,
  12700. reserve = checkboxOpts.reserve,
  12701. checkStrictly = checkboxOpts.checkStrictly,
  12702. checkMethod = checkboxOpts.checkMethod;
  12703. var selectRows = [];
  12704. var beforeSelection = treeConfig ? [] : selection.filter(function (row) {
  12705. return afterFullData.indexOf(row) === -1;
  12706. });
  12707. if (checkStrictly) {
  12708. this.isAllSelected = value;
  12709. } else {
  12710. /**
  12711. * 绑定属性方式(高性能,有污染)
  12712. * 必须在行数据存在对应的属性,否则将不响应
  12713. */
  12714. if (property) {
  12715. var checkValFn = function checkValFn(row) {
  12716. if (!checkMethod || checkMethod({
  12717. row: row
  12718. })) {
  12719. if (value) {
  12720. selectRows.push(row);
  12721. }
  12722. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.set(row, property, value);
  12723. }
  12724. }; // 如果存在选中方法
  12725. // 如果方法成立,则更新值,否则忽略该数据
  12726. if (treeConfig) {
  12727. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(afterFullData, checkValFn, treeOpts);
  12728. } else {
  12729. afterFullData.forEach(checkValFn);
  12730. }
  12731. } else {
  12732. /**
  12733. * 默认方式(低性能,无污染)
  12734. * 无需任何属性,直接绑定
  12735. */
  12736. if (treeConfig) {
  12737. if (value) {
  12738. /**
  12739. * 如果是树勾选
  12740. * 如果方法成立,则添加到临时集合中
  12741. */
  12742. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(afterFullData, function (row) {
  12743. if (!checkMethod || checkMethod({
  12744. row: row
  12745. })) {
  12746. selectRows.push(row);
  12747. }
  12748. }, treeOpts);
  12749. } else {
  12750. /**
  12751. * 如果是树取消
  12752. * 如果方法成立,则不添加到临时集合中
  12753. */
  12754. if (checkMethod) {
  12755. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(afterFullData, function (row) {
  12756. if (checkMethod({
  12757. row: row
  12758. }) ? 0 : selection.indexOf(row) > -1) {
  12759. selectRows.push(row);
  12760. }
  12761. }, treeOpts);
  12762. }
  12763. }
  12764. } else {
  12765. if (value) {
  12766. /**
  12767. * 如果是行勾选
  12768. * 如果存在选中方法且成立或者本身已勾选,则添加到临时集合中
  12769. * 如果不存在选中方法,则添加所有数据到临时集合中
  12770. */
  12771. if (checkMethod) {
  12772. selectRows = afterFullData.filter(function (row) {
  12773. return selection.indexOf(row) > -1 || checkMethod({
  12774. row: row
  12775. });
  12776. });
  12777. } else {
  12778. selectRows = afterFullData.slice(0);
  12779. }
  12780. } else {
  12781. /**
  12782. * 如果是行取消
  12783. * 如果方法成立,则不添加到临时集合中;如果方法不成立则判断当前是否已勾选,如果已被勾选则添加到新集合中
  12784. * 如果不存在选中方法,无需处理,临时集合默认为空
  12785. */
  12786. if (checkMethod) {
  12787. selectRows = afterFullData.filter(function (row) {
  12788. return checkMethod({
  12789. row: row
  12790. }) ? 0 : selection.indexOf(row) > -1;
  12791. });
  12792. }
  12793. }
  12794. }
  12795. }
  12796. if (reserve) {
  12797. if (value) {
  12798. selectRows.forEach(function (row) {
  12799. checkboxReserveRowMap[methods_getRowid(_this27, row)] = row;
  12800. });
  12801. } else {
  12802. afterFullData.forEach(function (row) {
  12803. return _this27.handleCheckboxReserveRow(row, false);
  12804. });
  12805. }
  12806. }
  12807. this.selection = property ? [] : beforeSelection.concat(selectRows);
  12808. }
  12809. this.treeIndeterminates = [];
  12810. this.checkSelectionStatus();
  12811. },
  12812. checkSelectionStatus: function checkSelectionStatus() {
  12813. var afterFullData = this.afterFullData,
  12814. selection = this.selection,
  12815. treeIndeterminates = this.treeIndeterminates,
  12816. checkboxOpts = this.checkboxOpts,
  12817. treeConfig = this.treeConfig;
  12818. var checkField = checkboxOpts.checkField,
  12819. halfField = checkboxOpts.halfField,
  12820. checkStrictly = checkboxOpts.checkStrictly,
  12821. checkMethod = checkboxOpts.checkMethod;
  12822. if (!checkStrictly) {
  12823. var isAllSelected = false;
  12824. var isIndeterminate = false;
  12825. if (checkField) {
  12826. isAllSelected = afterFullData.length && afterFullData.every(checkMethod ? function (row) {
  12827. return !checkMethod({
  12828. row: row
  12829. }) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, checkField);
  12830. } : function (row) {
  12831. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, checkField);
  12832. });
  12833. if (treeConfig) {
  12834. if (halfField) {
  12835. isIndeterminate = !isAllSelected && afterFullData.some(function (row) {
  12836. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, checkField) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, halfField) || treeIndeterminates.indexOf(row) > -1;
  12837. });
  12838. } else {
  12839. isIndeterminate = !isAllSelected && afterFullData.some(function (row) {
  12840. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, checkField) || treeIndeterminates.indexOf(row) > -1;
  12841. });
  12842. }
  12843. } else {
  12844. if (halfField) {
  12845. isIndeterminate = !isAllSelected && afterFullData.some(function (row) {
  12846. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, checkField) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, halfField);
  12847. });
  12848. } else {
  12849. isIndeterminate = !isAllSelected && afterFullData.some(function (row) {
  12850. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, checkField);
  12851. });
  12852. }
  12853. }
  12854. } else {
  12855. isAllSelected = afterFullData.length && afterFullData.every(checkMethod ? function (row) {
  12856. return !checkMethod({
  12857. row: row
  12858. }) || selection.indexOf(row) > -1;
  12859. } : function (row) {
  12860. return selection.indexOf(row) > -1;
  12861. });
  12862. if (treeConfig) {
  12863. isIndeterminate = !isAllSelected && afterFullData.some(function (row) {
  12864. return treeIndeterminates.indexOf(row) > -1 || selection.indexOf(row) > -1;
  12865. });
  12866. } else {
  12867. isIndeterminate = !isAllSelected && afterFullData.some(function (row) {
  12868. return selection.indexOf(row) > -1;
  12869. });
  12870. }
  12871. }
  12872. this.isAllSelected = isAllSelected;
  12873. this.isIndeterminate = isIndeterminate;
  12874. }
  12875. },
  12876. // 还原展开、选中等相关状态
  12877. handleReserveStatus: function handleReserveStatus() {
  12878. var expandColumn = this.expandColumn,
  12879. treeOpts = this.treeOpts,
  12880. treeConfig = this.treeConfig,
  12881. fullDataRowIdData = this.fullDataRowIdData,
  12882. fullAllDataRowMap = this.fullAllDataRowMap,
  12883. currentRow = this.currentRow,
  12884. selectRow = this.selectRow,
  12885. radioReserveRow = this.radioReserveRow,
  12886. radioOpts = this.radioOpts,
  12887. checkboxOpts = this.checkboxOpts,
  12888. selection = this.selection,
  12889. rowExpandeds = this.rowExpandeds,
  12890. treeExpandeds = this.treeExpandeds,
  12891. expandOpts = this.expandOpts; // 单选框
  12892. if (selectRow && !fullAllDataRowMap.has(selectRow)) {
  12893. this.selectRow = null; // 刷新单选行状态
  12894. } // 还原保留选中状态
  12895. if (radioOpts.reserve && radioReserveRow) {
  12896. var rowid = methods_getRowid(this, radioReserveRow);
  12897. if (fullDataRowIdData[rowid]) {
  12898. this.setRadioRow(fullDataRowIdData[rowid].row);
  12899. }
  12900. } // 复选框
  12901. this.selection = getRecoverRow(this, selection); // 刷新多选行状态
  12902. // 还原保留选中状态
  12903. if (checkboxOpts.reserve) {
  12904. this.setCheckboxRow(handleReserveRow(this, this.checkboxReserveRowMap), true);
  12905. }
  12906. if (currentRow && !fullAllDataRowMap.has(currentRow)) {
  12907. this.currentRow = null; // 刷新当前行状态
  12908. } // 行展开
  12909. this.rowExpandeds = expandColumn ? getRecoverRow(this, rowExpandeds) : []; // 刷新行展开状态
  12910. // 还原保留状态
  12911. if (expandColumn && expandOpts.reserve) {
  12912. this.setRowExpand(handleReserveRow(this, this.rowExpandedReserveRowMap), true);
  12913. } // 树展开
  12914. this.treeExpandeds = treeConfig ? getRecoverRow(this, treeExpandeds) : []; // 刷新树展开状态
  12915. if (treeConfig && treeOpts.reserve) {
  12916. this.setTreeExpand(handleReserveRow(this, this.treeExpandedReserveRowMap), true);
  12917. }
  12918. },
  12919. /**
  12920. * 获取单选框保留选中的行
  12921. */
  12922. getRadioReserveRecord: function getRadioReserveRecord() {
  12923. var fullDataRowIdData = this.fullDataRowIdData,
  12924. radioReserveRow = this.radioReserveRow,
  12925. radioOpts = this.radioOpts;
  12926. if (radioOpts.reserve && radioReserveRow) {
  12927. if (!fullDataRowIdData[methods_getRowid(this, radioReserveRow)]) {
  12928. return radioReserveRow;
  12929. }
  12930. }
  12931. return null;
  12932. },
  12933. clearRadioReserve: function clearRadioReserve() {
  12934. this.radioReserveRow = null;
  12935. return this.$nextTick();
  12936. },
  12937. handleRadioReserveRow: function handleRadioReserveRow(row) {
  12938. var radioOpts = this.radioOpts;
  12939. if (radioOpts.reserve) {
  12940. this.radioReserveRow = row;
  12941. }
  12942. },
  12943. /**
  12944. * 获取复选框保留选中的行
  12945. */
  12946. getCheckboxReserveRecords: function getCheckboxReserveRecords() {
  12947. var fullDataRowIdData = this.fullDataRowIdData,
  12948. checkboxReserveRowMap = this.checkboxReserveRowMap,
  12949. checkboxOpts = this.checkboxOpts;
  12950. var reserveSelection = [];
  12951. if (checkboxOpts.reserve) {
  12952. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.each(checkboxReserveRowMap, function (row, rowid) {
  12953. if (row && !fullDataRowIdData[rowid]) {
  12954. reserveSelection.push(row);
  12955. }
  12956. });
  12957. }
  12958. return reserveSelection;
  12959. },
  12960. clearCheckboxReserve: function clearCheckboxReserve() {
  12961. this.checkboxReserveRowMap = {};
  12962. return this.$nextTick();
  12963. },
  12964. handleCheckboxReserveRow: function handleCheckboxReserveRow(row, checked) {
  12965. var checkboxReserveRowMap = this.checkboxReserveRowMap,
  12966. checkboxOpts = this.checkboxOpts;
  12967. if (checkboxOpts.reserve) {
  12968. var rowid = methods_getRowid(this, row);
  12969. if (checked) {
  12970. checkboxReserveRowMap[rowid] = row;
  12971. } else if (checkboxReserveRowMap[rowid]) {
  12972. delete checkboxReserveRowMap[rowid];
  12973. }
  12974. }
  12975. },
  12976. /**
  12977. * 多选,选中所有事件
  12978. */
  12979. triggerCheckAllEvent: function triggerCheckAllEvent(evnt, value) {
  12980. this.setAllCheckboxRow(value);
  12981. this.emitEvent('checkbox-all', {
  12982. records: this.getCheckboxRecords(),
  12983. reserves: this.getCheckboxReserveRecords(),
  12984. indeterminates: this.getCheckboxIndeterminateRecords(),
  12985. checked: value
  12986. }, evnt);
  12987. },
  12988. /**
  12989. * 多选,切换所有行的选中状态
  12990. */
  12991. toggleAllCheckboxRow: function toggleAllCheckboxRow() {
  12992. this.triggerCheckAllEvent(null, !this.isAllSelected);
  12993. return this.$nextTick();
  12994. },
  12995. /**
  12996. * 用于多选行,手动清空用户的选择
  12997. * 清空行为不管是否被禁用还是保留记录,都将彻底清空选中状态
  12998. */
  12999. clearCheckboxRow: function clearCheckboxRow() {
  13000. var _this28 = this;
  13001. var tableFullData = this.tableFullData,
  13002. treeConfig = this.treeConfig,
  13003. treeOpts = this.treeOpts,
  13004. checkboxOpts = this.checkboxOpts;
  13005. var property = checkboxOpts.checkField,
  13006. reserve = checkboxOpts.reserve;
  13007. if (property) {
  13008. if (treeConfig) {
  13009. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(tableFullData, function (item) {
  13010. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.set(item, property, false);
  13011. }, treeOpts);
  13012. } else {
  13013. tableFullData.forEach(function (item) {
  13014. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.set(item, property, false);
  13015. });
  13016. }
  13017. }
  13018. if (reserve) {
  13019. tableFullData.forEach(function (row) {
  13020. return _this28.handleCheckboxReserveRow(row, false);
  13021. });
  13022. }
  13023. this.isAllSelected = false;
  13024. this.isIndeterminate = false;
  13025. this.selection = [];
  13026. this.treeIndeterminates = [];
  13027. return this.$nextTick();
  13028. },
  13029. /**
  13030. * 处理单选框默认勾选
  13031. */
  13032. handleDefaultRadioChecked: function handleDefaultRadioChecked() {
  13033. var radioOpts = this.radioOpts,
  13034. fullDataRowIdData = this.fullDataRowIdData;
  13035. var rowid = radioOpts.checkRowKey,
  13036. reserve = radioOpts.reserve;
  13037. if (rowid) {
  13038. if (fullDataRowIdData[rowid]) {
  13039. this.setRadioRow(fullDataRowIdData[rowid].row);
  13040. }
  13041. if (reserve) {
  13042. var rowkey = getRowkey(this);
  13043. this.radioReserveRow = _defineProperty({}, rowkey, rowid);
  13044. }
  13045. }
  13046. },
  13047. /**
  13048. * 单选,行选中事件
  13049. */
  13050. triggerRadioRowEvent: function triggerRadioRowEvent(evnt, params) {
  13051. var isChange = this.selectRow !== params.row;
  13052. this.setRadioRow(params.row);
  13053. if (isChange) {
  13054. this.emitEvent('radio-change', params, evnt);
  13055. }
  13056. },
  13057. triggerCurrentRowEvent: function triggerCurrentRowEvent(evnt, params) {
  13058. var isChange = this.currentRow !== params.row;
  13059. this.setCurrentRow(params.row);
  13060. if (isChange) {
  13061. this.emitEvent('current-change', params, evnt);
  13062. }
  13063. },
  13064. /**
  13065. * 用于当前行,设置某一行为高亮状态
  13066. * @param {Row} row 行对象
  13067. */
  13068. setCurrentRow: function setCurrentRow(row) {
  13069. this.clearCurrentRow();
  13070. this.clearCurrentColumn();
  13071. this.currentRow = row;
  13072. if (this.highlightCurrentRow) {
  13073. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.arrayEach(this.$el.querySelectorAll("[rowid=\"".concat(methods_getRowid(this, row), "\"]")), function (elem) {
  13074. return addClass(elem, 'row--current');
  13075. });
  13076. }
  13077. return this.$nextTick();
  13078. },
  13079. isCheckedByRadioRow: function isCheckedByRadioRow(row) {
  13080. return this.selectRow === row;
  13081. },
  13082. /**
  13083. * 用于单选行,设置某一行为选中状态
  13084. * @param {Row} row 行对象
  13085. */
  13086. setRadioRow: function setRadioRow(row) {
  13087. var radioOpts = this.radioOpts;
  13088. var checkMethod = radioOpts.checkMethod;
  13089. if (row && (!checkMethod || checkMethod({
  13090. row: row
  13091. }))) {
  13092. this.selectRow = row;
  13093. this.handleRadioReserveRow(row);
  13094. }
  13095. return this.$nextTick();
  13096. },
  13097. /**
  13098. * 用于当前行,手动清空当前高亮的状态
  13099. */
  13100. clearCurrentRow: function clearCurrentRow() {
  13101. this.currentRow = null;
  13102. this.hoverRow = null;
  13103. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.arrayEach(this.$el.querySelectorAll('.row--current'), function (elem) {
  13104. return methods_removeClass(elem, 'row--current');
  13105. });
  13106. return this.$nextTick();
  13107. },
  13108. /**
  13109. * 用于单选行,手动清空用户的选择
  13110. */
  13111. clearRadioRow: function clearRadioRow() {
  13112. this.selectRow = null;
  13113. return this.$nextTick();
  13114. },
  13115. /**
  13116. * 用于当前行,获取当前行的数据
  13117. */
  13118. getCurrentRecord: function getCurrentRecord() {
  13119. return this.highlightCurrentRow ? this.currentRow : null;
  13120. },
  13121. /**
  13122. * 用于单选行,获取当已选中的数据
  13123. */
  13124. getRadioRecord: function getRadioRecord() {
  13125. return this.selectRow;
  13126. },
  13127. /**
  13128. * 行 hover 事件
  13129. */
  13130. triggerHoverEvent: function triggerHoverEvent(evnt, _ref7) {
  13131. var row = _ref7.row;
  13132. this.setHoverRow(row);
  13133. },
  13134. setHoverRow: function setHoverRow(row) {
  13135. var rowid = methods_getRowid(this, row);
  13136. this.clearHoverRow();
  13137. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.arrayEach(this.$el.querySelectorAll("[rowid=\"".concat(rowid, "\"]")), function (elem) {
  13138. return addClass(elem, 'row--hover');
  13139. });
  13140. this.hoverRow = row;
  13141. },
  13142. clearHoverRow: function clearHoverRow() {
  13143. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.arrayEach(this.$el.querySelectorAll('.vxe-body--row.row--hover'), function (elem) {
  13144. return methods_removeClass(elem, 'row--hover');
  13145. });
  13146. this.hoverRow = null;
  13147. },
  13148. triggerHeaderCellClickEvent: function triggerHeaderCellClickEvent(evnt, params) {
  13149. var _lastResizeTime = this._lastResizeTime,
  13150. sortOpts = this.sortOpts;
  13151. var column = params.column;
  13152. var cell = evnt.currentTarget;
  13153. var triggerResizable = _lastResizeTime && _lastResizeTime > Date.now() - 300;
  13154. var triggerSort = getEventTargetNode(evnt, cell, 'vxe-cell--sort').flag;
  13155. var triggerFilter = getEventTargetNode(evnt, cell, 'vxe-cell--filter').flag;
  13156. if (sortOpts.trigger === 'cell' && !(triggerResizable || triggerSort || triggerFilter)) {
  13157. this.triggerSortEvent(evnt, column, getNextSortOrder(this, column));
  13158. }
  13159. this.emitEvent('header-cell-click', Object.assign({
  13160. triggerResizable: triggerResizable,
  13161. triggerSort: triggerSort,
  13162. triggerFilter: triggerFilter,
  13163. cell: cell
  13164. }, params), evnt);
  13165. if (this.highlightCurrentColumn) {
  13166. return this.setCurrentColumn(column);
  13167. }
  13168. return this.$nextTick();
  13169. },
  13170. triggerHeaderCellDBLClickEvent: function triggerHeaderCellDBLClickEvent(evnt, params) {
  13171. this.emitEvent('header-cell-dblclick', Object.assign({
  13172. cell: evnt.currentTarget
  13173. }, params), evnt);
  13174. },
  13175. getCurrentColumn: function getCurrentColumn() {
  13176. return this.highlightCurrentColumn ? this.currentColumn : null;
  13177. },
  13178. /**
  13179. * 用于当前列,设置某列行为高亮状态
  13180. * @param {ColumnInfo} fieldOrColumn 列配置
  13181. */
  13182. setCurrentColumn: function setCurrentColumn(fieldOrColumn) {
  13183. var column = handleFieldOrColumn(this, fieldOrColumn);
  13184. if (column) {
  13185. this.clearCurrentRow();
  13186. this.clearCurrentColumn();
  13187. this.currentColumn = column;
  13188. }
  13189. return this.$nextTick();
  13190. },
  13191. /**
  13192. * 用于当前列,手动清空当前高亮的状态
  13193. */
  13194. clearCurrentColumn: function clearCurrentColumn() {
  13195. this.currentColumn = null;
  13196. return this.$nextTick();
  13197. },
  13198. checkValidate: function checkValidate(type) {
  13199. if (v_x_e_table._valid) {
  13200. return this.triggerValidate(type);
  13201. }
  13202. return this.$nextTick();
  13203. },
  13204. /**
  13205. * 当单元格发生改变时
  13206. * 如果存在规则,则校验
  13207. */
  13208. handleChangeCell: function handleChangeCell(evnt, params) {
  13209. var _this29 = this;
  13210. this.checkValidate('blur').catch(function (e) {
  13211. return e;
  13212. }).then(function () {
  13213. _this29.handleActived(params, evnt).then(function () {
  13214. return _this29.checkValidate('change');
  13215. }).catch(function (e) {
  13216. return e;
  13217. });
  13218. });
  13219. },
  13220. /**
  13221. * 列点击事件
  13222. * 如果是单击模式,则激活为编辑状态
  13223. * 如果是双击模式,则单击后选中状态
  13224. */
  13225. triggerCellClickEvent: function triggerCellClickEvent(evnt, params) {
  13226. var highlightCurrentRow = this.highlightCurrentRow,
  13227. editStore = this.editStore,
  13228. radioOpts = this.radioOpts,
  13229. expandOpts = this.expandOpts,
  13230. treeOpts = this.treeOpts,
  13231. editConfig = this.editConfig,
  13232. editOpts = this.editOpts,
  13233. checkboxOpts = this.checkboxOpts;
  13234. var actived = editStore.actived;
  13235. var _params = params,
  13236. row = _params.row,
  13237. column = _params.column;
  13238. var type = column.type,
  13239. treeNode = column.treeNode;
  13240. var isRadioType = type === 'radio';
  13241. var isCheckboxType = type === 'checkbox';
  13242. var isExpandType = type === 'expand';
  13243. var cell = evnt.currentTarget;
  13244. var triggerRadio = isRadioType && getEventTargetNode(evnt, cell, 'vxe-cell--radio').flag;
  13245. var triggerCheckbox = isCheckboxType && getEventTargetNode(evnt, cell, 'vxe-cell--checkbox').flag;
  13246. var triggerTreeNode = treeNode && getEventTargetNode(evnt, cell, 'vxe-tree--btn-wrapper').flag;
  13247. var triggerExpandNode = isExpandType && getEventTargetNode(evnt, cell, 'vxe-table--expanded').flag;
  13248. params = Object.assign({
  13249. cell: cell,
  13250. triggerRadio: triggerRadio,
  13251. triggerCheckbox: triggerCheckbox,
  13252. triggerTreeNode: triggerTreeNode,
  13253. triggerExpandNode: triggerExpandNode
  13254. }, params);
  13255. if (!triggerCheckbox && !triggerRadio) {
  13256. // 如果是展开行
  13257. if (!triggerExpandNode && (expandOpts.trigger === 'row' || isExpandType && expandOpts.trigger === 'cell')) {
  13258. this.triggerRowExpandEvent(evnt, params);
  13259. } // 如果是树形表格
  13260. if (treeOpts.trigger === 'row' || treeNode && treeOpts.trigger === 'cell') {
  13261. this.triggerTreeExpandEvent(evnt, params);
  13262. }
  13263. } // 如果点击了树节点
  13264. if (!triggerTreeNode) {
  13265. if (!triggerExpandNode) {
  13266. // 如果是高亮行
  13267. if (highlightCurrentRow) {
  13268. if (!triggerCheckbox && !triggerRadio) {
  13269. this.triggerCurrentRowEvent(evnt, params);
  13270. }
  13271. } // 如果是单选框
  13272. if (!triggerRadio && (radioOpts.trigger === 'row' || isRadioType && radioOpts.trigger === 'cell')) {
  13273. this.triggerRadioRowEvent(evnt, params);
  13274. } // 如果是复选框
  13275. if (!triggerCheckbox && (checkboxOpts.trigger === 'row' || isCheckboxType && checkboxOpts.trigger === 'cell')) {
  13276. this.handleToggleCheckRowEvent(evnt, params);
  13277. }
  13278. } // 如果设置了单元格选中功能,则不会使用点击事件去处理(只能支持双击模式)
  13279. if (editConfig) {
  13280. if (editOpts.trigger === 'manual') {
  13281. if (actived.args && actived.row === row && column !== actived.column) {
  13282. this.handleChangeCell(evnt, params);
  13283. }
  13284. } else if (!actived.args || row !== actived.row || column !== actived.column) {
  13285. if (editOpts.trigger === 'click') {
  13286. this.handleChangeCell(evnt, params);
  13287. } else if (editOpts.trigger === 'dblclick') {
  13288. if (editOpts.mode === 'row' && actived.row === row) {
  13289. this.handleChangeCell(evnt, params);
  13290. }
  13291. }
  13292. }
  13293. }
  13294. }
  13295. this.emitEvent('cell-click', params, evnt);
  13296. },
  13297. /**
  13298. * 列双击点击事件
  13299. * 如果是双击模式,则激活为编辑状态
  13300. */
  13301. triggerCellDBLClickEvent: function triggerCellDBLClickEvent(evnt, params) {
  13302. var _this30 = this;
  13303. var editStore = this.editStore,
  13304. editConfig = this.editConfig,
  13305. editOpts = this.editOpts;
  13306. var actived = editStore.actived;
  13307. var cell = evnt.currentTarget;
  13308. params.cell = cell;
  13309. if (editConfig && editOpts.trigger === 'dblclick') {
  13310. if (!actived.args || evnt.currentTarget !== actived.args.cell) {
  13311. if (editOpts.mode === 'row') {
  13312. this.checkValidate('blur').catch(function (e) {
  13313. return e;
  13314. }).then(function () {
  13315. _this30.handleActived(params, evnt).then(function () {
  13316. return _this30.checkValidate('change');
  13317. }).catch(function (e) {
  13318. return e;
  13319. });
  13320. });
  13321. } else if (editOpts.mode === 'cell') {
  13322. this.handleActived(params, evnt).then(function () {
  13323. return _this30.checkValidate('change');
  13324. }).catch(function (e) {
  13325. return e;
  13326. });
  13327. }
  13328. }
  13329. }
  13330. this.emitEvent('cell-dblclick', params, evnt);
  13331. },
  13332. handleDefaultSort: function handleDefaultSort() {
  13333. var _this31 = this;
  13334. var sortConfig = this.sortConfig,
  13335. sortOpts = this.sortOpts;
  13336. var defaultSort = sortOpts.defaultSort;
  13337. if (defaultSort) {
  13338. if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(defaultSort)) {
  13339. defaultSort = [defaultSort];
  13340. }
  13341. if (defaultSort.length) {
  13342. (sortConfig.multiple ? defaultSort : defaultSort.slice(0, 1)).forEach(function (item) {
  13343. var field = item.field,
  13344. order = item.order;
  13345. if (field && order) {
  13346. var column = _this31.getColumnByField(field);
  13347. if (column && column.sortable) {
  13348. column.order = order;
  13349. }
  13350. }
  13351. });
  13352. if (!sortOpts.remote) {
  13353. this.handleTableData(true).then(this.updateStyle);
  13354. }
  13355. }
  13356. }
  13357. },
  13358. /**
  13359. * 点击排序事件
  13360. */
  13361. triggerSortEvent: function triggerSortEvent(evnt, column, order) {
  13362. var sortOpts = this.sortOpts;
  13363. var property = column.property;
  13364. if (column.sortable || column.remoteSort) {
  13365. if (!order || column.order === order) {
  13366. this.clearSort(sortOpts.multiple ? column : null);
  13367. } else {
  13368. this.sort({
  13369. field: property,
  13370. order: order
  13371. });
  13372. }
  13373. var params = {
  13374. column: column,
  13375. property: property,
  13376. order: column.order,
  13377. sortBy: column.sortBy,
  13378. sortList: this.getSortColumns()
  13379. };
  13380. this.emitEvent('sort-change', params, evnt);
  13381. }
  13382. },
  13383. sort: function sort(sortConfs, sortOrder) {
  13384. var _this32 = this;
  13385. var sortOpts = this.sortOpts;
  13386. var multiple = sortOpts.multiple,
  13387. remote = sortOpts.remote,
  13388. orders = sortOpts.orders;
  13389. if (sortConfs) {
  13390. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isString(sortConfs)) {
  13391. sortConfs = [{
  13392. field: sortConfs,
  13393. order: sortOrder
  13394. }];
  13395. }
  13396. }
  13397. if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(sortConfs)) {
  13398. sortConfs = [sortConfs];
  13399. }
  13400. if (sortConfs.length) {
  13401. var firstSortColumn;
  13402. if (!multiple) {
  13403. clearAllSort(this);
  13404. }
  13405. (multiple ? sortConfs : [sortConfs[0]]).forEach(function (confs) {
  13406. var field = confs.field,
  13407. order = confs.order;
  13408. var column = field;
  13409. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isString(field)) {
  13410. column = _this32.getColumnByField(field);
  13411. }
  13412. if (column && (column.sortable || column.remoteSort)) {
  13413. if (!firstSortColumn) {
  13414. firstSortColumn = column;
  13415. }
  13416. if (orders.indexOf(order) === -1) {
  13417. order = getNextSortOrder(_this32, column);
  13418. }
  13419. if (column.order !== order) {
  13420. column.order = order;
  13421. }
  13422. }
  13423. }); // 如果是服务端排序,则跳过本地排序处理
  13424. if (!remote || firstSortColumn && firstSortColumn.remoteSort) {
  13425. this.handleTableData(true);
  13426. }
  13427. return this.$nextTick().then(this.updateStyle);
  13428. }
  13429. return this.$nextTick();
  13430. },
  13431. /**
  13432. * 清空指定列的排序条件
  13433. * 如果为空则清空所有列的排序条件
  13434. * @param {String} column 列或字段名
  13435. */
  13436. clearSort: function clearSort(fieldOrColumn) {
  13437. var sortOpts = this.sortOpts;
  13438. if (fieldOrColumn) {
  13439. var column = handleFieldOrColumn(this, fieldOrColumn);
  13440. if (column) {
  13441. column.order = null;
  13442. }
  13443. } else {
  13444. clearAllSort(this);
  13445. }
  13446. if (!sortOpts.remote) {
  13447. return this.handleTableData(true);
  13448. }
  13449. return this.$nextTick();
  13450. },
  13451. // 在 v3 中废弃
  13452. getSortColumn: function getSortColumn() {
  13453. if (false) {}
  13454. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.find(this.visibleColumn, function (column) {
  13455. return (column.sortable || column.remoteSort) && column.order;
  13456. });
  13457. },
  13458. isSort: function isSort(fieldOrColumn) {
  13459. if (fieldOrColumn) {
  13460. var column = handleFieldOrColumn(this, fieldOrColumn);
  13461. return column && column.sortable && !!column.order;
  13462. }
  13463. return this.getSortColumns().length > 0;
  13464. },
  13465. getSortColumns: function getSortColumns() {
  13466. var sortList = [];
  13467. this.visibleColumn.forEach(function (column) {
  13468. var order = column.order;
  13469. if ((column.sortable || column.remoteSort) && order) {
  13470. sortList.push({
  13471. column: column,
  13472. sortBy: column.sortBy,
  13473. property: column.property,
  13474. order: order
  13475. });
  13476. }
  13477. });
  13478. return sortList;
  13479. },
  13480. /**
  13481. * 关闭筛选
  13482. * @param {Event} evnt 事件
  13483. */
  13484. closeFilter: function closeFilter() {
  13485. Object.assign(this.filterStore, {
  13486. isAllSelected: false,
  13487. isIndeterminate: false,
  13488. options: [],
  13489. visible: false
  13490. });
  13491. return this.$nextTick();
  13492. },
  13493. /**
  13494. * 判断指定列是否为筛选状态,如果为空则判断所有列
  13495. * @param {String} fieldOrColumn 字段名
  13496. */
  13497. isFilter: function isFilter(fieldOrColumn) {
  13498. var column = handleFieldOrColumn(this, fieldOrColumn);
  13499. if (column) {
  13500. return column.filters && column.filters.some(function (option) {
  13501. return option.checked;
  13502. });
  13503. }
  13504. return this.getCheckedFilters().length > 0;
  13505. },
  13506. /**
  13507. * 判断展开行是否懒加载完成
  13508. * @param {Row} row 行对象
  13509. */
  13510. isRowExpandLoaded: function isRowExpandLoaded(row) {
  13511. var rest = this.fullAllDataRowMap.get(row);
  13512. return rest && rest.expandLoaded;
  13513. },
  13514. clearRowExpandLoaded: function clearRowExpandLoaded(row) {
  13515. var expandOpts = this.expandOpts,
  13516. expandLazyLoadeds = this.expandLazyLoadeds,
  13517. fullAllDataRowMap = this.fullAllDataRowMap;
  13518. var lazy = expandOpts.lazy;
  13519. var rest = fullAllDataRowMap.get(row);
  13520. if (lazy && rest) {
  13521. rest.expandLoaded = false;
  13522. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.remove(expandLazyLoadeds, function (item) {
  13523. return row === item;
  13524. });
  13525. }
  13526. return this.$nextTick();
  13527. },
  13528. /**
  13529. * 重新加载展开行的内容
  13530. * @param {Row} row 行对象
  13531. */
  13532. reloadExpandContent: function reloadExpandContent(row) {
  13533. var _this33 = this;
  13534. var expandOpts = this.expandOpts,
  13535. expandLazyLoadeds = this.expandLazyLoadeds;
  13536. var lazy = expandOpts.lazy;
  13537. if (lazy && expandLazyLoadeds.indexOf(row) === -1) {
  13538. this.clearRowExpandLoaded(row).then(function () {
  13539. return _this33.handleAsyncRowExpand(row);
  13540. });
  13541. }
  13542. return this.$nextTick();
  13543. },
  13544. /**
  13545. * 展开行事件
  13546. */
  13547. triggerRowExpandEvent: function triggerRowExpandEvent(evnt, params) {
  13548. var expandOpts = this.expandOpts,
  13549. expandLazyLoadeds = this.expandLazyLoadeds,
  13550. column = this.expandColumn;
  13551. var row = params.row;
  13552. var lazy = expandOpts.lazy;
  13553. if (!lazy || expandLazyLoadeds.indexOf(row) === -1) {
  13554. var expanded = !this.isExpandByRow(row);
  13555. var columnIndex = this.getColumnIndex(column);
  13556. var $columnIndex = this.getVMColumnIndex(column);
  13557. this.setRowExpand(row, expanded);
  13558. this.emitEvent('toggle-row-expand', {
  13559. expanded: expanded,
  13560. column: column,
  13561. columnIndex: columnIndex,
  13562. $columnIndex: $columnIndex,
  13563. row: row,
  13564. rowIndex: this.getRowIndex(row),
  13565. $rowIndex: this.getVMRowIndex(row)
  13566. }, evnt);
  13567. }
  13568. },
  13569. /**
  13570. * 切换展开行
  13571. */
  13572. toggleRowExpand: function toggleRowExpand(row) {
  13573. return this.setRowExpand(row, !this.isExpandByRow(row));
  13574. },
  13575. /**
  13576. * 处理默认展开行
  13577. */
  13578. handleDefaultRowExpand: function handleDefaultRowExpand() {
  13579. var expandOpts = this.expandOpts,
  13580. fullDataRowIdData = this.fullDataRowIdData;
  13581. var expandAll = expandOpts.expandAll,
  13582. expandRowKeys = expandOpts.expandRowKeys;
  13583. if (expandAll) {
  13584. this.setAllRowExpand(true);
  13585. } else if (expandRowKeys) {
  13586. var defExpandeds = [];
  13587. expandRowKeys.forEach(function (rowid) {
  13588. if (fullDataRowIdData[rowid]) {
  13589. defExpandeds.push(fullDataRowIdData[rowid].row);
  13590. }
  13591. });
  13592. this.setRowExpand(defExpandeds, true);
  13593. }
  13594. },
  13595. /**
  13596. * 设置所有行的展开与否
  13597. * @param {Boolean} expanded 是否展开
  13598. */
  13599. setAllRowExpand: function setAllRowExpand(expanded) {
  13600. return this.setRowExpand(this.expandOpts.lazy ? this.tableData : this.tableFullData, expanded);
  13601. },
  13602. handleAsyncRowExpand: function handleAsyncRowExpand(row) {
  13603. var _this34 = this;
  13604. var rest = this.fullAllDataRowMap.get(row);
  13605. return new Promise(function (resolve) {
  13606. _this34.expandLazyLoadeds.push(row);
  13607. _this34.expandOpts.loadMethod({
  13608. $table: _this34,
  13609. row: row,
  13610. rowIndex: _this34.getRowIndex(row),
  13611. $rowIndex: _this34.getVMRowIndex(row)
  13612. }).catch(function (e) {
  13613. return e;
  13614. }).then(function () {
  13615. rest.expandLoaded = true;
  13616. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.remove(_this34.expandLazyLoadeds, function (item) {
  13617. return item === row;
  13618. });
  13619. _this34.rowExpandeds.push(row);
  13620. resolve(_this34.$nextTick().then(_this34.recalculate));
  13621. });
  13622. });
  13623. },
  13624. /**
  13625. * 设置展开行,二个参数设置这一行展开与否
  13626. * 支持单行
  13627. * 支持多行
  13628. * @param {Array/Row} rows 行数据
  13629. * @param {Boolean} expanded 是否展开
  13630. */
  13631. setRowExpand: function setRowExpand(rows, expanded) {
  13632. var _this35 = this;
  13633. var fullAllDataRowMap = this.fullAllDataRowMap,
  13634. expandLazyLoadeds = this.expandLazyLoadeds,
  13635. expandOpts = this.expandOpts,
  13636. column = this.expandColumn;
  13637. var rowExpandeds = this.rowExpandeds;
  13638. var reserve = expandOpts.reserve,
  13639. lazy = expandOpts.lazy,
  13640. accordion = expandOpts.accordion,
  13641. toggleMethod = expandOpts.toggleMethod;
  13642. var lazyRests = [];
  13643. var columnIndex = this.getColumnIndex(column);
  13644. var $columnIndex = this.getVMColumnIndex(column);
  13645. if (rows) {
  13646. if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(rows)) {
  13647. rows = [rows];
  13648. }
  13649. if (accordion) {
  13650. // 只能同时展开一个
  13651. rowExpandeds = [];
  13652. rows = rows.slice(rows.length - 1, rows.length);
  13653. }
  13654. var validRows = toggleMethod ? rows.filter(function (row) {
  13655. return toggleMethod({
  13656. expanded: expanded,
  13657. column: column,
  13658. columnIndex: columnIndex,
  13659. $columnIndex: $columnIndex,
  13660. row: row,
  13661. rowIndex: _this35.getRowIndex(row),
  13662. $rowIndex: _this35.getVMRowIndex(row)
  13663. });
  13664. }) : rows;
  13665. if (expanded) {
  13666. validRows.forEach(function (row) {
  13667. if (rowExpandeds.indexOf(row) === -1) {
  13668. var rest = fullAllDataRowMap.get(row);
  13669. var isLoad = lazy && !rest.expandLoaded && expandLazyLoadeds.indexOf(row) === -1;
  13670. if (isLoad) {
  13671. lazyRests.push(_this35.handleAsyncRowExpand(row));
  13672. } else {
  13673. rowExpandeds.push(row);
  13674. }
  13675. }
  13676. });
  13677. } else {
  13678. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.remove(rowExpandeds, function (row) {
  13679. return validRows.indexOf(row) > -1;
  13680. });
  13681. }
  13682. if (reserve) {
  13683. validRows.forEach(function (row) {
  13684. return _this35.handleRowExpandReserve(row, expanded);
  13685. });
  13686. }
  13687. }
  13688. this.rowExpandeds = rowExpandeds;
  13689. return Promise.all(lazyRests).then(this.recalculate);
  13690. },
  13691. /**
  13692. * 判断行是否为展开状态
  13693. * @param {Row} row 行对象
  13694. */
  13695. isExpandByRow: function isExpandByRow(row) {
  13696. return this.rowExpandeds.indexOf(row) > -1;
  13697. },
  13698. /**
  13699. * 手动清空展开行状态,数据会恢复成未展开的状态
  13700. */
  13701. clearRowExpand: function clearRowExpand() {
  13702. var _this36 = this;
  13703. var expandOpts = this.expandOpts,
  13704. rowExpandeds = this.rowExpandeds,
  13705. tableFullData = this.tableFullData;
  13706. var reserve = expandOpts.reserve;
  13707. var isExists = rowExpandeds.length;
  13708. this.rowExpandeds = [];
  13709. if (reserve) {
  13710. tableFullData.forEach(function (row) {
  13711. return _this36.handleRowExpandReserve(row, false);
  13712. });
  13713. }
  13714. return this.$nextTick().then(function () {
  13715. if (isExists) {
  13716. _this36.recalculate();
  13717. }
  13718. });
  13719. },
  13720. clearRowExpandReserve: function clearRowExpandReserve() {
  13721. this.rowExpandedReserveRowMap = {};
  13722. return this.$nextTick();
  13723. },
  13724. handleRowExpandReserve: function handleRowExpandReserve(row, expanded) {
  13725. var rowExpandedReserveRowMap = this.rowExpandedReserveRowMap,
  13726. expandOpts = this.expandOpts;
  13727. if (expandOpts.reserve) {
  13728. var rowid = methods_getRowid(this, row);
  13729. if (expanded) {
  13730. rowExpandedReserveRowMap[rowid] = row;
  13731. } else if (rowExpandedReserveRowMap[rowid]) {
  13732. delete rowExpandedReserveRowMap[rowid];
  13733. }
  13734. }
  13735. },
  13736. getRowExpandRecords: function getRowExpandRecords() {
  13737. return this.rowExpandeds.slice(0);
  13738. },
  13739. getTreeExpandRecords: function getTreeExpandRecords() {
  13740. return this.treeExpandeds.slice(0);
  13741. },
  13742. /**
  13743. * 获取数表格状态
  13744. */
  13745. getTreeStatus: function getTreeStatus() {
  13746. if (this.treeConfig) {
  13747. return {
  13748. config: this.treeOpts,
  13749. rowExpandeds: this.getTreeExpandRecords()
  13750. };
  13751. }
  13752. return null;
  13753. },
  13754. /**
  13755. * 判断树节点是否懒加载完成
  13756. * @param {Row} row 行对象
  13757. */
  13758. isTreeExpandLoaded: function isTreeExpandLoaded(row) {
  13759. var rest = this.fullAllDataRowMap.get(row);
  13760. return rest && rest.treeLoaded;
  13761. },
  13762. clearTreeExpandLoaded: function clearTreeExpandLoaded(row) {
  13763. var treeOpts = this.treeOpts,
  13764. treeExpandeds = this.treeExpandeds,
  13765. fullAllDataRowMap = this.fullAllDataRowMap;
  13766. var lazy = treeOpts.lazy;
  13767. var rest = fullAllDataRowMap.get(row);
  13768. if (lazy && rest) {
  13769. rest.treeLoaded = false;
  13770. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.remove(treeExpandeds, function (item) {
  13771. return row === item;
  13772. });
  13773. }
  13774. return this.$nextTick();
  13775. },
  13776. /**
  13777. * 重新加载树的子节点
  13778. * @param {Row} row 行对象
  13779. */
  13780. reloadTreeChilds: function reloadTreeChilds(row) {
  13781. var _this37 = this;
  13782. var treeOpts = this.treeOpts,
  13783. treeLazyLoadeds = this.treeLazyLoadeds;
  13784. var lazy = treeOpts.lazy,
  13785. hasChild = treeOpts.hasChild;
  13786. if (lazy && row[hasChild] && treeLazyLoadeds.indexOf(row) === -1) {
  13787. this.clearTreeExpandLoaded(row).then(function () {
  13788. return _this37.handleAsyncTreeExpandChilds(row);
  13789. });
  13790. }
  13791. return this.$nextTick();
  13792. },
  13793. /**
  13794. * 展开树节点事件
  13795. */
  13796. triggerTreeExpandEvent: function triggerTreeExpandEvent(evnt, params) {
  13797. var treeOpts = this.treeOpts,
  13798. treeLazyLoadeds = this.treeLazyLoadeds;
  13799. var row = params.row,
  13800. column = params.column;
  13801. var lazy = treeOpts.lazy;
  13802. if (!lazy || treeLazyLoadeds.indexOf(row) === -1) {
  13803. var expanded = !this.isTreeExpandByRow(row);
  13804. var columnIndex = this.getColumnIndex(column);
  13805. var $columnIndex = this.getVMColumnIndex(column);
  13806. this.setTreeExpand(row, expanded);
  13807. this.emitEvent('toggle-tree-expand', {
  13808. expanded: expanded,
  13809. column: column,
  13810. columnIndex: columnIndex,
  13811. $columnIndex: $columnIndex,
  13812. row: row
  13813. }, evnt);
  13814. }
  13815. },
  13816. /**
  13817. * 切换/展开树节点
  13818. */
  13819. toggleTreeExpand: function toggleTreeExpand(row) {
  13820. return this.setTreeExpand(row, !this.isTreeExpandByRow(row));
  13821. },
  13822. /**
  13823. * 处理默认展开树节点
  13824. */
  13825. handleDefaultTreeExpand: function handleDefaultTreeExpand() {
  13826. var treeConfig = this.treeConfig,
  13827. treeOpts = this.treeOpts,
  13828. tableFullData = this.tableFullData;
  13829. if (treeConfig) {
  13830. var expandAll = treeOpts.expandAll,
  13831. expandRowKeys = treeOpts.expandRowKeys;
  13832. if (expandAll) {
  13833. this.setAllTreeExpand(true);
  13834. } else if (expandRowKeys) {
  13835. var defExpandeds = [];
  13836. var rowkey = getRowkey(this);
  13837. expandRowKeys.forEach(function (rowid) {
  13838. var matchObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.findTree(tableFullData, function (item) {
  13839. return rowid === external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(item, rowkey);
  13840. }, treeOpts);
  13841. if (matchObj) {
  13842. defExpandeds.push(matchObj.item);
  13843. }
  13844. });
  13845. this.setTreeExpand(defExpandeds, true);
  13846. }
  13847. }
  13848. },
  13849. handleAsyncTreeExpandChilds: function handleAsyncTreeExpandChilds(row) {
  13850. var _this38 = this;
  13851. var fullAllDataRowMap = this.fullAllDataRowMap,
  13852. treeExpandeds = this.treeExpandeds,
  13853. treeOpts = this.treeOpts,
  13854. treeLazyLoadeds = this.treeLazyLoadeds,
  13855. checkboxOpts = this.checkboxOpts;
  13856. var loadMethod = treeOpts.loadMethod;
  13857. var checkStrictly = checkboxOpts.checkStrictly;
  13858. var rest = fullAllDataRowMap.get(row);
  13859. return new Promise(function (resolve) {
  13860. treeLazyLoadeds.push(row);
  13861. loadMethod({
  13862. $table: _this38,
  13863. row: row
  13864. }).catch(function () {
  13865. return [];
  13866. }).then(function (childRecords) {
  13867. rest.treeLoaded = true;
  13868. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.remove(treeLazyLoadeds, function (item) {
  13869. return item === row;
  13870. });
  13871. if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(childRecords)) {
  13872. childRecords = [];
  13873. }
  13874. if (childRecords) {
  13875. _this38.loadChildren(row, childRecords).then(function (childRows) {
  13876. if (childRows.length && treeExpandeds.indexOf(row) === -1) {
  13877. treeExpandeds.push(row);
  13878. } // 如果当前节点已选中,则展开后子节点也被选中
  13879. if (!checkStrictly && _this38.isCheckedByCheckboxRow(row)) {
  13880. _this38.setCheckboxRow(childRows, true);
  13881. }
  13882. });
  13883. }
  13884. resolve(_this38.$nextTick().then(_this38.recalculate));
  13885. });
  13886. });
  13887. },
  13888. /**
  13889. * 设置所有树节点的展开与否
  13890. * @param {Boolean} expanded 是否展开
  13891. */
  13892. setAllTreeExpand: function setAllTreeExpand(expanded) {
  13893. var tableFullData = this.tableFullData,
  13894. treeOpts = this.treeOpts;
  13895. var lazy = treeOpts.lazy,
  13896. children = treeOpts.children;
  13897. var expandeds = [];
  13898. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(tableFullData, function (row) {
  13899. var rowChildren = row[children];
  13900. if (lazy || rowChildren && rowChildren.length) {
  13901. expandeds.push(row);
  13902. }
  13903. }, treeOpts);
  13904. return this.setTreeExpand(expandeds, expanded);
  13905. },
  13906. /**
  13907. * 设置展开树形节点,二个参数设置这一行展开与否
  13908. * 支持单行
  13909. * 支持多行
  13910. * @param {Array/Row} rows 行数据
  13911. * @param {Boolean} expanded 是否展开
  13912. */
  13913. setTreeExpand: function setTreeExpand(rows, expanded) {
  13914. var _this39 = this;
  13915. var fullAllDataRowMap = this.fullAllDataRowMap,
  13916. tableFullData = this.tableFullData,
  13917. treeExpandeds = this.treeExpandeds,
  13918. treeOpts = this.treeOpts,
  13919. treeLazyLoadeds = this.treeLazyLoadeds,
  13920. treeNodeColumn = this.treeNodeColumn;
  13921. var reserve = treeOpts.reserve,
  13922. lazy = treeOpts.lazy,
  13923. hasChild = treeOpts.hasChild,
  13924. children = treeOpts.children,
  13925. accordion = treeOpts.accordion,
  13926. toggleMethod = treeOpts.toggleMethod;
  13927. var result = [];
  13928. var columnIndex = this.getColumnIndex(treeNodeColumn);
  13929. var $columnIndex = this.getVMColumnIndex(treeNodeColumn);
  13930. if (rows) {
  13931. if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(rows)) {
  13932. rows = [rows];
  13933. }
  13934. if (rows.length) {
  13935. var validRows = toggleMethod ? rows.filter(function (row) {
  13936. return toggleMethod({
  13937. expanded: expanded,
  13938. column: treeNodeColumn,
  13939. columnIndex: columnIndex,
  13940. $columnIndex: $columnIndex,
  13941. row: row
  13942. });
  13943. }) : rows;
  13944. if (accordion) {
  13945. validRows = validRows.length ? [validRows[validRows.length - 1]] : []; // 同一级只能展开一个
  13946. var matchObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.findTree(tableFullData, function (item) {
  13947. return item === validRows[0];
  13948. }, treeOpts);
  13949. if (matchObj) {
  13950. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.remove(treeExpandeds, function (item) {
  13951. return matchObj.items.indexOf(item) > -1;
  13952. });
  13953. }
  13954. }
  13955. if (expanded) {
  13956. validRows.forEach(function (row) {
  13957. if (treeExpandeds.indexOf(row) === -1) {
  13958. var rest = fullAllDataRowMap.get(row);
  13959. var isLoad = lazy && row[hasChild] && !rest.treeLoaded && treeLazyLoadeds.indexOf(row) === -1; // 是否使用懒加载
  13960. if (isLoad) {
  13961. result.push(_this39.handleAsyncTreeExpandChilds(row));
  13962. } else {
  13963. if (row[children] && row[children].length) {
  13964. treeExpandeds.push(row);
  13965. }
  13966. }
  13967. }
  13968. });
  13969. } else {
  13970. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.remove(treeExpandeds, function (row) {
  13971. return validRows.indexOf(row) > -1;
  13972. });
  13973. }
  13974. if (reserve) {
  13975. validRows.forEach(function (row) {
  13976. return _this39.handleTreeExpandReserve(row, expanded);
  13977. });
  13978. }
  13979. return Promise.all(result).then(this.recalculate);
  13980. }
  13981. }
  13982. return this.$nextTick();
  13983. },
  13984. /**
  13985. * 判断行是否为树形节点展开状态
  13986. * @param {Row} row 行对象
  13987. */
  13988. isTreeExpandByRow: function isTreeExpandByRow(row) {
  13989. return this.treeExpandeds.indexOf(row) > -1;
  13990. },
  13991. /**
  13992. * 手动清空树形节点的展开状态,数据会恢复成未展开的状态
  13993. */
  13994. clearTreeExpand: function clearTreeExpand() {
  13995. var _this40 = this;
  13996. var treeOpts = this.treeOpts,
  13997. treeExpandeds = this.treeExpandeds,
  13998. tableFullData = this.tableFullData;
  13999. var reserve = treeOpts.reserve;
  14000. var isExists = treeExpandeds.length;
  14001. this.treeExpandeds = [];
  14002. if (reserve) {
  14003. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(tableFullData, function (row) {
  14004. return _this40.handleTreeExpandReserve(row, false);
  14005. }, treeOpts);
  14006. }
  14007. return this.$nextTick().then(function () {
  14008. if (isExists) {
  14009. _this40.recalculate();
  14010. }
  14011. });
  14012. },
  14013. clearTreeExpandReserve: function clearTreeExpandReserve() {
  14014. this.treeExpandedReserveRowMap = {};
  14015. return this.$nextTick();
  14016. },
  14017. handleTreeExpandReserve: function handleTreeExpandReserve(row, expanded) {
  14018. var treeExpandedReserveRowMap = this.treeExpandedReserveRowMap,
  14019. treeOpts = this.treeOpts;
  14020. if (treeOpts.reserve) {
  14021. var rowid = methods_getRowid(this, row);
  14022. if (expanded) {
  14023. treeExpandedReserveRowMap[rowid] = row;
  14024. } else if (treeExpandedReserveRowMap[rowid]) {
  14025. delete treeExpandedReserveRowMap[rowid];
  14026. }
  14027. }
  14028. },
  14029. /**
  14030. * 获取表格的滚动状态
  14031. */
  14032. getScroll: function getScroll() {
  14033. var $refs = this.$refs,
  14034. scrollXLoad = this.scrollXLoad,
  14035. scrollYLoad = this.scrollYLoad;
  14036. var bodyElem = $refs.tableBody.$el;
  14037. return {
  14038. virtualX: scrollXLoad,
  14039. virtualY: scrollYLoad,
  14040. scrollTop: bodyElem.scrollTop,
  14041. scrollLeft: bodyElem.scrollLeft
  14042. };
  14043. },
  14044. /**
  14045. * 横向 X 可视渲染事件处理
  14046. */
  14047. triggerScrollXEvent: function triggerScrollXEvent() {
  14048. this.loadScrollXData();
  14049. },
  14050. loadScrollXData: function loadScrollXData() {
  14051. var mergeList = this.mergeList,
  14052. mergeFooterList = this.mergeFooterList,
  14053. scrollXStore = this.scrollXStore;
  14054. var startIndex = scrollXStore.startIndex,
  14055. endIndex = scrollXStore.endIndex,
  14056. offsetSize = scrollXStore.offsetSize;
  14057. var _computeVirtualX2 = computeVirtualX(this),
  14058. toVisibleIndex = _computeVirtualX2.toVisibleIndex,
  14059. visibleSize = _computeVirtualX2.visibleSize;
  14060. var offsetItem = {
  14061. startIndex: Math.max(0, toVisibleIndex - 1 - offsetSize),
  14062. endIndex: toVisibleIndex + visibleSize + offsetSize
  14063. };
  14064. calculateMergerOffserIndex(mergeList.concat(mergeFooterList), offsetItem, 'col');
  14065. var offsetStartIndex = offsetItem.startIndex,
  14066. offsetEndIndex = offsetItem.endIndex;
  14067. if (toVisibleIndex <= startIndex || toVisibleIndex >= endIndex - visibleSize - 1) {
  14068. if (startIndex !== offsetStartIndex || endIndex !== offsetEndIndex) {
  14069. scrollXStore.startIndex = offsetStartIndex;
  14070. scrollXStore.endIndex = offsetEndIndex;
  14071. this.updateScrollXData();
  14072. }
  14073. }
  14074. this.closeTooltip();
  14075. },
  14076. /**
  14077. * 纵向 Y 可视渲染事件处理
  14078. */
  14079. triggerScrollYEvent: function triggerScrollYEvent(evnt) {
  14080. var scrollYStore = this.scrollYStore;
  14081. var adaptive = scrollYStore.adaptive,
  14082. offsetSize = scrollYStore.offsetSize,
  14083. visibleSize = scrollYStore.visibleSize; // webkit 浏览器使用最佳的渲染方式,且最高渲染量不能大于 40 条
  14084. if (isWebkit && adaptive && offsetSize * 2 + visibleSize <= 40) {
  14085. this.loadScrollYData(evnt);
  14086. } else {
  14087. this.debounceScrollY(evnt);
  14088. }
  14089. },
  14090. debounceScrollY: external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.debounce(function (evnt) {
  14091. this.loadScrollYData(evnt);
  14092. }, debounceScrollYDuration, {
  14093. leading: false,
  14094. trailing: true
  14095. }),
  14096. /**
  14097. * 纵向 Y 可视渲染处理
  14098. */
  14099. loadScrollYData: function loadScrollYData(evnt) {
  14100. var mergeList = this.mergeList,
  14101. scrollYStore = this.scrollYStore;
  14102. var startIndex = scrollYStore.startIndex,
  14103. endIndex = scrollYStore.endIndex,
  14104. visibleSize = scrollYStore.visibleSize,
  14105. offsetSize = scrollYStore.offsetSize,
  14106. rowHeight = scrollYStore.rowHeight;
  14107. var scrollBodyElem = evnt.target;
  14108. var scrollTop = scrollBodyElem.scrollTop;
  14109. var toVisibleIndex = Math.floor(scrollTop / rowHeight);
  14110. var offsetItem = {
  14111. startIndex: Math.max(0, toVisibleIndex - 1 - offsetSize),
  14112. endIndex: toVisibleIndex + visibleSize + offsetSize
  14113. };
  14114. calculateMergerOffserIndex(mergeList, offsetItem, 'row');
  14115. var offsetStartIndex = offsetItem.startIndex,
  14116. offsetEndIndex = offsetItem.endIndex;
  14117. if (toVisibleIndex <= startIndex || toVisibleIndex >= endIndex - visibleSize - 1) {
  14118. if (startIndex !== offsetStartIndex || endIndex !== offsetEndIndex) {
  14119. scrollYStore.startIndex = offsetStartIndex;
  14120. scrollYStore.endIndex = offsetEndIndex;
  14121. this.updateScrollYData();
  14122. }
  14123. }
  14124. },
  14125. // 计算可视渲染相关数据
  14126. computeScrollLoad: function computeScrollLoad() {
  14127. var _this41 = this;
  14128. return this.$nextTick().then(function () {
  14129. var sYOpts = _this41.sYOpts,
  14130. sXOpts = _this41.sXOpts,
  14131. scrollXLoad = _this41.scrollXLoad,
  14132. scrollYLoad = _this41.scrollYLoad,
  14133. scrollXStore = _this41.scrollXStore,
  14134. scrollYStore = _this41.scrollYStore; // 计算 X 逻辑
  14135. if (scrollXLoad) {
  14136. var _computeVirtualX3 = computeVirtualX(_this41),
  14137. visibleXSize = _computeVirtualX3.visibleSize;
  14138. var offsetXSize = sXOpts.oSize ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(sXOpts.oSize) : methods_browse.msie ? 10 : methods_browse.edge ? 5 : 0;
  14139. scrollXStore.offsetSize = offsetXSize;
  14140. scrollXStore.visibleSize = visibleXSize;
  14141. scrollXStore.endIndex = Math.max(scrollXStore.startIndex + scrollXStore.visibleSize + offsetXSize, scrollXStore.endIndex);
  14142. _this41.updateScrollXData();
  14143. } else {
  14144. _this41.updateScrollXSpace();
  14145. } // 计算 Y 逻辑
  14146. var _computeVirtualY = computeVirtualY(_this41),
  14147. rowHeight = _computeVirtualY.rowHeight,
  14148. visibleYSize = _computeVirtualY.visibleSize;
  14149. scrollYStore.rowHeight = rowHeight;
  14150. if (scrollYLoad) {
  14151. var offsetYSize = sYOpts.oSize ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(sYOpts.oSize) : methods_browse.msie ? 20 : methods_browse.edge ? 10 : 0;
  14152. scrollYStore.offsetSize = offsetYSize;
  14153. scrollYStore.visibleSize = visibleYSize;
  14154. scrollYStore.endIndex = Math.max(scrollYStore.startIndex + visibleYSize + offsetYSize, scrollYStore.endIndex);
  14155. _this41.updateScrollYData();
  14156. } else {
  14157. _this41.updateScrollYSpace();
  14158. }
  14159. _this41.rowHeight = rowHeight;
  14160. _this41.$nextTick(_this41.updateStyle);
  14161. });
  14162. },
  14163. handleTableColumn: function handleTableColumn() {
  14164. var scrollXLoad = this.scrollXLoad,
  14165. visibleColumn = this.visibleColumn,
  14166. scrollXStore = this.scrollXStore;
  14167. this.tableColumn = scrollXLoad ? visibleColumn.slice(scrollXStore.startIndex, scrollXStore.endIndex) : visibleColumn.slice(0);
  14168. },
  14169. updateScrollXData: function updateScrollXData() {
  14170. this.handleTableColumn();
  14171. this.updateScrollXSpace();
  14172. },
  14173. // 更新横向 X 可视渲染上下剩余空间大小
  14174. updateScrollXSpace: function updateScrollXSpace() {
  14175. var $refs = this.$refs,
  14176. elemStore = this.elemStore,
  14177. visibleColumn = this.visibleColumn,
  14178. scrollXStore = this.scrollXStore,
  14179. scrollXLoad = this.scrollXLoad,
  14180. tableWidth = this.tableWidth,
  14181. scrollbarWidth = this.scrollbarWidth;
  14182. var tableHeader = $refs.tableHeader,
  14183. tableBody = $refs.tableBody,
  14184. tableFooter = $refs.tableFooter;
  14185. var tableBodyElem = tableBody ? tableBody.$el : null;
  14186. if (tableBodyElem) {
  14187. var tableHeaderElem = tableHeader ? tableHeader.$el : null;
  14188. var tableFooterElem = tableFooter ? tableFooter.$el : null;
  14189. var headerElem = tableHeaderElem ? tableHeaderElem.querySelector('.vxe-table--header') : null;
  14190. var bodyElem = tableBodyElem.querySelector('.vxe-table--body');
  14191. var footerElem = tableFooterElem ? tableFooterElem.querySelector('.vxe-table--footer') : null;
  14192. var leftSpaceWidth = visibleColumn.slice(0, scrollXStore.startIndex).reduce(function (previous, column) {
  14193. return previous + column.renderWidth;
  14194. }, 0);
  14195. var marginLeft = '';
  14196. if (scrollXLoad) {
  14197. marginLeft = "".concat(leftSpaceWidth, "px");
  14198. }
  14199. if (headerElem) {
  14200. headerElem.style.marginLeft = marginLeft;
  14201. }
  14202. bodyElem.style.marginLeft = marginLeft;
  14203. if (footerElem) {
  14204. footerElem.style.marginLeft = marginLeft;
  14205. }
  14206. var containerList = ['main'];
  14207. containerList.forEach(function (name) {
  14208. var layoutList = ['header', 'body', 'footer'];
  14209. layoutList.forEach(function (layout) {
  14210. var xSpaceElem = elemStore["".concat(name, "-").concat(layout, "-xSpace")];
  14211. if (xSpaceElem) {
  14212. xSpaceElem.style.width = scrollXLoad ? "".concat(tableWidth + (layout === 'header' ? scrollbarWidth : 0), "px") : '';
  14213. }
  14214. });
  14215. });
  14216. this.$nextTick(this.updateStyle);
  14217. }
  14218. },
  14219. updateScrollYData: function updateScrollYData() {
  14220. this.handleTableData();
  14221. this.updateScrollYSpace();
  14222. },
  14223. // 更新纵向 Y 可视渲染上下剩余空间大小
  14224. updateScrollYSpace: function updateScrollYSpace() {
  14225. var elemStore = this.elemStore,
  14226. scrollYStore = this.scrollYStore,
  14227. scrollYLoad = this.scrollYLoad,
  14228. afterFullData = this.afterFullData;
  14229. var startIndex = scrollYStore.startIndex,
  14230. rowHeight = scrollYStore.rowHeight;
  14231. var bodyHeight = afterFullData.length * rowHeight;
  14232. var topSpaceHeight = Math.max(0, startIndex * rowHeight);
  14233. var containerList = ['main', 'left', 'right'];
  14234. var marginTop = '';
  14235. var ySpaceHeight = '';
  14236. if (scrollYLoad) {
  14237. marginTop = "".concat(topSpaceHeight, "px");
  14238. ySpaceHeight = "".concat(bodyHeight, "px");
  14239. }
  14240. containerList.forEach(function (name) {
  14241. var layoutList = ['header', 'body', 'footer'];
  14242. var tableElem = elemStore["".concat(name, "-body-table")];
  14243. if (tableElem) {
  14244. tableElem.style.marginTop = marginTop;
  14245. }
  14246. layoutList.forEach(function (layout) {
  14247. var ySpaceElem = elemStore["".concat(name, "-").concat(layout, "-ySpace")];
  14248. if (ySpaceElem) {
  14249. ySpaceElem.style.height = ySpaceHeight;
  14250. }
  14251. });
  14252. });
  14253. this.$nextTick(this.updateStyle);
  14254. },
  14255. /**
  14256. * 如果有滚动条,则滚动到对应的位置
  14257. * @param {Number} scrollLeft 左距离
  14258. * @param {Number} scrollTop 上距离
  14259. */
  14260. scrollTo: function scrollTo(scrollLeft, scrollTop) {
  14261. var _this42 = this;
  14262. var $refs = this.$refs;
  14263. var tableBody = $refs.tableBody,
  14264. rightBody = $refs.rightBody,
  14265. tableFooter = $refs.tableFooter;
  14266. var tableBodyElem = tableBody ? tableBody.$el : null;
  14267. var rightBodyElem = rightBody ? rightBody.$el : null;
  14268. var bodyTargetElem = rightBodyElem || tableBodyElem;
  14269. var tableFooterElem = tableFooter ? tableFooter.$el : null;
  14270. var footerTargetElem = tableFooterElem || tableBodyElem;
  14271. if (footerTargetElem && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNumber(scrollLeft)) {
  14272. footerTargetElem.scrollLeft = scrollLeft;
  14273. }
  14274. if (bodyTargetElem && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNumber(scrollTop)) {
  14275. bodyTargetElem.scrollTop = scrollTop;
  14276. }
  14277. if (this.scrollXLoad || this.scrollYLoad) {
  14278. return new Promise(function (resolve) {
  14279. return setTimeout(function () {
  14280. return resolve(_this42.$nextTick());
  14281. }, 50);
  14282. });
  14283. }
  14284. return this.$nextTick();
  14285. },
  14286. /**
  14287. * 如果有滚动条,则滚动到对应的行
  14288. * @param {Row} row 行对象
  14289. * @param {ColumnInfo} column 列配置
  14290. */
  14291. scrollToRow: function scrollToRow(row, fieldOrColumn) {
  14292. var rest = [];
  14293. if (row) {
  14294. if (this.treeConfig) {
  14295. rest.push(this.scrollToTreeRow(row));
  14296. } else {
  14297. rest.push(DomTools.rowToVisible(this, row));
  14298. }
  14299. }
  14300. if (fieldOrColumn) {
  14301. rest.push(this.scrollToColumn(fieldOrColumn));
  14302. }
  14303. return Promise.all(rest);
  14304. },
  14305. /**
  14306. * 如果有滚动条,则滚动到对应的列
  14307. * @param {ColumnInfo} column 列配置
  14308. */
  14309. scrollToColumn: function scrollToColumn(fieldOrColumn) {
  14310. var column = handleFieldOrColumn(this, fieldOrColumn);
  14311. if (column && this.fullColumnMap.has(column)) {
  14312. return DomTools.colToVisible(this, column);
  14313. }
  14314. return this.$nextTick();
  14315. },
  14316. /**
  14317. * 对于树形结构中,可以直接滚动到指定深层节点中
  14318. * 对于某些特定的场景可能会用到,比如定位到某一节点
  14319. * @param {Row} row 行对象
  14320. */
  14321. scrollToTreeRow: function scrollToTreeRow(row) {
  14322. var _this43 = this;
  14323. var tableFullData = this.tableFullData,
  14324. treeConfig = this.treeConfig,
  14325. treeOpts = this.treeOpts;
  14326. if (treeConfig) {
  14327. var matchObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.findTree(tableFullData, function (item) {
  14328. return item === row;
  14329. }, treeOpts);
  14330. if (matchObj) {
  14331. var nodes = matchObj.nodes;
  14332. nodes.forEach(function (row, index) {
  14333. if (index < nodes.length - 1 && !_this43.isTreeExpandByRow(row)) {
  14334. _this43.setTreeExpand(row, true);
  14335. }
  14336. });
  14337. }
  14338. }
  14339. return this.$nextTick();
  14340. },
  14341. /**
  14342. * 手动清除滚动相关信息,还原到初始状态
  14343. */
  14344. clearScroll: function clearScroll() {
  14345. var $refs = this.$refs;
  14346. var tableBody = $refs.tableBody,
  14347. rightBody = $refs.rightBody,
  14348. tableFooter = $refs.tableFooter;
  14349. var tableBodyElem = tableBody ? tableBody.$el : null;
  14350. var rightBodyElem = rightBody ? rightBody.$el : null;
  14351. var tableFooterElem = tableFooter ? tableFooter.$el : null;
  14352. if (rightBodyElem) {
  14353. rightBodyElem.scrollTop = 0;
  14354. }
  14355. if (tableFooterElem) {
  14356. tableFooterElem.scrollLeft = 0;
  14357. }
  14358. if (tableBodyElem) {
  14359. tableBodyElem.scrollTop = 0;
  14360. tableBodyElem.scrollLeft = 0;
  14361. }
  14362. return this.$nextTick();
  14363. },
  14364. /**
  14365. * 更新表尾合计
  14366. */
  14367. updateFooter: function updateFooter() {
  14368. var showFooter = this.showFooter,
  14369. visibleColumn = this.visibleColumn,
  14370. footerMethod = this.footerMethod;
  14371. if (showFooter && footerMethod) {
  14372. this.footerTableData = visibleColumn.length ? footerMethod({
  14373. columns: visibleColumn,
  14374. data: this.afterFullData,
  14375. $table: this,
  14376. $grid: this.$xegrid
  14377. }) : [];
  14378. }
  14379. return this.$nextTick();
  14380. },
  14381. /**
  14382. * 更新列状态
  14383. * 如果组件值 v-model 发生 change 时,调用改函数用于更新某一列编辑状态
  14384. * 如果单元格配置了校验规则,则会进行校验
  14385. */
  14386. updateStatus: function updateStatus(scope, cellValue) {
  14387. var _this44 = this;
  14388. var customVal = !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isUndefined(cellValue);
  14389. return this.$nextTick().then(function () {
  14390. var $refs = _this44.$refs,
  14391. editRules = _this44.editRules,
  14392. validStore = _this44.validStore;
  14393. if (scope && $refs.tableBody && editRules) {
  14394. var row = scope.row,
  14395. column = scope.column;
  14396. var type = 'change';
  14397. if (_this44.hasCellRules(type, row, column)) {
  14398. var cell = _this44.getCell(row, column);
  14399. if (cell) {
  14400. return _this44.validCellRules(type, row, column, cellValue).then(function () {
  14401. if (customVal && validStore.visible) {
  14402. methods_setCellValue(row, column, cellValue);
  14403. }
  14404. _this44.clearValidate();
  14405. }).catch(function (_ref8) {
  14406. var rule = _ref8.rule;
  14407. if (customVal) {
  14408. methods_setCellValue(row, column, cellValue);
  14409. }
  14410. _this44.showValidTooltip({
  14411. rule: rule,
  14412. row: row,
  14413. column: column,
  14414. cell: cell
  14415. });
  14416. });
  14417. }
  14418. }
  14419. }
  14420. });
  14421. },
  14422. handleDefaultMergeCells: function handleDefaultMergeCells() {
  14423. this.setMergeCells(this.mergeCells);
  14424. },
  14425. /**
  14426. * 设置合并单元格
  14427. * @param {TableMergeConfig[]} merges { row: Row|number, column: ColumnInfo|number, rowspan: number, colspan: number }
  14428. */
  14429. setMergeCells: function setMergeCells(merges) {
  14430. var _this45 = this;
  14431. if (this.spanMethod) {
  14432. UtilTools.error('vxe.error.errConflicts', ['merge-cells', 'span-method']);
  14433. }
  14434. setMerges(this, merges, this.mergeList, this.afterFullData);
  14435. return this.$nextTick().then(function () {
  14436. return _this45.updateCellAreas();
  14437. });
  14438. },
  14439. /**
  14440. * 移除单元格合并
  14441. * @param {TableMergeConfig[]} merges 多个或数组 [{row:Row|number, col:ColumnInfo|number}]
  14442. */
  14443. removeMergeCells: function removeMergeCells(merges) {
  14444. var _this46 = this;
  14445. if (this.spanMethod) {
  14446. UtilTools.error('vxe.error.errConflicts', ['merge-cells', 'span-method']);
  14447. }
  14448. var rest = removeMerges(this, merges, this.mergeList, this.afterFullData);
  14449. return this.$nextTick().then(function () {
  14450. _this46.updateCellAreas();
  14451. return rest;
  14452. });
  14453. },
  14454. /**
  14455. * 获取所有被合并的单元格
  14456. */
  14457. getMergeCells: function getMergeCells() {
  14458. return this.mergeList.slice(0);
  14459. },
  14460. /**
  14461. * 清除所有单元格合并
  14462. */
  14463. clearMergeCells: function clearMergeCells() {
  14464. this.mergeList = [];
  14465. return this.$nextTick();
  14466. },
  14467. handleDefaultMergeFooterItems: function handleDefaultMergeFooterItems() {
  14468. this.setMergeFooterItems(this.mergeFooterItems);
  14469. },
  14470. setMergeFooterItems: function setMergeFooterItems(merges) {
  14471. var _this47 = this;
  14472. if (this.footerSpanMethod) {
  14473. UtilTools.error('vxe.error.errConflicts', ['merge-footer-items', 'footer-span-method']);
  14474. }
  14475. setMerges(this, merges, this.mergeFooterList, null);
  14476. return this.$nextTick().then(function () {
  14477. return _this47.updateCellAreas();
  14478. });
  14479. },
  14480. removeMergeFooterItems: function removeMergeFooterItems(merges) {
  14481. var _this48 = this;
  14482. if (this.footerSpanMethod) {
  14483. UtilTools.error('vxe.error.errConflicts', ['merge-footer-items', 'footer-span-method']);
  14484. }
  14485. var rest = removeMerges(this, merges, this.mergeFooterList, null);
  14486. return this.$nextTick().then(function () {
  14487. _this48.updateCellAreas();
  14488. return rest;
  14489. });
  14490. },
  14491. /**
  14492. * 获取所有被合并的表尾
  14493. */
  14494. getMergeFooterItems: function getMergeFooterItems() {
  14495. return this.mergeFooterList.slice(0);
  14496. },
  14497. /**
  14498. * 清除所有表尾合并
  14499. */
  14500. clearMergeFooterItems: function clearMergeFooterItems() {
  14501. this.mergeFooterList = [];
  14502. return this.$nextTick();
  14503. },
  14504. updateZindex: function updateZindex() {
  14505. if (this.zIndex) {
  14506. this.tZindex = this.zIndex;
  14507. } else if (this.tZindex < UtilTools.getLastZIndex()) {
  14508. this.tZindex = UtilTools.nextZIndex();
  14509. }
  14510. },
  14511. updateCellAreas: function updateCellAreas() {
  14512. var _this49 = this;
  14513. this.recalculate().then(function () {
  14514. return _this49.refreshScroll();
  14515. }).then(function () {
  14516. if (_this49.mouseConfig && _this49.mouseOpts.area && _this49.handleUpdateCellAreas) {
  14517. _this49.handleUpdateCellAreas();
  14518. }
  14519. });
  14520. },
  14521. emitEvent: function emitEvent(type, params, evnt) {
  14522. this.$emit(type, Object.assign({
  14523. $table: this,
  14524. $grid: this.$xegrid,
  14525. $event: evnt
  14526. }, params));
  14527. },
  14528. focus: function focus() {
  14529. this.isActivated = true;
  14530. return this.$nextTick();
  14531. },
  14532. blur: function blur() {
  14533. this.isActivated = false;
  14534. return this.$nextTick();
  14535. },
  14536. // 连接工具栏
  14537. connect: function connect($toolbar) {
  14538. if ($toolbar && $toolbar.syncUpdate) {
  14539. $toolbar.syncUpdate({
  14540. collectColumn: this.collectColumn,
  14541. $table: this
  14542. });
  14543. this.$toolbar = $toolbar;
  14544. } else {
  14545. UtilTools.error('vxe.error.barUnableLink');
  14546. }
  14547. return this.$nextTick();
  14548. },
  14549. /*************************
  14550. * Publish methods
  14551. *************************/
  14552. getCell: function getCell(row, column) {
  14553. var $refs = this.$refs;
  14554. var rowid = methods_getRowid(this, row);
  14555. var bodyElem = $refs["".concat(column.fixed || 'table', "Body")] || $refs.tableBody;
  14556. if (bodyElem && bodyElem.$el) {
  14557. return bodyElem.$el.querySelector(".vxe-body--row[rowid=\"".concat(rowid, "\"] .").concat(column.id));
  14558. }
  14559. return null;
  14560. },
  14561. getCellLabel: function getCellLabel(row, column) {
  14562. var formatter = column.formatter;
  14563. var cellValue = UtilTools.getCellValue(row, column);
  14564. var cellLabel = cellValue;
  14565. if (formatter) {
  14566. var rest, formatData;
  14567. var fullAllDataRowMap = this.fullAllDataRowMap;
  14568. var colid = column.id;
  14569. var cacheFormat = fullAllDataRowMap.has(row);
  14570. if (cacheFormat) {
  14571. rest = fullAllDataRowMap.get(row);
  14572. formatData = rest.formatData;
  14573. if (!formatData) {
  14574. formatData = fullAllDataRowMap.get(row).formatData = {};
  14575. }
  14576. if (rest && formatData[colid]) {
  14577. if (formatData[colid].value === cellValue) {
  14578. return formatData[colid].label;
  14579. }
  14580. }
  14581. }
  14582. var formatParams = {
  14583. cellValue: cellValue,
  14584. row: row,
  14585. rowIndex: this.getRowIndex(row),
  14586. column: column,
  14587. columnIndex: this.getColumnIndex(column)
  14588. };
  14589. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isString(formatter)) {
  14590. var globalFunc = formats.get(formatter);
  14591. cellLabel = globalFunc ? globalFunc(formatParams) : '';
  14592. } else if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(formatter)) {
  14593. var _globalFunc = formats.get(formatter[0]);
  14594. cellLabel = _globalFunc ? _globalFunc.apply(void 0, [formatParams].concat(_toConsumableArray(formatter.slice(1)))) : '';
  14595. } else {
  14596. cellLabel = formatter(formatParams);
  14597. }
  14598. if (formatData) {
  14599. formatData[colid] = {
  14600. value: cellValue,
  14601. label: cellLabel
  14602. };
  14603. }
  14604. }
  14605. return cellLabel;
  14606. }
  14607. /*************************
  14608. * Publish methods
  14609. *************************/
  14610. }; // Module methods
  14611. var funcs = 'setFilter,clearFilter,getCheckedFilters,closeMenu,setActiveCellArea,getActiveCellArea,getCellAreas,clearCellAreas,copyCellArea,cutCellArea,pasteCellArea,getCopyCellArea,clearCopyCellArea,setCellAreas,openFind,openReplace,getSelectedCell,clearSelected,insert,insertAt,remove,removeCheckboxRow,removeRadioRow,removeCurrentRow,getRecordset,getInsertRecords,getRemoveRecords,getUpdateRecords,clearActived,getActiveRecord,isActiveByRow,setActiveRow,setActiveCell,setSelectCell,clearValidate,fullValidate,validate,openExport,openPrint,exportData,openImport,importData,saveFile,readFile,importByFile,print'.split(',');
  14612. funcs.forEach(function (name) {
  14613. Methods[name] = function () {
  14614. return this["_".concat(name)] ? this["_".concat(name)].apply(this, arguments) : null;
  14615. };
  14616. });
  14617. /* harmony default export */ var methods = (Methods);
  14618. // CONCATENATED MODULE: ./packages/table/src/table.js
  14619. /**
  14620. * 渲染浮固定列
  14621. * 分别渲染左边固定列和右边固定列
  14622. * 如果宽度足够情况下,则不需要渲染固定列
  14623. * @param {Function} h 创建 VNode 函数
  14624. * @param {Object} $xetable 表格实例
  14625. * @param {String} fixedType 固定列类型
  14626. */
  14627. function renderFixed(h, $xetable, fixedType) {
  14628. var _e = $xetable._e,
  14629. tableData = $xetable.tableData,
  14630. tableColumn = $xetable.tableColumn,
  14631. tableGroupColumn = $xetable.tableGroupColumn,
  14632. vSize = $xetable.vSize,
  14633. showHeader = $xetable.showHeader,
  14634. showFooter = $xetable.showFooter,
  14635. columnStore = $xetable.columnStore,
  14636. footerTableData = $xetable.footerTableData;
  14637. var fixedColumn = columnStore["".concat(fixedType, "List")];
  14638. return h('div', {
  14639. class: "vxe-table--fixed-".concat(fixedType, "-wrapper"),
  14640. ref: "".concat(fixedType, "Container")
  14641. }, [showHeader ? h('vxe-table-header', {
  14642. props: {
  14643. fixedType: fixedType,
  14644. tableData: tableData,
  14645. tableColumn: tableColumn,
  14646. tableGroupColumn: tableGroupColumn,
  14647. size: vSize,
  14648. fixedColumn: fixedColumn
  14649. },
  14650. ref: "".concat(fixedType, "Header")
  14651. }) : _e(), h('vxe-table-body', {
  14652. props: {
  14653. fixedType: fixedType,
  14654. tableData: tableData,
  14655. tableColumn: tableColumn,
  14656. fixedColumn: fixedColumn,
  14657. size: vSize
  14658. },
  14659. ref: "".concat(fixedType, "Body")
  14660. }), showFooter ? h('vxe-table-footer', {
  14661. props: {
  14662. footerTableData: footerTableData,
  14663. tableColumn: tableColumn,
  14664. fixedColumn: fixedColumn,
  14665. fixedType: fixedType,
  14666. size: vSize
  14667. },
  14668. ref: "".concat(fixedType, "Footer")
  14669. }) : _e()]);
  14670. }
  14671. function renderEmptyContenet(h, _vm) {
  14672. var $scopedSlots = _vm.$scopedSlots,
  14673. emptyOpts = _vm.emptyOpts;
  14674. var emptyContent = '';
  14675. var params = {
  14676. $table: _vm
  14677. };
  14678. if ($scopedSlots.empty) {
  14679. emptyContent = $scopedSlots.empty.call(_vm, params, h);
  14680. } else {
  14681. var compConf = _vm.emptyRender ? v_x_e_table.renderer.get(emptyOpts.name) : null;
  14682. if (compConf) {
  14683. emptyContent = compConf.renderEmpty.call(_vm, h, emptyOpts, params);
  14684. } else {
  14685. emptyContent = _vm.emptyText || conf.i18n('vxe.table.emptyText');
  14686. }
  14687. }
  14688. return emptyContent;
  14689. }
  14690. function handleUupdateResize(_vm) {
  14691. var $el = _vm.$el;
  14692. if ($el && $el.clientWidth && $el.clientHeight) {
  14693. _vm.recalculate();
  14694. }
  14695. }
  14696. /* harmony default export */ var table = ({
  14697. name: 'VxeTable',
  14698. mixins: [size],
  14699. props: {
  14700. /** 基本属性 */
  14701. id: String,
  14702. // 数据
  14703. data: Array,
  14704. // 表格的高度
  14705. height: [Number, String],
  14706. // 表格的最大高度
  14707. maxHeight: [Number, String],
  14708. // 所有列是否允许拖动列宽调整大小
  14709. resizable: {
  14710. type: Boolean,
  14711. default: function _default() {
  14712. return conf.table.resizable;
  14713. }
  14714. },
  14715. // 是否带有斑马纹
  14716. stripe: {
  14717. type: Boolean,
  14718. default: function _default() {
  14719. return conf.table.stripe;
  14720. }
  14721. },
  14722. // 是否带有边框
  14723. border: {
  14724. type: [Boolean, String],
  14725. default: function _default() {
  14726. return conf.table.border;
  14727. }
  14728. },
  14729. // 是否圆角边框
  14730. round: {
  14731. type: Boolean,
  14732. default: function _default() {
  14733. return conf.table.round;
  14734. }
  14735. },
  14736. // 表格的尺寸
  14737. size: {
  14738. type: String,
  14739. default: function _default() {
  14740. return conf.table.size || conf.size;
  14741. }
  14742. },
  14743. // 列的宽度是否自撑开(可能会被废弃的参数,不要使用)
  14744. fit: {
  14745. type: Boolean,
  14746. default: function _default() {
  14747. return conf.table.fit;
  14748. }
  14749. },
  14750. // 表格是否加载中
  14751. loading: Boolean,
  14752. // 所有的列对其方式
  14753. align: {
  14754. type: String,
  14755. default: function _default() {
  14756. return conf.table.align;
  14757. }
  14758. },
  14759. // 所有的表头列的对齐方式
  14760. headerAlign: {
  14761. type: String,
  14762. default: function _default() {
  14763. return conf.table.headerAlign;
  14764. }
  14765. },
  14766. // 所有的表尾列的对齐方式
  14767. footerAlign: {
  14768. type: String,
  14769. default: function _default() {
  14770. return conf.table.footerAlign;
  14771. }
  14772. },
  14773. // 是否显示表头
  14774. showHeader: {
  14775. type: Boolean,
  14776. default: function _default() {
  14777. return conf.table.showHeader;
  14778. }
  14779. },
  14780. // 是否要高亮当前选中行
  14781. highlightCurrentRow: {
  14782. type: Boolean,
  14783. default: function _default() {
  14784. return conf.table.highlightCurrentRow;
  14785. }
  14786. },
  14787. // 鼠标移到行是否要高亮显示
  14788. highlightHoverRow: {
  14789. type: Boolean,
  14790. default: function _default() {
  14791. return conf.table.highlightHoverRow;
  14792. }
  14793. },
  14794. // 是否要高亮当前选中列
  14795. highlightCurrentColumn: {
  14796. type: Boolean,
  14797. default: function _default() {
  14798. return conf.table.highlightCurrentColumn;
  14799. }
  14800. },
  14801. // 鼠标移到列是否要高亮显示
  14802. highlightHoverColumn: {
  14803. type: Boolean,
  14804. default: function _default() {
  14805. return conf.table.highlightHoverColumn;
  14806. }
  14807. },
  14808. // 激活单元格编辑时是否高亮显示
  14809. highlightCell: Boolean,
  14810. // 是否显示表尾合计
  14811. showFooter: Boolean,
  14812. // 表尾合计的计算方法
  14813. footerMethod: {
  14814. type: Function,
  14815. default: conf.table.footerMethod
  14816. },
  14817. // 给行附加 className
  14818. rowClassName: [String, Function],
  14819. // 给单元格附加 className
  14820. cellClassName: [String, Function],
  14821. // 给表头的行附加 className
  14822. headerRowClassName: [String, Function],
  14823. // 给表头的单元格附加 className
  14824. headerCellClassName: [String, Function],
  14825. // 给表尾的行附加 className
  14826. footerRowClassName: [String, Function],
  14827. // 给表尾的单元格附加 className
  14828. footerCellClassName: [String, Function],
  14829. // 给单元格附加样式
  14830. cellStyle: [Object, Function],
  14831. // 给表头单元格附加样式
  14832. headerCellStyle: [Object, Function],
  14833. // 给表尾单元格附加样式
  14834. footerCellStyle: [Object, Function],
  14835. // 给行附加样式
  14836. rowStyle: [Object, Function],
  14837. // 给表头行附加样式
  14838. headerRowStyle: [Object, Function],
  14839. // 给表尾行附加样式
  14840. footerRowStyle: [Object, Function],
  14841. // 合并指定单元格
  14842. mergeCells: Array,
  14843. // 合并指定的表尾
  14844. mergeFooterItems: Array,
  14845. // 自定义合并行或列的方法
  14846. spanMethod: Function,
  14847. // 表尾合并行或列
  14848. footerSpanMethod: Function,
  14849. // 设置所有内容过长时显示为省略号
  14850. showOverflow: {
  14851. type: [Boolean, String],
  14852. default: function _default() {
  14853. return conf.table.showOverflow;
  14854. }
  14855. },
  14856. // 设置表头所有内容过长时显示为省略号
  14857. showHeaderOverflow: {
  14858. type: [Boolean, String],
  14859. default: function _default() {
  14860. return conf.table.showHeaderOverflow;
  14861. }
  14862. },
  14863. // 设置表尾所有内容过长时显示为省略号
  14864. showFooterOverflow: {
  14865. type: [Boolean, String],
  14866. default: function _default() {
  14867. return conf.table.showFooterOverflow;
  14868. }
  14869. },
  14870. /** 高级属性 */
  14871. // 主键配置
  14872. columnKey: Boolean,
  14873. rowKey: Boolean,
  14874. rowId: {
  14875. type: String,
  14876. default: function _default() {
  14877. return conf.table.rowId;
  14878. }
  14879. },
  14880. zIndex: Number,
  14881. emptyText: String,
  14882. keepSource: {
  14883. type: Boolean,
  14884. default: function _default() {
  14885. return conf.table.keepSource;
  14886. }
  14887. },
  14888. // 是否自动监听父容器变化去更新响应式表格宽高
  14889. autoResize: {
  14890. type: Boolean,
  14891. default: function _default() {
  14892. return conf.table.autoResize;
  14893. }
  14894. },
  14895. // 是否自动根据状态属性去更新响应式表格宽高
  14896. syncResize: [Boolean, String, Number],
  14897. // 设置列的默认参数,仅对部分支持的属性有效
  14898. columnConfig: Object,
  14899. resizableConfig: Object,
  14900. // 序号配置项
  14901. seqConfig: Object,
  14902. // 排序配置项
  14903. sortConfig: Object,
  14904. // 筛选配置项
  14905. filterConfig: Object,
  14906. // 单选框配置
  14907. radioConfig: Object,
  14908. // 复选框配置项
  14909. checkboxConfig: Object,
  14910. // tooltip 配置项
  14911. tooltipConfig: Object,
  14912. // 导出配置项
  14913. exportConfig: [Boolean, Object],
  14914. // 导入配置项
  14915. importConfig: [Boolean, Object],
  14916. // 打印配置项
  14917. printConfig: Object,
  14918. // 展开行配置项
  14919. expandConfig: Object,
  14920. // 树形结构配置项
  14921. treeConfig: [Boolean, Object],
  14922. // 快捷菜单配置项
  14923. menuConfig: [Boolean, Object],
  14924. // 在 v4 中废弃 contextMenu
  14925. contextMenu: [Boolean, Object],
  14926. // 鼠标配置项
  14927. mouseConfig: Object,
  14928. // 区域配置项
  14929. areaConfig: Object,
  14930. // 按键配置项
  14931. keyboardConfig: Object,
  14932. // 复制/粘贴配置项
  14933. clipConfig: Object,
  14934. // 查找/替换配置项
  14935. fnrConfig: Object,
  14936. // 编辑配置项
  14937. editConfig: [Boolean, Object],
  14938. // 校验配置项
  14939. validConfig: Object,
  14940. // 校验规则配置项
  14941. editRules: Object,
  14942. // 空内容渲染配置项
  14943. emptyRender: [Boolean, Object],
  14944. // 自定义列配置项
  14945. customConfig: [Boolean, Object],
  14946. // 横向虚拟滚动配置项
  14947. scrollX: Object,
  14948. // 纵向虚拟滚动配置项
  14949. scrollY: Object,
  14950. // 优化相关
  14951. animat: {
  14952. type: Boolean,
  14953. default: function _default() {
  14954. return conf.table.animat;
  14955. }
  14956. },
  14957. delayHover: {
  14958. type: Number,
  14959. default: function _default() {
  14960. return conf.table.delayHover;
  14961. }
  14962. },
  14963. // 额外的参数
  14964. params: Object
  14965. },
  14966. components: {
  14967. VxeTableBody: src_body
  14968. },
  14969. provide: function provide() {
  14970. return {
  14971. $xetable: this,
  14972. xecolgroup: null
  14973. };
  14974. },
  14975. inject: {
  14976. $xegrid: {
  14977. default: null
  14978. }
  14979. },
  14980. data: function data() {
  14981. return {
  14982. tId: "".concat(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.uniqueId()),
  14983. // 低性能的静态列
  14984. staticColumns: [],
  14985. // 渲染的列分组
  14986. tableGroupColumn: [],
  14987. // 可视区渲染的列
  14988. tableColumn: [],
  14989. // 渲染中的数据
  14990. tableData: [],
  14991. // 是否启用了横向 X 可视渲染方式加载
  14992. scrollXLoad: false,
  14993. // 是否启用了纵向 Y 可视渲染方式加载
  14994. scrollYLoad: false,
  14995. // 是否存在纵向滚动条
  14996. overflowY: true,
  14997. // 是否存在横向滚动条
  14998. overflowX: false,
  14999. // 纵向滚动条的宽度
  15000. scrollbarWidth: 0,
  15001. // 横向滚动条的高度
  15002. scrollbarHeight: 0,
  15003. // 行高
  15004. rowHeight: 0,
  15005. // 表格父容器的高度
  15006. parentHeight: 0,
  15007. // 是否使用分组表头
  15008. isGroup: false,
  15009. isAllOverflow: false,
  15010. // 复选框属性,是否全选
  15011. isAllSelected: false,
  15012. // 复选框属性,有选中且非全选状态
  15013. isIndeterminate: false,
  15014. // 复选框属性,已选中的行
  15015. selection: [],
  15016. // 当前行
  15017. currentRow: null,
  15018. // 单选框属性,选中列
  15019. currentColumn: null,
  15020. // 单选框属性,选中行
  15021. selectRow: null,
  15022. // 表尾合计数据
  15023. footerTableData: [],
  15024. // 展开列信息
  15025. expandColumn: null,
  15026. hasFixedColumn: false,
  15027. // 树节点列信息
  15028. treeNodeColumn: null,
  15029. // 已展开的行
  15030. rowExpandeds: [],
  15031. // 懒加载中的展开行的列表
  15032. expandLazyLoadeds: [],
  15033. // 已展开树节点
  15034. treeExpandeds: [],
  15035. // 懒加载中的树节点的列表
  15036. treeLazyLoadeds: [],
  15037. // 树节点不确定状态的列表
  15038. treeIndeterminates: [],
  15039. // 合并单元格的对象集
  15040. mergeList: [],
  15041. // 合并表尾数据的对象集
  15042. mergeFooterList: [],
  15043. // 初始化标识
  15044. initStore: {
  15045. filter: false,
  15046. import: false,
  15047. export: false
  15048. },
  15049. // 当前选中的筛选列
  15050. filterStore: {
  15051. isAllSelected: false,
  15052. isIndeterminate: false,
  15053. style: null,
  15054. options: [],
  15055. column: null,
  15056. multiple: false,
  15057. visible: false
  15058. },
  15059. // 存放列相关的信息
  15060. columnStore: {
  15061. leftList: [],
  15062. centerList: [],
  15063. rightList: [],
  15064. resizeList: [],
  15065. pxList: [],
  15066. pxMinList: [],
  15067. scaleList: [],
  15068. scaleMinList: [],
  15069. autoList: []
  15070. },
  15071. // 存放快捷菜单的信息
  15072. ctxMenuStore: {
  15073. selected: null,
  15074. visible: false,
  15075. showChild: false,
  15076. selectChild: null,
  15077. list: [],
  15078. style: null
  15079. },
  15080. // 存放可编辑相关信息
  15081. editStore: {
  15082. indexs: {
  15083. columns: []
  15084. },
  15085. titles: {
  15086. columns: []
  15087. },
  15088. // 选中源
  15089. selected: {
  15090. row: null,
  15091. column: null
  15092. },
  15093. // 已复制源
  15094. copyed: {
  15095. cut: false,
  15096. rows: [],
  15097. columns: []
  15098. },
  15099. // 激活
  15100. actived: {
  15101. row: null,
  15102. column: null
  15103. },
  15104. insertList: [],
  15105. removeList: []
  15106. },
  15107. // 存放数据校验相关信息
  15108. validStore: {
  15109. visible: false,
  15110. row: null,
  15111. column: null,
  15112. content: '',
  15113. rule: null,
  15114. isArrow: false
  15115. },
  15116. // 导入相关信息
  15117. importStore: {
  15118. inited: false,
  15119. file: null,
  15120. type: '',
  15121. modeList: [],
  15122. typeList: [],
  15123. filename: '',
  15124. visible: false
  15125. },
  15126. importParams: {
  15127. mode: '',
  15128. types: null,
  15129. message: true
  15130. },
  15131. // 导出相关信息
  15132. exportStore: {
  15133. inited: false,
  15134. name: '',
  15135. modeList: [],
  15136. typeList: [],
  15137. columns: [],
  15138. isPrint: false,
  15139. hasFooter: false,
  15140. hasTree: false,
  15141. hasMerge: false,
  15142. hasColgroup: false,
  15143. visible: false
  15144. },
  15145. exportParams: {
  15146. filename: '',
  15147. sheetName: '',
  15148. mode: '',
  15149. type: '',
  15150. isColgroup: false,
  15151. isMerge: false,
  15152. isAllExpand: false,
  15153. useStyle: false,
  15154. original: false,
  15155. message: true,
  15156. isHeader: false,
  15157. isFooter: false
  15158. }
  15159. };
  15160. },
  15161. computed: {
  15162. validOpts: function validOpts() {
  15163. return Object.assign({
  15164. message: 'default'
  15165. }, conf.table.validConfig, this.validConfig);
  15166. },
  15167. sXOpts: function sXOpts() {
  15168. return Object.assign({}, conf.table.scrollX, this.scrollX);
  15169. },
  15170. sYOpts: function sYOpts() {
  15171. return Object.assign({}, conf.table.scrollY, this.scrollY);
  15172. },
  15173. rowHeightMaps: function rowHeightMaps() {
  15174. return {
  15175. default: 48,
  15176. medium: 44,
  15177. small: 40,
  15178. mini: 36
  15179. };
  15180. },
  15181. columnOpts: function columnOpts() {
  15182. return Object.assign({}, this.columnConfig);
  15183. },
  15184. resizableOpts: function resizableOpts() {
  15185. return Object.assign({}, conf.table.resizableConfig, this.resizableConfig);
  15186. },
  15187. seqOpts: function seqOpts() {
  15188. return Object.assign({
  15189. startIndex: 0
  15190. }, conf.table.seqConfig, this.seqConfig);
  15191. },
  15192. radioOpts: function radioOpts() {
  15193. return Object.assign({}, conf.table.radioConfig, this.radioConfig);
  15194. },
  15195. checkboxOpts: function checkboxOpts() {
  15196. return Object.assign({}, conf.table.checkboxConfig, this.checkboxConfig);
  15197. },
  15198. tooltipOpts: function tooltipOpts() {
  15199. var opts = Object.assign({
  15200. leaveDelay: 300
  15201. }, conf.table.tooltipConfig, this.tooltipConfig);
  15202. if (opts.enterable) {
  15203. opts.leaveMethod = this.handleTooltipLeaveMethod;
  15204. }
  15205. return opts;
  15206. },
  15207. validTipOpts: function validTipOpts() {
  15208. return Object.assign({
  15209. isArrow: false
  15210. }, this.tooltipOpts);
  15211. },
  15212. editOpts: function editOpts() {
  15213. return Object.assign({}, conf.table.editConfig, this.editConfig);
  15214. },
  15215. sortOpts: function sortOpts() {
  15216. return Object.assign({
  15217. orders: ['asc', 'desc', null]
  15218. }, conf.table.sortConfig, this.sortConfig);
  15219. },
  15220. filterOpts: function filterOpts() {
  15221. return Object.assign({}, conf.table.filterConfig, this.filterConfig);
  15222. },
  15223. mouseOpts: function mouseOpts() {
  15224. return Object.assign({}, conf.table.mouseConfig, this.mouseConfig);
  15225. },
  15226. areaOpts: function areaOpts() {
  15227. return Object.assign({}, conf.table.areaConfig, this.areaConfig);
  15228. },
  15229. keyboardOpts: function keyboardOpts() {
  15230. return Object.assign({}, conf.table.keyboardConfig, this.keyboardConfig);
  15231. },
  15232. clipOpts: function clipOpts() {
  15233. return Object.assign({}, conf.table.clipConfig, this.clipConfig);
  15234. },
  15235. fnrOpts: function fnrOpts() {
  15236. return Object.assign({}, conf.table.fnrConfig, this.fnrConfig);
  15237. },
  15238. hasTip: function hasTip() {
  15239. return v_x_e_table._tooltip;
  15240. },
  15241. headerCtxMenu: function headerCtxMenu() {
  15242. var headerOpts = this.ctxMenuOpts.header;
  15243. return headerOpts && headerOpts.options ? headerOpts.options : [];
  15244. },
  15245. bodyCtxMenu: function bodyCtxMenu() {
  15246. var bodyOpts = this.ctxMenuOpts.body;
  15247. return bodyOpts && bodyOpts.options ? bodyOpts.options : [];
  15248. },
  15249. footerCtxMenu: function footerCtxMenu() {
  15250. var footerOpts = this.ctxMenuOpts.footer;
  15251. return footerOpts && footerOpts.options ? footerOpts.options : [];
  15252. },
  15253. isCtxMenu: function isCtxMenu() {
  15254. return !!((this.contextMenu || this.menuConfig) && isEnableConf(this.ctxMenuOpts) && (this.headerCtxMenu.length || this.bodyCtxMenu.length || this.footerCtxMenu.length));
  15255. },
  15256. ctxMenuOpts: function ctxMenuOpts() {
  15257. return Object.assign({}, conf.table.menuConfig, this.contextMenu, this.menuConfig);
  15258. },
  15259. ctxMenuList: function ctxMenuList() {
  15260. var rest = [];
  15261. this.ctxMenuStore.list.forEach(function (list) {
  15262. list.forEach(function (item) {
  15263. rest.push(item);
  15264. });
  15265. });
  15266. return rest;
  15267. },
  15268. exportOpts: function exportOpts() {
  15269. return Object.assign({}, conf.table.exportConfig, this.exportConfig);
  15270. },
  15271. importOpts: function importOpts() {
  15272. return Object.assign({}, conf.table.importConfig, this.importConfig);
  15273. },
  15274. printOpts: function printOpts() {
  15275. return Object.assign({}, conf.table.printConfig, this.printConfig);
  15276. },
  15277. expandOpts: function expandOpts() {
  15278. return Object.assign({}, conf.table.expandConfig, this.expandConfig);
  15279. },
  15280. treeOpts: function treeOpts() {
  15281. return Object.assign({}, conf.table.treeConfig, this.treeConfig);
  15282. },
  15283. emptyOpts: function emptyOpts() {
  15284. return Object.assign({}, conf.table.emptyRender, this.emptyRender);
  15285. },
  15286. cellOffsetWidth: function cellOffsetWidth() {
  15287. return this.border ? Math.max(2, Math.ceil(this.scrollbarWidth / this.tableColumn.length)) : 1;
  15288. },
  15289. customOpts: function customOpts() {
  15290. return Object.assign({}, conf.table.customConfig, this.customConfig);
  15291. },
  15292. tableBorder: function tableBorder() {
  15293. var border = this.border;
  15294. if (border === true) {
  15295. return 'full';
  15296. }
  15297. if (border) {
  15298. return border;
  15299. }
  15300. return 'default';
  15301. },
  15302. /**
  15303. * 判断列全选的复选框是否禁用
  15304. */
  15305. isAllCheckboxDisabled: function isAllCheckboxDisabled() {
  15306. var tableFullData = this.tableFullData,
  15307. treeConfig = this.treeConfig,
  15308. checkboxOpts = this.checkboxOpts;
  15309. var strict = checkboxOpts.strict,
  15310. checkMethod = checkboxOpts.checkMethod;
  15311. if (strict) {
  15312. if (tableFullData.length) {
  15313. if (checkMethod) {
  15314. if (treeConfig) {// 暂时不支持树形结构
  15315. } // 如果所有行都被禁用
  15316. return tableFullData.every(function (row) {
  15317. return !checkMethod({
  15318. row: row
  15319. });
  15320. });
  15321. }
  15322. return false;
  15323. }
  15324. return true;
  15325. }
  15326. return false;
  15327. }
  15328. },
  15329. watch: {
  15330. data: function data(value) {
  15331. var _this = this;
  15332. var inited = this.inited,
  15333. initStatus = this.initStatus;
  15334. this.loadTableData(value).then(function () {
  15335. _this.inited = true;
  15336. _this.initStatus = true;
  15337. if (!initStatus) {
  15338. _this.handleLoadDefaults();
  15339. }
  15340. if (!inited) {
  15341. _this.handleInitDefaults();
  15342. }
  15343. if ((_this.scrollXLoad || _this.scrollYLoad) && _this.expandColumn) {
  15344. UtilTools.warn('vxe.error.scrollErrProp', ['column.type=expand']);
  15345. }
  15346. _this.recalculate();
  15347. });
  15348. },
  15349. staticColumns: function staticColumns(value) {
  15350. this.handleColumn(value);
  15351. },
  15352. tableColumn: function tableColumn() {
  15353. this.analyColumnWidth();
  15354. },
  15355. showHeader: function showHeader() {
  15356. var _this2 = this;
  15357. this.$nextTick(function () {
  15358. _this2.recalculate(true).then(function () {
  15359. return _this2.refreshScroll();
  15360. });
  15361. });
  15362. },
  15363. showFooter: function showFooter() {
  15364. var _this3 = this;
  15365. this.$nextTick(function () {
  15366. _this3.recalculate(true).then(function () {
  15367. return _this3.refreshScroll();
  15368. });
  15369. });
  15370. },
  15371. height: function height() {
  15372. var _this4 = this;
  15373. this.$nextTick(function () {
  15374. return _this4.recalculate(true);
  15375. });
  15376. },
  15377. maxHeight: function maxHeight() {
  15378. var _this5 = this;
  15379. this.$nextTick(function () {
  15380. return _this5.recalculate(true);
  15381. });
  15382. },
  15383. syncResize: function syncResize(value) {
  15384. var _this6 = this;
  15385. if (value) {
  15386. handleUupdateResize(this);
  15387. this.$nextTick(function () {
  15388. handleUupdateResize(_this6);
  15389. setTimeout(function () {
  15390. return handleUupdateResize(_this6);
  15391. });
  15392. });
  15393. }
  15394. },
  15395. mergeCells: function mergeCells(value) {
  15396. this.clearMergeCells();
  15397. this.setMergeCells(value);
  15398. },
  15399. mergeFooterItems: function mergeFooterItems(value) {
  15400. this.clearMergeFooterItems();
  15401. this.setMergeFooterItems(value);
  15402. }
  15403. },
  15404. created: function created() {
  15405. var _this7 = this;
  15406. var _Object$assign = Object.assign(this, {
  15407. tZindex: 0,
  15408. elemStore: {},
  15409. // 存放横向 X 虚拟滚动相关的信息
  15410. scrollXStore: {},
  15411. // 存放纵向 Y 虚拟滚动相关信息
  15412. scrollYStore: {},
  15413. // 存放 tooltip 相关信息
  15414. tooltipStore: {},
  15415. // 表格宽度
  15416. tableWidth: 0,
  15417. // 表格高度
  15418. tableHeight: 0,
  15419. // 表头高度
  15420. headerHeight: 0,
  15421. // 表尾高度
  15422. footerHeight: 0,
  15423. // 当前 hover 行
  15424. // hoverRow: null,
  15425. // 最后滚动位置
  15426. lastScrollLeft: 0,
  15427. lastScrollTop: 0,
  15428. // 单选框属性,已选中保留的行
  15429. radioReserveRow: null,
  15430. // 复选框属性,已选中保留的行
  15431. checkboxReserveRowMap: {},
  15432. // 行数据,已展开保留的行
  15433. rowExpandedReserveRowMap: {},
  15434. // 树结构数据,已展开保留的行
  15435. treeExpandedReserveRowMap: {},
  15436. // 完整数据、条件处理后
  15437. tableFullData: [],
  15438. afterFullData: [],
  15439. // 收集的列配置(带分组)
  15440. collectColumn: [],
  15441. // 完整所有列(不带分组)
  15442. tableFullColumn: [],
  15443. // 渲染所有列
  15444. visibleColumn: [],
  15445. // 缓存数据集
  15446. fullAllDataRowMap: new Map(),
  15447. fullAllDataRowIdData: {},
  15448. fullDataRowMap: new Map(),
  15449. fullDataRowIdData: {},
  15450. fullColumnMap: new Map(),
  15451. fullColumnIdData: {},
  15452. fullColumnFieldData: {}
  15453. }),
  15454. scrollXStore = _Object$assign.scrollXStore,
  15455. sYOpts = _Object$assign.sYOpts,
  15456. scrollYStore = _Object$assign.scrollYStore,
  15457. data = _Object$assign.data,
  15458. editOpts = _Object$assign.editOpts,
  15459. treeOpts = _Object$assign.treeOpts,
  15460. treeConfig = _Object$assign.treeConfig,
  15461. showOverflow = _Object$assign.showOverflow;
  15462. if (false) { var exportConfig, exportOpts, importConfig, importOpts; }
  15463. if (false) { var customOpts; } // v4 中只支持对象类型
  15464. if (false) {} // 检查是否有安装需要的模块
  15465. if (false) {}
  15466. Object.assign(scrollYStore, {
  15467. startIndex: 0,
  15468. endIndex: 0,
  15469. visibleSize: 0,
  15470. adaptive: sYOpts.adaptive !== false
  15471. });
  15472. Object.assign(scrollXStore, {
  15473. startIndex: 0,
  15474. endIndex: 0,
  15475. visibleSize: 0
  15476. });
  15477. this.loadTableData(data).then(function () {
  15478. if (data && data.length) {
  15479. _this7.inited = true;
  15480. _this7.initStatus = true;
  15481. _this7.handleLoadDefaults();
  15482. _this7.handleInitDefaults();
  15483. }
  15484. _this7.updateStyle();
  15485. });
  15486. GlobalEvent.on(this, 'paste', this.handleGlobalPasteEvent);
  15487. GlobalEvent.on(this, 'copy', this.handleGlobalCopyEvent);
  15488. GlobalEvent.on(this, 'cut', this.handleGlobalCutEvent);
  15489. GlobalEvent.on(this, 'mousedown', this.handleGlobalMousedownEvent);
  15490. GlobalEvent.on(this, 'blur', this.handleGlobalBlurEvent);
  15491. GlobalEvent.on(this, 'mousewheel', this.handleGlobalMousewheelEvent);
  15492. GlobalEvent.on(this, 'keydown', this.handleGlobalKeydownEvent);
  15493. GlobalEvent.on(this, 'resize', this.handleGlobalResizeEvent);
  15494. GlobalEvent.on(this, 'contextmenu', this.handleGlobalContextmenuEvent);
  15495. this.preventEvent(null, 'created');
  15496. },
  15497. mounted: function mounted() {
  15498. var _this8 = this;
  15499. if (this.autoResize) {
  15500. var resizeObserver = createResizeEvent(function () {
  15501. return _this8.recalculate(true);
  15502. });
  15503. resizeObserver.observe(this.$el);
  15504. resizeObserver.observe(this.getParentElem());
  15505. this.$resize = resizeObserver;
  15506. }
  15507. this.preventEvent(null, 'mounted');
  15508. },
  15509. activated: function activated() {
  15510. var _this9 = this;
  15511. this.recalculate().then(function () {
  15512. return _this9.refreshScroll();
  15513. });
  15514. this.preventEvent(null, 'activated');
  15515. },
  15516. deactivated: function deactivated() {
  15517. this.preventEvent(null, 'deactivated');
  15518. },
  15519. beforeDestroy: function beforeDestroy() {
  15520. if (this.$resize) {
  15521. this.$resize.disconnect();
  15522. }
  15523. this.closeFilter();
  15524. this.closeMenu();
  15525. this.preventEvent(null, 'beforeDestroy');
  15526. },
  15527. destroyed: function destroyed() {
  15528. GlobalEvent.off(this, 'paste');
  15529. GlobalEvent.off(this, 'copy');
  15530. GlobalEvent.off(this, 'cut');
  15531. GlobalEvent.off(this, 'mousedown');
  15532. GlobalEvent.off(this, 'blur');
  15533. GlobalEvent.off(this, 'mousewheel');
  15534. GlobalEvent.off(this, 'keydown');
  15535. GlobalEvent.off(this, 'resize');
  15536. GlobalEvent.off(this, 'contextmenu');
  15537. this.preventEvent(null, 'destroyed');
  15538. },
  15539. render: function render(h) {
  15540. var _e = this._e,
  15541. tId = this.tId,
  15542. tableData = this.tableData,
  15543. tableColumn = this.tableColumn,
  15544. tableGroupColumn = this.tableGroupColumn,
  15545. isGroup = this.isGroup,
  15546. loading = this.loading,
  15547. stripe = this.stripe,
  15548. showHeader = this.showHeader,
  15549. height = this.height,
  15550. tableBorder = this.tableBorder,
  15551. treeOpts = this.treeOpts,
  15552. treeConfig = this.treeConfig,
  15553. mouseConfig = this.mouseConfig,
  15554. mouseOpts = this.mouseOpts,
  15555. vSize = this.vSize,
  15556. validOpts = this.validOpts,
  15557. showFooter = this.showFooter,
  15558. overflowX = this.overflowX,
  15559. overflowY = this.overflowY,
  15560. scrollXLoad = this.scrollXLoad,
  15561. scrollYLoad = this.scrollYLoad,
  15562. scrollbarHeight = this.scrollbarHeight,
  15563. highlightCell = this.highlightCell,
  15564. highlightHoverRow = this.highlightHoverRow,
  15565. highlightHoverColumn = this.highlightHoverColumn,
  15566. editConfig = this.editConfig,
  15567. validTipOpts = this.validTipOpts,
  15568. tooltipOpts = this.tooltipOpts,
  15569. initStore = this.initStore,
  15570. columnStore = this.columnStore,
  15571. filterStore = this.filterStore,
  15572. ctxMenuStore = this.ctxMenuStore,
  15573. ctxMenuOpts = this.ctxMenuOpts,
  15574. footerTableData = this.footerTableData,
  15575. hasTip = this.hasTip;
  15576. var leftList = columnStore.leftList,
  15577. rightList = columnStore.rightList;
  15578. return h('div', {
  15579. class: ['vxe-table', 'vxe-table--render-default', "tid_".concat(tId), vSize ? "size--".concat(vSize) : '', "border--".concat(tableBorder), {
  15580. 'vxe-editable': !!editConfig,
  15581. 'cell--highlight': highlightCell,
  15582. 'cell--selected': mouseConfig && mouseOpts.selected,
  15583. 'cell--area': mouseConfig && mouseOpts.area,
  15584. 'row--highlight': highlightHoverRow,
  15585. 'column--highlight': highlightHoverColumn,
  15586. 'is--header': showHeader,
  15587. 'is--footer': showFooter,
  15588. 'is--group': isGroup,
  15589. 'is--tree-line': treeConfig && treeOpts.line,
  15590. 'is--fixed-left': leftList.length,
  15591. 'is--fixed-right': rightList.length,
  15592. 'is--animat': !!this.animat,
  15593. 'is--round': this.round,
  15594. 'is--stripe': !treeConfig && stripe,
  15595. 'is--loading': loading,
  15596. 'is--empty': !loading && !tableData.length,
  15597. 'is--scroll-y': overflowY,
  15598. 'is--scroll-x': overflowX,
  15599. 'is--virtual-x': scrollXLoad,
  15600. 'is--virtual-y': scrollYLoad
  15601. }]
  15602. }, [
  15603. /**
  15604. * 隐藏列
  15605. */
  15606. h('div', {
  15607. class: 'vxe-table-slots',
  15608. ref: 'hideColumn'
  15609. }, this.$slots.default), h('div', {
  15610. class: 'vxe-table--render-wrapper'
  15611. }, [h('div', {
  15612. class: 'vxe-table--main-wrapper'
  15613. }, [
  15614. /**
  15615. * 表头
  15616. */
  15617. showHeader ? h('vxe-table-header', {
  15618. ref: 'tableHeader',
  15619. props: {
  15620. tableData: tableData,
  15621. tableColumn: tableColumn,
  15622. tableGroupColumn: tableGroupColumn,
  15623. size: vSize
  15624. }
  15625. }) : _e(),
  15626. /**
  15627. * 表体
  15628. */
  15629. h('vxe-table-body', {
  15630. ref: 'tableBody',
  15631. props: {
  15632. tableData: tableData,
  15633. tableColumn: tableColumn,
  15634. size: vSize
  15635. }
  15636. }),
  15637. /**
  15638. * 表尾
  15639. */
  15640. showFooter ? h('vxe-table-footer', {
  15641. ref: 'tableFooter',
  15642. props: {
  15643. footerTableData: footerTableData,
  15644. tableColumn: tableColumn,
  15645. size: vSize
  15646. }
  15647. }) : _e()]), h('div', {
  15648. class: 'vxe-table--fixed-wrapper'
  15649. }, [
  15650. /**
  15651. * 左侧固定区域
  15652. */
  15653. leftList && leftList.length && overflowX ? renderFixed(h, this, 'left') : _e(),
  15654. /**
  15655. * 右侧固定区域
  15656. */
  15657. rightList && rightList.length && overflowX ? renderFixed(h, this, 'right') : _e()])]),
  15658. /**
  15659. * 空数据
  15660. */
  15661. h('div', {
  15662. ref: 'emptyPlaceholder',
  15663. class: 'vxe-table--empty-placeholder'
  15664. }, [h('div', {
  15665. class: 'vxe-table--empty-content'
  15666. }, renderEmptyContenet(h, this))]),
  15667. /**
  15668. * 边框线
  15669. */
  15670. h('div', {
  15671. class: 'vxe-table--border-line'
  15672. }),
  15673. /**
  15674. * 列宽线
  15675. */
  15676. h('div', {
  15677. class: 'vxe-table--resizable-bar',
  15678. style: overflowX ? {
  15679. 'padding-bottom': "".concat(scrollbarHeight, "px")
  15680. } : null,
  15681. ref: 'resizeBar'
  15682. }),
  15683. /**
  15684. * 加载中
  15685. */
  15686. h('div', {
  15687. class: ['vxe-table--loading vxe-loading', {
  15688. 'is--visible': loading
  15689. }]
  15690. }, [h('div', {
  15691. class: 'vxe-loading--spinner'
  15692. })]),
  15693. /**
  15694. * 筛选
  15695. */
  15696. initStore.filter ? h('vxe-table-filter', {
  15697. ref: 'filterWrapper',
  15698. props: {
  15699. filterStore: filterStore
  15700. }
  15701. }) : _e(),
  15702. /**
  15703. * 导入
  15704. */
  15705. initStore.import && this.importConfig ? h('vxe-import-panel', {
  15706. props: {
  15707. defaultOptions: this.importParams,
  15708. storeData: this.importStore
  15709. }
  15710. }) : _e(),
  15711. /**
  15712. * 导出/打印
  15713. */
  15714. initStore.export && (this.exportConfig || this.printConfig) ? h('vxe-export-panel', {
  15715. props: {
  15716. defaultOptions: this.exportParams,
  15717. storeData: this.exportStore
  15718. }
  15719. }) : _e(),
  15720. /**
  15721. * 快捷菜单
  15722. */
  15723. ctxMenuStore.visible && this.isCtxMenu ? h('vxe-table-context-menu', {
  15724. ref: 'ctxWrapper',
  15725. props: {
  15726. ctxMenuStore: ctxMenuStore,
  15727. ctxMenuOpts: ctxMenuOpts
  15728. }
  15729. }) : _e(),
  15730. /**
  15731. * 通用提示
  15732. */
  15733. hasTip ? h('vxe-tooltip', {
  15734. ref: 'commTip',
  15735. props: {
  15736. isArrow: false,
  15737. enterable: false
  15738. }
  15739. }) : _e(),
  15740. /**
  15741. * 工具提示
  15742. */
  15743. hasTip ? h('vxe-tooltip', {
  15744. ref: 'tooltip',
  15745. props: tooltipOpts
  15746. }) : _e(),
  15747. /**
  15748. * 校验提示
  15749. */
  15750. hasTip && this.editRules && validOpts.showMessage && (validOpts.message === 'default' ? !height : validOpts.message === 'tooltip') ? h('vxe-tooltip', {
  15751. ref: 'validTip',
  15752. class: 'vxe-table--valid-error',
  15753. props: validOpts.message === 'tooltip' || tableData.length === 1 ? validTipOpts : null
  15754. }) : _e()]);
  15755. },
  15756. methods: methods
  15757. });
  15758. // CONCATENATED MODULE: ./packages/table/index.js
  15759. var Table = Object.assign(table, {
  15760. install: function install(Vue) {
  15761. if (typeof window !== 'undefined' && window.VXETableMixin) {
  15762. table.mixins.push(window.VXETableMixin);
  15763. delete window.VXETableMixin;
  15764. }
  15765. v_x_e_table.Vue = Vue;
  15766. v_x_e_table.Table = table;
  15767. v_x_e_table.TableComponent = table;
  15768. if (!Vue.prototype.$vxe) {
  15769. Vue.prototype.$vxe = {
  15770. t: v_x_e_table.t,
  15771. _t: v_x_e_table._t
  15772. };
  15773. } else {
  15774. Vue.prototype.$vxe.t = v_x_e_table.t;
  15775. Vue.prototype.$vxe._t = v_x_e_table._t;
  15776. }
  15777. Vue.component(table.name, table);
  15778. Vue.component(src_body.name, src_body);
  15779. }
  15780. });
  15781. /* harmony default export */ var packages_table = (Table);
  15782. // CONCATENATED MODULE: ./packages/filter/src/panel.js
  15783. /* harmony default export */ var panel = ({
  15784. name: 'VxeTableFilter',
  15785. props: {
  15786. filterStore: Object
  15787. },
  15788. computed: {
  15789. hasCheckOption: function hasCheckOption() {
  15790. var filterStore = this.filterStore;
  15791. return filterStore && filterStore.options.some(function (option) {
  15792. return option.checked;
  15793. });
  15794. }
  15795. },
  15796. render: function render(h) {
  15797. var $xetable = this.$parent,
  15798. filterStore = this.filterStore;
  15799. var column = filterStore.column;
  15800. var filterRender = column ? column.filterRender : null;
  15801. var compConf = filterRender ? v_x_e_table.renderer.get(filterRender.name) : null;
  15802. return h('div', {
  15803. class: ['vxe-table--filter-wrapper', 'filter--prevent-default', compConf && compConf.className ? compConf.className : '', {
  15804. 'is--animat': $xetable.animat,
  15805. 'is--multiple': filterStore.multiple,
  15806. 'filter--active': filterStore.visible
  15807. }],
  15808. style: filterStore.style
  15809. }, filterStore.visible ? this.renderOptions(h, filterRender, compConf).concat(this.renderFooter(h)) : []);
  15810. },
  15811. methods: {
  15812. renderOptions: function renderOptions(h, filterRender, compConf) {
  15813. var _this = this;
  15814. var $xetable = this.$parent,
  15815. filterStore = this.filterStore;
  15816. var args = filterStore.args,
  15817. column = filterStore.column,
  15818. multiple = filterStore.multiple;
  15819. var slots = column.slots;
  15820. if (slots && slots.filter) {
  15821. return [h('div', {
  15822. class: 'vxe-table--filter-template'
  15823. }, $xetable.callSlot(slots.filter, Object.assign({
  15824. $panel: this,
  15825. context: this
  15826. }, args), h))];
  15827. } else if (compConf && compConf.renderFilter) {
  15828. return [h('div', {
  15829. class: 'vxe-table--filter-template'
  15830. }, compConf.renderFilter.call($xetable, h, filterRender, Object.assign({
  15831. $panel: this,
  15832. context: this
  15833. }, args)))];
  15834. }
  15835. return [h('ul', {
  15836. class: 'vxe-table--filter-header'
  15837. }, [h('li', {
  15838. class: ['vxe-table--filter-option', {
  15839. 'is--checked': multiple ? filterStore.isAllSelected : !filterStore.options.some(function (item) {
  15840. return item._checked;
  15841. }),
  15842. 'is--indeterminate': multiple && filterStore.isIndeterminate
  15843. }],
  15844. attrs: {
  15845. title: conf.i18n(multiple ? 'vxe.table.allTitle' : 'vxe.table.allFilter')
  15846. },
  15847. on: {
  15848. click: function click(evnt) {
  15849. _this.changeAllOption(evnt, !filterStore.isAllSelected);
  15850. }
  15851. }
  15852. }, (multiple ? [h('span', {
  15853. class: 'vxe-checkbox--icon vxe-checkbox--checked-icon'
  15854. }), h('span', {
  15855. class: 'vxe-checkbox--icon vxe-checkbox--unchecked-icon'
  15856. }), h('span', {
  15857. class: 'vxe-checkbox--icon vxe-checkbox--indeterminate-icon'
  15858. })] : []).concat([h('span', {
  15859. class: 'vxe-checkbox--label'
  15860. }, conf.i18n('vxe.table.allFilter'))]))]), h('ul', {
  15861. class: 'vxe-table--filter-body'
  15862. }, filterStore.options.map(function (item) {
  15863. return h('li', {
  15864. class: ['vxe-table--filter-option', {
  15865. 'is--checked': item._checked
  15866. }],
  15867. attrs: {
  15868. title: item.label
  15869. },
  15870. on: {
  15871. click: function click(evnt) {
  15872. _this.changeOption(evnt, !item._checked, item);
  15873. }
  15874. }
  15875. }, (multiple ? [h('span', {
  15876. class: 'vxe-checkbox--icon vxe-checkbox--checked-icon'
  15877. }), h('span', {
  15878. class: 'vxe-checkbox--icon vxe-checkbox--unchecked-icon'
  15879. }), h('span', {
  15880. class: 'vxe-checkbox--icon vxe-checkbox--indeterminate-icon'
  15881. })] : []).concat([h('span', {
  15882. class: 'vxe-checkbox--label'
  15883. }, UtilTools.formatText(item.label, 1))]));
  15884. }))];
  15885. },
  15886. renderFooter: function renderFooter(h) {
  15887. var hasCheckOption = this.hasCheckOption,
  15888. filterStore = this.filterStore;
  15889. var column = filterStore.column,
  15890. multiple = filterStore.multiple;
  15891. var filterRender = column.filterRender;
  15892. var compConf = filterRender ? v_x_e_table.renderer.get(filterRender.name) : null;
  15893. var isDisabled = !hasCheckOption && !filterStore.isAllSelected && !filterStore.isIndeterminate;
  15894. return multiple && (!compConf || (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isBoolean(compConf.showFilterFooter) ? compConf.showFilterFooter !== false : compConf.isFooter !== false)) ? [h('div', {
  15895. class: 'vxe-table--filter-footer'
  15896. }, [h('button', {
  15897. class: {
  15898. 'is--disabled': isDisabled
  15899. },
  15900. attrs: {
  15901. disabled: isDisabled
  15902. },
  15903. on: {
  15904. click: this.confirmFilter
  15905. }
  15906. }, conf.i18n('vxe.table.confirmFilter')), h('button', {
  15907. on: {
  15908. click: this.resetFilter
  15909. }
  15910. }, conf.i18n('vxe.table.resetFilter'))])] : [];
  15911. },
  15912. // 全部筛选事件
  15913. filterCheckAllEvent: function filterCheckAllEvent(evnt, value) {
  15914. var filterStore = this.filterStore;
  15915. filterStore.options.forEach(function (option) {
  15916. option._checked = value;
  15917. option.checked = value;
  15918. });
  15919. filterStore.isAllSelected = value;
  15920. filterStore.isIndeterminate = false;
  15921. },
  15922. /*************************
  15923. * Publish methods
  15924. *************************/
  15925. // (单选)筛选发生改变
  15926. changeRadioOption: function changeRadioOption(evnt, checked, item) {
  15927. var $xetable = this.$parent,
  15928. filterStore = this.filterStore;
  15929. filterStore.options.forEach(function (option) {
  15930. option._checked = false;
  15931. });
  15932. item._checked = checked;
  15933. $xetable.checkFilterOptions();
  15934. this.confirmFilter(evnt);
  15935. },
  15936. // (多选)筛选发生改变
  15937. changeMultipleOption: function changeMultipleOption(evnt, checked, item) {
  15938. var $xetable = this.$parent;
  15939. item._checked = checked;
  15940. $xetable.checkFilterOptions();
  15941. },
  15942. changeAllOption: function changeAllOption(evnt, checked) {
  15943. if (this.filterStore.multiple) {
  15944. this.filterCheckAllEvent(evnt, checked);
  15945. } else {
  15946. this.resetFilter(evnt);
  15947. }
  15948. },
  15949. // 筛选发生改变
  15950. changeOption: function changeOption(evnt, checked, item) {
  15951. if (this.filterStore.multiple) {
  15952. this.changeMultipleOption(evnt, checked, item);
  15953. } else {
  15954. this.changeRadioOption(evnt, checked, item);
  15955. }
  15956. },
  15957. // 确认筛选
  15958. confirmFilter: function confirmFilter(evnt) {
  15959. var $xetable = this.$parent,
  15960. filterStore = this.filterStore;
  15961. filterStore.options.forEach(function (option) {
  15962. option.checked = option._checked;
  15963. });
  15964. $xetable.confirmFilterEvent(evnt);
  15965. },
  15966. // 重置筛选
  15967. resetFilter: function resetFilter(evnt) {
  15968. var $xetable = this.$parent;
  15969. $xetable.resetFilterEvent(evnt);
  15970. }
  15971. /*************************
  15972. * Publish methods
  15973. *************************/
  15974. }
  15975. });
  15976. // CONCATENATED MODULE: ./packages/filter/src/mixin.js
  15977. /* harmony default export */ var src_mixin = ({
  15978. methods: {
  15979. /**
  15980. * 修改筛选条件列表
  15981. * @param {ColumnInfo} fieldOrColumn 列
  15982. * @param {Array} options 选项
  15983. */
  15984. _setFilter: function _setFilter(fieldOrColumn, options) {
  15985. var column = handleFieldOrColumn(this, fieldOrColumn);
  15986. if (column && column.filters && options) {
  15987. column.filters = UtilTools.getFilters(options);
  15988. }
  15989. return this.$nextTick();
  15990. },
  15991. checkFilterOptions: function checkFilterOptions() {
  15992. var filterStore = this.filterStore;
  15993. filterStore.isAllSelected = filterStore.options.every(function (item) {
  15994. return item._checked;
  15995. });
  15996. filterStore.isIndeterminate = !filterStore.isAllSelected && filterStore.options.some(function (item) {
  15997. return item._checked;
  15998. });
  15999. },
  16000. /**
  16001. * 点击筛选事件
  16002. * 当筛选图标被点击时触发
  16003. * 更新选项是否全部状态
  16004. * 打开筛选面板
  16005. * @param {Event} evnt 事件
  16006. * @param {ColumnInfo} column 列配置
  16007. * @param {Object} params 参数
  16008. */
  16009. triggerFilterEvent: function triggerFilterEvent(evnt, column, params) {
  16010. var _this = this;
  16011. var filterStore = this.filterStore;
  16012. if (filterStore.column === column && filterStore.visible) {
  16013. filterStore.visible = false;
  16014. } else {
  16015. var targetElem = evnt.target,
  16016. pageX = evnt.pageX;
  16017. var filters = column.filters,
  16018. filterMultiple = column.filterMultiple,
  16019. filterRender = column.filterRender;
  16020. var compConf = filterRender ? v_x_e_table.renderer.get(filterRender.name) : null;
  16021. var filterRecoverMethod = column.filterRecoverMethod || (compConf ? compConf.filterRecoverMethod : null);
  16022. var _DomTools$getDomNode = DomTools.getDomNode(),
  16023. visibleWidth = _DomTools$getDomNode.visibleWidth;
  16024. Object.assign(filterStore, {
  16025. args: params,
  16026. multiple: filterMultiple,
  16027. options: filters,
  16028. column: column,
  16029. style: null,
  16030. visible: true
  16031. }); // 复原状态
  16032. filterStore.options.forEach(function (option) {
  16033. var _checked = option._checked,
  16034. checked = option.checked;
  16035. option._checked = checked;
  16036. if (!checked && _checked !== checked) {
  16037. if (filterRecoverMethod) {
  16038. filterRecoverMethod({
  16039. option: option,
  16040. column: column,
  16041. $table: _this
  16042. });
  16043. }
  16044. }
  16045. });
  16046. this.checkFilterOptions();
  16047. this.initStore.filter = true;
  16048. this.$nextTick(function () {
  16049. var $refs = _this.$refs;
  16050. var bodyElem = $refs.tableBody.$el;
  16051. var filterWrapperElem = $refs.filterWrapper.$el;
  16052. var filterWidth = filterWrapperElem.offsetWidth;
  16053. var centerWidth = filterWidth / 2;
  16054. var minMargin = 10;
  16055. var maxLeft = bodyElem.clientWidth - filterWidth - minMargin;
  16056. var left, right;
  16057. var style = {
  16058. top: "".concat(targetElem.offsetTop + targetElem.offsetParent.offsetTop + targetElem.offsetHeight + 8, "px")
  16059. };
  16060. if (column.fixed === 'left') {
  16061. left = targetElem.offsetLeft + targetElem.offsetParent.offsetLeft - centerWidth;
  16062. } else if (column.fixed === 'right') {
  16063. right = targetElem.offsetParent.offsetWidth - targetElem.offsetLeft + (targetElem.offsetParent.offsetParent.offsetWidth - targetElem.offsetParent.offsetLeft) - column.renderWidth - centerWidth;
  16064. } else {
  16065. left = targetElem.offsetLeft + targetElem.offsetParent.offsetLeft - centerWidth - bodyElem.scrollLeft;
  16066. }
  16067. if (left) {
  16068. var overflowWidth = pageX + filterWidth - centerWidth + minMargin - visibleWidth;
  16069. if (overflowWidth > 0) {
  16070. left -= overflowWidth;
  16071. }
  16072. style.left = "".concat(Math.min(maxLeft, Math.max(minMargin, left)), "px");
  16073. } else if (right) {
  16074. var _overflowWidth = pageX + filterWidth - centerWidth + minMargin - visibleWidth;
  16075. if (_overflowWidth > 0) {
  16076. right += _overflowWidth;
  16077. }
  16078. style.right = "".concat(Math.max(minMargin, right), "px");
  16079. }
  16080. filterStore.style = style;
  16081. });
  16082. }
  16083. },
  16084. _getCheckedFilters: function _getCheckedFilters() {
  16085. var visibleColumn = this.visibleColumn;
  16086. var filterList = [];
  16087. visibleColumn.filter(function (column) {
  16088. var property = column.property,
  16089. filters = column.filters;
  16090. var valueList = [];
  16091. var dataList = [];
  16092. if (filters && filters.length) {
  16093. filters.forEach(function (item) {
  16094. if (item.checked) {
  16095. valueList.push(item.value);
  16096. dataList.push(item.data);
  16097. }
  16098. });
  16099. if (valueList.length) {
  16100. filterList.push({
  16101. column: column,
  16102. property: property,
  16103. values: valueList,
  16104. datas: dataList
  16105. });
  16106. }
  16107. }
  16108. });
  16109. return filterList;
  16110. },
  16111. /**
  16112. * 确认筛选
  16113. * 当筛选面板中的确定按钮被按下时触发
  16114. * @param {Event} evnt 事件
  16115. */
  16116. confirmFilterEvent: function confirmFilterEvent(evnt) {
  16117. var _this2 = this;
  16118. var filterStore = this.filterStore,
  16119. filterOpts = this.filterOpts,
  16120. scrollXLoad = this.scrollXLoad,
  16121. scrollYLoad = this.scrollYLoad;
  16122. var column = filterStore.column;
  16123. var property = column.property;
  16124. var values = [];
  16125. var datas = [];
  16126. column.filters.forEach(function (item) {
  16127. if (item.checked) {
  16128. values.push(item.value);
  16129. datas.push(item.data);
  16130. }
  16131. });
  16132. filterStore.visible = false;
  16133. var filterList = this.getCheckedFilters(); // 如果是服务端筛选,则跳过本地筛选处理
  16134. if (!filterOpts.remote) {
  16135. this.handleTableData(true);
  16136. this.checkSelectionStatus();
  16137. }
  16138. this.emitEvent('filter-change', {
  16139. column: column,
  16140. property: property,
  16141. values: values,
  16142. datas: datas,
  16143. filters: filterList,
  16144. filterList: filterList
  16145. }, evnt);
  16146. this.updateFooter();
  16147. if (scrollXLoad || scrollYLoad) {
  16148. this.clearScroll();
  16149. if (scrollYLoad) {
  16150. this.updateScrollYSpace();
  16151. }
  16152. }
  16153. this.closeFilter();
  16154. this.$nextTick(function () {
  16155. _this2.recalculate();
  16156. _this2.updateCellAreas();
  16157. });
  16158. },
  16159. handleClearFilter: function handleClearFilter(column) {
  16160. if (column) {
  16161. var filters = column.filters,
  16162. filterRender = column.filterRender;
  16163. if (filters) {
  16164. var compConf = filterRender ? v_x_e_table.renderer.get(filterRender.name) : null;
  16165. var filterResetMethod = column.filterResetMethod || (compConf ? compConf.filterResetMethod : null);
  16166. filters.forEach(function (item) {
  16167. item._checked = false;
  16168. item.checked = false;
  16169. if (!filterResetMethod) {
  16170. item.data = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.clone(item.resetValue, true);
  16171. }
  16172. });
  16173. if (filterResetMethod) {
  16174. filterResetMethod({
  16175. options: filters,
  16176. column: column,
  16177. $table: this
  16178. });
  16179. }
  16180. }
  16181. }
  16182. },
  16183. /**
  16184. * 重置筛选
  16185. * 当筛选面板中的重置按钮被按下时触发
  16186. * @param {Event} evnt 事件
  16187. */
  16188. resetFilterEvent: function resetFilterEvent(evnt) {
  16189. this.handleClearFilter(this.filterStore.column);
  16190. this.confirmFilterEvent(evnt);
  16191. },
  16192. /**
  16193. * 清空指定列的筛选条件
  16194. * 如果为空则清空所有列的筛选条件
  16195. * @param {String} fieldOrColumn 列
  16196. */
  16197. _clearFilter: function _clearFilter(fieldOrColumn) {
  16198. var filterStore = this.filterStore;
  16199. var column;
  16200. if (fieldOrColumn) {
  16201. column = handleFieldOrColumn(this, fieldOrColumn);
  16202. if (column) {
  16203. this.handleClearFilter(column);
  16204. }
  16205. } else {
  16206. this.visibleColumn.forEach(this.handleClearFilter);
  16207. }
  16208. if (!fieldOrColumn || column !== filterStore.column) {
  16209. Object.assign(filterStore, {
  16210. isAllSelected: false,
  16211. isIndeterminate: false,
  16212. style: null,
  16213. options: [],
  16214. column: null,
  16215. multiple: false,
  16216. visible: false
  16217. });
  16218. }
  16219. return this.updateData();
  16220. }
  16221. }
  16222. });
  16223. // CONCATENATED MODULE: ./packages/filter/index.js
  16224. var Filter = {
  16225. Panel: panel,
  16226. install: function install(Vue) {
  16227. v_x_e_table.reg('filter');
  16228. packages_table.mixins.push(src_mixin);
  16229. Vue.component(panel.name, panel);
  16230. }
  16231. };
  16232. /* harmony default export */ var filter = (Filter);
  16233. // CONCATENATED MODULE: ./packages/menu/src/panel.js
  16234. /* harmony default export */ var src_panel = ({
  16235. name: 'VxeTableContextMenu',
  16236. props: {
  16237. ctxMenuStore: Object,
  16238. ctxMenuOpts: Object
  16239. },
  16240. mounted: function mounted() {
  16241. document.body.appendChild(this.$el);
  16242. },
  16243. beforeDestroy: function beforeDestroy() {
  16244. var $el = this.$el;
  16245. if ($el.parentNode) {
  16246. $el.parentNode.removeChild($el);
  16247. }
  16248. },
  16249. render: function render(h) {
  16250. var $xetable = this.$parent;
  16251. var ctxMenuOpts = this.ctxMenuOpts,
  16252. ctxMenuStore = this.ctxMenuStore;
  16253. return h('div', {
  16254. class: ['vxe-table--context-menu-wrapper', ctxMenuOpts.className],
  16255. style: ctxMenuStore.style
  16256. }, ctxMenuStore.list.map(function (options, gIndex) {
  16257. return h('ul', {
  16258. class: 'vxe-context-menu--option-wrapper',
  16259. key: gIndex
  16260. }, options.map(function (item, index) {
  16261. var hasChildMenus = item.children && item.children.length;
  16262. return item.visible === false ? null : h('li', {
  16263. class: [item.className, {
  16264. 'link--disabled': item.disabled,
  16265. 'link--active': item === ctxMenuStore.selected
  16266. }],
  16267. key: "".concat(gIndex, "_").concat(index)
  16268. }, [h('a', {
  16269. class: 'vxe-context-menu--link',
  16270. on: {
  16271. click: function click(evnt) {
  16272. $xetable.ctxMenuLinkEvent(evnt, item);
  16273. },
  16274. mouseover: function mouseover(evnt) {
  16275. $xetable.ctxMenuMouseoverEvent(evnt, item);
  16276. },
  16277. mouseout: function mouseout(evnt) {
  16278. $xetable.ctxMenuMouseoutEvent(evnt, item);
  16279. }
  16280. }
  16281. }, [h('i', {
  16282. class: ['vxe-context-menu--link-prefix', item.prefixIcon]
  16283. }), h('span', {
  16284. class: 'vxe-context-menu--link-content'
  16285. }, UtilTools.getFuncText(item.name)), h('i', {
  16286. class: ['vxe-context-menu--link-suffix', hasChildMenus ? item.suffixIcon || 'suffix--haschild' : item.suffixIcon]
  16287. })]), hasChildMenus ? h('ul', {
  16288. class: ['vxe-table--context-menu-clild-wrapper', {
  16289. 'is--show': item === ctxMenuStore.selected && ctxMenuStore.showChild
  16290. }]
  16291. }, item.children.map(function (child, cIndex) {
  16292. return child.visible === false ? null : h('li', {
  16293. class: [child.className, {
  16294. 'link--disabled': child.disabled,
  16295. 'link--active': child === ctxMenuStore.selectChild
  16296. }],
  16297. key: "".concat(gIndex, "_").concat(index, "_").concat(cIndex)
  16298. }, [h('a', {
  16299. class: 'vxe-context-menu--link',
  16300. on: {
  16301. click: function click(evnt) {
  16302. $xetable.ctxMenuLinkEvent(evnt, child);
  16303. },
  16304. mouseover: function mouseover(evnt) {
  16305. $xetable.ctxMenuMouseoverEvent(evnt, item, child);
  16306. },
  16307. mouseout: function mouseout(evnt) {
  16308. $xetable.ctxMenuMouseoutEvent(evnt, item, child);
  16309. }
  16310. }
  16311. }, [h('i', {
  16312. class: ['vxe-context-menu--link-prefix', child.prefixIcon]
  16313. }), h('span', {
  16314. class: 'vxe-context-menu--link-content'
  16315. }, UtilTools.getFuncText(child.name))])]);
  16316. })) : null]);
  16317. }));
  16318. }));
  16319. }
  16320. });
  16321. // CONCATENATED MODULE: ./packages/menu/src/mixin.js
  16322. /* harmony default export */ var menu_src_mixin = ({
  16323. methods: {
  16324. /**
  16325. * 关闭快捷菜单
  16326. */
  16327. _closeMenu: function _closeMenu() {
  16328. Object.assign(this.ctxMenuStore, {
  16329. visible: false,
  16330. selected: null,
  16331. selectChild: null,
  16332. showChild: false
  16333. });
  16334. return this.$nextTick();
  16335. },
  16336. // 处理菜单的移动
  16337. moveCtxMenu: function moveCtxMenu(evnt, keyCode, ctxMenuStore, property, operKey, operRest, menuList) {
  16338. var selectItem;
  16339. var selectIndex = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.findIndexOf(menuList, function (item) {
  16340. return ctxMenuStore[property] === item;
  16341. });
  16342. if (keyCode === operKey) {
  16343. if (operRest && UtilTools.hasChildrenList(ctxMenuStore.selected)) {
  16344. ctxMenuStore.showChild = true;
  16345. } else {
  16346. ctxMenuStore.showChild = false;
  16347. ctxMenuStore.selectChild = null;
  16348. }
  16349. } else if (keyCode === 38) {
  16350. for (var len = selectIndex - 1; len >= 0; len--) {
  16351. if (menuList[len].visible !== false) {
  16352. selectItem = menuList[len];
  16353. break;
  16354. }
  16355. }
  16356. ctxMenuStore[property] = selectItem || menuList[menuList.length - 1];
  16357. } else if (keyCode === 40) {
  16358. for (var index = selectIndex + 1; index < menuList.length; index++) {
  16359. if (menuList[index].visible !== false) {
  16360. selectItem = menuList[index];
  16361. break;
  16362. }
  16363. }
  16364. ctxMenuStore[property] = selectItem || menuList[0];
  16365. } else if (ctxMenuStore[property] && (keyCode === 13 || keyCode === 32)) {
  16366. this.ctxMenuLinkEvent(evnt, ctxMenuStore[property]);
  16367. }
  16368. },
  16369. /**
  16370. * 快捷菜单事件处理
  16371. */
  16372. handleGlobalContextmenuEvent: function handleGlobalContextmenuEvent(evnt) {
  16373. var $refs = this.$refs,
  16374. tId = this.tId,
  16375. editStore = this.editStore,
  16376. menuConfig = this.menuConfig,
  16377. contextMenu = this.contextMenu,
  16378. ctxMenuStore = this.ctxMenuStore,
  16379. ctxMenuOpts = this.ctxMenuOpts,
  16380. mouseConfig = this.mouseConfig,
  16381. mouseOpts = this.mouseOpts;
  16382. var selected = editStore.selected;
  16383. var layoutList = ['header', 'body', 'footer'];
  16384. if (menuConfig || contextMenu) {
  16385. if (ctxMenuStore.visible && $refs.ctxWrapper && DomTools.getEventTargetNode(evnt, $refs.ctxWrapper.$el).flag) {
  16386. evnt.preventDefault();
  16387. return;
  16388. }
  16389. if (this._keyCtx) {
  16390. var type = 'body';
  16391. var params = {
  16392. type: type,
  16393. $grid: this.$xegrid,
  16394. $table: this,
  16395. keyboard: true,
  16396. columns: this.visibleColumn.slice(0),
  16397. $event: evnt
  16398. }; // 如果开启单元格区域
  16399. if (mouseConfig && mouseOpts.area) {
  16400. var activeArea = this.getActiveCellArea();
  16401. if (activeArea && activeArea.row && activeArea.column) {
  16402. params.row = activeArea.row;
  16403. params.column = activeArea.column;
  16404. this.openContextMenu(evnt, type, params);
  16405. return;
  16406. }
  16407. } else if (mouseConfig && mouseOpts.selected) {
  16408. // 如果启用键盘导航且已选中单元格
  16409. if (selected.row && selected.column) {
  16410. params.row = selected.row;
  16411. params.column = selected.column;
  16412. this.openContextMenu(evnt, type, params);
  16413. return;
  16414. }
  16415. }
  16416. } // 分别匹配表尾、内容、表尾的快捷菜单
  16417. for (var index = 0; index < layoutList.length; index++) {
  16418. var layout = layoutList[index];
  16419. var columnTargetNode = DomTools.getEventTargetNode(evnt, this.$el, "vxe-".concat(layout, "--column"), function (target) {
  16420. // target=td|th,直接向上找 table 去匹配即可
  16421. return target.parentNode.parentNode.parentNode.getAttribute('xid') === tId;
  16422. });
  16423. var _params = {
  16424. type: layout,
  16425. $grid: this.$xegrid,
  16426. $table: this,
  16427. columns: this.visibleColumn.slice(0),
  16428. $event: evnt
  16429. };
  16430. if (columnTargetNode.flag) {
  16431. var cell = columnTargetNode.targetElem;
  16432. var column = this.getColumnNode(cell).item;
  16433. var typePrefix = "".concat(layout, "-");
  16434. Object.assign(_params, {
  16435. column: column,
  16436. columnIndex: this.getColumnIndex(column),
  16437. cell: cell
  16438. });
  16439. if (layout === 'body') {
  16440. var row = this.getRowNode(cell.parentNode).item;
  16441. typePrefix = '';
  16442. _params.row = row;
  16443. _params.rowIndex = this.getRowIndex(row);
  16444. }
  16445. this.openContextMenu(evnt, layout, _params); // 在 v4 中废弃事件 cell-context-menu、header-cell-context-menu、footer-cell-context-menu
  16446. if (this.$listeners["".concat(typePrefix, "cell-context-menu")]) {
  16447. if (false) {}
  16448. this.emitEvent("".concat(typePrefix, "cell-context-menu"), _params, evnt);
  16449. } else {
  16450. this.emitEvent("".concat(typePrefix, "cell-menu"), _params, evnt);
  16451. }
  16452. return;
  16453. } else if (DomTools.getEventTargetNode(evnt, this.$el, "vxe-table--".concat(layout, "-wrapper"), function (target) {
  16454. return target.getAttribute('xid') === tId;
  16455. }).flag) {
  16456. if (ctxMenuOpts.trigger === 'cell') {
  16457. evnt.preventDefault();
  16458. } else {
  16459. this.openContextMenu(evnt, layout, _params);
  16460. }
  16461. return;
  16462. }
  16463. }
  16464. }
  16465. if ($refs.filterWrapper && !DomTools.getEventTargetNode(evnt, $refs.filterWrapper.$el).flag) {
  16466. this.closeFilter();
  16467. }
  16468. this.closeMenu();
  16469. },
  16470. /**
  16471. * 显示快捷菜单
  16472. */
  16473. openContextMenu: function openContextMenu(evnt, type, params) {
  16474. var _this = this;
  16475. var isCtxMenu = this.isCtxMenu,
  16476. ctxMenuStore = this.ctxMenuStore,
  16477. ctxMenuOpts = this.ctxMenuOpts;
  16478. var config = ctxMenuOpts[type];
  16479. var visibleMethod = ctxMenuOpts.visibleMethod;
  16480. if (config) {
  16481. var options = config.options,
  16482. disabled = config.disabled;
  16483. if (disabled) {
  16484. evnt.preventDefault();
  16485. } else if (isCtxMenu && options && options.length) {
  16486. params.options = options;
  16487. this.preventEvent(evnt, 'event.showMenu', params, null, function () {
  16488. if (!visibleMethod || visibleMethod(params)) {
  16489. evnt.preventDefault();
  16490. _this.updateZindex();
  16491. var _DomTools$getDomNode = DomTools.getDomNode(),
  16492. scrollTop = _DomTools$getDomNode.scrollTop,
  16493. scrollLeft = _DomTools$getDomNode.scrollLeft,
  16494. visibleHeight = _DomTools$getDomNode.visibleHeight,
  16495. visibleWidth = _DomTools$getDomNode.visibleWidth;
  16496. var top = evnt.clientY + scrollTop;
  16497. var left = evnt.clientX + scrollLeft;
  16498. var handleVisible = function handleVisible() {
  16499. Object.assign(ctxMenuStore, {
  16500. args: params,
  16501. visible: true,
  16502. list: options,
  16503. selected: null,
  16504. selectChild: null,
  16505. showChild: false,
  16506. style: {
  16507. zIndex: _this.tZindex,
  16508. top: "".concat(top, "px"),
  16509. left: "".concat(left, "px")
  16510. }
  16511. });
  16512. _this.$nextTick(function () {
  16513. var ctxElem = _this.$refs.ctxWrapper.$el;
  16514. var clientHeight = ctxElem.clientHeight;
  16515. var clientWidth = ctxElem.clientWidth;
  16516. var _DomTools$getAbsolute = DomTools.getAbsolutePos(ctxElem),
  16517. boundingTop = _DomTools$getAbsolute.boundingTop,
  16518. boundingLeft = _DomTools$getAbsolute.boundingLeft;
  16519. var offsetTop = boundingTop + clientHeight - visibleHeight;
  16520. var offsetLeft = boundingLeft + clientWidth - visibleWidth;
  16521. if (offsetTop > -10) {
  16522. ctxMenuStore.style.top = "".concat(Math.max(scrollTop + 2, top - clientHeight - 2), "px");
  16523. }
  16524. if (offsetLeft > -10) {
  16525. ctxMenuStore.style.left = "".concat(Math.max(scrollLeft + 2, left - clientWidth - 2), "px");
  16526. }
  16527. });
  16528. };
  16529. var keyboard = params.keyboard,
  16530. row = params.row,
  16531. column = params.column;
  16532. if (keyboard && row && column) {
  16533. _this.scrollToRow(row, column).then(function () {
  16534. var cell = _this.getCell(row, column);
  16535. var _DomTools$getAbsolute2 = DomTools.getAbsolutePos(cell),
  16536. boundingTop = _DomTools$getAbsolute2.boundingTop,
  16537. boundingLeft = _DomTools$getAbsolute2.boundingLeft;
  16538. top = boundingTop + scrollTop + Math.floor(cell.offsetHeight / 2);
  16539. left = boundingLeft + scrollLeft + Math.floor(cell.offsetWidth / 2);
  16540. handleVisible();
  16541. });
  16542. } else {
  16543. handleVisible();
  16544. }
  16545. } else {
  16546. _this.closeMenu();
  16547. }
  16548. });
  16549. }
  16550. }
  16551. this.closeFilter();
  16552. },
  16553. ctxMenuMouseoverEvent: function ctxMenuMouseoverEvent(evnt, item, child) {
  16554. var menuElem = evnt.currentTarget;
  16555. var ctxMenuStore = this.ctxMenuStore;
  16556. evnt.preventDefault();
  16557. evnt.stopPropagation();
  16558. ctxMenuStore.selected = item;
  16559. ctxMenuStore.selectChild = child;
  16560. if (!child) {
  16561. ctxMenuStore.showChild = UtilTools.hasChildrenList(item);
  16562. if (ctxMenuStore.showChild) {
  16563. this.$nextTick(function () {
  16564. var childWrapperElem = menuElem.nextElementSibling;
  16565. if (childWrapperElem) {
  16566. var _DomTools$getAbsolute3 = DomTools.getAbsolutePos(menuElem),
  16567. boundingTop = _DomTools$getAbsolute3.boundingTop,
  16568. boundingLeft = _DomTools$getAbsolute3.boundingLeft,
  16569. visibleHeight = _DomTools$getAbsolute3.visibleHeight,
  16570. visibleWidth = _DomTools$getAbsolute3.visibleWidth;
  16571. var posTop = boundingTop + menuElem.offsetHeight;
  16572. var posLeft = boundingLeft + menuElem.offsetWidth;
  16573. var left = '';
  16574. var right = ''; // 是否超出右侧
  16575. if (posLeft + childWrapperElem.offsetWidth > visibleWidth - 10) {
  16576. left = 'auto';
  16577. right = "".concat(menuElem.offsetWidth, "px");
  16578. } // 是否超出底部
  16579. var top = '';
  16580. var bottom = '';
  16581. if (posTop + childWrapperElem.offsetHeight > visibleHeight - 10) {
  16582. top = 'auto';
  16583. bottom = '0';
  16584. }
  16585. childWrapperElem.style.left = left;
  16586. childWrapperElem.style.right = right;
  16587. childWrapperElem.style.top = top;
  16588. childWrapperElem.style.bottom = bottom;
  16589. }
  16590. });
  16591. }
  16592. }
  16593. },
  16594. ctxMenuMouseoutEvent: function ctxMenuMouseoutEvent(evnt, item) {
  16595. var ctxMenuStore = this.ctxMenuStore;
  16596. if (!item.children) {
  16597. ctxMenuStore.selected = null;
  16598. }
  16599. ctxMenuStore.selectChild = null;
  16600. },
  16601. /**
  16602. * 快捷菜单点击事件
  16603. */
  16604. ctxMenuLinkEvent: function ctxMenuLinkEvent(evnt, menu) {
  16605. if (!menu.disabled && (!menu.children || !menu.children.length)) {
  16606. var ctxMenuMethod = v_x_e_table.menus.get(menu.code);
  16607. var params = Object.assign({
  16608. menu: menu,
  16609. $grid: this.$xegrid,
  16610. $table: this,
  16611. $event: evnt
  16612. }, this.ctxMenuStore.args);
  16613. if (ctxMenuMethod) {
  16614. ctxMenuMethod.call(this, params, evnt);
  16615. } // 在 v4 中废弃事件 context-menu-click
  16616. if (this.$listeners['context-menu-click']) {
  16617. if (false) {}
  16618. this.emitEvent('context-menu-click', params, evnt);
  16619. } else {
  16620. this.emitEvent('menu-click', params, evnt);
  16621. }
  16622. this.closeMenu();
  16623. }
  16624. }
  16625. }
  16626. });
  16627. // CONCATENATED MODULE: ./packages/menu/index.js
  16628. var Menu = {
  16629. Panel: src_panel,
  16630. install: function install(Vue) {
  16631. v_x_e_table.reg('menu');
  16632. packages_table.mixins.push(menu_src_mixin);
  16633. Vue.component(src_panel.name, src_panel);
  16634. }
  16635. };
  16636. /* harmony default export */ var packages_menu = (Menu);
  16637. // CONCATENATED MODULE: ./packages/edit/src/mixin.js
  16638. /* harmony default export */ var edit_src_mixin = ({
  16639. methods: {
  16640. /**
  16641. * 往表格中插入临时数据
  16642. *
  16643. * @param {*} records
  16644. */
  16645. _insert: function _insert(records) {
  16646. return this.insertAt(records);
  16647. },
  16648. /**
  16649. * 往表格指定行中插入临时数据
  16650. * 如果 row 为空则从插入到顶部
  16651. * 如果 row 为 -1 则从插入到底部
  16652. * 如果 row 为有效行则插入到该行的位置
  16653. * @param {Object/Array} records 新的数据
  16654. * @param {Row} row 指定行
  16655. */
  16656. _insertAt: function _insertAt(records, row) {
  16657. var _this = this,
  16658. _editStore$insertList;
  16659. var mergeList = this.mergeList,
  16660. afterFullData = this.afterFullData,
  16661. editStore = this.editStore,
  16662. sYOpts = this.sYOpts,
  16663. scrollYLoad = this.scrollYLoad,
  16664. tableFullData = this.tableFullData,
  16665. treeConfig = this.treeConfig;
  16666. if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(records)) {
  16667. records = [records];
  16668. }
  16669. var newRecords = records.map(function (record) {
  16670. return _this.defineField(Object.assign({}, record));
  16671. });
  16672. if (!row) {
  16673. afterFullData.unshift.apply(afterFullData, _toConsumableArray(newRecords));
  16674. tableFullData.unshift.apply(tableFullData, _toConsumableArray(newRecords)); // 刷新单元格合并
  16675. mergeList.forEach(function (mergeItem) {
  16676. var mergeRowIndex = mergeItem.row;
  16677. if (mergeRowIndex > 0) {
  16678. mergeItem.row = mergeRowIndex + newRecords.length;
  16679. }
  16680. });
  16681. } else {
  16682. if (row === -1) {
  16683. afterFullData.push.apply(afterFullData, _toConsumableArray(newRecords));
  16684. tableFullData.push.apply(tableFullData, _toConsumableArray(newRecords)); // 刷新单元格合并
  16685. mergeList.forEach(function (mergeItem) {
  16686. var mergeRowIndex = mergeItem.row,
  16687. mergeRowspan = mergeItem.rowspan;
  16688. if (mergeRowIndex + mergeRowspan > afterFullData.length) {
  16689. mergeItem.rowspan = mergeRowspan + newRecords.length;
  16690. }
  16691. });
  16692. } else {
  16693. if (treeConfig) {
  16694. throw new Error(UtilTools.getLog('vxe.error.noTree', ['insert']));
  16695. }
  16696. var afIndex = afterFullData.indexOf(row);
  16697. if (afIndex === -1) {
  16698. throw new Error(UtilTools.error('vxe.error.unableInsert'));
  16699. }
  16700. afterFullData.splice.apply(afterFullData, [afIndex, 0].concat(_toConsumableArray(newRecords)));
  16701. tableFullData.splice.apply(tableFullData, [tableFullData.indexOf(row), 0].concat(_toConsumableArray(newRecords))); // 刷新单元格合并
  16702. mergeList.forEach(function (mergeItem) {
  16703. var mergeRowIndex = mergeItem.row,
  16704. mergeRowspan = mergeItem.rowspan;
  16705. if (mergeRowIndex > afIndex) {
  16706. mergeItem.row = mergeRowIndex + newRecords.length;
  16707. } else if (mergeRowIndex + mergeRowspan > afIndex) {
  16708. mergeItem.rowspan = mergeRowspan + newRecords.length;
  16709. }
  16710. });
  16711. }
  16712. }
  16713. (_editStore$insertList = editStore.insertList).unshift.apply(_editStore$insertList, _toConsumableArray(newRecords));
  16714. this.scrollYLoad = !treeConfig && sYOpts.gt > -1 && sYOpts.gt < tableFullData.length;
  16715. this.handleTableData();
  16716. this.updateFooter();
  16717. this.updateCache();
  16718. this.checkSelectionStatus();
  16719. if (scrollYLoad) {
  16720. this.updateScrollYSpace();
  16721. }
  16722. return this.$nextTick().then(function () {
  16723. _this.updateCellAreas();
  16724. return _this.recalculate();
  16725. }).then(function () {
  16726. return {
  16727. row: newRecords.length ? newRecords[newRecords.length - 1] : null,
  16728. rows: newRecords
  16729. };
  16730. });
  16731. },
  16732. /**
  16733. * 删除指定行数据
  16734. * 如果传 row 则删除一行
  16735. * 如果传 rows 则删除多行
  16736. * 如果为空则删除所有
  16737. */
  16738. _remove: function _remove(rows) {
  16739. var _this2 = this;
  16740. var afterFullData = this.afterFullData,
  16741. tableFullData = this.tableFullData,
  16742. treeConfig = this.treeConfig,
  16743. mergeList = this.mergeList,
  16744. editStore = this.editStore,
  16745. checkboxOpts = this.checkboxOpts,
  16746. selection = this.selection,
  16747. isInsertByRow = this.isInsertByRow,
  16748. sYOpts = this.sYOpts,
  16749. scrollYLoad = this.scrollYLoad;
  16750. var actived = editStore.actived,
  16751. removeList = editStore.removeList,
  16752. insertList = editStore.insertList;
  16753. var property = checkboxOpts.checkField;
  16754. var rest = [];
  16755. if (!rows) {
  16756. rows = tableFullData;
  16757. } else if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(rows)) {
  16758. rows = [rows];
  16759. } // 如果是新增,则保存记录
  16760. rows.forEach(function (row) {
  16761. if (!isInsertByRow(row)) {
  16762. removeList.push(row);
  16763. }
  16764. }); // 如果绑定了多选属性,则更新状态
  16765. if (!property) {
  16766. rows.forEach(function (row) {
  16767. var sIndex = selection.indexOf(row);
  16768. if (sIndex > -1) {
  16769. selection.splice(sIndex, 1);
  16770. }
  16771. });
  16772. } // 从数据源中移除
  16773. if (tableFullData === rows) {
  16774. rows = rest = tableFullData.slice(0);
  16775. this.tableFullData = [];
  16776. this.afterFullData = [];
  16777. this.clearMergeCells();
  16778. } else {
  16779. rows.forEach(function (row) {
  16780. var tfIndex = tableFullData.indexOf(row);
  16781. if (tfIndex > -1) {
  16782. var rItems = tableFullData.splice(tfIndex, 1);
  16783. rest.push(rItems[0]);
  16784. }
  16785. var afIndex = afterFullData.indexOf(row);
  16786. if (afIndex > -1) {
  16787. // 刷新单元格合并
  16788. mergeList.forEach(function (mergeItem) {
  16789. var mergeRowIndex = mergeItem.row,
  16790. mergeRowspan = mergeItem.rowspan;
  16791. if (mergeRowIndex > afIndex) {
  16792. mergeItem.row = mergeRowIndex - 1;
  16793. } else if (mergeRowIndex + mergeRowspan > afIndex) {
  16794. mergeItem.rowspan = mergeRowspan - 1;
  16795. }
  16796. });
  16797. afterFullData.splice(afIndex, 1);
  16798. }
  16799. });
  16800. } // 如果当前行被激活编辑,则清除激活状态
  16801. if (actived.row && rows.indexOf(actived.row) > -1) {
  16802. this.clearActived();
  16803. } // 从新增中移除已删除的数据
  16804. rows.forEach(function (row) {
  16805. var iIndex = insertList.indexOf(row);
  16806. if (iIndex > -1) {
  16807. insertList.splice(iIndex, 1);
  16808. }
  16809. });
  16810. this.scrollYLoad = !treeConfig && sYOpts.gt > -1 && sYOpts.gt < tableFullData.length;
  16811. this.handleTableData();
  16812. this.updateFooter();
  16813. this.updateCache();
  16814. this.checkSelectionStatus();
  16815. if (scrollYLoad) {
  16816. this.updateScrollYSpace();
  16817. }
  16818. return this.$nextTick().then(function () {
  16819. _this2.updateCellAreas();
  16820. return _this2.recalculate();
  16821. }).then(function () {
  16822. return {
  16823. row: rest.length ? rest[rest.length - 1] : null,
  16824. rows: rest
  16825. };
  16826. });
  16827. },
  16828. /**
  16829. * 删除复选框选中的数据
  16830. */
  16831. _removeCheckboxRow: function _removeCheckboxRow() {
  16832. var _this3 = this;
  16833. return this.remove(this.getCheckboxRecords()).then(function (params) {
  16834. _this3.clearCheckboxRow();
  16835. return params;
  16836. });
  16837. },
  16838. /**
  16839. * 删除单选框选中的数据
  16840. */
  16841. _removeRadioRow: function _removeRadioRow() {
  16842. var _this4 = this;
  16843. var radioRecord = this.getRadioRecord();
  16844. return this.remove(radioRecord || []).then(function (params) {
  16845. _this4.clearRadioRow();
  16846. return params;
  16847. });
  16848. },
  16849. /**
  16850. * 删除当前行选中的数据
  16851. */
  16852. _removeCurrentRow: function _removeCurrentRow() {
  16853. var _this5 = this;
  16854. var currentRecord = this.getCurrentRecord();
  16855. return this.remove(currentRecord || []).then(function (params) {
  16856. _this5.clearCurrentRow();
  16857. return params;
  16858. });
  16859. },
  16860. /**
  16861. * 获取表格数据集,包含新增、删除、修改
  16862. */
  16863. _getRecordset: function _getRecordset() {
  16864. return {
  16865. insertRecords: this.getInsertRecords(),
  16866. removeRecords: this.getRemoveRecords(),
  16867. updateRecords: this.getUpdateRecords()
  16868. };
  16869. },
  16870. /**
  16871. * 获取新增的临时数据
  16872. */
  16873. _getInsertRecords: function _getInsertRecords() {
  16874. var insertList = this.editStore.insertList;
  16875. var insertRecords = [];
  16876. if (insertList.length) {
  16877. this.tableFullData.forEach(function (row) {
  16878. if (insertList.indexOf(row) > -1) {
  16879. insertRecords.push(row);
  16880. }
  16881. });
  16882. }
  16883. return insertRecords;
  16884. },
  16885. /**
  16886. * 获取已删除的数据
  16887. */
  16888. _getRemoveRecords: function _getRemoveRecords() {
  16889. return this.editStore.removeList;
  16890. },
  16891. /**
  16892. * 获取更新数据
  16893. * 只精准匹配 row 的更改
  16894. * 如果是树表格,子节点更改状态不会影响父节点的更新状态
  16895. */
  16896. _getUpdateRecords: function _getUpdateRecords() {
  16897. var keepSource = this.keepSource,
  16898. tableFullData = this.tableFullData,
  16899. isUpdateByRow = this.isUpdateByRow,
  16900. treeConfig = this.treeConfig,
  16901. treeOpts = this.treeOpts,
  16902. editStore = this.editStore;
  16903. if (keepSource) {
  16904. var actived = editStore.actived;
  16905. var row = actived.row,
  16906. column = actived.column;
  16907. if (row || column) {
  16908. this.clearActived();
  16909. }
  16910. if (treeConfig) {
  16911. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.filterTree(tableFullData, function (row) {
  16912. return isUpdateByRow(row);
  16913. }, treeOpts);
  16914. }
  16915. return tableFullData.filter(function (row) {
  16916. return isUpdateByRow(row);
  16917. });
  16918. }
  16919. return [];
  16920. },
  16921. /**
  16922. * 处理激活编辑
  16923. */
  16924. handleActived: function handleActived(params, evnt) {
  16925. var _this6 = this;
  16926. var editStore = this.editStore,
  16927. editOpts = this.editOpts,
  16928. tableColumn = this.tableColumn,
  16929. mouseConfig = this.mouseConfig;
  16930. var mode = editOpts.mode,
  16931. activeMethod = editOpts.activeMethod;
  16932. var actived = editStore.actived;
  16933. var row = params.row,
  16934. column = params.column;
  16935. var editRender = column.editRender;
  16936. var cell = params.cell = params.cell || this.getCell(row, column);
  16937. if (isEnableConf(editRender) && cell) {
  16938. if (actived.row !== row || (mode === 'cell' ? actived.column !== column : false)) {
  16939. // 判断是否禁用编辑
  16940. var type = 'edit-disabled';
  16941. if (!activeMethod || activeMethod(params)) {
  16942. if (mouseConfig) {
  16943. this.clearSelected(evnt);
  16944. this.clearCellAreas(evnt);
  16945. this.clearCopyCellArea(evnt);
  16946. }
  16947. this.closeTooltip();
  16948. this.clearActived(evnt);
  16949. type = 'edit-actived';
  16950. column.renderHeight = cell.offsetHeight;
  16951. actived.args = params;
  16952. actived.row = row;
  16953. actived.column = column;
  16954. if (mode === 'row') {
  16955. tableColumn.forEach(function (column) {
  16956. return _this6._getColumnModel(row, column);
  16957. });
  16958. } else {
  16959. this._getColumnModel(row, column);
  16960. }
  16961. this.$nextTick(function () {
  16962. _this6.handleFocus(params, evnt);
  16963. });
  16964. }
  16965. this.emitEvent(type, {
  16966. row: row,
  16967. rowIndex: this.getRowIndex(row),
  16968. $rowIndex: this.getVMRowIndex(row),
  16969. column: column,
  16970. columnIndex: this.getColumnIndex(column),
  16971. $columnIndex: this.getVMColumnIndex(column)
  16972. }, evnt);
  16973. } else {
  16974. var oldColumn = actived.column;
  16975. if (mouseConfig) {
  16976. this.clearSelected(evnt);
  16977. this.clearCellAreas(evnt);
  16978. this.clearCopyCellArea(evnt);
  16979. }
  16980. if (oldColumn !== column) {
  16981. var oldModel = oldColumn.model;
  16982. if (oldModel.update) {
  16983. UtilTools.setCellValue(row, oldColumn, oldModel.value);
  16984. }
  16985. this.clearValidate();
  16986. }
  16987. column.renderHeight = cell.offsetHeight;
  16988. actived.args = params;
  16989. actived.column = column;
  16990. setTimeout(function () {
  16991. _this6.handleFocus(params, evnt);
  16992. });
  16993. }
  16994. this.focus();
  16995. }
  16996. return this.$nextTick();
  16997. },
  16998. _getColumnModel: function _getColumnModel(row, column) {
  16999. var model = column.model,
  17000. editRender = column.editRender;
  17001. if (editRender) {
  17002. model.value = UtilTools.getCellValue(row, column);
  17003. model.update = false;
  17004. }
  17005. },
  17006. _setColumnModel: function _setColumnModel(row, column) {
  17007. var model = column.model,
  17008. editRender = column.editRender;
  17009. if (editRender && model.update) {
  17010. UtilTools.setCellValue(row, column, model.value);
  17011. model.update = false;
  17012. model.value = null;
  17013. }
  17014. },
  17015. /**
  17016. * 清除激活的编辑
  17017. */
  17018. _clearActived: function _clearActived(evnt) {
  17019. var _this7 = this;
  17020. var tableColumn = this.tableColumn,
  17021. editStore = this.editStore,
  17022. editOpts = this.editOpts;
  17023. var actived = editStore.actived;
  17024. var row = actived.row,
  17025. column = actived.column;
  17026. if (row || column) {
  17027. if (editOpts.mode === 'row') {
  17028. tableColumn.forEach(function (column) {
  17029. return _this7._setColumnModel(row, column);
  17030. });
  17031. } else {
  17032. this._setColumnModel(row, column);
  17033. }
  17034. actived.args = null;
  17035. actived.row = null;
  17036. actived.column = null;
  17037. this.updateFooter();
  17038. this.emitEvent('edit-closed', {
  17039. row: row,
  17040. rowIndex: this.getRowIndex(row),
  17041. $rowIndex: this.getVMRowIndex(row),
  17042. column: column,
  17043. columnIndex: this.getColumnIndex(column),
  17044. $columnIndex: this.getVMColumnIndex(column)
  17045. }, evnt);
  17046. }
  17047. return (v_x_e_table._valid ? this.clearValidate() : this.$nextTick()).then(this.recalculate);
  17048. },
  17049. _getActiveRecord: function _getActiveRecord() {
  17050. var $el = this.$el,
  17051. editStore = this.editStore,
  17052. afterFullData = this.afterFullData;
  17053. var actived = editStore.actived;
  17054. var args = actived.args,
  17055. row = actived.row;
  17056. if (args && afterFullData.indexOf(row) > -1 && $el.querySelectorAll('.vxe-body--column.col--actived').length) {
  17057. return Object.assign({}, args);
  17058. }
  17059. return null;
  17060. },
  17061. /**
  17062. * 判断行是否为激活编辑状态
  17063. * @param {Row} row 行对象
  17064. */
  17065. _isActiveByRow: function _isActiveByRow(row) {
  17066. return this.editStore.actived.row === row;
  17067. },
  17068. /**
  17069. * 处理聚焦
  17070. */
  17071. handleFocus: function handleFocus(params) {
  17072. var row = params.row,
  17073. column = params.column,
  17074. cell = params.cell;
  17075. var editRender = column.editRender;
  17076. if (isEnableConf(editRender)) {
  17077. var compRender = v_x_e_table.renderer.get(editRender.name);
  17078. var autofocus = editRender.autofocus,
  17079. autoselect = editRender.autoselect;
  17080. var inputElem; // 如果指定了聚焦 class
  17081. if (autofocus) {
  17082. inputElem = cell.querySelector(autofocus);
  17083. } // 渲染器的聚焦处理
  17084. if (!inputElem && compRender && compRender.autofocus) {
  17085. inputElem = cell.querySelector(compRender.autofocus);
  17086. }
  17087. if (inputElem) {
  17088. inputElem.focus();
  17089. if (autoselect) {
  17090. inputElem.select();
  17091. } else {
  17092. // 保持一致行为,光标移到末端
  17093. if (DomTools.browse.msie) {
  17094. var textRange = inputElem.createTextRange();
  17095. textRange.collapse(false);
  17096. textRange.select();
  17097. }
  17098. }
  17099. } else {
  17100. // 显示到可视区中
  17101. this.scrollToRow(row, column);
  17102. }
  17103. }
  17104. },
  17105. /**
  17106. * 激活行编辑
  17107. */
  17108. _setActiveRow: function _setActiveRow(row) {
  17109. return this.setActiveCell(row, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.find(this.visibleColumn, function (column) {
  17110. return isEnableConf(column.editRender);
  17111. }));
  17112. },
  17113. /**
  17114. * 激活单元格编辑
  17115. */
  17116. _setActiveCell: function _setActiveCell(row, fieldOrColumn) {
  17117. var _this8 = this;
  17118. var column = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isString(fieldOrColumn) ? this.getColumnByField(fieldOrColumn) : fieldOrColumn;
  17119. if (row && column && isEnableConf(column.editRender)) {
  17120. return this.scrollToRow(row, true).then(function () {
  17121. var cell = _this8.getCell(row, column);
  17122. if (cell) {
  17123. _this8.handleActived({
  17124. row: row,
  17125. rowIndex: _this8.getRowIndex(row),
  17126. column: column,
  17127. columnIndex: _this8.getColumnIndex(column),
  17128. cell: cell,
  17129. $table: _this8
  17130. });
  17131. _this8.lastCallTime = Date.now();
  17132. }
  17133. });
  17134. }
  17135. return this.$nextTick();
  17136. },
  17137. /**
  17138. * 只对 trigger=dblclick 有效,选中单元格
  17139. */
  17140. _setSelectCell: function _setSelectCell(row, fieldOrColumn) {
  17141. var tableData = this.tableData,
  17142. editOpts = this.editOpts,
  17143. visibleColumn = this.visibleColumn;
  17144. var column = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isString(fieldOrColumn) ? this.getColumnByField(fieldOrColumn) : fieldOrColumn;
  17145. if (row && column && editOpts.trigger !== 'manual') {
  17146. var rowIndex = tableData.indexOf(row);
  17147. if (rowIndex > -1) {
  17148. var cell = this.getCell(row, column);
  17149. var params = {
  17150. row: row,
  17151. rowIndex: rowIndex,
  17152. column: column,
  17153. columnIndex: visibleColumn.indexOf(column),
  17154. cell: cell
  17155. };
  17156. this.handleSelected(params, {});
  17157. }
  17158. }
  17159. return this.$nextTick();
  17160. },
  17161. /**
  17162. * 处理选中源
  17163. */
  17164. handleSelected: function handleSelected(params, evnt) {
  17165. var _this9 = this;
  17166. var mouseConfig = this.mouseConfig,
  17167. mouseOpts = this.mouseOpts,
  17168. editOpts = this.editOpts,
  17169. editStore = this.editStore;
  17170. var actived = editStore.actived,
  17171. selected = editStore.selected;
  17172. var row = params.row,
  17173. column = params.column;
  17174. var isMouseSelected = mouseConfig && mouseOpts.selected;
  17175. var selectMethod = function selectMethod() {
  17176. if (isMouseSelected && (selected.row !== row || selected.column !== column)) {
  17177. if (actived.row !== row || (editOpts.mode === 'cell' ? actived.column !== column : false)) {
  17178. _this9.clearActived(evnt);
  17179. _this9.clearSelected(evnt);
  17180. _this9.clearCellAreas(evnt);
  17181. _this9.clearCopyCellArea(evnt);
  17182. selected.args = params;
  17183. selected.row = row;
  17184. selected.column = column;
  17185. if (isMouseSelected) {
  17186. _this9.addColSdCls();
  17187. }
  17188. _this9.focus();
  17189. if (evnt) {
  17190. _this9.emitEvent('cell-selected', params, evnt);
  17191. }
  17192. }
  17193. }
  17194. return _this9.$nextTick();
  17195. };
  17196. return selectMethod();
  17197. },
  17198. /**
  17199. * 获取选中的单元格
  17200. */
  17201. _getSelectedCell: function _getSelectedCell() {
  17202. var _this$editStore$selec = this.editStore.selected,
  17203. args = _this$editStore$selec.args,
  17204. column = _this$editStore$selec.column;
  17205. if (args && column) {
  17206. return Object.assign({}, args);
  17207. }
  17208. return null;
  17209. },
  17210. /**
  17211. * 清除所选中源状态
  17212. */
  17213. _clearSelected: function _clearSelected() {
  17214. var selected = this.editStore.selected;
  17215. selected.row = null;
  17216. selected.column = null;
  17217. this.reColTitleSdCls();
  17218. this.reColSdCls();
  17219. return this.$nextTick();
  17220. },
  17221. reColTitleSdCls: function reColTitleSdCls() {
  17222. var headerElem = this.elemStore['main-header-list'];
  17223. if (headerElem) {
  17224. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.arrayEach(headerElem.querySelectorAll('.col--title-selected'), function (elem) {
  17225. return DomTools.removeClass(elem, 'col--title-selected');
  17226. });
  17227. }
  17228. },
  17229. reColSdCls: function reColSdCls() {
  17230. var cell = this.$el.querySelector('.col--selected');
  17231. if (cell) {
  17232. DomTools.removeClass(cell, 'col--selected');
  17233. }
  17234. },
  17235. addColSdCls: function addColSdCls() {
  17236. var selected = this.editStore.selected;
  17237. var row = selected.row,
  17238. column = selected.column;
  17239. this.reColSdCls();
  17240. if (row && column) {
  17241. var cell = this.getCell(row, column);
  17242. if (cell) {
  17243. DomTools.addClass(cell, 'col--selected');
  17244. }
  17245. }
  17246. }
  17247. }
  17248. });
  17249. // CONCATENATED MODULE: ./packages/edit/index.js
  17250. var Edit = {
  17251. install: function install() {
  17252. v_x_e_table.reg('edit');
  17253. packages_table.mixins.push(edit_src_mixin);
  17254. }
  17255. };
  17256. /* harmony default export */ var edit = (Edit);
  17257. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
  17258. function _arrayWithHoles(arr) {
  17259. if (Array.isArray(arr)) return arr;
  17260. }
  17261. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
  17262. function _iterableToArrayLimit(arr, i) {
  17263. if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
  17264. var _arr = [];
  17265. var _n = true;
  17266. var _d = false;
  17267. var _e = undefined;
  17268. try {
  17269. for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
  17270. _arr.push(_s.value);
  17271. if (i && _arr.length === i) break;
  17272. }
  17273. } catch (err) {
  17274. _d = true;
  17275. _e = err;
  17276. } finally {
  17277. try {
  17278. if (!_n && _i["return"] != null) _i["return"]();
  17279. } finally {
  17280. if (_d) throw _e;
  17281. }
  17282. }
  17283. return _arr;
  17284. }
  17285. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
  17286. function _nonIterableRest() {
  17287. throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  17288. }
  17289. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js
  17290. function _slicedToArray(arr, i) {
  17291. return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
  17292. }
  17293. // CONCATENATED MODULE: ./packages/modal/src/modal.js
  17294. var allActivedModals = [];
  17295. var msgQueue = [];
  17296. /* harmony default export */ var modal = ({
  17297. name: 'VxeModal',
  17298. mixins: [size],
  17299. props: {
  17300. value: Boolean,
  17301. id: String,
  17302. type: {
  17303. type: String,
  17304. default: 'modal'
  17305. },
  17306. loading: {
  17307. type: Boolean,
  17308. default: null
  17309. },
  17310. status: String,
  17311. iconStatus: String,
  17312. className: String,
  17313. top: {
  17314. type: [Number, String],
  17315. default: function _default() {
  17316. return conf.modal.top;
  17317. }
  17318. },
  17319. position: [String, Object],
  17320. title: String,
  17321. duration: {
  17322. type: [Number, String],
  17323. default: function _default() {
  17324. return conf.modal.duration;
  17325. }
  17326. },
  17327. message: [String, Function],
  17328. cancelButtonText: {
  17329. type: String,
  17330. default: function _default() {
  17331. return conf.modal.cancelButtonText;
  17332. }
  17333. },
  17334. confirmButtonText: {
  17335. type: String,
  17336. default: function _default() {
  17337. return conf.modal.confirmButtonText;
  17338. }
  17339. },
  17340. lockView: {
  17341. type: Boolean,
  17342. default: function _default() {
  17343. return conf.modal.lockView;
  17344. }
  17345. },
  17346. lockScroll: Boolean,
  17347. mask: {
  17348. type: Boolean,
  17349. default: function _default() {
  17350. return conf.modal.mask;
  17351. }
  17352. },
  17353. maskClosable: {
  17354. type: Boolean,
  17355. default: function _default() {
  17356. return conf.modal.maskClosable;
  17357. }
  17358. },
  17359. escClosable: {
  17360. type: Boolean,
  17361. default: function _default() {
  17362. return conf.modal.escClosable;
  17363. }
  17364. },
  17365. resize: {
  17366. type: Boolean,
  17367. default: function _default() {
  17368. return conf.modal.resize;
  17369. }
  17370. },
  17371. showHeader: {
  17372. type: Boolean,
  17373. default: function _default() {
  17374. return conf.modal.showHeader;
  17375. }
  17376. },
  17377. showFooter: {
  17378. type: Boolean,
  17379. default: function _default() {
  17380. return conf.modal.showFooter;
  17381. }
  17382. },
  17383. showZoom: {
  17384. type: Boolean,
  17385. default: null
  17386. },
  17387. dblclickZoom: {
  17388. type: Boolean,
  17389. default: function _default() {
  17390. return conf.modal.dblclickZoom;
  17391. }
  17392. },
  17393. width: [Number, String],
  17394. height: [Number, String],
  17395. minWidth: {
  17396. type: [Number, String],
  17397. default: function _default() {
  17398. return conf.modal.minWidth;
  17399. }
  17400. },
  17401. minHeight: {
  17402. type: [Number, String],
  17403. default: function _default() {
  17404. return conf.modal.minHeight;
  17405. }
  17406. },
  17407. zIndex: Number,
  17408. marginSize: {
  17409. type: [Number, String],
  17410. default: conf.modal.marginSize
  17411. },
  17412. fullscreen: Boolean,
  17413. remember: {
  17414. type: Boolean,
  17415. default: function _default() {
  17416. return conf.modal.remember;
  17417. }
  17418. },
  17419. destroyOnClose: {
  17420. type: Boolean,
  17421. default: function _default() {
  17422. return conf.modal.destroyOnClose;
  17423. }
  17424. },
  17425. showTitleOverflow: {
  17426. type: Boolean,
  17427. default: function _default() {
  17428. return conf.modal.showTitleOverflow;
  17429. }
  17430. },
  17431. transfer: {
  17432. type: Boolean,
  17433. default: function _default() {
  17434. return conf.modal.transfer;
  17435. }
  17436. },
  17437. storage: {
  17438. type: Boolean,
  17439. default: function _default() {
  17440. return conf.modal.storage;
  17441. }
  17442. },
  17443. storageKey: {
  17444. type: String,
  17445. default: function _default() {
  17446. return conf.modal.storageKey;
  17447. }
  17448. },
  17449. animat: {
  17450. type: Boolean,
  17451. default: function _default() {
  17452. return conf.modal.animat;
  17453. }
  17454. },
  17455. size: {
  17456. type: String,
  17457. default: function _default() {
  17458. return conf.modal.size || conf.size;
  17459. }
  17460. },
  17461. beforeHideMethod: {
  17462. type: Function,
  17463. default: function _default() {
  17464. return conf.modal.beforeHideMethod;
  17465. }
  17466. },
  17467. slots: Object,
  17468. events: Object
  17469. },
  17470. data: function data() {
  17471. return {
  17472. inited: false,
  17473. visible: false,
  17474. contentVisible: false,
  17475. modalTop: 0,
  17476. modalZindex: 0,
  17477. zoomLocat: null,
  17478. firstOpen: false
  17479. };
  17480. },
  17481. computed: {
  17482. isMsg: function isMsg() {
  17483. return this.type === 'message';
  17484. }
  17485. },
  17486. watch: {
  17487. width: function width() {
  17488. this.recalculate();
  17489. },
  17490. height: function height() {
  17491. this.recalculate();
  17492. },
  17493. value: function value(visible) {
  17494. this[visible ? 'open' : 'close']();
  17495. }
  17496. },
  17497. created: function created() {
  17498. if (this.storage && !this.id) {
  17499. UtilTools.error('vxe.error.reqProp', ['modal.id']);
  17500. }
  17501. },
  17502. mounted: function mounted() {
  17503. var $listeners = this.$listeners,
  17504. _this$events = this.events,
  17505. events = _this$events === void 0 ? {} : _this$events;
  17506. if (this.value) {
  17507. this.open();
  17508. }
  17509. this.recalculate();
  17510. if (this.escClosable) {
  17511. GlobalEvent.on(this, 'keydown', this.handleGlobalKeydownEvent);
  17512. } // 触发 inserted 事件
  17513. var type = 'inserted';
  17514. var params = {
  17515. type: type,
  17516. $modal: this,
  17517. $event: {
  17518. type: type
  17519. }
  17520. };
  17521. if ($listeners.inserted) {
  17522. this.$emit('inserted', params);
  17523. } else if (events.inserted) {
  17524. events.inserted.call(this, params);
  17525. }
  17526. },
  17527. beforeDestroy: function beforeDestroy() {
  17528. var $el = this.$el;
  17529. GlobalEvent.off(this, 'keydown');
  17530. this.removeMsgQueue();
  17531. if ($el.parentNode === document.body) {
  17532. $el.parentNode.removeChild($el);
  17533. }
  17534. },
  17535. render: function render(h) {
  17536. var _ref,
  17537. _this = this;
  17538. var $scopedSlots = this.$scopedSlots,
  17539. _this$slots = this.slots,
  17540. slots = _this$slots === void 0 ? {} : _this$slots,
  17541. inited = this.inited,
  17542. vSize = this.vSize,
  17543. className = this.className,
  17544. type = this.type,
  17545. resize = this.resize,
  17546. showZoom = this.showZoom,
  17547. animat = this.animat,
  17548. loading = this.loading,
  17549. status = this.status,
  17550. iconStatus = this.iconStatus,
  17551. showFooter = this.showFooter,
  17552. zoomLocat = this.zoomLocat,
  17553. modalTop = this.modalTop,
  17554. dblclickZoom = this.dblclickZoom,
  17555. contentVisible = this.contentVisible,
  17556. visible = this.visible,
  17557. title = this.title,
  17558. message = this.message,
  17559. lockScroll = this.lockScroll,
  17560. lockView = this.lockView,
  17561. mask = this.mask,
  17562. isMsg = this.isMsg,
  17563. showTitleOverflow = this.showTitleOverflow,
  17564. destroyOnClose = this.destroyOnClose;
  17565. var defaultSlot = $scopedSlots.default || slots.default;
  17566. var footerSlot = $scopedSlots.footer || slots.footer;
  17567. var headerSlot = $scopedSlots.header || slots.header;
  17568. var titleSlot = $scopedSlots.title || slots.title;
  17569. var headerOns = {
  17570. mousedown: this.mousedownEvent
  17571. };
  17572. if (showZoom && dblclickZoom && type === 'modal') {
  17573. headerOns.dblclick = this.toggleZoomEvent;
  17574. }
  17575. return h('div', {
  17576. 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)],
  17577. style: {
  17578. zIndex: this.modalZindex,
  17579. top: modalTop ? "".concat(modalTop, "px") : null
  17580. },
  17581. on: {
  17582. click: this.selfClickEvent
  17583. }
  17584. }, [h('div', {
  17585. class: 'vxe-modal--box',
  17586. on: {
  17587. mousedown: this.boxMousedownEvent
  17588. },
  17589. ref: 'modalBox'
  17590. }, [this.showHeader ? h('div', {
  17591. class: ['vxe-modal--header', !isMsg && showTitleOverflow ? 'is--ellipsis' : ''],
  17592. on: headerOns
  17593. }, headerSlot ? !inited || destroyOnClose && !visible ? [] : headerSlot.call(this, {
  17594. $modal: this
  17595. }, h) : [titleSlot ? titleSlot.call(this, {
  17596. $modal: this
  17597. }, h) : h('span', {
  17598. class: 'vxe-modal--title'
  17599. }, title ? UtilTools.getFuncText(title) : conf.i18n('vxe.alert.title')), showZoom ? h('i', {
  17600. class: ['vxe-modal--zoom-btn', 'trigger--btn', zoomLocat ? conf.icon.MODAL_ZOOM_OUT : conf.icon.MODAL_ZOOM_IN],
  17601. attrs: {
  17602. title: conf.i18n("vxe.modal.zoom".concat(zoomLocat ? 'Out' : 'In'))
  17603. },
  17604. on: {
  17605. click: this.toggleZoomEvent
  17606. }
  17607. }) : null, h('i', {
  17608. class: ['vxe-modal--close-btn', 'trigger--btn', conf.icon.MODAL_CLOSE],
  17609. attrs: {
  17610. title: conf.i18n('vxe.modal.close')
  17611. },
  17612. on: {
  17613. click: this.closeEvent
  17614. }
  17615. })]) : null, h('div', {
  17616. class: 'vxe-modal--body'
  17617. }, [status ? h('div', {
  17618. class: 'vxe-modal--status-wrapper'
  17619. }, [h('i', {
  17620. class: ['vxe-modal--status-icon', iconStatus || conf.icon["MODAL_".concat(status).toLocaleUpperCase()]]
  17621. })]) : null, h('div', {
  17622. class: 'vxe-modal--content'
  17623. }, defaultSlot ? !inited || destroyOnClose && !visible ? [] : defaultSlot.call(this, {
  17624. $modal: this
  17625. }, h) : UtilTools.getFuncText(message)), !isMsg ? h('div', {
  17626. class: ['vxe-loading', {
  17627. 'is--visible': loading
  17628. }]
  17629. }, [h('div', {
  17630. class: 'vxe-loading--spinner'
  17631. })]) : null]), showFooter ? h('div', {
  17632. class: 'vxe-modal--footer'
  17633. }, footerSlot ? !inited || destroyOnClose && !visible ? [] : footerSlot.call(this, {
  17634. $modal: this
  17635. }, h) : [type === 'confirm' ? h('vxe-button', {
  17636. ref: 'cancelBtn',
  17637. on: {
  17638. click: this.cancelEvent
  17639. }
  17640. }, this.cancelButtonText || conf.i18n('vxe.button.cancel')) : null, h('vxe-button', {
  17641. ref: 'confirmBtn',
  17642. props: {
  17643. status: 'primary'
  17644. },
  17645. on: {
  17646. click: this.confirmEvent
  17647. }
  17648. }, this.confirmButtonText || conf.i18n('vxe.button.confirm'))]) : null, !isMsg && resize ? h('span', {
  17649. class: 'vxe-modal--resize'
  17650. }, ['wl', 'wr', 'swst', 'sest', 'st', 'swlb', 'selb', 'sb'].map(function (type) {
  17651. return h('span', {
  17652. class: "".concat(type, "-resize"),
  17653. attrs: {
  17654. type: type
  17655. },
  17656. on: {
  17657. mousedown: _this.dragEvent
  17658. }
  17659. });
  17660. })) : null])]);
  17661. },
  17662. methods: {
  17663. recalculate: function recalculate() {
  17664. var width = this.width,
  17665. height = this.height;
  17666. var modalBoxElem = this.getBox();
  17667. modalBoxElem.style.width = width ? isNaN(width) ? width : "".concat(width, "px") : null;
  17668. modalBoxElem.style.height = height ? isNaN(height) ? height : "".concat(height, "px") : null;
  17669. return this.$nextTick();
  17670. },
  17671. selfClickEvent: function selfClickEvent(evnt) {
  17672. if (this.maskClosable && evnt.target === this.$el) {
  17673. var type = 'mask';
  17674. this.close(type);
  17675. }
  17676. },
  17677. updateZindex: function updateZindex() {
  17678. var zIndex = this.zIndex,
  17679. modalZindex = this.modalZindex;
  17680. if (zIndex) {
  17681. this.modalZindex = zIndex;
  17682. } else if (modalZindex < UtilTools.getLastZIndex()) {
  17683. this.modalZindex = UtilTools.nextZIndex();
  17684. }
  17685. },
  17686. closeEvent: function closeEvent(evnt) {
  17687. var type = 'close';
  17688. this.$emit(type, {
  17689. type: type,
  17690. $modal: this,
  17691. $event: evnt
  17692. });
  17693. this.close(type);
  17694. },
  17695. confirmEvent: function confirmEvent(evnt) {
  17696. var type = 'confirm';
  17697. this.$emit(type, {
  17698. type: type,
  17699. $modal: this,
  17700. $event: evnt
  17701. });
  17702. this.close(type);
  17703. },
  17704. cancelEvent: function cancelEvent(evnt) {
  17705. var type = 'cancel';
  17706. this.$emit(type, {
  17707. type: type,
  17708. $modal: this,
  17709. $event: evnt
  17710. });
  17711. this.close(type);
  17712. },
  17713. open: function open() {
  17714. var _this2 = this;
  17715. var $refs = this.$refs,
  17716. _this$events2 = this.events,
  17717. events = _this$events2 === void 0 ? {} : _this$events2,
  17718. inited = this.inited,
  17719. duration = this.duration,
  17720. visible = this.visible,
  17721. isMsg = this.isMsg,
  17722. remember = this.remember,
  17723. showFooter = this.showFooter;
  17724. if (!inited) {
  17725. this.inited = true;
  17726. if (this.transfer) {
  17727. document.body.appendChild(this.$el);
  17728. }
  17729. }
  17730. if (!visible) {
  17731. if (!remember) {
  17732. this.recalculate();
  17733. }
  17734. this.visible = true;
  17735. this.contentVisible = false;
  17736. this.updateZindex();
  17737. allActivedModals.push(this);
  17738. setTimeout(function () {
  17739. _this2.contentVisible = true;
  17740. _this2.$nextTick(function () {
  17741. if (showFooter) {
  17742. var operBtn = $refs.confirmBtn || $refs.cancelBtn;
  17743. if (operBtn) {
  17744. operBtn.focus();
  17745. }
  17746. }
  17747. var type = '';
  17748. var params = {
  17749. type: type,
  17750. $modal: _this2
  17751. };
  17752. if (events.show) {
  17753. events.show.call(_this2, params);
  17754. } else {
  17755. _this2.$emit('input', true);
  17756. _this2.$emit('show', params);
  17757. }
  17758. });
  17759. }, 10);
  17760. if (isMsg) {
  17761. this.addMsgQueue();
  17762. if (duration !== -1) {
  17763. setTimeout(this.close, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(duration));
  17764. }
  17765. } else {
  17766. this.$nextTick(function () {
  17767. var firstOpen = _this2.firstOpen,
  17768. fullscreen = _this2.fullscreen;
  17769. if (!remember || !firstOpen) {
  17770. _this2.updatePosition().then(function () {
  17771. setTimeout(function () {
  17772. return _this2.updatePosition();
  17773. }, 20);
  17774. });
  17775. }
  17776. if (!firstOpen) {
  17777. _this2.firstOpen = true;
  17778. if (_this2.hasPosStorage()) {
  17779. _this2.restorePosStorage();
  17780. } else if (fullscreen) {
  17781. _this2.$nextTick(function () {
  17782. return _this2.maximize();
  17783. });
  17784. }
  17785. }
  17786. });
  17787. }
  17788. }
  17789. },
  17790. addMsgQueue: function addMsgQueue() {
  17791. if (msgQueue.indexOf(this) === -1) {
  17792. msgQueue.push(this);
  17793. }
  17794. this.updateStyle();
  17795. },
  17796. removeMsgQueue: function removeMsgQueue() {
  17797. var _this3 = this;
  17798. if (msgQueue.indexOf(this) > -1) {
  17799. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.remove(msgQueue, function (comp) {
  17800. return comp === _this3;
  17801. });
  17802. }
  17803. this.updateStyle();
  17804. },
  17805. updateStyle: function updateStyle() {
  17806. this.$nextTick(function () {
  17807. var offsetTop = 0;
  17808. msgQueue.forEach(function (comp) {
  17809. offsetTop += external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(comp.top);
  17810. comp.modalTop = offsetTop;
  17811. offsetTop += comp.$refs.modalBox.clientHeight;
  17812. });
  17813. });
  17814. },
  17815. updatePosition: function updatePosition() {
  17816. var _this4 = this;
  17817. return this.$nextTick().then(function () {
  17818. var marginSize = _this4.marginSize,
  17819. position = _this4.position;
  17820. var modalBoxElem = _this4.getBox();
  17821. var clientVisibleWidth = document.documentElement.clientWidth || document.body.clientWidth;
  17822. var clientVisibleHeight = document.documentElement.clientHeight || document.body.clientHeight;
  17823. var isPosCenter = position === 'center';
  17824. var _ref2 = isPosCenter ? {
  17825. top: position,
  17826. left: position
  17827. } : Object.assign({}, position),
  17828. top = _ref2.top,
  17829. left = _ref2.left;
  17830. var topCenter = isPosCenter || top === 'center';
  17831. var leftCenter = isPosCenter || left === 'center';
  17832. var posTop = '';
  17833. var posLeft = '';
  17834. if (left && !leftCenter) {
  17835. posLeft = isNaN(left) ? left : "".concat(left, "px");
  17836. } else {
  17837. posLeft = "".concat(Math.max(marginSize, clientVisibleWidth / 2 - modalBoxElem.offsetWidth / 2), "px");
  17838. }
  17839. if (top && !topCenter) {
  17840. posTop = isNaN(top) ? top : "".concat(top, "px");
  17841. } else {
  17842. posTop = "".concat(Math.max(marginSize, clientVisibleHeight / 2 - modalBoxElem.offsetHeight / 2), "px");
  17843. }
  17844. modalBoxElem.style.top = posTop;
  17845. modalBoxElem.style.left = posLeft;
  17846. });
  17847. },
  17848. close: function close(type) {
  17849. var _this5 = this;
  17850. var _this$events3 = this.events,
  17851. events = _this$events3 === void 0 ? {} : _this$events3,
  17852. remember = this.remember,
  17853. visible = this.visible,
  17854. isMsg = this.isMsg,
  17855. beforeHideMethod = this.beforeHideMethod;
  17856. var params = {
  17857. type: type,
  17858. $modal: this
  17859. };
  17860. if (visible) {
  17861. Promise.resolve(beforeHideMethod ? beforeHideMethod(params) : null).then(function (rest) {
  17862. if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isError(rest)) {
  17863. if (isMsg) {
  17864. _this5.removeMsgQueue();
  17865. }
  17866. _this5.contentVisible = false;
  17867. if (!remember) {
  17868. _this5.zoomLocat = null;
  17869. }
  17870. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.remove(allActivedModals, function (item) {
  17871. return item === _this5;
  17872. });
  17873. setTimeout(function () {
  17874. _this5.visible = false;
  17875. if (events.hide) {
  17876. events.hide.call(_this5, params);
  17877. } else {
  17878. _this5.$emit('input', false);
  17879. _this5.$emit('hide', params);
  17880. }
  17881. }, 200);
  17882. }
  17883. }).catch(function (e) {
  17884. return e;
  17885. });
  17886. }
  17887. },
  17888. handleGlobalKeydownEvent: function handleGlobalKeydownEvent(evnt) {
  17889. var _this6 = this;
  17890. if (evnt.keyCode === 27) {
  17891. var lastModal = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.max(allActivedModals, function (item) {
  17892. return item.modalZindex;
  17893. }); // 多个时,只关掉最上层的窗口
  17894. if (lastModal) {
  17895. setTimeout(function () {
  17896. if (lastModal === _this6 && lastModal.escClosable) {
  17897. _this6.close();
  17898. }
  17899. }, 10);
  17900. }
  17901. }
  17902. },
  17903. getBox: function getBox() {
  17904. return this.$refs.modalBox;
  17905. },
  17906. isMaximized: function isMaximized() {
  17907. return !!this.zoomLocat;
  17908. },
  17909. maximize: function maximize() {
  17910. var _this7 = this;
  17911. return this.$nextTick().then(function () {
  17912. if (!_this7.zoomLocat) {
  17913. var marginSize = _this7.marginSize;
  17914. var modalBoxElem = _this7.getBox();
  17915. var _DomTools$getDomNode = DomTools.getDomNode(),
  17916. visibleHeight = _DomTools$getDomNode.visibleHeight,
  17917. visibleWidth = _DomTools$getDomNode.visibleWidth;
  17918. _this7.zoomLocat = {
  17919. top: modalBoxElem.offsetTop,
  17920. left: modalBoxElem.offsetLeft,
  17921. width: modalBoxElem.offsetWidth + (modalBoxElem.style.width ? 0 : 1),
  17922. height: modalBoxElem.offsetHeight + (modalBoxElem.style.height ? 0 : 1)
  17923. };
  17924. Object.assign(modalBoxElem.style, {
  17925. top: "".concat(marginSize, "px"),
  17926. left: "".concat(marginSize, "px"),
  17927. width: "".concat(visibleWidth - marginSize * 2, "px"),
  17928. height: "".concat(visibleHeight - marginSize * 2, "px")
  17929. });
  17930. _this7.savePosStorage();
  17931. }
  17932. });
  17933. },
  17934. revert: function revert() {
  17935. var _this8 = this;
  17936. return this.$nextTick().then(function () {
  17937. var zoomLocat = _this8.zoomLocat;
  17938. if (zoomLocat) {
  17939. var modalBoxElem = _this8.getBox();
  17940. _this8.zoomLocat = null;
  17941. Object.assign(modalBoxElem.style, {
  17942. top: "".concat(zoomLocat.top, "px"),
  17943. left: "".concat(zoomLocat.left, "px"),
  17944. width: "".concat(zoomLocat.width, "px"),
  17945. height: "".concat(zoomLocat.height, "px")
  17946. });
  17947. _this8.savePosStorage();
  17948. }
  17949. });
  17950. },
  17951. zoom: function zoom() {
  17952. var _this9 = this;
  17953. return this[this.zoomLocat ? 'revert' : 'maximize']().then(function () {
  17954. return _this9.isMaximized();
  17955. });
  17956. },
  17957. toggleZoomEvent: function toggleZoomEvent(evnt) {
  17958. var _this10 = this;
  17959. var $listeners = this.$listeners,
  17960. zoomLocat = this.zoomLocat,
  17961. _this$events4 = this.events,
  17962. events = _this$events4 === void 0 ? {} : _this$events4;
  17963. var params = {
  17964. type: zoomLocat ? 'revert' : 'max',
  17965. $modal: this,
  17966. $event: evnt
  17967. };
  17968. return this.zoom().then(function () {
  17969. if ($listeners.zoom) {
  17970. _this10.$emit('zoom', params);
  17971. } else if (events.zoom) {
  17972. events.zoom.call(_this10, params);
  17973. }
  17974. });
  17975. },
  17976. getPosition: function getPosition() {
  17977. if (!this.isMsg) {
  17978. var modalBoxElem = this.getBox();
  17979. if (modalBoxElem) {
  17980. return {
  17981. top: modalBoxElem.offsetTop,
  17982. left: modalBoxElem.offsetLeft
  17983. };
  17984. }
  17985. }
  17986. return null;
  17987. },
  17988. setPosition: function setPosition(top, left) {
  17989. if (!this.isMsg) {
  17990. var modalBoxElem = this.getBox();
  17991. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNumber(top)) {
  17992. modalBoxElem.style.top = "".concat(top, "px");
  17993. }
  17994. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNumber(left)) {
  17995. modalBoxElem.style.left = "".concat(left, "px");
  17996. }
  17997. }
  17998. return this.$nextTick();
  17999. },
  18000. boxMousedownEvent: function boxMousedownEvent() {
  18001. var modalZindex = this.modalZindex;
  18002. if (allActivedModals.some(function (_vm) {
  18003. return _vm.visible && _vm.modalZindex > modalZindex;
  18004. })) {
  18005. this.updateZindex();
  18006. }
  18007. },
  18008. mousedownEvent: function mousedownEvent(evnt) {
  18009. var _this11 = this;
  18010. var remember = this.remember,
  18011. storage = this.storage,
  18012. marginSize = this.marginSize,
  18013. zoomLocat = this.zoomLocat;
  18014. var modalBoxElem = this.getBox();
  18015. if (!zoomLocat && evnt.button === 0 && !DomTools.getEventTargetNode(evnt, modalBoxElem, 'trigger--btn').flag) {
  18016. evnt.preventDefault();
  18017. var domMousemove = document.onmousemove;
  18018. var domMouseup = document.onmouseup;
  18019. var disX = evnt.clientX - modalBoxElem.offsetLeft;
  18020. var disY = evnt.clientY - modalBoxElem.offsetTop;
  18021. var _DomTools$getDomNode2 = DomTools.getDomNode(),
  18022. visibleHeight = _DomTools$getDomNode2.visibleHeight,
  18023. visibleWidth = _DomTools$getDomNode2.visibleWidth;
  18024. document.onmousemove = function (evnt) {
  18025. evnt.preventDefault();
  18026. var offsetWidth = modalBoxElem.offsetWidth;
  18027. var offsetHeight = modalBoxElem.offsetHeight;
  18028. var minX = marginSize;
  18029. var maxX = visibleWidth - offsetWidth - marginSize - 1;
  18030. var minY = marginSize;
  18031. var maxY = visibleHeight - offsetHeight - marginSize - 1;
  18032. var left = evnt.clientX - disX;
  18033. var top = evnt.clientY - disY;
  18034. if (left > maxX) {
  18035. left = maxX;
  18036. }
  18037. if (left < minX) {
  18038. left = minX;
  18039. }
  18040. if (top > maxY) {
  18041. top = maxY;
  18042. }
  18043. if (top < minY) {
  18044. top = minY;
  18045. }
  18046. modalBoxElem.style.left = "".concat(left, "px");
  18047. modalBoxElem.style.top = "".concat(top, "px");
  18048. };
  18049. document.onmouseup = function () {
  18050. document.onmousemove = domMousemove;
  18051. document.onmouseup = domMouseup;
  18052. if (remember && storage) {
  18053. _this11.$nextTick(function () {
  18054. _this11.savePosStorage();
  18055. });
  18056. }
  18057. };
  18058. }
  18059. },
  18060. dragEvent: function dragEvent(evnt) {
  18061. var _this12 = this;
  18062. evnt.preventDefault();
  18063. var $listeners = this.$listeners,
  18064. marginSize = this.marginSize,
  18065. _this$events5 = this.events,
  18066. events = _this$events5 === void 0 ? {} : _this$events5,
  18067. remember = this.remember,
  18068. storage = this.storage;
  18069. var _DomTools$getDomNode3 = DomTools.getDomNode(),
  18070. visibleHeight = _DomTools$getDomNode3.visibleHeight,
  18071. visibleWidth = _DomTools$getDomNode3.visibleWidth;
  18072. var type = evnt.target.getAttribute('type');
  18073. var minWidth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(this.minWidth);
  18074. var minHeight = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(this.minHeight);
  18075. var maxWidth = visibleWidth;
  18076. var maxHeight = visibleHeight;
  18077. var modalBoxElem = this.getBox();
  18078. var domMousemove = document.onmousemove;
  18079. var domMouseup = document.onmouseup;
  18080. var clientWidth = modalBoxElem.clientWidth;
  18081. var clientHeight = modalBoxElem.clientHeight;
  18082. var disX = evnt.clientX;
  18083. var disY = evnt.clientY;
  18084. var offsetTop = modalBoxElem.offsetTop;
  18085. var offsetLeft = modalBoxElem.offsetLeft;
  18086. var params = {
  18087. type: 'resize',
  18088. $modal: this
  18089. };
  18090. document.onmousemove = function (evnt) {
  18091. evnt.preventDefault();
  18092. var dragLeft;
  18093. var dragTop;
  18094. var width;
  18095. var height;
  18096. switch (type) {
  18097. case 'wl':
  18098. dragLeft = disX - evnt.clientX;
  18099. width = dragLeft + clientWidth;
  18100. if (offsetLeft - dragLeft > marginSize) {
  18101. if (width > minWidth) {
  18102. modalBoxElem.style.width = "".concat(width < maxWidth ? width : maxWidth, "px");
  18103. modalBoxElem.style.left = "".concat(offsetLeft - dragLeft, "px");
  18104. }
  18105. }
  18106. break;
  18107. case 'swst':
  18108. dragLeft = disX - evnt.clientX;
  18109. dragTop = disY - evnt.clientY;
  18110. width = dragLeft + clientWidth;
  18111. height = dragTop + clientHeight;
  18112. if (offsetLeft - dragLeft > marginSize) {
  18113. if (width > minWidth) {
  18114. modalBoxElem.style.width = "".concat(width < maxWidth ? width : maxWidth, "px");
  18115. modalBoxElem.style.left = "".concat(offsetLeft - dragLeft, "px");
  18116. }
  18117. }
  18118. if (offsetTop - dragTop > marginSize) {
  18119. if (height > minHeight) {
  18120. modalBoxElem.style.height = "".concat(height < maxHeight ? height : maxHeight, "px");
  18121. modalBoxElem.style.top = "".concat(offsetTop - dragTop, "px");
  18122. }
  18123. }
  18124. break;
  18125. case 'swlb':
  18126. dragLeft = disX - evnt.clientX;
  18127. dragTop = evnt.clientY - disY;
  18128. width = dragLeft + clientWidth;
  18129. height = dragTop + clientHeight;
  18130. if (offsetLeft - dragLeft > marginSize) {
  18131. if (width > minWidth) {
  18132. modalBoxElem.style.width = "".concat(width < maxWidth ? width : maxWidth, "px");
  18133. modalBoxElem.style.left = "".concat(offsetLeft - dragLeft, "px");
  18134. }
  18135. }
  18136. if (offsetTop + height + marginSize < visibleHeight) {
  18137. if (height > minHeight) {
  18138. modalBoxElem.style.height = "".concat(height < maxHeight ? height : maxHeight, "px");
  18139. }
  18140. }
  18141. break;
  18142. case 'st':
  18143. dragTop = disY - evnt.clientY;
  18144. height = clientHeight + dragTop;
  18145. if (offsetTop - dragTop > marginSize) {
  18146. if (height > minHeight) {
  18147. modalBoxElem.style.height = "".concat(height < maxHeight ? height : maxHeight, "px");
  18148. modalBoxElem.style.top = "".concat(offsetTop - dragTop, "px");
  18149. }
  18150. }
  18151. break;
  18152. case 'wr':
  18153. dragLeft = evnt.clientX - disX;
  18154. width = dragLeft + clientWidth;
  18155. if (offsetLeft + width + marginSize < visibleWidth) {
  18156. if (width > minWidth) {
  18157. modalBoxElem.style.width = "".concat(width < maxWidth ? width : maxWidth, "px");
  18158. }
  18159. }
  18160. break;
  18161. case 'sest':
  18162. dragLeft = evnt.clientX - disX;
  18163. dragTop = disY - evnt.clientY;
  18164. width = dragLeft + clientWidth;
  18165. height = dragTop + clientHeight;
  18166. if (offsetLeft + width + marginSize < visibleWidth) {
  18167. if (width > minWidth) {
  18168. modalBoxElem.style.width = "".concat(width < maxWidth ? width : maxWidth, "px");
  18169. }
  18170. }
  18171. if (offsetTop - dragTop > marginSize) {
  18172. if (height > minHeight) {
  18173. modalBoxElem.style.height = "".concat(height < maxHeight ? height : maxHeight, "px");
  18174. modalBoxElem.style.top = "".concat(offsetTop - dragTop, "px");
  18175. }
  18176. }
  18177. break;
  18178. case 'selb':
  18179. dragLeft = evnt.clientX - disX;
  18180. dragTop = evnt.clientY - disY;
  18181. width = dragLeft + clientWidth;
  18182. height = dragTop + clientHeight;
  18183. if (offsetLeft + width + marginSize < visibleWidth) {
  18184. if (width > minWidth) {
  18185. modalBoxElem.style.width = "".concat(width < maxWidth ? width : maxWidth, "px");
  18186. }
  18187. }
  18188. if (offsetTop + height + marginSize < visibleHeight) {
  18189. if (height > minHeight) {
  18190. modalBoxElem.style.height = "".concat(height < maxHeight ? height : maxHeight, "px");
  18191. }
  18192. }
  18193. break;
  18194. case 'sb':
  18195. dragTop = evnt.clientY - disY;
  18196. height = dragTop + clientHeight;
  18197. if (offsetTop + height + marginSize < visibleHeight) {
  18198. if (height > minHeight) {
  18199. modalBoxElem.style.height = "".concat(height < maxHeight ? height : maxHeight, "px");
  18200. }
  18201. }
  18202. break;
  18203. }
  18204. modalBoxElem.className = modalBoxElem.className.replace(/\s?is--drag/, '') + ' is--drag';
  18205. if (remember && storage) {
  18206. _this12.savePosStorage();
  18207. }
  18208. if ($listeners.zoom) {
  18209. _this12.$emit('zoom', params);
  18210. } else if (events.zoom) {
  18211. events.zoom.call(_this12, params);
  18212. }
  18213. };
  18214. document.onmouseup = function () {
  18215. _this12.zoomLocat = null;
  18216. document.onmousemove = domMousemove;
  18217. document.onmouseup = domMouseup;
  18218. setTimeout(function () {
  18219. modalBoxElem.className = modalBoxElem.className.replace(/\s?is--drag/, '');
  18220. }, 50);
  18221. };
  18222. },
  18223. getStorageMap: function getStorageMap(key) {
  18224. var version = conf.version;
  18225. var rest = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toStringJSON(localStorage.getItem(key));
  18226. return rest && rest._v === version ? rest : {
  18227. _v: version
  18228. };
  18229. },
  18230. hasPosStorage: function hasPosStorage() {
  18231. var id = this.id,
  18232. remember = this.remember,
  18233. storage = this.storage,
  18234. storageKey = this.storageKey;
  18235. return !!(remember && storage && this.getStorageMap(storageKey)[id]);
  18236. },
  18237. restorePosStorage: function restorePosStorage() {
  18238. var id = this.id,
  18239. remember = this.remember,
  18240. storage = this.storage,
  18241. storageKey = this.storageKey;
  18242. if (remember && storage) {
  18243. var posStorage = this.getStorageMap(storageKey)[id];
  18244. if (posStorage) {
  18245. var modalBoxElem = this.getBox();
  18246. var _posStorage$split = posStorage.split(','),
  18247. _posStorage$split2 = _slicedToArray(_posStorage$split, 8),
  18248. left = _posStorage$split2[0],
  18249. top = _posStorage$split2[1],
  18250. width = _posStorage$split2[2],
  18251. height = _posStorage$split2[3],
  18252. zoomLeft = _posStorage$split2[4],
  18253. zoomTop = _posStorage$split2[5],
  18254. zoomWidth = _posStorage$split2[6],
  18255. zoomHeight = _posStorage$split2[7];
  18256. if (left) {
  18257. modalBoxElem.style.left = "".concat(left, "px");
  18258. }
  18259. if (top) {
  18260. modalBoxElem.style.top = "".concat(top, "px");
  18261. }
  18262. if (width) {
  18263. modalBoxElem.style.width = "".concat(width, "px");
  18264. }
  18265. if (height) {
  18266. modalBoxElem.style.height = "".concat(height, "px");
  18267. }
  18268. if (zoomLeft && zoomTop) {
  18269. this.zoomLocat = {
  18270. left: zoomLeft,
  18271. top: zoomTop,
  18272. width: zoomWidth,
  18273. height: zoomHeight
  18274. };
  18275. }
  18276. }
  18277. }
  18278. },
  18279. savePosStorage: function savePosStorage() {
  18280. var id = this.id,
  18281. remember = this.remember,
  18282. storage = this.storage,
  18283. storageKey = this.storageKey,
  18284. zoomLocat = this.zoomLocat;
  18285. if (remember && storage) {
  18286. var modalBoxElem = this.getBox();
  18287. var posStorageMap = this.getStorageMap(storageKey);
  18288. 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) {
  18289. return val ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(val) : '';
  18290. }).join(',');
  18291. localStorage.setItem(storageKey, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toJSONString(posStorageMap));
  18292. }
  18293. }
  18294. }
  18295. });
  18296. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.object.keys.js
  18297. var es_object_keys = __webpack_require__("b64b");
  18298. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.object.get-own-property-descriptor.js
  18299. var es_object_get_own_property_descriptor = __webpack_require__("e439");
  18300. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.object.get-own-property-descriptors.js
  18301. var es_object_get_own_property_descriptors = __webpack_require__("dbb4");
  18302. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js
  18303. function ownKeys(object, enumerableOnly) {
  18304. var keys = Object.keys(object);
  18305. if (Object.getOwnPropertySymbols) {
  18306. var symbols = Object.getOwnPropertySymbols(object);
  18307. if (enumerableOnly) symbols = symbols.filter(function (sym) {
  18308. return Object.getOwnPropertyDescriptor(object, sym).enumerable;
  18309. });
  18310. keys.push.apply(keys, symbols);
  18311. }
  18312. return keys;
  18313. }
  18314. function _objectSpread2(target) {
  18315. for (var i = 1; i < arguments.length; i++) {
  18316. var source = arguments[i] != null ? arguments[i] : {};
  18317. if (i % 2) {
  18318. ownKeys(Object(source), true).forEach(function (key) {
  18319. _defineProperty(target, key, source[key]);
  18320. });
  18321. } else if (Object.getOwnPropertyDescriptors) {
  18322. Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
  18323. } else {
  18324. ownKeys(Object(source)).forEach(function (key) {
  18325. Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
  18326. });
  18327. }
  18328. }
  18329. return target;
  18330. }
  18331. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.pad-start.js
  18332. var es_string_pad_start = __webpack_require__("4d90");
  18333. // CONCATENATED MODULE: ./packages/input/src/input.js
  18334. var input_browse = DomTools.browse;
  18335. var input_wheelName = input_browse.firefox ? 'DOMMouseScroll' : 'mousewheel';
  18336. var yearSize = 20;
  18337. var monthSize = 20;
  18338. function toStringTimeDate(str) {
  18339. if (str) {
  18340. var rest = new Date();
  18341. var h, m, s;
  18342. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isDate(str)) {
  18343. h = str.getHours();
  18344. m = str.getMinutes();
  18345. s = str.getSeconds();
  18346. } else {
  18347. str = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toValueString(str);
  18348. var parses = str.match(/^(\d{1,2})(:(\d{1,2}))?(:(\d{1,2}))?/);
  18349. if (parses) {
  18350. h = parses[1];
  18351. m = parses[3];
  18352. s = parses[5];
  18353. }
  18354. }
  18355. rest.setHours(h || 0);
  18356. rest.setMinutes(m || 0);
  18357. rest.setSeconds(s || 0);
  18358. return rest;
  18359. }
  18360. return new Date('');
  18361. }
  18362. function getNumberValue(_vm, val) {
  18363. var type = _vm.type,
  18364. digitsValue = _vm.digitsValue;
  18365. return type === 'float' ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toFixed(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.floor(val, digitsValue), digitsValue) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toValueString(val);
  18366. }
  18367. function renderDateLabel(h, _vm, item, label) {
  18368. var festivalMethod = _vm.festivalMethod;
  18369. if (festivalMethod) {
  18370. var festivalRest = festivalMethod(_objectSpread2({
  18371. type: _vm.datePanelType
  18372. }, item));
  18373. var festivalItem = festivalRest ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isString(festivalRest) ? {
  18374. label: festivalRest
  18375. } : festivalRest : {};
  18376. var extraItem = festivalItem.extra ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isString(festivalItem.extra) ? {
  18377. label: festivalItem.extra
  18378. } : festivalItem.extra : null;
  18379. var labels = [h('span', {
  18380. class: ['vxe-input--date-label', {
  18381. 'is-notice': festivalItem.notice
  18382. }]
  18383. }, extraItem && extraItem.label ? [h('span', label), h('span', {
  18384. class: ['vxe-input--date-label--extra', extraItem.important ? 'is-important' : '', extraItem.className],
  18385. style: extraItem.style
  18386. }, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toValueString(extraItem.label))] : label)];
  18387. var festivalLabel = festivalItem.label;
  18388. if (festivalLabel) {
  18389. // 默认最多支持3个节日重叠
  18390. var festivalLabels = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toValueString(festivalLabel).split(',');
  18391. labels.push(h('span', {
  18392. class: ['vxe-input--date-festival', festivalItem.important ? 'is-important' : '', festivalItem.className],
  18393. style: festivalItem.style
  18394. }, [festivalLabels.length > 1 ? h('span', {
  18395. class: ['vxe-input--date-festival--overlap', "overlap--".concat(festivalLabels.length)]
  18396. }, festivalLabels.map(function (label) {
  18397. return h('span', label.substring(0, 3));
  18398. })) : h('span', {
  18399. class: 'vxe-input--date-festival--label'
  18400. }, festivalLabels[0].substring(0, 3))]));
  18401. }
  18402. return labels;
  18403. }
  18404. return label;
  18405. }
  18406. function isDateDisabled(_vm, item) {
  18407. var disabledMethod = _vm.disabledMethod;
  18408. return disabledMethod && disabledMethod({
  18409. type: _vm.type,
  18410. date: item.date
  18411. });
  18412. }
  18413. function renderDateDayTable(h, _vm) {
  18414. var datePanelType = _vm.datePanelType,
  18415. dateValue = _vm.dateValue,
  18416. datePanelValue = _vm.datePanelValue,
  18417. dateHeaders = _vm.dateHeaders,
  18418. dayDatas = _vm.dayDatas;
  18419. var matchFormat = 'yyyy-MM-dd';
  18420. return [h('table', {
  18421. class: "vxe-input--date-".concat(datePanelType, "-view"),
  18422. attrs: {
  18423. cellspacing: 0,
  18424. cellpadding: 0,
  18425. border: 0
  18426. }
  18427. }, [h('thead', [h('tr', dateHeaders.map(function (item) {
  18428. return h('th', item.label);
  18429. }))]), h('tbody', dayDatas.map(function (rows) {
  18430. return h('tr', rows.map(function (item) {
  18431. return h('td', {
  18432. class: {
  18433. 'is--prev': item.isPrev,
  18434. 'is--current': item.isCurrent,
  18435. 'is--now': item.isNow,
  18436. 'is--next': item.isNext,
  18437. 'is--disabled': isDateDisabled(_vm, item),
  18438. 'is--selected': external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isDateSame(dateValue, item.date, matchFormat),
  18439. 'is--hover': external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isDateSame(datePanelValue, item.date, matchFormat)
  18440. },
  18441. on: {
  18442. click: function click() {
  18443. return _vm.dateSelectEvent(item);
  18444. },
  18445. mouseenter: function mouseenter() {
  18446. return _vm.dateMouseenterEvent(item);
  18447. }
  18448. }
  18449. }, renderDateLabel(h, _vm, item, item.label));
  18450. }));
  18451. }))])];
  18452. }
  18453. function renderDateWeekTable(h, _vm) {
  18454. var datePanelType = _vm.datePanelType,
  18455. dateValue = _vm.dateValue,
  18456. datePanelValue = _vm.datePanelValue,
  18457. weekHeaders = _vm.weekHeaders,
  18458. weekDates = _vm.weekDates;
  18459. var matchFormat = 'yyyy-MM-dd';
  18460. return [h('table', {
  18461. class: "vxe-input--date-".concat(datePanelType, "-view"),
  18462. attrs: {
  18463. cellspacing: 0,
  18464. cellpadding: 0,
  18465. border: 0
  18466. }
  18467. }, [h('thead', [h('tr', weekHeaders.map(function (item) {
  18468. return h('th', item.label);
  18469. }))]), h('tbody', weekDates.map(function (rows) {
  18470. var isSelected = rows.some(function (item) {
  18471. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isDateSame(dateValue, item.date, matchFormat);
  18472. });
  18473. var isHover = rows.some(function (item) {
  18474. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isDateSame(datePanelValue, item.date, matchFormat);
  18475. });
  18476. return h('tr', rows.map(function (item) {
  18477. return h('td', {
  18478. class: {
  18479. 'is--prev': item.isPrev,
  18480. 'is--current': item.isCurrent,
  18481. 'is--now': item.isNow,
  18482. 'is--next': item.isNext,
  18483. 'is--disabled': isDateDisabled(_vm, item),
  18484. 'is--selected': isSelected,
  18485. 'is--hover': isHover
  18486. },
  18487. on: {
  18488. click: function click() {
  18489. return _vm.dateSelectEvent(item);
  18490. },
  18491. mouseenter: function mouseenter() {
  18492. return _vm.dateMouseenterEvent(item);
  18493. }
  18494. }
  18495. }, renderDateLabel(h, _vm, item, item.label));
  18496. }));
  18497. }))])];
  18498. }
  18499. function renderDateMonthTable(h, _vm) {
  18500. var dateValue = _vm.dateValue,
  18501. datePanelType = _vm.datePanelType,
  18502. monthDatas = _vm.monthDatas,
  18503. datePanelValue = _vm.datePanelValue;
  18504. var matchFormat = 'yyyy-MM';
  18505. return [h('table', {
  18506. class: "vxe-input--date-".concat(datePanelType, "-view"),
  18507. attrs: {
  18508. cellspacing: 0,
  18509. cellpadding: 0,
  18510. border: 0
  18511. }
  18512. }, [h('tbody', monthDatas.map(function (rows) {
  18513. return h('tr', rows.map(function (item) {
  18514. return h('td', {
  18515. class: {
  18516. 'is--prev': item.isPrev,
  18517. 'is--current': item.isCurrent,
  18518. 'is--now': item.isNow,
  18519. 'is--next': item.isNext,
  18520. 'is--disabled': isDateDisabled(_vm, item),
  18521. 'is--selected': external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isDateSame(dateValue, item.date, matchFormat),
  18522. 'is--hover': external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isDateSame(datePanelValue, item.date, matchFormat)
  18523. },
  18524. on: {
  18525. click: function click() {
  18526. return _vm.dateSelectEvent(item);
  18527. },
  18528. mouseenter: function mouseenter() {
  18529. return _vm.dateMouseenterEvent(item);
  18530. }
  18531. }
  18532. }, renderDateLabel(h, _vm, item, conf.i18n("vxe.input.date.months.m".concat(item.month))));
  18533. }));
  18534. }))])];
  18535. }
  18536. function renderDateYearTable(h, _vm) {
  18537. var dateValue = _vm.dateValue,
  18538. datePanelType = _vm.datePanelType,
  18539. yearDatas = _vm.yearDatas,
  18540. datePanelValue = _vm.datePanelValue;
  18541. var matchFormat = 'yyyy';
  18542. return [h('table', {
  18543. class: "vxe-input--date-".concat(datePanelType, "-view"),
  18544. attrs: {
  18545. cellspacing: 0,
  18546. cellpadding: 0,
  18547. border: 0
  18548. }
  18549. }, [h('tbody', yearDatas.map(function (rows) {
  18550. return h('tr', rows.map(function (item) {
  18551. return h('td', {
  18552. class: {
  18553. 'is--disabled': isDateDisabled(_vm, item),
  18554. 'is--current': item.isCurrent,
  18555. 'is--now': item.isNow,
  18556. 'is--selected': external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isDateSame(dateValue, item.date, matchFormat),
  18557. 'is--hover': external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isDateSame(datePanelValue, item.date, matchFormat)
  18558. },
  18559. on: {
  18560. click: function click() {
  18561. return _vm.dateSelectEvent(item);
  18562. },
  18563. mouseenter: function mouseenter() {
  18564. return _vm.dateMouseenterEvent(item);
  18565. }
  18566. }
  18567. }, renderDateLabel(h, _vm, item, item.year));
  18568. }));
  18569. }))])];
  18570. }
  18571. function renderDateTable(h, _vm) {
  18572. var datePanelType = _vm.datePanelType;
  18573. switch (datePanelType) {
  18574. case 'week':
  18575. return renderDateWeekTable(h, _vm);
  18576. case 'month':
  18577. return renderDateMonthTable(h, _vm);
  18578. case 'year':
  18579. return renderDateYearTable(h, _vm);
  18580. }
  18581. return renderDateDayTable(h, _vm);
  18582. }
  18583. function renderDatePanel(h, _vm) {
  18584. var datePanelType = _vm.datePanelType,
  18585. selectDatePanelLabel = _vm.selectDatePanelLabel,
  18586. isDisabledPrevDateBtn = _vm.isDisabledPrevDateBtn,
  18587. isDisabledNextDateBtn = _vm.isDisabledNextDateBtn;
  18588. return [h('div', {
  18589. class: 'vxe-input--date-picker-header'
  18590. }, [h('div', {
  18591. class: 'vxe-input--date-picker-type-wrapper'
  18592. }, [datePanelType === 'year' ? h('span', {
  18593. class: 'vxe-input--date-picker-label'
  18594. }, selectDatePanelLabel) : h('span', {
  18595. class: 'vxe-input--date-picker-btn',
  18596. on: {
  18597. click: _vm.dateToggleTypeEvent
  18598. }
  18599. }, selectDatePanelLabel)]), h('div', {
  18600. class: 'vxe-input--date-picker-btn-wrapper'
  18601. }, [h('span', {
  18602. class: ['vxe-input--date-picker-btn vxe-input--date-picker-prev-btn', {
  18603. 'is--disabled': isDisabledPrevDateBtn
  18604. }],
  18605. on: {
  18606. click: _vm.datePrevEvent
  18607. }
  18608. }, [h('i', {
  18609. class: 'vxe-icon--caret-left'
  18610. })]), h('span', {
  18611. class: 'vxe-input--date-picker-btn vxe-input--date-picker-current-btn',
  18612. on: {
  18613. click: _vm.dateTodayMonthEvent
  18614. }
  18615. }, [h('i', {
  18616. class: 'vxe-icon--dot'
  18617. })]), h('span', {
  18618. class: ['vxe-input--date-picker-btn vxe-input--date-picker-next-btn', {
  18619. 'is--disabled': isDisabledNextDateBtn
  18620. }],
  18621. on: {
  18622. click: _vm.dateNextEvent
  18623. }
  18624. }, [h('i', {
  18625. class: 'vxe-icon--caret-right'
  18626. })])])]), h('div', {
  18627. class: 'vxe-input--date-picker-body'
  18628. }, renderDateTable(h, _vm))];
  18629. }
  18630. function renderTimePanel(h, _vm) {
  18631. var dateTimeLabel = _vm.dateTimeLabel,
  18632. datetimePanelValue = _vm.datetimePanelValue,
  18633. hourList = _vm.hourList,
  18634. minuteList = _vm.minuteList,
  18635. secondList = _vm.secondList;
  18636. return [h('div', {
  18637. class: 'vxe-input--time-picker-header'
  18638. }, [h('span', {
  18639. class: 'vxe-input--time-picker-title'
  18640. }, dateTimeLabel), h('button', {
  18641. class: 'vxe-input--time-picker-confirm',
  18642. attrs: {
  18643. type: 'button'
  18644. },
  18645. on: {
  18646. click: _vm.dateConfirmEvent
  18647. }
  18648. }, conf.i18n('vxe.button.confirm'))]), h('div', {
  18649. ref: 'timeBody',
  18650. class: 'vxe-input--time-picker-body'
  18651. }, [h('ul', {
  18652. class: 'vxe-input--time-picker-hour-list'
  18653. }, hourList.map(function (item, index) {
  18654. return h('li', {
  18655. key: index,
  18656. class: {
  18657. 'is--selected': datetimePanelValue && datetimePanelValue.getHours() === item.value
  18658. },
  18659. on: {
  18660. click: function click(evnt) {
  18661. return _vm.dateHourEvent(evnt, item);
  18662. }
  18663. }
  18664. }, item.label);
  18665. })), h('ul', {
  18666. class: 'vxe-input--time-picker-minute-list'
  18667. }, minuteList.map(function (item, index) {
  18668. return h('li', {
  18669. key: index,
  18670. class: {
  18671. 'is--selected': datetimePanelValue && datetimePanelValue.getMinutes() === item.value
  18672. },
  18673. on: {
  18674. click: function click(evnt) {
  18675. return _vm.dateMinuteEvent(evnt, item);
  18676. }
  18677. }
  18678. }, item.label);
  18679. })), h('ul', {
  18680. class: 'vxe-input--time-picker-second-list'
  18681. }, secondList.map(function (item, index) {
  18682. return h('li', {
  18683. key: index,
  18684. class: {
  18685. 'is--selected': datetimePanelValue && datetimePanelValue.getSeconds() === item.value
  18686. },
  18687. on: {
  18688. click: function click(evnt) {
  18689. return _vm.dateSecondEvent(evnt, item);
  18690. }
  18691. }
  18692. }, item.label);
  18693. }))])];
  18694. }
  18695. function renderPanel(h, _vm) {
  18696. var type = _vm.type,
  18697. vSize = _vm.vSize,
  18698. isDatePicker = _vm.isDatePicker,
  18699. transfer = _vm.transfer,
  18700. animatVisible = _vm.animatVisible,
  18701. visiblePanel = _vm.visiblePanel,
  18702. panelPlacement = _vm.panelPlacement,
  18703. panelStyle = _vm.panelStyle;
  18704. var renders = [];
  18705. if (isDatePicker) {
  18706. var _ref;
  18707. if (type === 'datetime') {
  18708. renders.push(h('div', {
  18709. class: 'vxe-input--panel-layout-wrapper'
  18710. }, [h('div', {
  18711. class: 'vxe-input--panel-left-wrapper'
  18712. }, renderDatePanel(h, _vm)), h('div', {
  18713. class: 'vxe-input--panel-right-wrapper'
  18714. }, renderTimePanel(h, _vm))]));
  18715. } else if (type === 'time') {
  18716. renders.push(h('div', {
  18717. class: 'vxe-input--panel-wrapper'
  18718. }, renderTimePanel(h, _vm)));
  18719. } else {
  18720. renders.push(h('div', {
  18721. class: 'vxe-input--panel-wrapper'
  18722. }, renderDatePanel(h, _vm)));
  18723. }
  18724. return h('div', {
  18725. ref: 'panel',
  18726. 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)],
  18727. attrs: {
  18728. placement: panelPlacement
  18729. },
  18730. style: panelStyle
  18731. }, renders);
  18732. }
  18733. return null;
  18734. }
  18735. function renderNumberIcon(h, _vm) {
  18736. return h('span', {
  18737. class: 'vxe-input--number-suffix'
  18738. }, [h('span', {
  18739. class: 'vxe-input--number-prev is--prev',
  18740. on: {
  18741. mousedown: _vm.numberMousedownEvent,
  18742. mouseup: _vm.numberStopDown,
  18743. mouseleave: _vm.numberStopDown
  18744. }
  18745. }, [h('i', {
  18746. class: ['vxe-input--number-prev-icon', conf.icon.INPUT_PREV_NUM]
  18747. })]), h('span', {
  18748. class: 'vxe-input--number-next is--next',
  18749. on: {
  18750. mousedown: _vm.numberMousedownEvent,
  18751. mouseup: _vm.numberStopDown,
  18752. mouseleave: _vm.numberStopDown
  18753. }
  18754. }, [h('i', {
  18755. class: ['vxe-input--number-next-icon', conf.icon.INPUT_NEXT_NUM]
  18756. })])]);
  18757. }
  18758. function renderDatePickerIcon(h, _vm) {
  18759. return h('span', {
  18760. class: 'vxe-input--date-picker-suffix',
  18761. on: {
  18762. click: _vm.datePickerOpenEvent
  18763. }
  18764. }, [h('i', {
  18765. class: ['vxe-input--date-picker-icon', conf.icon.INPUT_DATE]
  18766. })]);
  18767. }
  18768. function renderSearchIcon(h, _vm) {
  18769. return h('span', {
  18770. class: 'vxe-input--search-suffix',
  18771. on: {
  18772. click: _vm.searchEvent
  18773. }
  18774. }, [h('i', {
  18775. class: ['vxe-input--search-icon', conf.icon.INPUT_SEARCH]
  18776. })]);
  18777. }
  18778. function renderPasswordIcon(h, _vm) {
  18779. var showPwd = _vm.showPwd;
  18780. return h('span', {
  18781. class: 'vxe-input--password-suffix',
  18782. on: {
  18783. click: _vm.passwordToggleEvent
  18784. }
  18785. }, [h('i', {
  18786. class: ['vxe-input--password-icon', showPwd ? conf.icon.INPUT_SHOW_PWD : conf.icon.INPUT_PWD]
  18787. })]);
  18788. }
  18789. function rendePrefixIcon(h, _vm) {
  18790. var $scopedSlots = _vm.$scopedSlots,
  18791. prefixIcon = _vm.prefixIcon;
  18792. var icons = [];
  18793. if ($scopedSlots.prefix) {
  18794. icons.push(h('span', {
  18795. class: 'vxe-input--prefix-icon'
  18796. }, $scopedSlots.prefix.call(this, {}, h)));
  18797. } else if (prefixIcon) {
  18798. icons.push(h('i', {
  18799. class: ['vxe-input--prefix-icon', prefixIcon]
  18800. }));
  18801. }
  18802. return icons.length ? h('span', {
  18803. class: 'vxe-input--prefix',
  18804. on: {
  18805. click: _vm.clickPrefixEvent
  18806. }
  18807. }, icons) : null;
  18808. }
  18809. function renderSuffixIcon(h, _vm) {
  18810. var $scopedSlots = _vm.$scopedSlots,
  18811. inputValue = _vm.inputValue,
  18812. isClearable = _vm.isClearable,
  18813. disabled = _vm.disabled,
  18814. suffixIcon = _vm.suffixIcon;
  18815. var icons = [];
  18816. if ($scopedSlots.suffix) {
  18817. icons.push(h('span', {
  18818. class: 'vxe-input--suffix-icon'
  18819. }, $scopedSlots.suffix.call(this, {}, h)));
  18820. } else if (suffixIcon) {
  18821. icons.push(h('i', {
  18822. class: ['vxe-input--suffix-icon', suffixIcon]
  18823. }));
  18824. }
  18825. if (isClearable) {
  18826. icons.push(h('i', {
  18827. class: ['vxe-input--clear-icon', conf.icon.INPUT_CLEAR]
  18828. }));
  18829. }
  18830. return icons.length ? h('span', {
  18831. class: ['vxe-input--suffix', {
  18832. 'is--clear': isClearable && !disabled && !(inputValue === '' || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eqNull(inputValue))
  18833. }],
  18834. on: {
  18835. click: _vm.clickSuffixEvent
  18836. }
  18837. }, icons) : null;
  18838. }
  18839. function renderExtraSuffixIcon(h, _vm) {
  18840. var controls = _vm.controls,
  18841. isPassword = _vm.isPassword,
  18842. isNumber = _vm.isNumber,
  18843. isDatePicker = _vm.isDatePicker,
  18844. isSearch = _vm.isSearch;
  18845. var icons;
  18846. if (isPassword) {
  18847. icons = renderPasswordIcon(h, _vm);
  18848. } else if (isNumber) {
  18849. if (controls) {
  18850. icons = renderNumberIcon(h, _vm);
  18851. }
  18852. } else if (isDatePicker) {
  18853. icons = renderDatePickerIcon(h, _vm);
  18854. } else if (isSearch) {
  18855. icons = renderSearchIcon(h, _vm);
  18856. }
  18857. return icons ? h('span', {
  18858. class: 'vxe-input--extra-suffix'
  18859. }, [icons]) : null;
  18860. }
  18861. /* harmony default export */ var input = ({
  18862. name: 'VxeInput',
  18863. mixins: [size],
  18864. model: {
  18865. prop: 'value',
  18866. event: 'modelValue'
  18867. },
  18868. props: {
  18869. value: [String, Number, Date],
  18870. immediate: {
  18871. type: Boolean,
  18872. default: true
  18873. },
  18874. name: String,
  18875. type: {
  18876. type: String,
  18877. default: 'text'
  18878. },
  18879. clearable: {
  18880. type: Boolean,
  18881. default: function _default() {
  18882. return conf.input.clearable;
  18883. }
  18884. },
  18885. readonly: Boolean,
  18886. disabled: Boolean,
  18887. placeholder: String,
  18888. maxlength: [String, Number],
  18889. autocomplete: {
  18890. type: String,
  18891. default: 'off'
  18892. },
  18893. align: String,
  18894. form: String,
  18895. size: {
  18896. type: String,
  18897. default: function _default() {
  18898. return conf.input.size || conf.size;
  18899. }
  18900. },
  18901. // number、integer、float
  18902. min: {
  18903. type: [String, Number],
  18904. default: null
  18905. },
  18906. max: {
  18907. type: [String, Number],
  18908. default: null
  18909. },
  18910. step: [String, Number],
  18911. // number、integer、float、password
  18912. controls: {
  18913. type: Boolean,
  18914. default: function _default() {
  18915. return conf.input.controls;
  18916. }
  18917. },
  18918. // float
  18919. digits: {
  18920. type: [String, Number],
  18921. default: function _default() {
  18922. return conf.input.digits;
  18923. }
  18924. },
  18925. // date、week、month、year
  18926. dateConfig: Object,
  18927. minDate: {
  18928. type: [String, Number, Date],
  18929. default: function _default() {
  18930. return conf.input.minDate;
  18931. }
  18932. },
  18933. maxDate: {
  18934. type: [String, Number, Date],
  18935. default: function _default() {
  18936. return conf.input.maxDate;
  18937. }
  18938. },
  18939. startWeek: {
  18940. type: Number,
  18941. default: function _default() {
  18942. return conf.input.startWeek;
  18943. }
  18944. },
  18945. labelFormat: {
  18946. type: String,
  18947. default: function _default() {
  18948. return conf.input.labelFormat;
  18949. }
  18950. },
  18951. valueFormat: {
  18952. type: String,
  18953. default: function _default() {
  18954. return conf.input.valueFormat;
  18955. }
  18956. },
  18957. editable: {
  18958. type: Boolean,
  18959. default: true
  18960. },
  18961. festivalMethod: {
  18962. type: Function,
  18963. default: function _default() {
  18964. return conf.input.festivalMethod;
  18965. }
  18966. },
  18967. disabledMethod: {
  18968. type: Function,
  18969. default: function _default() {
  18970. return conf.input.disabledMethod;
  18971. }
  18972. },
  18973. prefixIcon: String,
  18974. suffixIcon: String,
  18975. placement: String,
  18976. transfer: {
  18977. type: Boolean,
  18978. default: function _default() {
  18979. return conf.input.transfer;
  18980. }
  18981. }
  18982. },
  18983. data: function data() {
  18984. return {
  18985. panelIndex: 0,
  18986. showPwd: false,
  18987. visiblePanel: false,
  18988. animatVisible: false,
  18989. panelStyle: null,
  18990. panelPlacement: null,
  18991. isActivated: false,
  18992. inputValue: this.value,
  18993. datetimePanelValue: null,
  18994. datePanelValue: null,
  18995. datePanelLabel: '',
  18996. datePanelType: 'day',
  18997. selectMonth: null,
  18998. currentDate: null
  18999. };
  19000. },
  19001. computed: {
  19002. isNumber: function isNumber() {
  19003. return ['number', 'integer', 'float'].indexOf(this.type) > -1;
  19004. },
  19005. isDatePicker: function isDatePicker() {
  19006. return this.hasTime || ['date', 'week', 'month', 'year'].indexOf(this.type) > -1;
  19007. },
  19008. hasTime: function hasTime() {
  19009. var type = this.type;
  19010. return type === 'time' || type === 'datetime';
  19011. },
  19012. isPassword: function isPassword() {
  19013. return this.type === 'password';
  19014. },
  19015. isSearch: function isSearch() {
  19016. return this.type === 'search';
  19017. },
  19018. stepValue: function stepValue() {
  19019. var type = this.type,
  19020. step = this.step;
  19021. if (type === 'integer') {
  19022. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toInteger(step) || 1;
  19023. } else if (type === 'float') {
  19024. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(step) || 1 / Math.pow(10, this.digitsValue);
  19025. }
  19026. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(step) || 1;
  19027. },
  19028. digitsValue: function digitsValue() {
  19029. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toInteger(this.digits) || 1;
  19030. },
  19031. isClearable: function isClearable() {
  19032. return this.clearable && (this.isPassword || this.isNumber || this.isDatePicker || this.type === 'text' || this.type === 'search');
  19033. },
  19034. isDisabledPrevDateBtn: function isDisabledPrevDateBtn() {
  19035. var selectMonth = this.selectMonth,
  19036. dateMinTime = this.dateMinTime;
  19037. if (selectMonth) {
  19038. return selectMonth <= dateMinTime;
  19039. }
  19040. return false;
  19041. },
  19042. isDisabledNextDateBtn: function isDisabledNextDateBtn() {
  19043. var selectMonth = this.selectMonth,
  19044. dateMaxTime = this.dateMaxTime;
  19045. if (selectMonth) {
  19046. return selectMonth >= dateMaxTime;
  19047. }
  19048. return false;
  19049. },
  19050. dateMinTime: function dateMinTime() {
  19051. return this.minDate ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toStringDate(this.minDate) : null;
  19052. },
  19053. dateMaxTime: function dateMaxTime() {
  19054. return this.maxDate ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toStringDate(this.maxDate) : null;
  19055. },
  19056. dateValue: function dateValue() {
  19057. var inputValue = this.inputValue,
  19058. value = this.value,
  19059. isDatePicker = this.isDatePicker,
  19060. type = this.type,
  19061. dateValueFormat = this.dateValueFormat;
  19062. var val = null;
  19063. if (inputValue && isDatePicker) {
  19064. var date;
  19065. if (type === 'time') {
  19066. date = toStringTimeDate(inputValue);
  19067. } else {
  19068. date = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toStringDate(type === 'week' ? value : inputValue, dateValueFormat);
  19069. }
  19070. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isValidDate(date)) {
  19071. val = date;
  19072. }
  19073. }
  19074. return val;
  19075. },
  19076. dateTimeLabel: function dateTimeLabel() {
  19077. var datetimePanelValue = this.datetimePanelValue;
  19078. if (datetimePanelValue) {
  19079. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toDateString(datetimePanelValue, 'HH:mm:ss');
  19080. }
  19081. return '';
  19082. },
  19083. hmsTime: function hmsTime() {
  19084. var dateValue = this.dateValue;
  19085. return dateValue && this.hasTime ? (dateValue.getHours() * 3600 + dateValue.getMinutes() * 60 + dateValue.getSeconds()) * 1000 : 0;
  19086. },
  19087. dateLabelFormat: function dateLabelFormat() {
  19088. if (this.isDatePicker) {
  19089. return this.labelFormat || conf.i18n("vxe.input.date.labelFormat.".concat(this.type));
  19090. }
  19091. return null;
  19092. },
  19093. dateValueFormat: function dateValueFormat() {
  19094. var type = this.type;
  19095. return type === 'time' ? 'HH:mm:ss' : this.valueFormat || (type === 'datetime' ? 'yyyy-MM-dd HH:mm:ss' : 'yyyy-MM-dd');
  19096. },
  19097. selectDatePanelLabel: function selectDatePanelLabel() {
  19098. if (this.isDatePicker) {
  19099. var datePanelType = this.datePanelType,
  19100. selectMonth = this.selectMonth,
  19101. yearList = this.yearList;
  19102. var year = '';
  19103. var month;
  19104. if (selectMonth) {
  19105. year = selectMonth.getFullYear();
  19106. month = selectMonth.getMonth() + 1;
  19107. }
  19108. if (datePanelType === 'month') {
  19109. return conf.i18n('vxe.input.date.monthLabel', [year]);
  19110. } else if (datePanelType === 'year') {
  19111. return yearList.length ? "".concat(yearList[0].year, " - ").concat(yearList[yearList.length - 1].year) : '';
  19112. }
  19113. return conf.i18n('vxe.input.date.dayLabel', [year, month ? conf.i18n("vxe.input.date.m".concat(month)) : '-']);
  19114. }
  19115. return '';
  19116. },
  19117. weekDatas: function weekDatas() {
  19118. var weeks = [];
  19119. if (this.isDatePicker) {
  19120. var sWeek = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(this.startWeek);
  19121. weeks.push(sWeek);
  19122. for (var index = 0; index < 6; index++) {
  19123. if (sWeek >= 6) {
  19124. sWeek = 0;
  19125. } else {
  19126. sWeek++;
  19127. }
  19128. weeks.push(sWeek);
  19129. }
  19130. }
  19131. return weeks;
  19132. },
  19133. dateHeaders: function dateHeaders() {
  19134. if (this.isDatePicker) {
  19135. return this.weekDatas.map(function (day) {
  19136. return {
  19137. value: day,
  19138. label: conf.i18n("vxe.input.date.weeks.w".concat(day))
  19139. };
  19140. });
  19141. }
  19142. return [];
  19143. },
  19144. weekHeaders: function weekHeaders() {
  19145. if (this.isDatePicker) {
  19146. return [{
  19147. label: conf.i18n('vxe.input.date.weeks.w')
  19148. }].concat(this.dateHeaders);
  19149. }
  19150. return [];
  19151. },
  19152. yearList: function yearList() {
  19153. var selectMonth = this.selectMonth,
  19154. currentDate = this.currentDate;
  19155. var months = [];
  19156. if (selectMonth && currentDate) {
  19157. var currFullYear = currentDate.getFullYear();
  19158. var startYear = new Date(('' + selectMonth.getFullYear()).replace(/\d{1}$/, '0'), 0, 1);
  19159. for (var index = -10; index < yearSize - 10; index++) {
  19160. var date = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatYear(startYear, index, 'first');
  19161. var itemFullYear = date.getFullYear();
  19162. months.push({
  19163. date: date,
  19164. isCurrent: true,
  19165. isNow: currFullYear === itemFullYear,
  19166. year: itemFullYear
  19167. });
  19168. }
  19169. }
  19170. return months;
  19171. },
  19172. yearDatas: function yearDatas() {
  19173. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.chunk(this.yearList, 4);
  19174. },
  19175. monthList: function monthList() {
  19176. var selectMonth = this.selectMonth,
  19177. currentDate = this.currentDate;
  19178. var months = [];
  19179. if (selectMonth && currentDate) {
  19180. var currFullYear = currentDate.getFullYear();
  19181. var currMonth = currentDate.getMonth();
  19182. var selFullYear = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatYear(selectMonth, 0, 'first').getFullYear();
  19183. for (var index = -4; index < monthSize - 4; index++) {
  19184. var date = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatYear(selectMonth, 0, index);
  19185. var itemFullYear = date.getFullYear();
  19186. var itemMonth = date.getMonth();
  19187. var isPrev = itemFullYear < selFullYear;
  19188. months.push({
  19189. date: date,
  19190. isPrev: isPrev,
  19191. isCurrent: itemFullYear === selFullYear,
  19192. isNow: itemFullYear === currFullYear && itemMonth === currMonth,
  19193. isNext: !isPrev && itemFullYear > selFullYear,
  19194. month: itemMonth
  19195. });
  19196. }
  19197. }
  19198. return months;
  19199. },
  19200. monthDatas: function monthDatas() {
  19201. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.chunk(this.monthList, 4);
  19202. },
  19203. dayList: function dayList() {
  19204. var weekDatas = this.weekDatas,
  19205. selectMonth = this.selectMonth,
  19206. currentDate = this.currentDate,
  19207. hmsTime = this.hmsTime;
  19208. var days = [];
  19209. if (selectMonth && currentDate) {
  19210. var currFullYear = currentDate.getFullYear();
  19211. var currMonth = currentDate.getMonth();
  19212. var currDate = currentDate.getDate();
  19213. var selFullYear = selectMonth.getFullYear();
  19214. var selMonth = selectMonth.getMonth();
  19215. var selDay = selectMonth.getDay();
  19216. var prevOffsetDate = -weekDatas.indexOf(selDay);
  19217. var startDate = new Date(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatDay(selectMonth, prevOffsetDate).getTime() + hmsTime);
  19218. for (var index = 0; index < 42; index++) {
  19219. var date = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatDay(startDate, index);
  19220. var itemFullYear = date.getFullYear();
  19221. var itemMonth = date.getMonth();
  19222. var itemDate = date.getDate();
  19223. var isPrev = date < selectMonth;
  19224. days.push({
  19225. date: date,
  19226. isPrev: isPrev,
  19227. isCurrent: itemFullYear === selFullYear && itemMonth === selMonth,
  19228. isNow: itemFullYear === currFullYear && itemMonth === currMonth && itemDate === currDate,
  19229. isNext: !isPrev && selMonth !== itemMonth,
  19230. label: itemDate
  19231. });
  19232. }
  19233. }
  19234. return days;
  19235. },
  19236. dayDatas: function dayDatas() {
  19237. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.chunk(this.dayList, 7);
  19238. },
  19239. weekDates: function weekDates() {
  19240. return this.dayDatas.map(function (list) {
  19241. var firstItem = list[0];
  19242. var item = {
  19243. date: firstItem.date,
  19244. isWeekNumber: true,
  19245. isPrev: false,
  19246. isCurrent: false,
  19247. isNow: false,
  19248. isNext: false,
  19249. label: external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getYearWeek(firstItem.date)
  19250. };
  19251. return [item].concat(list);
  19252. });
  19253. },
  19254. hourList: function hourList() {
  19255. var list = [];
  19256. if (this.hasTime) {
  19257. for (var index = 0; index < 24; index++) {
  19258. list.push({
  19259. value: index,
  19260. label: ('' + index).padStart(2, 0)
  19261. });
  19262. }
  19263. }
  19264. return list;
  19265. },
  19266. minuteList: function minuteList() {
  19267. var list = [];
  19268. if (this.hasTime) {
  19269. for (var index = 0; index < 60; index++) {
  19270. list.push({
  19271. value: index,
  19272. label: ('' + index).padStart(2, 0)
  19273. });
  19274. }
  19275. }
  19276. return list;
  19277. },
  19278. secondList: function secondList() {
  19279. return this.minuteList;
  19280. },
  19281. inpImmediate: function inpImmediate() {
  19282. var type = this.type,
  19283. immediate = this.immediate;
  19284. return immediate || !(type === 'text' || type === 'number' || type === 'integer' || type === 'float');
  19285. },
  19286. inpAttrs: function inpAttrs() {
  19287. var isDatePicker = this.isDatePicker,
  19288. isNumber = this.isNumber,
  19289. isPassword = this.isPassword,
  19290. type = this.type,
  19291. name = this.name,
  19292. placeholder = this.placeholder,
  19293. readonly = this.readonly,
  19294. disabled = this.disabled,
  19295. maxlength = this.maxlength,
  19296. form = this.form,
  19297. autocomplete = this.autocomplete,
  19298. showPwd = this.showPwd,
  19299. editable = this.editable;
  19300. var inputType = type;
  19301. if (isDatePicker || isNumber || isPassword && showPwd || type === 'number') {
  19302. inputType = 'text';
  19303. }
  19304. var attrs = {
  19305. name: name,
  19306. form: form,
  19307. type: inputType,
  19308. placeholder: placeholder,
  19309. maxlength: isNumber && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(maxlength) ? 16 : maxlength,
  19310. // 数值最大长度限制 16 位,包含小数
  19311. readonly: readonly || type === 'week' || !editable,
  19312. disabled: disabled,
  19313. autocomplete: autocomplete
  19314. };
  19315. if (placeholder) {
  19316. attrs.placeholder = UtilTools.getFuncText(placeholder);
  19317. }
  19318. return attrs;
  19319. },
  19320. inpEvents: function inpEvents() {
  19321. var _this = this;
  19322. var evnts = {};
  19323. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.each(this.$listeners, function (cb, name) {
  19324. if (['input', 'change', 'blur', 'clear', 'prefix-click', 'suffix-click'].indexOf(name) === -1) {
  19325. evnts[name] = _this.triggerEvent;
  19326. }
  19327. });
  19328. if (this.isNumber) {
  19329. evnts.keydown = this.keydownEvent;
  19330. evnts[input_wheelName] = this.mousewheelEvent;
  19331. } else if (this.isDatePicker) {
  19332. evnts.click = this.clickEvent;
  19333. }
  19334. evnts.input = this.inputEvent;
  19335. evnts.change = this.changeEvent;
  19336. evnts.focus = this.focusEvent;
  19337. evnts.blur = this.blurEvent;
  19338. return evnts;
  19339. }
  19340. },
  19341. watch: {
  19342. value: function value(val) {
  19343. this.inputValue = val;
  19344. this.changeValue();
  19345. },
  19346. dateLabelFormat: function dateLabelFormat() {
  19347. this.dateParseValue(this.datePanelValue);
  19348. this.inputValue = this.datePanelLabel;
  19349. }
  19350. },
  19351. created: function created() {
  19352. this.initValue();
  19353. GlobalEvent.on(this, 'mousewheel', this.handleGlobalMousewheelEvent);
  19354. GlobalEvent.on(this, 'mousedown', this.handleGlobalMousedownEvent);
  19355. GlobalEvent.on(this, 'keydown', this.handleGlobalKeydownEvent);
  19356. GlobalEvent.on(this, 'blur', this.handleGlobalBlurEvent);
  19357. },
  19358. mounted: function mounted() {
  19359. if (this.dateConfig) {
  19360. UtilTools.warn('vxe.error.removeProp', ['date-config']);
  19361. }
  19362. if (this.isDatePicker) {
  19363. if (this.transfer) {
  19364. document.body.appendChild(this.$refs.panel);
  19365. }
  19366. }
  19367. },
  19368. beforeDestroy: function beforeDestroy() {
  19369. var panelElem = this.$refs.panel;
  19370. if (panelElem && panelElem.parentNode) {
  19371. panelElem.parentNode.removeChild(panelElem);
  19372. }
  19373. },
  19374. destroyed: function destroyed() {
  19375. this.numberStopDown();
  19376. GlobalEvent.off(this, 'mousewheel');
  19377. GlobalEvent.off(this, 'mousedown');
  19378. GlobalEvent.off(this, 'keydown');
  19379. GlobalEvent.off(this, 'blur');
  19380. },
  19381. render: function render(h) {
  19382. var _ref2;
  19383. var controls = this.controls,
  19384. inputValue = this.inputValue,
  19385. isDatePicker = this.isDatePicker,
  19386. visiblePanel = this.visiblePanel,
  19387. isActivated = this.isActivated,
  19388. vSize = this.vSize,
  19389. type = this.type,
  19390. align = this.align,
  19391. readonly = this.readonly,
  19392. disabled = this.disabled,
  19393. inpAttrs = this.inpAttrs,
  19394. inpEvents = this.inpEvents;
  19395. var childs = [];
  19396. var prefix = rendePrefixIcon(h, this);
  19397. var suffix = renderSuffixIcon(h, this); // 前缀图标
  19398. if (prefix) {
  19399. childs.push(prefix);
  19400. } // 输入框
  19401. childs.push(h('input', {
  19402. ref: 'input',
  19403. class: 'vxe-input--inner',
  19404. domProps: {
  19405. value: inputValue
  19406. },
  19407. attrs: inpAttrs,
  19408. on: inpEvents
  19409. })); // 后缀图标
  19410. if (suffix) {
  19411. childs.push(suffix);
  19412. } // 特殊功能图标
  19413. childs.push(renderExtraSuffixIcon(h, this)); // 面板容器
  19414. if (isDatePicker) {
  19415. childs.push(renderPanel(h, this));
  19416. }
  19417. return h('div', {
  19418. 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)]
  19419. }, childs);
  19420. },
  19421. methods: {
  19422. focus: function focus() {
  19423. this.isActivated = true;
  19424. this.$refs.input.focus();
  19425. return this.$nextTick();
  19426. },
  19427. blur: function blur() {
  19428. this.$refs.input.blur();
  19429. this.isActivated = false;
  19430. return this.$nextTick();
  19431. },
  19432. triggerEvent: function triggerEvent(evnt) {
  19433. var $refs = this.$refs,
  19434. inputValue = this.inputValue;
  19435. this.$emit(evnt.type, {
  19436. $panel: $refs.panel,
  19437. value: inputValue,
  19438. $event: evnt
  19439. });
  19440. },
  19441. emitModel: function emitModel(value, evnt) {
  19442. this.inputValue = value;
  19443. this.$emit('modelValue', value);
  19444. this.$emit('input', {
  19445. value: value,
  19446. $event: evnt
  19447. });
  19448. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toValueString(this.value) !== value) {
  19449. this.$emit('change', {
  19450. value: value,
  19451. $event: evnt
  19452. });
  19453. }
  19454. },
  19455. emitInputEvent: function emitInputEvent(value, evnt) {
  19456. var inpImmediate = this.inpImmediate,
  19457. isDatePicker = this.isDatePicker;
  19458. this.inputValue = value;
  19459. if (!isDatePicker) {
  19460. if (inpImmediate) {
  19461. this.emitModel(value, evnt);
  19462. } else {
  19463. this.$emit('input', {
  19464. value: value,
  19465. $event: evnt
  19466. });
  19467. }
  19468. }
  19469. },
  19470. inputEvent: function inputEvent(evnt) {
  19471. var value = evnt.target.value;
  19472. this.emitInputEvent(value, evnt);
  19473. },
  19474. changeEvent: function changeEvent(evnt) {
  19475. var inpImmediate = this.inpImmediate;
  19476. if (inpImmediate) {
  19477. this.triggerEvent(evnt);
  19478. } else {
  19479. this.emitModel(this.inputValue, evnt);
  19480. }
  19481. },
  19482. focusEvent: function focusEvent(evnt) {
  19483. this.isActivated = true;
  19484. this.triggerEvent(evnt);
  19485. },
  19486. blurEvent: function blurEvent(evnt) {
  19487. var inputValue = this.inputValue,
  19488. inpImmediate = this.inpImmediate;
  19489. var value = inputValue;
  19490. if (!inpImmediate) {
  19491. this.emitModel(value, evnt);
  19492. }
  19493. this.afterCheckValue();
  19494. if (!this.visiblePanel) {
  19495. this.isActivated = false;
  19496. }
  19497. this.$emit('blur', {
  19498. value: value,
  19499. $event: evnt
  19500. });
  19501. },
  19502. keydownEvent: function keydownEvent(evnt) {
  19503. if (this.isNumber) {
  19504. var isCtrlKey = evnt.ctrlKey;
  19505. var isShiftKey = evnt.shiftKey;
  19506. var isAltKey = evnt.altKey;
  19507. var keyCode = evnt.keyCode;
  19508. if (!isCtrlKey && !isShiftKey && !isAltKey && (keyCode === 32 || keyCode >= 65 && keyCode <= 90)) {
  19509. evnt.preventDefault();
  19510. }
  19511. this.numberKeydownEvent(evnt);
  19512. }
  19513. this.triggerEvent(evnt);
  19514. },
  19515. mousewheelEvent: function mousewheelEvent(evnt) {
  19516. if (this.isNumber && this.controls) {
  19517. if (this.isActivated) {
  19518. var delta = -evnt.wheelDelta || evnt.detail;
  19519. if (delta > 0) {
  19520. this.numberNextEvent(evnt);
  19521. } else if (delta < 0) {
  19522. this.numberPrevEvent(evnt);
  19523. }
  19524. evnt.preventDefault();
  19525. }
  19526. }
  19527. },
  19528. clickEvent: function clickEvent(evnt) {
  19529. var isDatePicker = this.isDatePicker;
  19530. if (isDatePicker) {
  19531. this.datePickerOpenEvent(evnt);
  19532. }
  19533. this.triggerEvent(evnt);
  19534. },
  19535. clickPrefixEvent: function clickPrefixEvent(evnt) {
  19536. var $refs = this.$refs,
  19537. disabled = this.disabled,
  19538. inputValue = this.inputValue;
  19539. if (!disabled) {
  19540. this.$emit('prefix-click', {
  19541. $panel: $refs.panel,
  19542. value: inputValue,
  19543. $event: evnt
  19544. });
  19545. }
  19546. },
  19547. clickSuffixEvent: function clickSuffixEvent(evnt) {
  19548. var $refs = this.$refs,
  19549. disabled = this.disabled,
  19550. inputValue = this.inputValue;
  19551. if (!disabled) {
  19552. if (DomTools.hasClass(evnt.currentTarget, 'is--clear')) {
  19553. this.emitModel('', evnt);
  19554. this.clearValueEvent(evnt, '');
  19555. } else {
  19556. this.$emit('suffix-click', {
  19557. $panel: $refs.panel,
  19558. value: inputValue,
  19559. $event: evnt
  19560. });
  19561. }
  19562. }
  19563. },
  19564. clearValueEvent: function clearValueEvent(evnt, value) {
  19565. var $refs = this.$refs,
  19566. type = this.type,
  19567. isNumber = this.isNumber;
  19568. if (this.isDatePicker) {
  19569. this.hidePanel();
  19570. }
  19571. if (isNumber || ['text', 'search', 'password'].indexOf(type) > -1) {
  19572. this.focus();
  19573. }
  19574. this.$emit('clear', {
  19575. $panel: $refs.panel,
  19576. value: value,
  19577. $event: evnt
  19578. });
  19579. },
  19580. /**
  19581. * 检查初始值
  19582. */
  19583. initValue: function initValue() {
  19584. var type = this.type,
  19585. isDatePicker = this.isDatePicker,
  19586. inputValue = this.inputValue,
  19587. digitsValue = this.digitsValue;
  19588. if (isDatePicker) {
  19589. this.changeValue();
  19590. } else if (type === 'float') {
  19591. if (inputValue) {
  19592. var validValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toFixed(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.floor(inputValue, digitsValue), digitsValue);
  19593. if (inputValue !== validValue) {
  19594. this.emitModel(validValue, {
  19595. type: 'init'
  19596. });
  19597. }
  19598. }
  19599. }
  19600. },
  19601. /**
  19602. * 值变化时处理
  19603. */
  19604. changeValue: function changeValue() {
  19605. if (this.isDatePicker) {
  19606. this.dateParseValue(this.inputValue);
  19607. this.inputValue = this.datePanelLabel;
  19608. }
  19609. },
  19610. afterCheckValue: function afterCheckValue() {
  19611. var type = this.type,
  19612. inpAttrs = this.inpAttrs,
  19613. inputValue = this.inputValue,
  19614. isDatePicker = this.isDatePicker,
  19615. isNumber = this.isNumber,
  19616. datetimePanelValue = this.datetimePanelValue,
  19617. dateLabelFormat = this.dateLabelFormat,
  19618. min = this.min,
  19619. max = this.max;
  19620. if (!inpAttrs.readonly) {
  19621. if (isNumber) {
  19622. if (inputValue) {
  19623. var inpVal = type === 'integer' ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toInteger(inputValue) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(inputValue);
  19624. if (!this.vaildMinNum(inpVal)) {
  19625. inpVal = min;
  19626. } else if (!this.vaildMaxNum(inpVal)) {
  19627. inpVal = max;
  19628. }
  19629. this.emitModel(getNumberValue(this, inpVal), {
  19630. type: 'check'
  19631. });
  19632. }
  19633. } else if (isDatePicker) {
  19634. var _inpVal = inputValue;
  19635. if (_inpVal) {
  19636. if (type === 'time') {
  19637. _inpVal = toStringTimeDate(_inpVal);
  19638. } else {
  19639. _inpVal = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toStringDate(_inpVal, dateLabelFormat);
  19640. }
  19641. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isValidDate(_inpVal)) {
  19642. if (type === 'time') {
  19643. _inpVal = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toDateString(_inpVal, dateLabelFormat);
  19644. if (inputValue !== _inpVal) {
  19645. this.emitModel(_inpVal, {
  19646. type: 'check'
  19647. });
  19648. }
  19649. this.inputValue = _inpVal;
  19650. } else {
  19651. if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isDateSame(inputValue, _inpVal, dateLabelFormat)) {
  19652. if (type === 'datetime') {
  19653. datetimePanelValue.setHours(_inpVal.getHours());
  19654. datetimePanelValue.setMinutes(_inpVal.getMinutes());
  19655. datetimePanelValue.setSeconds(_inpVal.getSeconds());
  19656. }
  19657. } else {
  19658. this.inputValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toDateString(_inpVal, dateLabelFormat);
  19659. }
  19660. this.dateChange(_inpVal);
  19661. }
  19662. } else {
  19663. this.dateRevert();
  19664. }
  19665. } else {
  19666. this.emitModel('', {
  19667. type: 'check'
  19668. });
  19669. }
  19670. }
  19671. }
  19672. },
  19673. // 密码
  19674. passwordToggleEvent: function passwordToggleEvent(evnt) {
  19675. var disabled = this.disabled,
  19676. readonly = this.readonly,
  19677. showPwd = this.showPwd;
  19678. if (!disabled && !readonly) {
  19679. this.showPwd = !showPwd;
  19680. }
  19681. this.$emit('toggle-visible', {
  19682. visible: this.showPwd,
  19683. $event: evnt
  19684. });
  19685. },
  19686. // 密码
  19687. // 搜索
  19688. searchEvent: function searchEvent(evnt) {
  19689. this.$emit('search-click', {
  19690. $event: evnt
  19691. });
  19692. },
  19693. // 搜索
  19694. // 数值
  19695. vaildMinNum: function vaildMinNum(num) {
  19696. return this.min === null || num >= external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(this.min);
  19697. },
  19698. vaildMaxNum: function vaildMaxNum(num) {
  19699. return this.max === null || num <= external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(this.max);
  19700. },
  19701. numberStopDown: function numberStopDown() {
  19702. clearTimeout(this.downbumTimeout);
  19703. },
  19704. numberDownPrevEvent: function numberDownPrevEvent(evnt) {
  19705. var _this2 = this;
  19706. this.downbumTimeout = setTimeout(function () {
  19707. _this2.numberPrevEvent(evnt);
  19708. _this2.numberDownPrevEvent(evnt);
  19709. }, 60);
  19710. },
  19711. numberDownNextEvent: function numberDownNextEvent(evnt) {
  19712. var _this3 = this;
  19713. this.downbumTimeout = setTimeout(function () {
  19714. _this3.numberNextEvent(evnt);
  19715. _this3.numberDownNextEvent(evnt);
  19716. }, 60);
  19717. },
  19718. numberKeydownEvent: function numberKeydownEvent(evnt) {
  19719. var keyCode = evnt.keyCode;
  19720. var isUpArrow = keyCode === 38;
  19721. var isDwArrow = keyCode === 40;
  19722. if (isUpArrow || isDwArrow) {
  19723. evnt.preventDefault();
  19724. if (isUpArrow) {
  19725. this.numberPrevEvent(evnt);
  19726. } else {
  19727. this.numberNextEvent(evnt);
  19728. }
  19729. }
  19730. },
  19731. numberMousedownEvent: function numberMousedownEvent(evnt) {
  19732. var _this4 = this;
  19733. this.numberStopDown();
  19734. if (evnt.button === 0) {
  19735. var isPrevNumber = DomTools.hasClass(evnt.currentTarget, 'is--prev');
  19736. if (isPrevNumber) {
  19737. this.numberPrevEvent(evnt);
  19738. } else {
  19739. this.numberNextEvent(evnt);
  19740. }
  19741. this.downbumTimeout = setTimeout(function () {
  19742. if (isPrevNumber) {
  19743. _this4.numberDownPrevEvent(evnt);
  19744. } else {
  19745. _this4.numberDownNextEvent(evnt);
  19746. }
  19747. }, 500);
  19748. }
  19749. },
  19750. numberPrevEvent: function numberPrevEvent(evnt) {
  19751. var disabled = this.disabled,
  19752. readonly = this.readonly;
  19753. clearTimeout(this.downbumTimeout);
  19754. if (!disabled && !readonly) {
  19755. this.numberChange(true, evnt);
  19756. }
  19757. this.$emit('prev-number', {
  19758. $event: evnt
  19759. });
  19760. },
  19761. numberNextEvent: function numberNextEvent(evnt) {
  19762. var disabled = this.disabled,
  19763. readonly = this.readonly;
  19764. clearTimeout(this.downbumTimeout);
  19765. if (!disabled && !readonly) {
  19766. this.numberChange(false, evnt);
  19767. }
  19768. this.$emit('next-number', {
  19769. $event: evnt
  19770. });
  19771. },
  19772. numberChange: function numberChange(isPlus, evnt) {
  19773. var min = this.min,
  19774. max = this.max,
  19775. type = this.type,
  19776. inputValue = this.inputValue,
  19777. stepValue = this.stepValue;
  19778. var numValue = type === 'integer' ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toInteger(inputValue) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(inputValue);
  19779. var newValue = isPlus ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.add(numValue, stepValue) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.subtract(numValue, stepValue);
  19780. var restNum;
  19781. if (!this.vaildMinNum(newValue)) {
  19782. restNum = min;
  19783. } else if (!this.vaildMaxNum(newValue)) {
  19784. restNum = max;
  19785. } else {
  19786. restNum = newValue;
  19787. }
  19788. this.emitInputEvent(getNumberValue(this, restNum), evnt);
  19789. },
  19790. // 数值
  19791. // 日期
  19792. datePickerOpenEvent: function datePickerOpenEvent(evnt) {
  19793. var readonly = this.readonly;
  19794. if (!readonly) {
  19795. evnt.preventDefault();
  19796. this.showPanel();
  19797. }
  19798. },
  19799. dateMonthHandle: function dateMonthHandle(date, offsetMonth) {
  19800. this.selectMonth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatMonth(date, offsetMonth, 'first');
  19801. },
  19802. dateNowHandle: function dateNowHandle() {
  19803. var currentDate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatDay(Date.now(), 0, 'first');
  19804. this.currentDate = currentDate;
  19805. this.dateMonthHandle(currentDate, 0);
  19806. },
  19807. dateToggleTypeEvent: function dateToggleTypeEvent() {
  19808. var datePanelType = this.datePanelType;
  19809. if (datePanelType === 'month') {
  19810. datePanelType = 'year';
  19811. } else {
  19812. datePanelType = 'month';
  19813. }
  19814. this.datePanelType = datePanelType;
  19815. },
  19816. datePrevEvent: function datePrevEvent(evnt) {
  19817. var isDisabledPrevDateBtn = this.isDisabledPrevDateBtn,
  19818. type = this.type,
  19819. datePanelType = this.datePanelType;
  19820. if (!isDisabledPrevDateBtn) {
  19821. if (type === 'year') {
  19822. this.selectMonth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatYear(this.selectMonth, -yearSize, 'first');
  19823. } else if (type === 'month') {
  19824. if (datePanelType === 'year') {
  19825. this.selectMonth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatYear(this.selectMonth, -yearSize, 'first');
  19826. } else {
  19827. this.selectMonth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatYear(this.selectMonth, -1, 'first');
  19828. }
  19829. } else {
  19830. if (datePanelType === 'year') {
  19831. this.selectMonth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatYear(this.selectMonth, -yearSize, 'first');
  19832. } else if (datePanelType === 'month') {
  19833. this.selectMonth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatYear(this.selectMonth, -1, 'first');
  19834. } else {
  19835. this.selectMonth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatMonth(this.selectMonth, -1, 'first');
  19836. }
  19837. }
  19838. this.$emit('date-prev', {
  19839. type: type,
  19840. $event: evnt
  19841. });
  19842. }
  19843. },
  19844. dateTodayMonthEvent: function dateTodayMonthEvent(evnt) {
  19845. this.dateNowHandle();
  19846. this.dateChange(this.currentDate);
  19847. this.hidePanel();
  19848. this.$emit('date-today', {
  19849. type: this.type,
  19850. $event: evnt
  19851. });
  19852. },
  19853. dateNextEvent: function dateNextEvent(evnt) {
  19854. var isDisabledNextDateBtn = this.isDisabledNextDateBtn,
  19855. type = this.type,
  19856. datePanelType = this.datePanelType;
  19857. if (!isDisabledNextDateBtn) {
  19858. if (type === 'year') {
  19859. this.selectMonth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatYear(this.selectMonth, yearSize, 'first');
  19860. } else if (type === 'month') {
  19861. if (datePanelType === 'year') {
  19862. this.selectMonth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatYear(this.selectMonth, yearSize, 'first');
  19863. } else {
  19864. this.selectMonth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatYear(this.selectMonth, 1, 'first');
  19865. }
  19866. } else {
  19867. if (datePanelType === 'year') {
  19868. this.selectMonth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatYear(this.selectMonth, yearSize, 'first');
  19869. } else if (datePanelType === 'month') {
  19870. this.selectMonth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatYear(this.selectMonth, 1, 'first');
  19871. } else {
  19872. this.selectMonth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatMonth(this.selectMonth, 1, 'first');
  19873. }
  19874. }
  19875. this.$emit('date-next', {
  19876. type: type,
  19877. $event: evnt
  19878. });
  19879. }
  19880. },
  19881. dateSelectEvent: function dateSelectEvent(item) {
  19882. if (!isDateDisabled(this, item)) {
  19883. this.dateSelectItem(item.date);
  19884. }
  19885. },
  19886. dateSelectItem: function dateSelectItem(date) {
  19887. var type = this.type,
  19888. datePanelType = this.datePanelType;
  19889. var isWeekType = type === 'week';
  19890. if (type === 'month') {
  19891. if (datePanelType === 'year') {
  19892. this.datePanelType = 'month';
  19893. this.dateCheckMonth(date);
  19894. } else {
  19895. this.dateChange(date);
  19896. this.hidePanel();
  19897. }
  19898. } else if (type === 'year') {
  19899. this.hidePanel();
  19900. this.dateChange(date);
  19901. } else {
  19902. if (datePanelType === 'month') {
  19903. this.datePanelType = type === 'week' ? type : 'day';
  19904. this.dateCheckMonth(date);
  19905. } else if (datePanelType === 'year') {
  19906. this.datePanelType = 'month';
  19907. this.dateCheckMonth(date);
  19908. } else {
  19909. this.dateChange(date);
  19910. this.hidePanel();
  19911. }
  19912. }
  19913. if (isWeekType) {
  19914. this.changeValue();
  19915. }
  19916. },
  19917. dateMouseenterEvent: function dateMouseenterEvent(item) {
  19918. if (!isDateDisabled(this, item)) {
  19919. var datePanelType = this.datePanelType;
  19920. if (datePanelType === 'month') {
  19921. this.dateMoveMonth(item.date);
  19922. } else if (datePanelType === 'year') {
  19923. this.dateMoveYear(item.date);
  19924. } else {
  19925. this.dateMoveDay(item.date);
  19926. }
  19927. }
  19928. },
  19929. dateHourEvent: function dateHourEvent(evnt, item) {
  19930. this.datetimePanelValue.setHours(item.value);
  19931. this.dateTimeChangeEvent(evnt);
  19932. },
  19933. dateConfirmEvent: function dateConfirmEvent() {
  19934. this.dateChange(this.dateValue || this.currentDate);
  19935. this.hidePanel();
  19936. },
  19937. dateMinuteEvent: function dateMinuteEvent(evnt, item) {
  19938. this.datetimePanelValue.setMinutes(item.value);
  19939. this.dateTimeChangeEvent(evnt);
  19940. },
  19941. dateSecondEvent: function dateSecondEvent(evnt, item) {
  19942. this.datetimePanelValue.setSeconds(item.value);
  19943. this.dateTimeChangeEvent(evnt);
  19944. },
  19945. dateTimeChangeEvent: function dateTimeChangeEvent(evnt) {
  19946. this.datetimePanelValue = new Date(this.datetimePanelValue.getTime());
  19947. this.updateTimePos(evnt.currentTarget);
  19948. },
  19949. updateTimePos: function updateTimePos(liElem) {
  19950. if (liElem) {
  19951. var height = liElem.offsetHeight;
  19952. liElem.parentNode.scrollTop = liElem.offsetTop - height * 4;
  19953. }
  19954. },
  19955. dateMoveDay: function dateMoveDay(offsetDay) {
  19956. if (!isDateDisabled(this, {
  19957. date: offsetDay
  19958. })) {
  19959. if (!this.dayList.some(function (item) {
  19960. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isDateSame(item.date, offsetDay, 'yyyy-MM-dd');
  19961. })) {
  19962. this.dateCheckMonth(offsetDay);
  19963. }
  19964. this.dateParseValue(offsetDay);
  19965. }
  19966. },
  19967. dateMoveMonth: function dateMoveMonth(offsetMonth) {
  19968. if (!isDateDisabled(this, {
  19969. date: offsetMonth
  19970. })) {
  19971. if (!this.monthList.some(function (item) {
  19972. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isDateSame(item.date, offsetMonth, 'yyyy-MM');
  19973. })) {
  19974. this.dateCheckMonth(offsetMonth);
  19975. }
  19976. this.dateParseValue(offsetMonth);
  19977. }
  19978. },
  19979. dateMoveYear: function dateMoveYear(offsetYear) {
  19980. if (!isDateDisabled(this, {
  19981. date: offsetYear
  19982. })) {
  19983. if (!this.yearList.some(function (item) {
  19984. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isDateSame(item.date, offsetYear, 'yyyy');
  19985. })) {
  19986. this.dateCheckMonth(offsetYear);
  19987. }
  19988. this.dateParseValue(offsetYear);
  19989. }
  19990. },
  19991. dateParseValue: function dateParseValue(date) {
  19992. var type = this.type,
  19993. dateLabelFormat = this.dateLabelFormat,
  19994. valueFormat = this.valueFormat;
  19995. var dValue = null;
  19996. var dLabel = '';
  19997. if (date) {
  19998. if (type === 'time') {
  19999. dValue = toStringTimeDate(date);
  20000. } else {
  20001. dValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toStringDate(date, valueFormat);
  20002. }
  20003. }
  20004. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isValidDate(dValue)) {
  20005. dLabel = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toDateString(dValue, dateLabelFormat);
  20006. } else {
  20007. dValue = null;
  20008. }
  20009. this.datePanelValue = dValue;
  20010. this.datePanelLabel = dLabel;
  20011. },
  20012. dateOffsetEvent: function dateOffsetEvent(evnt) {
  20013. var isActivated = this.isActivated,
  20014. datePanelValue = this.datePanelValue,
  20015. datePanelType = this.datePanelType;
  20016. if (isActivated) {
  20017. evnt.preventDefault();
  20018. var keyCode = evnt.keyCode;
  20019. var isLeftArrow = keyCode === 37;
  20020. var isUpArrow = keyCode === 38;
  20021. var isRightArrow = keyCode === 39;
  20022. var isDwArrow = keyCode === 40;
  20023. if (datePanelType === 'year') {
  20024. var offsetYear = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatYear(datePanelValue || Date.now(), 0, 'first');
  20025. if (isLeftArrow) {
  20026. offsetYear = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatYear(offsetYear, -1);
  20027. } else if (isUpArrow) {
  20028. offsetYear = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatYear(offsetYear, -4);
  20029. } else if (isRightArrow) {
  20030. offsetYear = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatYear(offsetYear, 1);
  20031. } else if (isDwArrow) {
  20032. offsetYear = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatYear(offsetYear, 4);
  20033. }
  20034. this.dateMoveYear(offsetYear);
  20035. } else if (datePanelType === 'month') {
  20036. var offsetMonth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatMonth(datePanelValue || Date.now(), 0, 'first');
  20037. if (isLeftArrow) {
  20038. offsetMonth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatMonth(offsetMonth, -1);
  20039. } else if (isUpArrow) {
  20040. offsetMonth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatMonth(offsetMonth, -4);
  20041. } else if (isRightArrow) {
  20042. offsetMonth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatMonth(offsetMonth, 1);
  20043. } else if (isDwArrow) {
  20044. offsetMonth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatMonth(offsetMonth, 4);
  20045. }
  20046. this.dateMoveMonth(offsetMonth);
  20047. } else {
  20048. var offsetDay = datePanelValue || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatDay(Date.now(), 0, 'first');
  20049. if (isLeftArrow) {
  20050. offsetDay = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatDay(offsetDay, -1);
  20051. } else if (isUpArrow) {
  20052. offsetDay = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatWeek(offsetDay, -1);
  20053. } else if (isRightArrow) {
  20054. offsetDay = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatDay(offsetDay, 1);
  20055. } else if (isDwArrow) {
  20056. offsetDay = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatWeek(offsetDay, 1);
  20057. }
  20058. this.dateMoveDay(offsetDay);
  20059. }
  20060. }
  20061. },
  20062. datePgOffsetEvent: function datePgOffsetEvent(evnt) {
  20063. var isActivated = this.isActivated;
  20064. if (isActivated) {
  20065. var isPgUp = evnt.keyCode === 33;
  20066. evnt.preventDefault();
  20067. if (isPgUp) {
  20068. this.datePrevEvent(evnt);
  20069. } else {
  20070. this.dateNextEvent(evnt);
  20071. }
  20072. }
  20073. },
  20074. dateChange: function dateChange(date) {
  20075. var value = this.value,
  20076. datetimePanelValue = this.datetimePanelValue,
  20077. dateValueFormat = this.dateValueFormat;
  20078. if (this.type === 'week') {
  20079. var sWeek = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(this.startWeek);
  20080. date = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatWeek(date, 0, sWeek);
  20081. } else if (this.hasTime) {
  20082. date.setHours(datetimePanelValue.getHours());
  20083. date.setMinutes(datetimePanelValue.getMinutes());
  20084. date.setSeconds(datetimePanelValue.getSeconds());
  20085. }
  20086. var inpVal = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toDateString(date, dateValueFormat);
  20087. this.dateCheckMonth(date);
  20088. if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isEqual(value, inpVal)) {
  20089. this.emitModel(inpVal, {
  20090. type: 'update'
  20091. });
  20092. }
  20093. },
  20094. dateCheckMonth: function dateCheckMonth(date) {
  20095. var month = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatMonth(date, 0, 'first');
  20096. if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isEqual(month, this.selectMonth)) {
  20097. this.selectMonth = month;
  20098. }
  20099. },
  20100. dateOpenPanel: function dateOpenPanel() {
  20101. var _this5 = this;
  20102. var type = this.type,
  20103. dateValue = this.dateValue;
  20104. if (['year', 'month', 'week'].indexOf(type) > -1) {
  20105. this.datePanelType = type;
  20106. } else {
  20107. this.datePanelType = 'day';
  20108. }
  20109. this.currentDate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatDay(Date.now(), 0, 'first');
  20110. if (dateValue) {
  20111. this.dateMonthHandle(dateValue, 0);
  20112. this.dateParseValue(dateValue);
  20113. } else {
  20114. this.dateNowHandle();
  20115. }
  20116. if (this.hasTime) {
  20117. this.datetimePanelValue = this.datePanelValue || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatDay(Date.now(), 0, 'first');
  20118. this.$nextTick(function () {
  20119. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.arrayEach(_this5.$refs.timeBody.querySelectorAll('li.is--selected'), _this5.updateTimePos);
  20120. });
  20121. }
  20122. },
  20123. dateRevert: function dateRevert() {
  20124. this.inputValue = this.datePanelLabel;
  20125. },
  20126. // 日期
  20127. // 弹出面板
  20128. updateZindex: function updateZindex() {
  20129. if (this.panelIndex < UtilTools.getLastZIndex()) {
  20130. this.panelIndex = UtilTools.nextZIndex();
  20131. }
  20132. },
  20133. showPanel: function showPanel() {
  20134. var _this6 = this;
  20135. var disabled = this.disabled,
  20136. visiblePanel = this.visiblePanel,
  20137. isDatePicker = this.isDatePicker;
  20138. if (!disabled && !visiblePanel) {
  20139. clearTimeout(this.hidePanelTimeout);
  20140. this.isActivated = true;
  20141. this.animatVisible = true;
  20142. if (isDatePicker) {
  20143. this.dateOpenPanel();
  20144. }
  20145. setTimeout(function () {
  20146. _this6.visiblePanel = true;
  20147. }, 10);
  20148. this.updateZindex();
  20149. this.updatePlacement();
  20150. }
  20151. },
  20152. hidePanel: function hidePanel() {
  20153. var _this7 = this;
  20154. this.visiblePanel = false;
  20155. this.hidePanelTimeout = setTimeout(function () {
  20156. _this7.animatVisible = false;
  20157. }, 350);
  20158. },
  20159. updatePlacement: function updatePlacement() {
  20160. var _this8 = this;
  20161. return this.$nextTick().then(function () {
  20162. var $refs = _this8.$refs,
  20163. transfer = _this8.transfer,
  20164. placement = _this8.placement,
  20165. panelIndex = _this8.panelIndex;
  20166. var targetElem = $refs.input;
  20167. var panelElem = $refs.panel;
  20168. if (targetElem && panelElem) {
  20169. var targetHeight = targetElem.offsetHeight;
  20170. var targetWidth = targetElem.offsetWidth;
  20171. var panelHeight = panelElem.offsetHeight;
  20172. var panelWidth = panelElem.offsetWidth;
  20173. var marginSize = 5;
  20174. var panelStyle = {
  20175. zIndex: panelIndex
  20176. };
  20177. var _DomTools$getAbsolute = DomTools.getAbsolutePos(targetElem),
  20178. boundingTop = _DomTools$getAbsolute.boundingTop,
  20179. boundingLeft = _DomTools$getAbsolute.boundingLeft,
  20180. visibleHeight = _DomTools$getAbsolute.visibleHeight,
  20181. visibleWidth = _DomTools$getAbsolute.visibleWidth;
  20182. var panelPlacement = 'bottom';
  20183. if (transfer) {
  20184. var left = boundingLeft;
  20185. var top = boundingTop + targetHeight;
  20186. if (placement === 'top') {
  20187. panelPlacement = 'top';
  20188. top = boundingTop - panelHeight;
  20189. } else if (!placement) {
  20190. // 如果下面不够放,则向上
  20191. if (top + panelHeight + marginSize > visibleHeight) {
  20192. panelPlacement = 'top';
  20193. top = boundingTop - panelHeight;
  20194. } // 如果上面不够放,则向下(优先)
  20195. if (top < marginSize) {
  20196. panelPlacement = 'bottom';
  20197. top = boundingTop + targetHeight;
  20198. }
  20199. } // 如果溢出右边
  20200. if (left + panelWidth + marginSize > visibleWidth) {
  20201. left -= left + panelWidth + marginSize - visibleWidth;
  20202. } // 如果溢出左边
  20203. if (left < marginSize) {
  20204. left = marginSize;
  20205. }
  20206. Object.assign(panelStyle, {
  20207. left: "".concat(left, "px"),
  20208. top: "".concat(top, "px"),
  20209. minWidth: "".concat(targetWidth, "px")
  20210. });
  20211. } else {
  20212. if (placement === 'top') {
  20213. panelPlacement = 'top';
  20214. panelStyle.bottom = "".concat(targetHeight, "px");
  20215. } else if (!placement) {
  20216. // 如果下面不够放,则向上
  20217. if (boundingTop + targetHeight + panelHeight > visibleHeight) {
  20218. // 如果上面不够放,则向下(优先)
  20219. if (boundingTop - targetHeight - panelHeight > marginSize) {
  20220. panelPlacement = 'top';
  20221. panelStyle.bottom = "".concat(targetHeight, "px");
  20222. }
  20223. }
  20224. }
  20225. }
  20226. _this8.panelStyle = panelStyle;
  20227. _this8.panelPlacement = panelPlacement;
  20228. return _this8.$nextTick();
  20229. }
  20230. });
  20231. },
  20232. // 弹出面板
  20233. // 全局事件
  20234. handleGlobalMousedownEvent: function handleGlobalMousedownEvent(evnt) {
  20235. var $refs = this.$refs,
  20236. $el = this.$el,
  20237. disabled = this.disabled,
  20238. visiblePanel = this.visiblePanel,
  20239. isActivated = this.isActivated;
  20240. if (!disabled && isActivated) {
  20241. this.isActivated = DomTools.getEventTargetNode(evnt, $el).flag || DomTools.getEventTargetNode(evnt, $refs.panel).flag;
  20242. if (!this.isActivated) {
  20243. // 如果是日期类型
  20244. if (this.isDatePicker) {
  20245. if (visiblePanel) {
  20246. this.hidePanel();
  20247. this.afterCheckValue();
  20248. }
  20249. } else {
  20250. this.afterCheckValue();
  20251. }
  20252. }
  20253. }
  20254. },
  20255. handleGlobalKeydownEvent: function handleGlobalKeydownEvent(evnt) {
  20256. var isDatePicker = this.isDatePicker,
  20257. visiblePanel = this.visiblePanel,
  20258. clearable = this.clearable,
  20259. disabled = this.disabled;
  20260. if (!disabled) {
  20261. var keyCode = evnt.keyCode;
  20262. var isTab = keyCode === 9;
  20263. var isDel = keyCode === 46;
  20264. var isEsc = keyCode === 27;
  20265. var isEnter = keyCode === 13;
  20266. var isLeftArrow = keyCode === 37;
  20267. var isUpArrow = keyCode === 38;
  20268. var isRightArrow = keyCode === 39;
  20269. var isDwArrow = keyCode === 40;
  20270. var isPgUp = keyCode === 33;
  20271. var isPgDn = keyCode === 34;
  20272. var operArrow = isLeftArrow || isUpArrow || isRightArrow || isDwArrow;
  20273. var isActivated = this.isActivated;
  20274. if (isTab) {
  20275. if (isActivated) {
  20276. this.afterCheckValue();
  20277. }
  20278. isActivated = false;
  20279. this.isActivated = isActivated;
  20280. } else if (operArrow) {
  20281. if (isDatePicker) {
  20282. if (isActivated) {
  20283. if (visiblePanel) {
  20284. this.dateOffsetEvent(evnt);
  20285. } else if (isUpArrow || isDwArrow) {
  20286. this.datePickerOpenEvent(evnt);
  20287. }
  20288. }
  20289. }
  20290. } else if (isEnter) {
  20291. if (isDatePicker) {
  20292. if (visiblePanel) {
  20293. if (this.datePanelValue) {
  20294. this.dateSelectItem(this.datePanelValue);
  20295. } else {
  20296. this.hidePanel();
  20297. }
  20298. } else if (isActivated) {
  20299. this.datePickerOpenEvent(evnt);
  20300. }
  20301. }
  20302. } else if (isPgUp || isPgDn) {
  20303. if (isDatePicker) {
  20304. if (isActivated) {
  20305. this.datePgOffsetEvent(evnt);
  20306. }
  20307. }
  20308. }
  20309. if (isTab || isEsc) {
  20310. if (visiblePanel) {
  20311. this.hidePanel();
  20312. }
  20313. } else if (isDel && clearable) {
  20314. if (isActivated) {
  20315. this.clearValueEvent(evnt, null);
  20316. }
  20317. }
  20318. }
  20319. },
  20320. handleGlobalMousewheelEvent: function handleGlobalMousewheelEvent(evnt) {
  20321. var $refs = this.$refs,
  20322. disabled = this.disabled,
  20323. visiblePanel = this.visiblePanel;
  20324. if (!disabled) {
  20325. if (visiblePanel) {
  20326. if (DomTools.getEventTargetNode(evnt, $refs.panel).flag) {
  20327. this.updatePlacement();
  20328. } else {
  20329. this.hidePanel();
  20330. this.afterCheckValue();
  20331. }
  20332. }
  20333. }
  20334. },
  20335. handleGlobalBlurEvent: function handleGlobalBlurEvent() {
  20336. var isActivated = this.isActivated,
  20337. visiblePanel = this.visiblePanel;
  20338. if (visiblePanel) {
  20339. this.hidePanel();
  20340. this.afterCheckValue();
  20341. } else if (isActivated) {
  20342. this.afterCheckValue();
  20343. }
  20344. } // 全局事件
  20345. }
  20346. });
  20347. // CONCATENATED MODULE: ./packages/checkbox/src/checkbox.js
  20348. /* harmony default export */ var src_checkbox = ({
  20349. name: 'VxeCheckbox',
  20350. mixins: [size],
  20351. props: {
  20352. value: Boolean,
  20353. label: [String, Number],
  20354. indeterminate: Boolean,
  20355. title: [String, Number],
  20356. content: [String, Number],
  20357. disabled: Boolean,
  20358. size: {
  20359. type: String,
  20360. default: function _default() {
  20361. return conf.checkbox.size || conf.size;
  20362. }
  20363. }
  20364. },
  20365. inject: {
  20366. $xecheckboxgroup: {
  20367. default: null
  20368. }
  20369. },
  20370. computed: {
  20371. isGroup: function isGroup() {
  20372. return this.$xecheckboxgroup;
  20373. },
  20374. isDisabled: function isDisabled() {
  20375. return this.disabled || this.isGroup && this.$xecheckboxgroup.disabled;
  20376. }
  20377. },
  20378. render: function render(h) {
  20379. var _ref;
  20380. var $scopedSlots = this.$scopedSlots,
  20381. $xecheckboxgroup = this.$xecheckboxgroup,
  20382. isGroup = this.isGroup,
  20383. isDisabled = this.isDisabled,
  20384. title = this.title,
  20385. vSize = this.vSize,
  20386. indeterminate = this.indeterminate,
  20387. value = this.value,
  20388. label = this.label,
  20389. content = this.content;
  20390. var attrs = {};
  20391. if (title) {
  20392. attrs.title = title;
  20393. }
  20394. return h('label', {
  20395. class: ['vxe-checkbox', (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, 'is--indeterminate', indeterminate), _defineProperty(_ref, 'is--disabled', isDisabled), _ref)],
  20396. attrs: attrs
  20397. }, [h('input', {
  20398. class: 'vxe-checkbox--input',
  20399. attrs: {
  20400. type: 'checkbox',
  20401. disabled: isDisabled
  20402. },
  20403. domProps: {
  20404. checked: isGroup ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.includes($xecheckboxgroup.value, label) : value
  20405. },
  20406. on: {
  20407. change: this.changeEvent
  20408. }
  20409. }), h('span', {
  20410. class: 'vxe-checkbox--icon'
  20411. }), h('span', {
  20412. class: 'vxe-checkbox--label'
  20413. }, $scopedSlots.default ? $scopedSlots.default.call(this, {}) : [UtilTools.getFuncText(content)])]);
  20414. },
  20415. methods: {
  20416. changeEvent: function changeEvent(evnt) {
  20417. var $xecheckboxgroup = this.$xecheckboxgroup,
  20418. isGroup = this.isGroup,
  20419. isDisabled = this.isDisabled,
  20420. label = this.label;
  20421. if (!isDisabled) {
  20422. var checked = evnt.target.checked;
  20423. var params = {
  20424. checked: checked,
  20425. label: label,
  20426. $event: evnt
  20427. };
  20428. if (isGroup) {
  20429. $xecheckboxgroup.handleChecked(params);
  20430. } else {
  20431. this.$emit('input', checked);
  20432. this.$emit('change', params);
  20433. }
  20434. }
  20435. }
  20436. }
  20437. });
  20438. // CONCATENATED MODULE: ./packages/select/src/select.js
  20439. function isOptionVisible(option) {
  20440. return option.visible !== false;
  20441. }
  20442. function getOptUniqueId() {
  20443. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.uniqueId('opt_');
  20444. }
  20445. function getOptkey(_vm) {
  20446. return _vm.optionId || '_XID';
  20447. }
  20448. function getOptid(_vm, option) {
  20449. var optid = option[getOptkey(_vm)];
  20450. return optid ? encodeURIComponent(optid) : '';
  20451. }
  20452. function findOffsetOption(_vm, optionValue) {
  20453. var isUpArrow = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  20454. var isGroup = _vm.isGroup,
  20455. visibleOptionList = _vm.visibleOptionList,
  20456. visibleGroupList = _vm.visibleGroupList,
  20457. valueField = _vm.valueField,
  20458. groupOptionsField = _vm.groupOptionsField;
  20459. var firstOption;
  20460. var prevOption;
  20461. var nextOption;
  20462. var currOption;
  20463. if (isGroup) {
  20464. for (var gIndex = 0; gIndex < visibleGroupList.length; gIndex++) {
  20465. var group = visibleGroupList[gIndex];
  20466. var groupOptionList = group[groupOptionsField];
  20467. var isGroupDisabled = group.disabled;
  20468. if (groupOptionList) {
  20469. for (var index = 0; index < groupOptionList.length; index++) {
  20470. var option = groupOptionList[index];
  20471. var isVisible = isOptionVisible(option);
  20472. var isDisabled = isGroupDisabled || option.disabled;
  20473. if (!firstOption && !isDisabled) {
  20474. firstOption = option;
  20475. }
  20476. if (currOption) {
  20477. if (isVisible && !isDisabled) {
  20478. nextOption = option;
  20479. if (!isUpArrow) {
  20480. return {
  20481. offsetOption: nextOption
  20482. };
  20483. }
  20484. }
  20485. }
  20486. if (optionValue === option[valueField]) {
  20487. currOption = option;
  20488. if (isUpArrow) {
  20489. return {
  20490. offsetOption: prevOption
  20491. };
  20492. }
  20493. } else {
  20494. if (isVisible && !isDisabled) {
  20495. prevOption = option;
  20496. }
  20497. }
  20498. }
  20499. }
  20500. }
  20501. } else {
  20502. for (var _index = 0; _index < visibleOptionList.length; _index++) {
  20503. var _option = visibleOptionList[_index];
  20504. var _isDisabled = _option.disabled;
  20505. if (!firstOption && !_isDisabled) {
  20506. firstOption = _option;
  20507. }
  20508. if (currOption) {
  20509. if (!_isDisabled) {
  20510. nextOption = _option;
  20511. if (!isUpArrow) {
  20512. return {
  20513. offsetOption: nextOption
  20514. };
  20515. }
  20516. }
  20517. }
  20518. if (optionValue === _option[valueField]) {
  20519. currOption = _option;
  20520. if (isUpArrow) {
  20521. return {
  20522. offsetOption: prevOption
  20523. };
  20524. }
  20525. } else {
  20526. if (!_isDisabled) {
  20527. prevOption = _option;
  20528. }
  20529. }
  20530. }
  20531. }
  20532. return {
  20533. firstOption: firstOption
  20534. };
  20535. }
  20536. function findOption(_vm, optionValue) {
  20537. var isGroup = _vm.isGroup,
  20538. fullOptionList = _vm.fullOptionList,
  20539. fullGroupList = _vm.fullGroupList,
  20540. valueField = _vm.valueField;
  20541. if (isGroup) {
  20542. for (var gIndex = 0; gIndex < fullGroupList.length; gIndex++) {
  20543. var group = fullGroupList[gIndex];
  20544. if (group.options) {
  20545. for (var index = 0; index < group.options.length; index++) {
  20546. var option = group.options[index];
  20547. if (optionValue === option[valueField]) {
  20548. return option;
  20549. }
  20550. }
  20551. }
  20552. }
  20553. }
  20554. return fullOptionList.find(function (item) {
  20555. return optionValue === item[valueField];
  20556. });
  20557. }
  20558. function getSelectLabel(_vm, value) {
  20559. var item = findOption(_vm, value);
  20560. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toValueString(item ? item[_vm.labelField] : value);
  20561. }
  20562. function renderOption(h, _vm, list, group) {
  20563. var isGroup = _vm.isGroup,
  20564. labelField = _vm.labelField,
  20565. valueField = _vm.valueField,
  20566. optionKey = _vm.optionKey,
  20567. value = _vm.value,
  20568. multiple = _vm.multiple,
  20569. currentValue = _vm.currentValue;
  20570. return list.map(function (option, cIndex) {
  20571. var isVisible = !isGroup || isOptionVisible(option);
  20572. var isDisabled = group && group.disabled || option.disabled;
  20573. var optionValue = option[valueField];
  20574. var optid = getOptid(_vm, option);
  20575. return isVisible ? h('div', {
  20576. key: optionKey ? optid : cIndex,
  20577. class: ['vxe-select-option', {
  20578. 'is--disabled': isDisabled,
  20579. 'is--selected': multiple ? value && value.indexOf(optionValue) > -1 : value === optionValue,
  20580. 'is--hover': currentValue === optionValue
  20581. }],
  20582. attrs: {
  20583. optid: optid
  20584. },
  20585. on: {
  20586. click: function click(evnt) {
  20587. if (!isDisabled) {
  20588. _vm.changeOptionEvent(evnt, optionValue);
  20589. }
  20590. },
  20591. mouseenter: function mouseenter() {
  20592. if (!isDisabled) {
  20593. _vm.setCurrentOption(option);
  20594. }
  20595. }
  20596. }
  20597. }, UtilTools.formatText(UtilTools.getFuncText(option[labelField]))) : null;
  20598. });
  20599. }
  20600. function renderOptgroup(h, _vm) {
  20601. var optionKey = _vm.optionKey,
  20602. visibleGroupList = _vm.visibleGroupList,
  20603. groupLabelField = _vm.groupLabelField,
  20604. groupOptionsField = _vm.groupOptionsField;
  20605. return visibleGroupList.map(function (group, gIndex) {
  20606. var optid = getOptid(_vm, group);
  20607. var isGroupDisabled = group.disabled;
  20608. return h('div', {
  20609. key: optionKey ? optid : gIndex,
  20610. class: ['vxe-optgroup', {
  20611. 'is--disabled': isGroupDisabled
  20612. }],
  20613. attrs: {
  20614. optid: optid
  20615. }
  20616. }, [h('div', {
  20617. class: 'vxe-optgroup--title'
  20618. }, UtilTools.getFuncText(group[groupLabelField])), h('div', {
  20619. class: 'vxe-optgroup--wrapper'
  20620. }, renderOption(h, _vm, group[groupOptionsField], group))]);
  20621. });
  20622. }
  20623. function select_renderOpts(h, _vm) {
  20624. var isGroup = _vm.isGroup,
  20625. visibleGroupList = _vm.visibleGroupList,
  20626. visibleOptionList = _vm.visibleOptionList;
  20627. if (isGroup) {
  20628. if (visibleGroupList.length) {
  20629. return renderOptgroup(h, _vm);
  20630. }
  20631. } else {
  20632. if (visibleOptionList.length) {
  20633. return renderOption(h, _vm, visibleOptionList);
  20634. }
  20635. }
  20636. return [h('div', {
  20637. class: 'vxe-select--empty-placeholder'
  20638. }, _vm.emptyText || conf.i18n('vxe.select.emptyText'))];
  20639. }
  20640. /* harmony default export */ var src_select = ({
  20641. name: 'VxeSelect',
  20642. mixins: [size],
  20643. props: {
  20644. value: null,
  20645. clearable: Boolean,
  20646. placeholder: String,
  20647. disabled: Boolean,
  20648. multiple: Boolean,
  20649. multiCharOverflow: {
  20650. type: [Number, String],
  20651. default: function _default() {
  20652. return conf.select.multiCharOverflow;
  20653. }
  20654. },
  20655. prefixIcon: String,
  20656. placement: String,
  20657. options: Array,
  20658. optionProps: Object,
  20659. optionGroups: Array,
  20660. optionGroupProps: Object,
  20661. size: {
  20662. type: String,
  20663. default: function _default() {
  20664. return conf.select.size || conf.size;
  20665. }
  20666. },
  20667. emptyText: String,
  20668. optionId: {
  20669. type: String,
  20670. default: function _default() {
  20671. return conf.select.optionId;
  20672. }
  20673. },
  20674. optionKey: Boolean,
  20675. transfer: {
  20676. type: Boolean,
  20677. default: function _default() {
  20678. return conf.select.transfer;
  20679. }
  20680. }
  20681. },
  20682. components: {
  20683. VxeInput: input
  20684. },
  20685. provide: function provide() {
  20686. return {
  20687. $xeselect: this
  20688. };
  20689. },
  20690. data: function data() {
  20691. return {
  20692. inited: false,
  20693. collectOption: [],
  20694. fullGroupList: [],
  20695. fullOptionList: [],
  20696. visibleGroupList: [],
  20697. visibleOptionList: [],
  20698. panelIndex: 0,
  20699. panelStyle: null,
  20700. panelPlacement: null,
  20701. currentValue: null,
  20702. visiblePanel: false,
  20703. animatVisible: false,
  20704. isActivated: false
  20705. };
  20706. },
  20707. computed: {
  20708. propsOpts: function propsOpts() {
  20709. return this.optionProps || {};
  20710. },
  20711. groupPropsOpts: function groupPropsOpts() {
  20712. return this.optionGroupProps || {};
  20713. },
  20714. labelField: function labelField() {
  20715. return this.propsOpts.label || 'label';
  20716. },
  20717. valueField: function valueField() {
  20718. return this.propsOpts.value || 'value';
  20719. },
  20720. groupLabelField: function groupLabelField() {
  20721. return this.groupPropsOpts.label || 'label';
  20722. },
  20723. groupOptionsField: function groupOptionsField() {
  20724. return this.groupPropsOpts.options || 'options';
  20725. },
  20726. isGroup: function isGroup() {
  20727. return this.fullGroupList.some(function (item) {
  20728. return item.options && item.options.length;
  20729. });
  20730. },
  20731. multiMaxCharNum: function multiMaxCharNum() {
  20732. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(this.multiCharOverflow);
  20733. },
  20734. selectLabel: function selectLabel() {
  20735. var _this = this;
  20736. var value = this.value,
  20737. multiple = this.multiple,
  20738. multiMaxCharNum = this.multiMaxCharNum;
  20739. if (value && multiple) {
  20740. return value.map(function (val) {
  20741. var label = getSelectLabel(_this, val);
  20742. if (multiMaxCharNum > 0 && label.length > multiMaxCharNum) {
  20743. return "".concat(label.substring(0, multiMaxCharNum), "...");
  20744. }
  20745. return label;
  20746. }).join(', ');
  20747. }
  20748. return getSelectLabel(this, value);
  20749. }
  20750. },
  20751. watch: {
  20752. collectOption: function collectOption(value) {
  20753. if (value.some(function (item) {
  20754. return item.options && item.options.length;
  20755. })) {
  20756. this.fullOptionList = [];
  20757. this.fullGroupList = value;
  20758. } else {
  20759. this.fullGroupList = [];
  20760. this.fullOptionList = value;
  20761. }
  20762. this.updateCache();
  20763. },
  20764. options: function options(value) {
  20765. this.fullGroupList = [];
  20766. this.fullOptionList = value;
  20767. this.updateCache();
  20768. },
  20769. optionGroups: function optionGroups(value) {
  20770. this.fullOptionList = [];
  20771. this.fullGroupList = value;
  20772. this.updateCache();
  20773. }
  20774. },
  20775. created: function created() {
  20776. var options = this.options,
  20777. optionGroups = this.optionGroups;
  20778. if (optionGroups) {
  20779. this.fullGroupList = optionGroups;
  20780. } else if (options) {
  20781. this.fullOptionList = options;
  20782. }
  20783. this.updateCache();
  20784. GlobalEvent.on(this, 'mousewheel', this.handleGlobalMousewheelEvent);
  20785. GlobalEvent.on(this, 'mousedown', this.handleGlobalMousedownEvent);
  20786. GlobalEvent.on(this, 'keydown', this.handleGlobalKeydownEvent);
  20787. GlobalEvent.on(this, 'blur', this.handleGlobalBlurEvent);
  20788. },
  20789. beforeDestroy: function beforeDestroy() {
  20790. var panelElem = this.$refs.panel;
  20791. if (panelElem && panelElem.parentNode) {
  20792. panelElem.parentNode.removeChild(panelElem);
  20793. }
  20794. },
  20795. destroyed: function destroyed() {
  20796. GlobalEvent.off(this, 'mousewheel');
  20797. GlobalEvent.off(this, 'mousedown');
  20798. GlobalEvent.off(this, 'keydown');
  20799. GlobalEvent.off(this, 'blur');
  20800. },
  20801. render: function render(h) {
  20802. var _ref, _ref2;
  20803. var vSize = this.vSize,
  20804. inited = this.inited,
  20805. isActivated = this.isActivated,
  20806. disabled = this.disabled,
  20807. visiblePanel = this.visiblePanel;
  20808. return h('div', {
  20809. class: ['vxe-select', (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, 'is--visivle', visiblePanel), _defineProperty(_ref, 'is--disabled', disabled), _defineProperty(_ref, 'is--active', isActivated), _ref)]
  20810. }, [h('div', {
  20811. class: 'vxe-select-slots',
  20812. ref: 'hideOption'
  20813. }, this.$slots.default), h('vxe-input', {
  20814. ref: 'input',
  20815. props: {
  20816. clearable: this.clearable,
  20817. placeholder: this.placeholder,
  20818. readonly: true,
  20819. disabled: disabled,
  20820. type: 'text',
  20821. prefixIcon: this.prefixIcon,
  20822. suffixIcon: visiblePanel ? conf.icon.SELECT_OPEN : conf.icon.SELECT_CLOSE,
  20823. value: this.selectLabel
  20824. },
  20825. on: {
  20826. clear: this.clearEvent,
  20827. click: this.togglePanelEvent,
  20828. focus: this.focusEvent,
  20829. blur: this.blurEvent,
  20830. 'suffix-click': this.togglePanelEvent
  20831. }
  20832. }), h('div', {
  20833. ref: 'panel',
  20834. 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)],
  20835. attrs: {
  20836. placement: this.panelPlacement
  20837. },
  20838. style: this.panelStyle
  20839. }, inited ? [h('div', {
  20840. ref: 'optWrapper',
  20841. class: 'vxe-select-option--wrapper'
  20842. }, select_renderOpts(h, this))] : null)]);
  20843. },
  20844. methods: {
  20845. updateCache: function updateCache() {
  20846. var _this2 = this;
  20847. var fullOptionList = this.fullOptionList,
  20848. fullGroupList = this.fullGroupList,
  20849. groupOptionsField = this.groupOptionsField;
  20850. var optkey = getOptkey(this);
  20851. var handleOptis = function handleOptis(item) {
  20852. if (!getOptid(_this2, item)) {
  20853. item[optkey] = getOptUniqueId();
  20854. }
  20855. };
  20856. if (fullGroupList.length) {
  20857. fullGroupList.forEach(function (group) {
  20858. handleOptis(group);
  20859. if (group[groupOptionsField]) {
  20860. group[groupOptionsField].forEach(handleOptis);
  20861. }
  20862. });
  20863. } else if (fullOptionList.length) {
  20864. fullOptionList.forEach(handleOptis);
  20865. }
  20866. this.refreshOption();
  20867. },
  20868. /**
  20869. * 刷新选项,当选项被动态显示/隐藏时可能会用到
  20870. */
  20871. refreshOption: function refreshOption() {
  20872. var isGroup = this.isGroup,
  20873. fullOptionList = this.fullOptionList,
  20874. fullGroupList = this.fullGroupList;
  20875. if (isGroup) {
  20876. this.visibleGroupList = fullGroupList.filter(isOptionVisible);
  20877. } else {
  20878. this.visibleOptionList = fullOptionList.filter(isOptionVisible);
  20879. }
  20880. return this.$nextTick();
  20881. },
  20882. setCurrentOption: function setCurrentOption(option) {
  20883. if (option) {
  20884. this.currentValue = option[this.valueField];
  20885. }
  20886. },
  20887. scrollToOption: function scrollToOption(option, isAlignBottom) {
  20888. var _this3 = this;
  20889. return this.$nextTick().then(function () {
  20890. if (option) {
  20891. var $refs = _this3.$refs;
  20892. var optWrapperElem = $refs.optWrapper;
  20893. var optElem = $refs.panel.querySelector("[optid='".concat(getOptid(_this3, option), "']"));
  20894. if (optWrapperElem && optElem) {
  20895. var wrapperHeight = optWrapperElem.offsetHeight;
  20896. var offsetPadding = 5;
  20897. if (isAlignBottom) {
  20898. if (optElem.offsetTop + optElem.offsetHeight - optWrapperElem.scrollTop > wrapperHeight) {
  20899. optWrapperElem.scrollTop = optElem.offsetTop + optElem.offsetHeight - wrapperHeight;
  20900. }
  20901. } else {
  20902. if (optElem.offsetTop + offsetPadding < optWrapperElem.scrollTop || optElem.offsetTop + offsetPadding > optWrapperElem.scrollTop + optWrapperElem.clientHeight) {
  20903. optWrapperElem.scrollTop = optElem.offsetTop - offsetPadding;
  20904. }
  20905. }
  20906. }
  20907. }
  20908. });
  20909. },
  20910. clearEvent: function clearEvent(params, evnt) {
  20911. this.clearValueEvent(evnt, null);
  20912. this.hideOptionPanel();
  20913. },
  20914. clearValueEvent: function clearValueEvent(evnt, selectValue) {
  20915. this.changeEvent(evnt, selectValue);
  20916. this.$emit('clear', {
  20917. value: selectValue,
  20918. $event: evnt
  20919. });
  20920. },
  20921. changeEvent: function changeEvent(evnt, selectValue) {
  20922. if (selectValue !== this.value) {
  20923. this.$emit('input', selectValue);
  20924. this.$emit('change', {
  20925. value: selectValue,
  20926. $event: evnt
  20927. });
  20928. }
  20929. },
  20930. changeOptionEvent: function changeOptionEvent(evnt, selectValue) {
  20931. var value = this.value,
  20932. multiple = this.multiple;
  20933. if (multiple) {
  20934. var multipleValue;
  20935. if (value) {
  20936. if (value.indexOf(selectValue) === -1) {
  20937. multipleValue = value.concat([selectValue]);
  20938. } else {
  20939. multipleValue = value.filter(function (val) {
  20940. return val !== selectValue;
  20941. });
  20942. }
  20943. } else {
  20944. multipleValue = [selectValue];
  20945. }
  20946. this.changeEvent(evnt, multipleValue);
  20947. } else {
  20948. this.changeEvent(evnt, selectValue);
  20949. this.hideOptionPanel();
  20950. }
  20951. },
  20952. handleGlobalMousewheelEvent: function handleGlobalMousewheelEvent(evnt) {
  20953. var $refs = this.$refs,
  20954. disabled = this.disabled,
  20955. visiblePanel = this.visiblePanel;
  20956. if (!disabled) {
  20957. if (visiblePanel) {
  20958. if (DomTools.getEventTargetNode(evnt, $refs.panel).flag) {
  20959. this.updatePlacement();
  20960. } else {
  20961. this.hideOptionPanel();
  20962. }
  20963. }
  20964. }
  20965. },
  20966. handleGlobalMousedownEvent: function handleGlobalMousedownEvent(evnt) {
  20967. var $refs = this.$refs,
  20968. $el = this.$el,
  20969. disabled = this.disabled,
  20970. visiblePanel = this.visiblePanel;
  20971. if (!disabled) {
  20972. this.isActivated = DomTools.getEventTargetNode(evnt, $el).flag || DomTools.getEventTargetNode(evnt, $refs.panel).flag;
  20973. if (visiblePanel && !this.isActivated) {
  20974. this.hideOptionPanel();
  20975. }
  20976. }
  20977. },
  20978. handleGlobalKeydownEvent: function handleGlobalKeydownEvent(evnt) {
  20979. var visiblePanel = this.visiblePanel,
  20980. currentValue = this.currentValue,
  20981. clearable = this.clearable,
  20982. disabled = this.disabled;
  20983. if (!disabled) {
  20984. var keyCode = evnt.keyCode;
  20985. var isTab = keyCode === 9;
  20986. var isEnter = keyCode === 13;
  20987. var isEsc = keyCode === 27;
  20988. var isUpArrow = keyCode === 38;
  20989. var isDwArrow = keyCode === 40;
  20990. var isDel = keyCode === 46;
  20991. var isSpacebar = keyCode === 32;
  20992. if (isTab) {
  20993. this.isActivated = false;
  20994. }
  20995. if (visiblePanel) {
  20996. if (isEsc || isTab) {
  20997. this.hideOptionPanel();
  20998. } else if (isEnter) {
  20999. evnt.preventDefault();
  21000. evnt.stopPropagation();
  21001. this.changeOptionEvent(evnt, currentValue);
  21002. } else if (isUpArrow || isDwArrow) {
  21003. evnt.preventDefault();
  21004. var _findOffsetOption = findOffsetOption(this, currentValue, isUpArrow),
  21005. firstOption = _findOffsetOption.firstOption,
  21006. offsetOption = _findOffsetOption.offsetOption;
  21007. if (!offsetOption && !findOption(this, currentValue)) {
  21008. offsetOption = firstOption;
  21009. }
  21010. this.setCurrentOption(offsetOption);
  21011. this.scrollToOption(offsetOption, isDwArrow);
  21012. } else if (isSpacebar) {
  21013. evnt.preventDefault();
  21014. }
  21015. } else if ((isUpArrow || isDwArrow || isEnter || isSpacebar) && this.isActivated) {
  21016. evnt.preventDefault();
  21017. this.showOptionPanel();
  21018. }
  21019. if (this.isActivated) {
  21020. if (isDel && clearable) {
  21021. this.clearValueEvent(evnt, null);
  21022. }
  21023. }
  21024. }
  21025. },
  21026. handleGlobalBlurEvent: function handleGlobalBlurEvent() {
  21027. this.hideOptionPanel();
  21028. },
  21029. updateZindex: function updateZindex() {
  21030. if (this.panelIndex < UtilTools.getLastZIndex()) {
  21031. this.panelIndex = UtilTools.nextZIndex();
  21032. }
  21033. },
  21034. focusEvent: function focusEvent() {
  21035. if (!this.disabled) {
  21036. this.isActivated = true;
  21037. }
  21038. },
  21039. blurEvent: function blurEvent() {
  21040. this.isActivated = false;
  21041. },
  21042. isPanelVisible: function isPanelVisible() {
  21043. return this.visiblePanel;
  21044. },
  21045. togglePanel: function togglePanel() {
  21046. if (this.visiblePanel) {
  21047. this.hideOptionPanel();
  21048. } else {
  21049. this.showOptionPanel();
  21050. }
  21051. this.$nextTick();
  21052. },
  21053. hidePanel: function hidePanel() {
  21054. if (this.visiblePanel) {
  21055. this.hideOptionPanel();
  21056. }
  21057. this.$nextTick();
  21058. },
  21059. showPanel: function showPanel() {
  21060. if (!this.visiblePanel) {
  21061. this.showOptionPanel();
  21062. }
  21063. this.$nextTick();
  21064. },
  21065. togglePanelEvent: function togglePanelEvent(params) {
  21066. var $event = params.$event;
  21067. $event.preventDefault();
  21068. if (this.visiblePanel) {
  21069. this.hideOptionPanel();
  21070. } else {
  21071. this.showOptionPanel();
  21072. }
  21073. },
  21074. showOptionPanel: function showOptionPanel() {
  21075. var _this4 = this;
  21076. if (!this.disabled) {
  21077. clearTimeout(this.hidePanelTimeout);
  21078. if (!this.inited) {
  21079. this.inited = true;
  21080. if (this.transfer) {
  21081. document.body.appendChild(this.$refs.panel);
  21082. }
  21083. }
  21084. this.isActivated = true;
  21085. this.animatVisible = true;
  21086. setTimeout(function () {
  21087. var value = _this4.value,
  21088. multiple = _this4.multiple;
  21089. var currOption = findOption(_this4, multiple && value ? value[0] : value);
  21090. _this4.visiblePanel = true;
  21091. if (currOption) {
  21092. _this4.setCurrentOption(currOption);
  21093. _this4.scrollToOption(currOption);
  21094. }
  21095. }, 10);
  21096. this.updateZindex();
  21097. this.updatePlacement();
  21098. }
  21099. },
  21100. hideOptionPanel: function hideOptionPanel() {
  21101. var _this5 = this;
  21102. this.visiblePanel = false;
  21103. this.hidePanelTimeout = setTimeout(function () {
  21104. _this5.animatVisible = false;
  21105. }, 350);
  21106. },
  21107. updatePlacement: function updatePlacement() {
  21108. var _this6 = this;
  21109. return this.$nextTick().then(function () {
  21110. var $refs = _this6.$refs,
  21111. transfer = _this6.transfer,
  21112. placement = _this6.placement,
  21113. panelIndex = _this6.panelIndex;
  21114. var targetElem = $refs.input.$el;
  21115. var panelElem = $refs.panel;
  21116. if (panelElem && targetElem) {
  21117. var targetHeight = targetElem.offsetHeight;
  21118. var targetWidth = targetElem.offsetWidth;
  21119. var panelHeight = panelElem.offsetHeight;
  21120. var panelWidth = panelElem.offsetWidth;
  21121. var marginSize = 5;
  21122. var panelStyle = {
  21123. zIndex: panelIndex
  21124. };
  21125. var _DomTools$getAbsolute = DomTools.getAbsolutePos(targetElem),
  21126. boundingTop = _DomTools$getAbsolute.boundingTop,
  21127. boundingLeft = _DomTools$getAbsolute.boundingLeft,
  21128. visibleHeight = _DomTools$getAbsolute.visibleHeight,
  21129. visibleWidth = _DomTools$getAbsolute.visibleWidth;
  21130. var panelPlacement = 'bottom';
  21131. if (transfer) {
  21132. var left = boundingLeft;
  21133. var top = boundingTop + targetHeight;
  21134. if (placement === 'top') {
  21135. panelPlacement = 'top';
  21136. top = boundingTop - panelHeight;
  21137. } else if (!placement) {
  21138. // 如果下面不够放,则向上
  21139. if (top + panelHeight + marginSize > visibleHeight) {
  21140. panelPlacement = 'top';
  21141. top = boundingTop - panelHeight;
  21142. } // 如果上面不够放,则向下(优先)
  21143. if (top < marginSize) {
  21144. panelPlacement = 'bottom';
  21145. top = boundingTop + targetHeight;
  21146. }
  21147. } // 如果溢出右边
  21148. if (left + panelWidth + marginSize > visibleWidth) {
  21149. left -= left + panelWidth + marginSize - visibleWidth;
  21150. } // 如果溢出左边
  21151. if (left < marginSize) {
  21152. left = marginSize;
  21153. }
  21154. Object.assign(panelStyle, {
  21155. left: "".concat(left, "px"),
  21156. top: "".concat(top, "px"),
  21157. minWidth: "".concat(targetWidth, "px")
  21158. });
  21159. } else {
  21160. if (placement === 'top') {
  21161. panelPlacement = 'top';
  21162. panelStyle.bottom = "".concat(targetHeight, "px");
  21163. } else if (!placement) {
  21164. // 如果下面不够放,则向上
  21165. if (boundingTop + targetHeight + panelHeight > visibleHeight) {
  21166. // 如果上面不够放,则向下(优先)
  21167. if (boundingTop - targetHeight - panelHeight > marginSize) {
  21168. panelPlacement = 'top';
  21169. panelStyle.bottom = "".concat(targetHeight, "px");
  21170. }
  21171. }
  21172. }
  21173. }
  21174. _this6.panelStyle = panelStyle;
  21175. _this6.panelPlacement = panelPlacement;
  21176. return _this6.$nextTick();
  21177. }
  21178. });
  21179. },
  21180. focus: function focus() {
  21181. this.isActivated = true;
  21182. this.$refs.input.focus();
  21183. return this.$nextTick();
  21184. },
  21185. blur: function blur() {
  21186. this.hideOptionPanel();
  21187. this.$refs.input.blur();
  21188. return this.$nextTick();
  21189. }
  21190. }
  21191. });
  21192. // CONCATENATED MODULE: ./packages/select/src/util.js
  21193. var util_OptionConfig = /*#__PURE__*/function () {
  21194. function OptionConfig($xeselect, _vm) {
  21195. _classCallCheck(this, OptionConfig);
  21196. Object.assign(this, {
  21197. value: _vm.value,
  21198. label: _vm.label,
  21199. visible: _vm.visible,
  21200. disabled: _vm.disabled
  21201. });
  21202. }
  21203. _createClass(OptionConfig, [{
  21204. key: "update",
  21205. value: function update(name, value) {
  21206. this[name] = value;
  21207. }
  21208. }]);
  21209. return OptionConfig;
  21210. }();
  21211. function isOption(option) {
  21212. return option instanceof util_OptionConfig;
  21213. }
  21214. function getOptionConfig($xeselect, _vm, options) {
  21215. return isOption(_vm) ? _vm : new util_OptionConfig($xeselect, _vm, options);
  21216. }
  21217. function createOption($xeselect, _vm) {
  21218. return getOptionConfig($xeselect, _vm);
  21219. }
  21220. function destroyOption(_vm) {
  21221. var $xeselect = _vm.$xeselect,
  21222. optionConfig = _vm.optionConfig;
  21223. var matchObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.findTree($xeselect.collectOption, function (option) {
  21224. return option === optionConfig;
  21225. });
  21226. if (matchObj) {
  21227. matchObj.items.splice(matchObj.index, 1);
  21228. }
  21229. }
  21230. function assemOption(_vm) {
  21231. var $el = _vm.$el,
  21232. $xeselect = _vm.$xeselect,
  21233. $xeoptgroup = _vm.$xeoptgroup,
  21234. optionConfig = _vm.optionConfig;
  21235. var groupConfig = $xeoptgroup ? $xeoptgroup.optionConfig : null;
  21236. optionConfig.slots = _vm.$scopedSlots;
  21237. if (groupConfig) {
  21238. if (!groupConfig.options) {
  21239. groupConfig.options = [];
  21240. }
  21241. groupConfig.options.splice([].indexOf.call($xeoptgroup.$el.children, $el), 0, optionConfig);
  21242. } else {
  21243. $xeselect.collectOption.splice([].indexOf.call($xeselect.$refs.hideOption.children, $el), 0, optionConfig);
  21244. }
  21245. }
  21246. // CONCATENATED MODULE: ./packages/select/src/option.js
  21247. var option_props = {
  21248. value: null,
  21249. label: {
  21250. type: [String, Number, Boolean],
  21251. default: ''
  21252. },
  21253. visible: {
  21254. type: Boolean,
  21255. default: null
  21256. },
  21257. disabled: Boolean
  21258. };
  21259. var watch = {};
  21260. Object.keys(option_props).forEach(function (name) {
  21261. watch[name] = function (value) {
  21262. this.optionConfig.update(name, value);
  21263. };
  21264. });
  21265. /* harmony default export */ var src_option = ({
  21266. name: 'VxeOption',
  21267. props: option_props,
  21268. inject: {
  21269. $xeselect: {
  21270. default: null
  21271. },
  21272. $xeoptgroup: {
  21273. default: null
  21274. }
  21275. },
  21276. watch: watch,
  21277. mounted: function mounted() {
  21278. assemOption(this);
  21279. },
  21280. created: function created() {
  21281. this.optionConfig = createOption(this.$xeselect, this);
  21282. },
  21283. destroyed: function destroyed() {
  21284. destroyOption(this);
  21285. },
  21286. render: function render(h) {
  21287. return h('div');
  21288. }
  21289. });
  21290. // CONCATENATED MODULE: ./packages/export/src/export-panel.js
  21291. /* harmony default export */ var export_panel = ({
  21292. name: 'VxeExportPanel',
  21293. props: {
  21294. defaultOptions: Object,
  21295. storeData: Object
  21296. },
  21297. components: {
  21298. VxeModal: modal,
  21299. VxeInput: input,
  21300. VxeCheckbox: src_checkbox,
  21301. VxeSelect: src_select,
  21302. VxeOption: src_option
  21303. },
  21304. data: function data() {
  21305. return {
  21306. isAll: false,
  21307. isIndeterminate: false,
  21308. loading: false
  21309. };
  21310. },
  21311. computed: {
  21312. vSize: function vSize() {
  21313. return this.size || this.$parent.size || this.$parent.vSize;
  21314. },
  21315. checkedAll: function checkedAll() {
  21316. return this.storeData.columns.every(function (column) {
  21317. return column.checked;
  21318. });
  21319. },
  21320. showSheet: function showSheet() {
  21321. return ['html', 'xml', 'xlsx', 'pdf'].indexOf(this.defaultOptions.type) > -1;
  21322. },
  21323. supportMerge: function supportMerge() {
  21324. var storeData = this.storeData,
  21325. defaultOptions = this.defaultOptions;
  21326. return !defaultOptions.original && defaultOptions.mode === 'current' && (storeData.isPrint || ['html', 'xlsx'].indexOf(defaultOptions.type) > -1);
  21327. },
  21328. supportStyle: function supportStyle() {
  21329. var defaultOptions = this.defaultOptions;
  21330. return !defaultOptions.original && ['xlsx'].indexOf(defaultOptions.type) > -1;
  21331. }
  21332. },
  21333. render: function render(h) {
  21334. var _this = this;
  21335. var _e = this._e,
  21336. checkedAll = this.checkedAll,
  21337. isAll = this.isAll,
  21338. isIndeterminate = this.isIndeterminate,
  21339. showSheet = this.showSheet,
  21340. supportMerge = this.supportMerge,
  21341. supportStyle = this.supportStyle,
  21342. defaultOptions = this.defaultOptions,
  21343. storeData = this.storeData;
  21344. var hasTree = storeData.hasTree,
  21345. hasMerge = storeData.hasMerge,
  21346. isPrint = storeData.isPrint,
  21347. hasColgroup = storeData.hasColgroup;
  21348. var isHeader = defaultOptions.isHeader;
  21349. var cols = [];
  21350. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(storeData.columns, function (column) {
  21351. var colTitle = UtilTools.formatText(column.getTitle(), 1);
  21352. var isColGroup = column.children && column.children.length;
  21353. cols.push(h('li', {
  21354. class: ['vxe-export--panel-column-option', "level--".concat(column.level), {
  21355. 'is--group': isColGroup,
  21356. 'is--checked': column.checked,
  21357. 'is--indeterminate': column.halfChecked,
  21358. 'is--disabled': column.disabled
  21359. }],
  21360. attrs: {
  21361. title: colTitle
  21362. },
  21363. on: {
  21364. click: function click() {
  21365. if (!column.disabled) {
  21366. _this.changeOption(column);
  21367. }
  21368. }
  21369. }
  21370. }, [h('span', {
  21371. class: 'vxe-checkbox--icon vxe-checkbox--checked-icon'
  21372. }), h('span', {
  21373. class: 'vxe-checkbox--icon vxe-checkbox--unchecked-icon'
  21374. }), h('span', {
  21375. class: 'vxe-checkbox--icon vxe-checkbox--indeterminate-icon'
  21376. }), h('span', {
  21377. class: 'vxe-checkbox--label'
  21378. }, colTitle)]));
  21379. });
  21380. return h('vxe-modal', {
  21381. res: 'modal',
  21382. props: {
  21383. value: storeData.visible,
  21384. title: conf.i18n(isPrint ? 'vxe.export.printTitle' : 'vxe.export.expTitle'),
  21385. width: 660,
  21386. mask: true,
  21387. lockView: true,
  21388. showFooter: false,
  21389. escClosable: true,
  21390. maskClosable: true,
  21391. loading: this.loading
  21392. },
  21393. on: {
  21394. input: function input(value) {
  21395. storeData.visible = value;
  21396. },
  21397. show: this.showEvent
  21398. }
  21399. }, [h('div', {
  21400. class: 'vxe-export--panel'
  21401. }, [h('table', {
  21402. attrs: {
  21403. cellspacing: 0,
  21404. cellpadding: 0,
  21405. border: 0
  21406. }
  21407. }, [h('tbody', [[isPrint ? _e() : h('tr', [h('td', conf.i18n('vxe.export.expName')), h('td', [h('vxe-input', {
  21408. ref: 'filename',
  21409. props: {
  21410. value: defaultOptions.filename,
  21411. type: 'text',
  21412. clearable: true,
  21413. placeholder: conf.i18n('vxe.export.expNamePlaceholder')
  21414. },
  21415. on: {
  21416. modelValue: function modelValue(value) {
  21417. defaultOptions.filename = value;
  21418. }
  21419. }
  21420. })])]), isPrint ? _e() : h('tr', [h('td', conf.i18n('vxe.export.expType')), h('td', [h('vxe-select', {
  21421. props: {
  21422. value: defaultOptions.type
  21423. },
  21424. on: {
  21425. input: function input(value) {
  21426. defaultOptions.type = value;
  21427. }
  21428. }
  21429. }, storeData.typeList.map(function (item) {
  21430. return h('vxe-option', {
  21431. props: {
  21432. value: item.value,
  21433. label: conf.i18n(item.label)
  21434. }
  21435. });
  21436. }))])]), isPrint || showSheet ? h('tr', [h('td', conf.i18n('vxe.export.expSheetName')), h('td', [h('vxe-input', {
  21437. ref: 'sheetname',
  21438. props: {
  21439. value: defaultOptions.sheetName,
  21440. type: 'text',
  21441. clearable: true,
  21442. placeholder: conf.i18n('vxe.export.expSheetNamePlaceholder')
  21443. },
  21444. on: {
  21445. modelValue: function modelValue(value) {
  21446. defaultOptions.sheetName = value;
  21447. }
  21448. }
  21449. })])]) : _e(), h('tr', [h('td', conf.i18n('vxe.export.expMode')), h('td', [h('vxe-select', {
  21450. props: {
  21451. value: defaultOptions.mode
  21452. },
  21453. on: {
  21454. input: function input(value) {
  21455. defaultOptions.mode = value;
  21456. }
  21457. }
  21458. }, storeData.modeList.map(function (item) {
  21459. return h('vxe-option', {
  21460. props: {
  21461. value: item.value,
  21462. label: conf.i18n(item.label)
  21463. }
  21464. });
  21465. }))])]), h('tr', [h('td', [conf.i18n('vxe.export.expColumn')]), h('td', [h('div', {
  21466. class: 'vxe-export--panel-column'
  21467. }, [h('ul', {
  21468. class: 'vxe-export--panel-column-header'
  21469. }, [h('li', {
  21470. class: ['vxe-export--panel-column-option', {
  21471. 'is--checked': isAll,
  21472. 'is--indeterminate': isIndeterminate
  21473. }],
  21474. attrs: {
  21475. title: conf.i18n('vxe.table.allTitle')
  21476. },
  21477. on: {
  21478. click: this.allColumnEvent
  21479. }
  21480. }, [h('span', {
  21481. class: 'vxe-checkbox--icon vxe-checkbox--checked-icon'
  21482. }), h('span', {
  21483. class: 'vxe-checkbox--icon vxe-checkbox--unchecked-icon'
  21484. }), h('span', {
  21485. class: 'vxe-checkbox--icon vxe-checkbox--indeterminate-icon'
  21486. }), h('span', {
  21487. class: 'vxe-checkbox--label'
  21488. }, conf.i18n('vxe.export.expCurrentColumn'))])]), h('ul', {
  21489. class: 'vxe-export--panel-column-body'
  21490. }, cols)])])]), h('tr', [h('td', conf.i18n('vxe.export.expOpts')), h('td', [h('div', {
  21491. class: 'vxe-export--panel-option-row'
  21492. }, [h('vxe-checkbox', {
  21493. props: {
  21494. value: isHeader,
  21495. title: conf.i18n('vxe.export.expHeaderTitle'),
  21496. content: conf.i18n('vxe.export.expOptHeader')
  21497. },
  21498. on: {
  21499. input: function input(value) {
  21500. defaultOptions.isHeader = value;
  21501. }
  21502. }
  21503. }), h('vxe-checkbox', {
  21504. props: {
  21505. value: defaultOptions.isFooter,
  21506. disabled: !storeData.hasFooter,
  21507. title: conf.i18n('vxe.export.expFooterTitle'),
  21508. content: conf.i18n('vxe.export.expOptFooter')
  21509. },
  21510. on: {
  21511. input: function input(value) {
  21512. defaultOptions.isFooter = value;
  21513. }
  21514. }
  21515. }), h('vxe-checkbox', {
  21516. props: {
  21517. value: defaultOptions.original,
  21518. title: conf.i18n('vxe.export.expOriginalTitle'),
  21519. content: conf.i18n('vxe.export.expOptOriginal')
  21520. },
  21521. on: {
  21522. input: function input(value) {
  21523. defaultOptions.original = value;
  21524. }
  21525. }
  21526. })]), h('div', {
  21527. class: 'vxe-export--panel-option-row'
  21528. }, [h('vxe-checkbox', {
  21529. props: {
  21530. value: isHeader && hasColgroup && supportMerge ? defaultOptions.isColgroup : false,
  21531. disabled: !isHeader || !hasColgroup || !supportMerge,
  21532. title: conf.i18n('vxe.export.expColgroupTitle'),
  21533. content: conf.i18n('vxe.export.expOptColgroup')
  21534. },
  21535. on: {
  21536. input: function input(value) {
  21537. defaultOptions.isColgroup = value;
  21538. }
  21539. }
  21540. }), h('vxe-checkbox', {
  21541. props: {
  21542. value: hasMerge && supportMerge && checkedAll ? defaultOptions.isMerge : false,
  21543. disabled: !hasMerge || !supportMerge || !checkedAll,
  21544. title: conf.i18n('vxe.export.expMergeTitle'),
  21545. content: conf.i18n('vxe.export.expOptMerge')
  21546. },
  21547. on: {
  21548. input: function input(value) {
  21549. defaultOptions.isMerge = value;
  21550. }
  21551. }
  21552. }), isPrint ? _e() : h('vxe-checkbox', {
  21553. props: {
  21554. value: supportStyle ? defaultOptions.useStyle : false,
  21555. disabled: !supportStyle,
  21556. title: conf.i18n('vxe.export.expUseStyleTitle'),
  21557. content: conf.i18n('vxe.export.expOptUseStyle')
  21558. },
  21559. on: {
  21560. input: function input(value) {
  21561. defaultOptions.useStyle = value;
  21562. }
  21563. }
  21564. }), h('vxe-checkbox', {
  21565. props: {
  21566. value: hasTree ? defaultOptions.isAllExpand : false,
  21567. disabled: !hasTree,
  21568. title: conf.i18n('vxe.export.expAllExpandTitle'),
  21569. content: conf.i18n('vxe.export.expOptAllExpand')
  21570. },
  21571. on: {
  21572. input: function input(value) {
  21573. defaultOptions.isAllExpand = value;
  21574. }
  21575. }
  21576. })])])])]])]), h('div', {
  21577. class: 'vxe-export--panel-btns'
  21578. }, [h('vxe-button', {
  21579. props: {
  21580. content: conf.i18n('vxe.export.expCancel')
  21581. },
  21582. on: {
  21583. click: this.cancelEvent
  21584. }
  21585. }), h('vxe-button', {
  21586. ref: 'confirmBtn',
  21587. props: {
  21588. status: 'primary',
  21589. content: conf.i18n(isPrint ? 'vxe.export.expPrint' : 'vxe.export.expConfirm')
  21590. },
  21591. on: {
  21592. click: this.confirmEvent
  21593. }
  21594. })])])]);
  21595. },
  21596. methods: {
  21597. changeOption: function changeOption(column) {
  21598. var isChecked = !column.checked;
  21599. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree([column], function (item) {
  21600. item.checked = isChecked;
  21601. item.halfChecked = false;
  21602. });
  21603. this.handleOptionCheck(column);
  21604. this.checkStatus();
  21605. },
  21606. handleOptionCheck: function handleOptionCheck(column) {
  21607. var matchObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.findTree(this.storeData.columns, function (item) {
  21608. return item === column;
  21609. });
  21610. if (matchObj && matchObj.parent) {
  21611. var parent = matchObj.parent;
  21612. if (parent.children && parent.children.length) {
  21613. parent.checked = parent.children.every(function (column) {
  21614. return column.checked;
  21615. });
  21616. parent.halfChecked = !parent.checked && parent.children.some(function (column) {
  21617. return column.checked || column.halfChecked;
  21618. });
  21619. this.handleOptionCheck(parent);
  21620. }
  21621. }
  21622. },
  21623. checkStatus: function checkStatus() {
  21624. var columns = this.storeData.columns;
  21625. this.isAll = columns.every(function (column) {
  21626. return column.disabled || column.checked;
  21627. });
  21628. this.isIndeterminate = !this.isAll && columns.some(function (column) {
  21629. return !column.disabled && (column.checked || column.halfChecked);
  21630. });
  21631. },
  21632. allColumnEvent: function allColumnEvent() {
  21633. var isAll = !this.isAll;
  21634. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(this.storeData.columns, function (column) {
  21635. if (!column.disabled) {
  21636. column.checked = isAll;
  21637. column.halfChecked = false;
  21638. }
  21639. });
  21640. this.isAll = isAll;
  21641. this.checkStatus();
  21642. },
  21643. showEvent: function showEvent() {
  21644. var _this2 = this;
  21645. this.$nextTick(function () {
  21646. var $refs = _this2.$refs;
  21647. var targetElem = $refs.filename || $refs.sheetname || $refs.confirmBtn;
  21648. if (targetElem) {
  21649. targetElem.focus();
  21650. }
  21651. });
  21652. this.checkStatus();
  21653. },
  21654. getExportOption: function getExportOption() {
  21655. var checkedAll = this.checkedAll,
  21656. storeData = this.storeData,
  21657. defaultOptions = this.defaultOptions,
  21658. supportMerge = this.supportMerge;
  21659. var hasMerge = storeData.hasMerge,
  21660. columns = storeData.columns;
  21661. var expColumns = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.searchTree(columns, function (column) {
  21662. return column.checked;
  21663. }, {
  21664. children: 'children',
  21665. mapChildren: 'childNodes',
  21666. original: true
  21667. });
  21668. return Object.assign({}, defaultOptions, {
  21669. columns: expColumns,
  21670. isMerge: hasMerge && supportMerge && checkedAll ? defaultOptions.isMerge : false
  21671. });
  21672. },
  21673. cancelEvent: function cancelEvent() {
  21674. this.storeData.visible = false;
  21675. },
  21676. confirmEvent: function confirmEvent(evnt) {
  21677. if (this.storeData.isPrint) {
  21678. this.printEvent(evnt);
  21679. } else {
  21680. this.exportEvent(evnt);
  21681. }
  21682. },
  21683. printEvent: function printEvent() {
  21684. var $xetable = this.$parent;
  21685. this.storeData.visible = false;
  21686. $xetable.print(Object.assign({}, $xetable.printOpts, this.getExportOption()));
  21687. },
  21688. exportEvent: function exportEvent() {
  21689. var _this3 = this;
  21690. var $xetable = this.$parent;
  21691. this.loading = true;
  21692. $xetable.exportData(Object.assign({}, $xetable.exportOpts, this.getExportOption())).then(function () {
  21693. _this3.loading = false;
  21694. _this3.storeData.visible = false;
  21695. }).catch(function () {
  21696. _this3.loading = false;
  21697. });
  21698. }
  21699. }
  21700. });
  21701. // CONCATENATED MODULE: ./packages/radio/src/radio.js
  21702. /* harmony default export */ var src_radio = ({
  21703. name: 'VxeRadio',
  21704. mixins: [size],
  21705. props: {
  21706. value: [String, Number, Boolean],
  21707. label: [String, Number, Boolean],
  21708. title: [String, Number],
  21709. content: [String, Number],
  21710. disabled: Boolean,
  21711. name: String,
  21712. size: {
  21713. type: String,
  21714. default: function _default() {
  21715. return conf.radio.size || conf.size;
  21716. }
  21717. }
  21718. },
  21719. inject: {
  21720. $xeradiogroup: {
  21721. default: null
  21722. }
  21723. },
  21724. computed: {
  21725. isDisabled: function isDisabled() {
  21726. var $xeradiogroup = this.$xeradiogroup;
  21727. return this.disabled || $xeradiogroup && $xeradiogroup.disabled;
  21728. }
  21729. },
  21730. render: function render(h) {
  21731. var _ref,
  21732. _this = this;
  21733. var $scopedSlots = this.$scopedSlots,
  21734. $xeradiogroup = this.$xeradiogroup,
  21735. isDisabled = this.isDisabled,
  21736. title = this.title,
  21737. vSize = this.vSize,
  21738. value = this.value,
  21739. label = this.label,
  21740. name = this.name,
  21741. content = this.content;
  21742. var attrs = {};
  21743. if (title) {
  21744. attrs.title = title;
  21745. }
  21746. return h('label', {
  21747. class: ['vxe-radio', (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, 'is--disabled', isDisabled), _ref)],
  21748. attrs: attrs
  21749. }, [h('input', {
  21750. class: 'vxe-radio--input',
  21751. attrs: {
  21752. type: 'radio',
  21753. name: $xeradiogroup ? $xeradiogroup.name : name,
  21754. disabled: isDisabled
  21755. },
  21756. domProps: {
  21757. checked: $xeradiogroup ? $xeradiogroup.value === label : value === label
  21758. },
  21759. on: {
  21760. change: function change(evnt) {
  21761. if (!isDisabled) {
  21762. var params = {
  21763. label: label,
  21764. $event: evnt
  21765. };
  21766. if ($xeradiogroup) {
  21767. $xeradiogroup.handleChecked(params);
  21768. } else {
  21769. _this.$emit('input', label);
  21770. _this.$emit('change', params);
  21771. }
  21772. }
  21773. }
  21774. }
  21775. }), h('span', {
  21776. class: 'vxe-radio--icon'
  21777. }), h('span', {
  21778. class: 'vxe-radio--label'
  21779. }, $scopedSlots.default ? $scopedSlots.default.call(this, {}) : [UtilTools.getFuncText(content)])]);
  21780. },
  21781. methods: {
  21782. changeEvent: function changeEvent(evnt) {
  21783. var $xeradiogroup = this.$xeradiogroup,
  21784. isDisabled = this.isDisabled,
  21785. label = this.label;
  21786. if (!isDisabled) {
  21787. var params = {
  21788. label: label,
  21789. $event: evnt
  21790. };
  21791. if ($xeradiogroup) {
  21792. $xeradiogroup.handleChecked(params);
  21793. } else {
  21794. this.$emit('input', label);
  21795. this.$emit('change', params);
  21796. }
  21797. }
  21798. }
  21799. }
  21800. });
  21801. // CONCATENATED MODULE: ./packages/export/src/import-panel.js
  21802. /* harmony default export */ var import_panel = ({
  21803. name: 'VxeImportPanel',
  21804. props: {
  21805. defaultOptions: Object,
  21806. storeData: Object
  21807. },
  21808. components: {
  21809. VxeModal: modal,
  21810. VxeRadio: src_radio
  21811. },
  21812. data: function data() {
  21813. return {
  21814. loading: false
  21815. };
  21816. },
  21817. computed: {
  21818. vSize: function vSize() {
  21819. return this.size || this.$parent.size || this.$parent.vSize;
  21820. },
  21821. selectName: function selectName() {
  21822. return "".concat(this.storeData.filename, ".").concat(this.storeData.type);
  21823. },
  21824. hasFile: function hasFile() {
  21825. return this.storeData.file && this.storeData.type;
  21826. },
  21827. parseTypeLabel: function parseTypeLabel() {
  21828. var storeData = this.storeData;
  21829. var type = storeData.type,
  21830. typeList = storeData.typeList;
  21831. if (type) {
  21832. var selectItem = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.find(typeList, function (item) {
  21833. return type === item.value;
  21834. });
  21835. return selectItem ? conf.i18n(selectItem.label) : '*.*';
  21836. }
  21837. return "*.".concat(typeList.map(function (item) {
  21838. return item.value;
  21839. }).join(', *.'));
  21840. }
  21841. },
  21842. render: function render(h) {
  21843. var hasFile = this.hasFile,
  21844. parseTypeLabel = this.parseTypeLabel,
  21845. defaultOptions = this.defaultOptions,
  21846. storeData = this.storeData,
  21847. selectName = this.selectName;
  21848. return h('vxe-modal', {
  21849. res: 'modal',
  21850. props: {
  21851. value: storeData.visible,
  21852. title: conf.i18n('vxe.import.impTitle'),
  21853. width: 440,
  21854. mask: true,
  21855. lockView: true,
  21856. showFooter: false,
  21857. escClosable: true,
  21858. maskClosable: true,
  21859. loading: this.loading
  21860. },
  21861. on: {
  21862. input: function input(value) {
  21863. storeData.visible = value;
  21864. },
  21865. show: this.showEvent
  21866. }
  21867. }, [h('div', {
  21868. class: 'vxe-export--panel'
  21869. }, [h('table', {
  21870. attrs: {
  21871. cellspacing: 0,
  21872. cellpadding: 0,
  21873. border: 0
  21874. }
  21875. }, [h('tbody', [h('tr', [h('td', conf.i18n('vxe.import.impFile')), h('td', [hasFile ? h('div', {
  21876. class: 'vxe-import-selected--file',
  21877. attrs: {
  21878. title: selectName
  21879. }
  21880. }, [h('span', selectName), h('i', {
  21881. class: conf.icon.INPUT_CLEAR,
  21882. on: {
  21883. click: this.clearFileEvent
  21884. }
  21885. })]) : h('button', {
  21886. ref: 'fileBtn',
  21887. class: 'vxe-import-select--file',
  21888. attrs: {
  21889. type: 'button'
  21890. },
  21891. on: {
  21892. click: this.selectFileEvent
  21893. }
  21894. }, 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', {
  21895. props: {
  21896. value: defaultOptions.mode
  21897. },
  21898. on: {
  21899. input: function input(value) {
  21900. defaultOptions.mode = value;
  21901. }
  21902. }
  21903. }, storeData.modeList.map(function (item) {
  21904. return h('vxe-radio', {
  21905. props: {
  21906. label: item.value
  21907. }
  21908. }, conf.i18n(item.label));
  21909. }))])])])]), h('div', {
  21910. class: 'vxe-export--panel-btns'
  21911. }, [h('vxe-button', {
  21912. on: {
  21913. click: this.cancelEvent
  21914. }
  21915. }, conf.i18n('vxe.import.impCancel')), h('vxe-button', {
  21916. props: {
  21917. status: 'primary',
  21918. disabled: !hasFile
  21919. },
  21920. on: {
  21921. click: this.importEvent
  21922. }
  21923. }, conf.i18n('vxe.import.impConfirm'))])])]);
  21924. },
  21925. methods: {
  21926. clearFileEvent: function clearFileEvent() {
  21927. Object.assign(this.storeData, {
  21928. filename: '',
  21929. sheetName: '',
  21930. type: ''
  21931. });
  21932. },
  21933. selectFileEvent: function selectFileEvent() {
  21934. var _this = this;
  21935. var $xetable = this.$parent;
  21936. $xetable.readFile(this.defaultOptions).then(function (params) {
  21937. var file = params.file;
  21938. Object.assign(_this.storeData, UtilTools.parseFile(file), {
  21939. file: file
  21940. });
  21941. }).catch(function (e) {
  21942. return e;
  21943. });
  21944. },
  21945. showEvent: function showEvent() {
  21946. var _this2 = this;
  21947. this.$nextTick(function () {
  21948. var $refs = _this2.$refs;
  21949. var targetElem = $refs.fileBtn;
  21950. if (targetElem) {
  21951. targetElem.focus();
  21952. }
  21953. });
  21954. },
  21955. cancelEvent: function cancelEvent() {
  21956. this.storeData.visible = false;
  21957. },
  21958. importEvent: function importEvent() {
  21959. var _this3 = this;
  21960. var $xetable = this.$parent;
  21961. this.loading = true;
  21962. $xetable.importByFile(this.storeData.file, Object.assign({}, $xetable.importOpts, this.defaultOptions)).then(function () {
  21963. _this3.loading = false;
  21964. _this3.storeData.visible = false;
  21965. }).catch(function () {
  21966. _this3.loading = false;
  21967. });
  21968. }
  21969. }
  21970. });
  21971. // EXTERNAL MODULE: ./node_modules/core-js/modules/web.url.js
  21972. var web_url = __webpack_require__("2b3d");
  21973. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.repeat.js
  21974. var es_string_repeat = __webpack_require__("38cf");
  21975. // CONCATENATED MODULE: ./packages/export/src/mixin.js
  21976. var mixin_formatText = UtilTools.formatText; // 默认导出或打印的 HTML 样式
  21977. 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}';
  21978. var htmlCellElem; // 导入
  21979. var fileForm;
  21980. var fileInput; // 打印
  21981. var printFrame;
  21982. var csvBOM = "\uFEFF";
  21983. var enterSymbol = '\r\n';
  21984. function createFrame() {
  21985. var frame = document.createElement('iframe');
  21986. frame.className = 'vxe-table--print-frame';
  21987. return frame;
  21988. }
  21989. function getExportBlobByContent(content, options) {
  21990. if (window.Blob) {
  21991. return new Blob([content], {
  21992. type: "text/".concat(options.type)
  21993. });
  21994. }
  21995. return null;
  21996. }
  21997. function hasTreeChildren($xetable, row) {
  21998. var treeOpts = $xetable.treeOpts;
  21999. return row[treeOpts.children] && row[treeOpts.children].length > 0;
  22000. }
  22001. function getSeq($xetable, row, rowIndex, column, columnIndex) {
  22002. var seqOpts = $xetable.seqOpts;
  22003. var seqMethod = seqOpts.seqMethod || column.seqMethod;
  22004. return seqMethod ? seqMethod({
  22005. row: row,
  22006. rowIndex: rowIndex,
  22007. column: column,
  22008. columnIndex: columnIndex
  22009. }) : seqOpts.startIndex + rowIndex + 1;
  22010. }
  22011. function defaultFilterExportColumn(column) {
  22012. return column.property || ['seq', 'checkbox', 'radio'].indexOf(column.type) > -1;
  22013. }
  22014. function toTableBorder(border) {
  22015. if (border === true) {
  22016. return 'full';
  22017. }
  22018. if (border) {
  22019. return border;
  22020. }
  22021. return 'default';
  22022. }
  22023. function toBooleanValue(cellValue) {
  22024. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isBoolean(cellValue) ? cellValue ? 'TRUE' : 'FALSE' : cellValue;
  22025. }
  22026. function getLabelData($xetable, opts, columns, datas) {
  22027. var isAllExpand = opts.isAllExpand;
  22028. var treeConfig = $xetable.treeConfig,
  22029. treeOpts = $xetable.treeOpts,
  22030. radioOpts = $xetable.radioOpts,
  22031. checkboxOpts = $xetable.checkboxOpts;
  22032. if (!htmlCellElem) {
  22033. htmlCellElem = document.createElement('div');
  22034. }
  22035. if (treeConfig) {
  22036. // 如果是树表格只允许导出数据源
  22037. var rest = [];
  22038. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(datas, function (item, rowIndex, items, path, parent, nodes) {
  22039. var row = item._row || item;
  22040. var parentRow = parent && parent._row ? parent._row : parent;
  22041. if (isAllExpand || !parentRow || $xetable.isTreeExpandByRow(parentRow)) {
  22042. var hasRowChild = hasTreeChildren($xetable, row);
  22043. var _item = {
  22044. _row: row,
  22045. _level: nodes.length - 1,
  22046. _hasChild: hasRowChild,
  22047. _expand: hasRowChild && $xetable.isTreeExpandByRow(row)
  22048. };
  22049. columns.forEach(function (column, columnIndex) {
  22050. var cellValue = '';
  22051. var renderOpts = column.editRender || column.cellRender;
  22052. var exportLabelMethod = column.exportMethod;
  22053. if (!exportLabelMethod && renderOpts && renderOpts.name) {
  22054. var compConf = v_x_e_table.renderer.get(renderOpts.name);
  22055. if (compConf) {
  22056. exportLabelMethod = compConf.exportMethod || compConf.cellExportMethod;
  22057. }
  22058. }
  22059. if (exportLabelMethod) {
  22060. cellValue = exportLabelMethod({
  22061. $table: $xetable,
  22062. row: row,
  22063. column: column,
  22064. options: opts
  22065. });
  22066. } else {
  22067. switch (column.type) {
  22068. case 'seq':
  22069. cellValue = getSeq($xetable, row, rowIndex, column, columnIndex);
  22070. break;
  22071. case 'checkbox':
  22072. cellValue = toBooleanValue($xetable.isCheckedByCheckboxRow(row));
  22073. _item._checkboxLabel = checkboxOpts.labelField ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, checkboxOpts.labelField) : '';
  22074. _item._checkboxDisabled = checkboxOpts.checkMethod && !checkboxOpts.checkMethod({
  22075. row: row
  22076. });
  22077. break;
  22078. case 'radio':
  22079. cellValue = toBooleanValue($xetable.isCheckedByRadioRow(row));
  22080. _item._radioLabel = radioOpts.labelField ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, radioOpts.labelField) : '';
  22081. _item._radioDisabled = radioOpts.checkMethod && !radioOpts.checkMethod({
  22082. row: row
  22083. });
  22084. break;
  22085. default:
  22086. if (opts.original) {
  22087. cellValue = UtilTools.getCellValue(row, column);
  22088. } else {
  22089. cellValue = $xetable.getCellLabel(row, column);
  22090. if (column.type === 'html') {
  22091. htmlCellElem.innerHTML = cellValue;
  22092. cellValue = htmlCellElem.innerText.trim();
  22093. } else {
  22094. var cell = $xetable.getCell(row, column);
  22095. if (cell) {
  22096. cellValue = cell.innerText.trim();
  22097. }
  22098. }
  22099. }
  22100. }
  22101. }
  22102. _item[column.id] = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toValueString(cellValue);
  22103. });
  22104. rest.push(Object.assign(_item, row));
  22105. }
  22106. }, treeOpts);
  22107. return rest;
  22108. }
  22109. return datas.map(function (row, rowIndex) {
  22110. var item = {
  22111. _row: row
  22112. };
  22113. columns.forEach(function (column, columnIndex) {
  22114. var cellValue = '';
  22115. var renderOpts = column.editRender || column.cellRender;
  22116. var exportLabelMethod = column.exportMethod;
  22117. if (!exportLabelMethod && renderOpts && renderOpts.name) {
  22118. var compConf = v_x_e_table.renderer.get(renderOpts.name);
  22119. if (compConf) {
  22120. exportLabelMethod = compConf.exportMethod || compConf.cellExportMethod;
  22121. }
  22122. }
  22123. if (exportLabelMethod) {
  22124. cellValue = exportLabelMethod({
  22125. $table: $xetable,
  22126. row: row,
  22127. column: column,
  22128. options: opts
  22129. });
  22130. } else {
  22131. switch (column.type) {
  22132. case 'seq':
  22133. cellValue = getSeq($xetable, row, rowIndex, column, columnIndex);
  22134. break;
  22135. case 'checkbox':
  22136. cellValue = toBooleanValue($xetable.isCheckedByCheckboxRow(row));
  22137. item._checkboxLabel = checkboxOpts.labelField ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, checkboxOpts.labelField) : '';
  22138. item._checkboxDisabled = checkboxOpts.checkMethod && !checkboxOpts.checkMethod({
  22139. row: row
  22140. });
  22141. break;
  22142. case 'radio':
  22143. cellValue = toBooleanValue($xetable.isCheckedByRadioRow(row));
  22144. item._radioLabel = radioOpts.labelField ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, radioOpts.labelField) : '';
  22145. item._radioDisabled = radioOpts.checkMethod && !radioOpts.checkMethod({
  22146. row: row
  22147. });
  22148. break;
  22149. default:
  22150. if (opts.original) {
  22151. cellValue = UtilTools.getCellValue(row, column);
  22152. } else {
  22153. cellValue = $xetable.getCellLabel(row, column);
  22154. if (column.type === 'html') {
  22155. htmlCellElem.innerHTML = cellValue;
  22156. cellValue = htmlCellElem.innerText.trim();
  22157. } else {
  22158. var cell = $xetable.getCell(row, column);
  22159. if (cell) {
  22160. cellValue = cell.innerText.trim();
  22161. }
  22162. }
  22163. }
  22164. }
  22165. }
  22166. item[column.id] = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toValueString(cellValue);
  22167. });
  22168. return item;
  22169. });
  22170. }
  22171. function getExportData($xetable, opts) {
  22172. var columns = opts.columns,
  22173. dataFilterMethod = opts.dataFilterMethod;
  22174. var datas = opts.data;
  22175. if (dataFilterMethod) {
  22176. datas = datas.filter(function (row, index) {
  22177. return dataFilterMethod({
  22178. row: row,
  22179. $rowIndex: index
  22180. });
  22181. });
  22182. }
  22183. return getLabelData($xetable, opts, columns, datas);
  22184. }
  22185. function getBooleanValue(cellValue) {
  22186. return cellValue === 'TRUE' || cellValue === 'true' || cellValue === true;
  22187. }
  22188. function getHeaderTitle(opts, column) {
  22189. return (opts.original ? column.property : column.getTitle()) || '';
  22190. }
  22191. function getFooterCellValue($xetable, opts, items, column) {
  22192. var renderOpts = column.editRender || column.cellRender;
  22193. var exportLabelMethod = column.footerExportMethod;
  22194. if (!exportLabelMethod && renderOpts && renderOpts.name) {
  22195. var compConf = v_x_e_table.renderer.get(renderOpts.name);
  22196. if (compConf) {
  22197. exportLabelMethod = compConf.footerExportMethod || compConf.footerCellExportMethod;
  22198. }
  22199. }
  22200. var _columnIndex = $xetable.getVTColumnIndex(column);
  22201. var cellValue = exportLabelMethod ? exportLabelMethod({
  22202. $table: $xetable,
  22203. items: items,
  22204. itemIndex: _columnIndex,
  22205. _columnIndex: _columnIndex,
  22206. column: column,
  22207. options: opts
  22208. }) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toValueString(items[_columnIndex]);
  22209. return cellValue;
  22210. }
  22211. function getFooterData(opts, footerTableData) {
  22212. var footerFilterMethod = opts.footerFilterMethod;
  22213. return footerFilterMethod ? footerTableData.filter(function (items, index) {
  22214. return footerFilterMethod({
  22215. items: items,
  22216. $rowIndex: index
  22217. });
  22218. }) : footerTableData;
  22219. }
  22220. function getCsvCellTypeLabel(column, cellValue) {
  22221. if (cellValue) {
  22222. switch (column.cellType) {
  22223. case 'string':
  22224. if (!isNaN(cellValue)) {
  22225. return "\t".concat(cellValue);
  22226. }
  22227. break;
  22228. case 'number':
  22229. break;
  22230. default:
  22231. if (cellValue.length >= 12 && !isNaN(cellValue)) {
  22232. return "\t".concat(cellValue);
  22233. }
  22234. break;
  22235. }
  22236. }
  22237. return cellValue;
  22238. }
  22239. function toTxtCellLabel(val) {
  22240. if (/[",\s\n]/.test(val)) {
  22241. return "\"".concat(val.replace(/"/g, '""'), "\"");
  22242. }
  22243. return val;
  22244. }
  22245. function toCsv($xetable, opts, columns, datas) {
  22246. var content = csvBOM;
  22247. if (opts.isHeader) {
  22248. content += columns.map(function (column) {
  22249. return toTxtCellLabel(getHeaderTitle(opts, column));
  22250. }).join(',') + enterSymbol;
  22251. }
  22252. datas.forEach(function (row) {
  22253. content += columns.map(function (column) {
  22254. return toTxtCellLabel(getCsvCellTypeLabel(column, row[column.id]));
  22255. }).join(',') + enterSymbol;
  22256. });
  22257. if (opts.isFooter) {
  22258. var footerTableData = $xetable.footerTableData;
  22259. var footers = getFooterData(opts, footerTableData);
  22260. footers.forEach(function (rows) {
  22261. content += columns.map(function (column) {
  22262. return toTxtCellLabel(getFooterCellValue($xetable, opts, rows, column));
  22263. }).join(',') + enterSymbol;
  22264. });
  22265. }
  22266. return content;
  22267. }
  22268. function toTxt($xetable, opts, columns, datas) {
  22269. var content = '';
  22270. if (opts.isHeader) {
  22271. content += columns.map(function (column) {
  22272. return toTxtCellLabel(getHeaderTitle(opts, column));
  22273. }).join('\t') + enterSymbol;
  22274. }
  22275. datas.forEach(function (row) {
  22276. content += columns.map(function (column) {
  22277. return toTxtCellLabel(row[column.id]);
  22278. }).join('\t') + enterSymbol;
  22279. });
  22280. if (opts.isFooter) {
  22281. var footerTableData = $xetable.footerTableData;
  22282. var footers = getFooterData(opts, footerTableData);
  22283. footers.forEach(function (rows) {
  22284. content += columns.map(function (column) {
  22285. return toTxtCellLabel(getFooterCellValue($xetable, opts, rows, column));
  22286. }).join(',') + enterSymbol;
  22287. });
  22288. }
  22289. return content;
  22290. }
  22291. function mixin_hasEllipsis($xetable, column, property, allColumnOverflow) {
  22292. var columnOverflow = column[property];
  22293. var headOverflow = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isUndefined(columnOverflow) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNull(columnOverflow) ? allColumnOverflow : columnOverflow;
  22294. var showEllipsis = headOverflow === 'ellipsis';
  22295. var showTitle = headOverflow === 'title';
  22296. var showTooltip = headOverflow === true || headOverflow === 'tooltip';
  22297. var isEllipsis = showTitle || showTooltip || showEllipsis; // 虚拟滚动不支持动态高度
  22298. if (($xetable.scrollXLoad || $xetable.scrollYLoad) && !isEllipsis) {
  22299. isEllipsis = true;
  22300. }
  22301. return isEllipsis;
  22302. }
  22303. function createHtmlPage(opts, content) {
  22304. var style = opts.style;
  22305. 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(content, "</body>"), '</html>'].join('');
  22306. }
  22307. function toHtml($xetable, opts, columns, datas) {
  22308. var id = $xetable.id,
  22309. border = $xetable.border,
  22310. treeConfig = $xetable.treeConfig,
  22311. treeOpts = $xetable.treeOpts,
  22312. isAllSelected = $xetable.isAllSelected,
  22313. isIndeterminate = $xetable.isIndeterminate,
  22314. allHeaderAlign = $xetable.headerAlign,
  22315. allAlign = $xetable.align,
  22316. allFooterAlign = $xetable.footerAlign,
  22317. allColumnOverflow = $xetable.showOverflow,
  22318. allColumnHeaderOverflow = $xetable.showHeaderOverflow,
  22319. mergeList = $xetable.mergeList;
  22320. var isPrint = opts.print,
  22321. isHeader = opts.isHeader,
  22322. isFooter = opts.isFooter,
  22323. isColgroup = opts.isColgroup,
  22324. isMerge = opts.isMerge,
  22325. colgroups = opts.colgroups,
  22326. original = opts.original;
  22327. var allCls = 'check-all';
  22328. var clss = ['vxe-table', "border--".concat(toTableBorder(border)), isPrint ? 'is--print' : '', isHeader ? 'is--header' : ''].filter(function (cls) {
  22329. return cls;
  22330. });
  22331. var tables = ["<table class=\"".concat(clss.join(' '), "\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"), "<colgroup>".concat(columns.map(function (column) {
  22332. return "<col style=\"width:".concat(column.renderWidth, "px\">");
  22333. }).join(''), "</colgroup>")];
  22334. if (isHeader) {
  22335. tables.push('<thead>');
  22336. if (isColgroup && !original) {
  22337. colgroups.forEach(function (cols) {
  22338. tables.push("<tr>".concat(cols.map(function (column) {
  22339. var headAlign = column.headerAlign || column.align || allHeaderAlign || allAlign;
  22340. var classNames = mixin_hasEllipsis($xetable, column, 'showHeaderOverflow', allColumnHeaderOverflow) ? ['col--ellipsis'] : [];
  22341. var cellTitle = getHeaderTitle(opts, column);
  22342. var childWidth = 0;
  22343. var countChild = 0;
  22344. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree([column], function (item) {
  22345. if (!item.childNodes || !column.childNodes.length) {
  22346. countChild++;
  22347. }
  22348. childWidth += item.renderWidth;
  22349. }, {
  22350. children: 'childNodes'
  22351. });
  22352. var cellWidth = childWidth - countChild;
  22353. if (headAlign) {
  22354. classNames.push("col--".concat(headAlign));
  22355. }
  22356. if (column.type === 'checkbox') {
  22357. return "<th class=\"".concat(classNames.join(' '), "\" colspan=\"").concat(column._colSpan, "\" rowspan=\"").concat(column._rowSpan, "\"><div ").concat(isPrint ? '' : "style=\"width: ".concat(cellWidth, "px\""), "><input type=\"checkbox\" class=\"").concat(allCls, "\" ").concat(isAllSelected ? 'checked' : '', "><span>").concat(cellTitle, "</span></div></th>");
  22358. }
  22359. return "<th class=\"".concat(classNames.join(' '), "\" colspan=\"").concat(column._colSpan, "\" rowspan=\"").concat(column._rowSpan, "\" title=\"").concat(cellTitle, "\"><div ").concat(isPrint ? '' : "style=\"width: ".concat(cellWidth, "px\""), "><span>").concat(mixin_formatText(cellTitle, true), "</span></div></th>");
  22360. }).join(''), "</tr>"));
  22361. });
  22362. } else {
  22363. tables.push("<tr>".concat(columns.map(function (column) {
  22364. var headAlign = column.headerAlign || column.align || allHeaderAlign || allAlign;
  22365. var classNames = mixin_hasEllipsis($xetable, column, 'showHeaderOverflow', allColumnHeaderOverflow) ? ['col--ellipsis'] : [];
  22366. var cellTitle = getHeaderTitle(opts, column);
  22367. if (headAlign) {
  22368. classNames.push("col--".concat(headAlign));
  22369. }
  22370. if (column.type === 'checkbox') {
  22371. 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>");
  22372. }
  22373. return "<th class=\"".concat(classNames.join(' '), "\" title=\"").concat(cellTitle, "\"><div ").concat(isPrint ? '' : "style=\"width: ".concat(column.renderWidth, "px\""), "><span>").concat(mixin_formatText(cellTitle, true), "</span></div></th>");
  22374. }).join(''), "</tr>"));
  22375. }
  22376. tables.push('</thead>');
  22377. }
  22378. if (datas.length) {
  22379. tables.push('<tbody>');
  22380. if (treeConfig) {
  22381. datas.forEach(function (item) {
  22382. tables.push('<tr>' + columns.map(function (column) {
  22383. var cellAlign = column.align || allAlign;
  22384. var classNames = mixin_hasEllipsis($xetable, column, 'showOverflow', allColumnOverflow) ? ['col--ellipsis'] : [];
  22385. var cellValue = item[column.id];
  22386. if (cellAlign) {
  22387. classNames.push("col--".concat(cellAlign));
  22388. }
  22389. if (column.treeNode) {
  22390. var treeIcon = '';
  22391. if (item._hasChild) {
  22392. treeIcon = "<i class=\"".concat(item._expand ? 'vxe-table--tree-fold-icon' : 'vxe-table--tree-unfold-icon', "\"></i>");
  22393. }
  22394. classNames.push('vxe-table--tree-node');
  22395. if (column.type === 'radio') {
  22396. 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>");
  22397. } else if (column.type === 'checkbox') {
  22398. 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>");
  22399. }
  22400. 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>");
  22401. }
  22402. if (column.type === 'radio') {
  22403. 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>");
  22404. } else if (column.type === 'checkbox') {
  22405. 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>");
  22406. }
  22407. return "<td class=\"".concat(classNames.join(' '), "\" title=\"").concat(cellValue, "\"><div ").concat(isPrint ? '' : "style=\"width: ".concat(column.renderWidth, "px\""), ">").concat(mixin_formatText(cellValue, true), "</div></td>");
  22408. }).join('') + '</tr>');
  22409. });
  22410. } else {
  22411. datas.forEach(function (item) {
  22412. tables.push('<tr>' + columns.map(function (column) {
  22413. var cellAlign = column.align || allAlign;
  22414. var classNames = mixin_hasEllipsis($xetable, column, 'showOverflow', allColumnOverflow) ? ['col--ellipsis'] : [];
  22415. var cellValue = item[column.id];
  22416. var rowSpan = 1;
  22417. var colSpan = 1;
  22418. if (isMerge && mergeList.length) {
  22419. var _rowIndex = $xetable.getVTRowIndex(item._row);
  22420. var _columnIndex = $xetable.getVTColumnIndex(column);
  22421. var spanRest = mergeBodyMethod(mergeList, _rowIndex, _columnIndex);
  22422. if (spanRest) {
  22423. var rowspan = spanRest.rowspan,
  22424. colspan = spanRest.colspan;
  22425. if (!rowspan || !colspan) {
  22426. return '';
  22427. }
  22428. if (rowspan > 1) {
  22429. rowSpan = rowspan;
  22430. }
  22431. if (colspan > 1) {
  22432. colSpan = colspan;
  22433. }
  22434. }
  22435. }
  22436. if (cellAlign) {
  22437. classNames.push("col--".concat(cellAlign));
  22438. }
  22439. if (column.type === 'radio') {
  22440. return "<td class=\"".concat(classNames.join(' '), "\" rowspan=\"").concat(rowSpan, "\" colspan=\"").concat(colSpan, "\"><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>");
  22441. } else if (column.type === 'checkbox') {
  22442. return "<td class=\"".concat(classNames.join(' '), "\" rowspan=\"").concat(rowSpan, "\" colspan=\"").concat(colSpan, "\"><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>");
  22443. }
  22444. return "<td class=\"".concat(classNames.join(' '), "\" rowspan=\"").concat(rowSpan, "\" colspan=\"").concat(colSpan, "\" title=\"").concat(cellValue, "\"><div ").concat(isPrint ? '' : "style=\"width: ".concat(column.renderWidth, "px\""), ">").concat(mixin_formatText(cellValue, true), "</div></td>");
  22445. }).join('') + '</tr>');
  22446. });
  22447. }
  22448. tables.push('</tbody>');
  22449. }
  22450. if (isFooter) {
  22451. var footerTableData = $xetable.footerTableData;
  22452. var footers = getFooterData(opts, footerTableData);
  22453. if (footers.length) {
  22454. tables.push('<tfoot>');
  22455. footers.forEach(function (rows) {
  22456. tables.push("<tr>".concat(columns.map(function (column) {
  22457. var footAlign = column.footerAlign || column.align || allFooterAlign || allAlign;
  22458. var classNames = mixin_hasEllipsis($xetable, column, 'showOverflow', allColumnOverflow) ? ['col--ellipsis'] : [];
  22459. var cellValue = getFooterCellValue($xetable, opts, rows, column);
  22460. if (footAlign) {
  22461. classNames.push("col--".concat(footAlign));
  22462. }
  22463. return "<td class=\"".concat(classNames.join(' '), "\" title=\"").concat(cellValue, "\"><div ").concat(isPrint ? '' : "style=\"width: ".concat(column.renderWidth, "px\""), ">").concat(mixin_formatText(cellValue, true), "</div></td>");
  22464. }).join(''), "</tr>"));
  22465. });
  22466. tables.push('</tfoot>');
  22467. }
  22468. } // 是否半选状态
  22469. var script = !isAllSelected && isIndeterminate ? "<script>(function(){var a=document.querySelector(\".".concat(allCls, "\");if(a){a.indeterminate=true}})()</script>") : '';
  22470. tables.push('</table>', script);
  22471. return isPrint ? tables.join('') : createHtmlPage(opts, tables.join(''));
  22472. }
  22473. function toXML($xetable, opts, columns, datas) {
  22474. 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) {
  22475. return "<Column ss:Width=\"".concat(column.renderWidth, "\"/>");
  22476. }).join('')].join('');
  22477. if (opts.isHeader) {
  22478. xml += "<Row>".concat(columns.map(function (column) {
  22479. return "<Cell><Data ss:Type=\"String\">".concat(getHeaderTitle(opts, column), "</Data></Cell>");
  22480. }).join(''), "</Row>");
  22481. }
  22482. datas.forEach(function (row) {
  22483. xml += '<Row>' + columns.map(function (column) {
  22484. return "<Cell><Data ss:Type=\"String\">".concat(row[column.id], "</Data></Cell>");
  22485. }).join('') + '</Row>';
  22486. });
  22487. if (opts.isFooter) {
  22488. var footerTableData = $xetable.footerTableData;
  22489. var footers = getFooterData(opts, footerTableData);
  22490. footers.forEach(function (rows) {
  22491. xml += "<Row>".concat(columns.map(function (column) {
  22492. return "<Cell><Data ss:Type=\"String\">".concat(getFooterCellValue($xetable, opts, rows, column), "</Data></Cell>");
  22493. }).join(''), "</Row>");
  22494. });
  22495. }
  22496. return "".concat(xml, "</Table></Worksheet></Workbook>");
  22497. }
  22498. function getContent($xetable, opts, columns, datas) {
  22499. if (columns.length) {
  22500. switch (opts.type) {
  22501. case 'csv':
  22502. return toCsv($xetable, opts, columns, datas);
  22503. case 'txt':
  22504. return toTxt($xetable, opts, columns, datas);
  22505. case 'html':
  22506. return toHtml($xetable, opts, columns, datas);
  22507. case 'xml':
  22508. return toXML($xetable, opts, columns, datas);
  22509. }
  22510. }
  22511. return '';
  22512. }
  22513. /**
  22514. * 保存文件到本地
  22515. * @param {*} options 参数
  22516. */
  22517. function saveLocalFile(options) {
  22518. var filename = options.filename,
  22519. type = options.type,
  22520. content = options.content;
  22521. var name = "".concat(filename, ".").concat(type);
  22522. if (window.Blob) {
  22523. var blob = content instanceof Blob ? content : getExportBlobByContent(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toValueString(content), options);
  22524. if (navigator.msSaveBlob) {
  22525. navigator.msSaveBlob(blob, name);
  22526. } else {
  22527. var linkElem = document.createElement('a');
  22528. linkElem.target = '_blank';
  22529. linkElem.download = name;
  22530. linkElem.href = URL.createObjectURL(blob);
  22531. document.body.appendChild(linkElem);
  22532. linkElem.click();
  22533. document.body.removeChild(linkElem);
  22534. }
  22535. return Promise.resolve();
  22536. }
  22537. return Promise.reject(new Error(UtilTools.getLog('vxe.error.notExp')));
  22538. }
  22539. function downloadFile($xetable, opts, content) {
  22540. var filename = opts.filename,
  22541. type = opts.type,
  22542. download = opts.download;
  22543. if (!download) {
  22544. var blob = getExportBlobByContent(content, opts);
  22545. return Promise.resolve({
  22546. type: type,
  22547. content: content,
  22548. blob: blob
  22549. });
  22550. }
  22551. saveLocalFile({
  22552. filename: filename,
  22553. type: type,
  22554. content: content
  22555. }).then(function () {
  22556. if (opts.message !== false) {
  22557. v_x_e_table.modal.message({
  22558. message: conf.i18n('vxe.table.expSuccess'),
  22559. status: 'success'
  22560. });
  22561. }
  22562. });
  22563. }
  22564. function clearColumnConvert(columns) {
  22565. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(columns, function (column) {
  22566. delete column._level;
  22567. delete column._colSpan;
  22568. delete column._rowSpan;
  22569. delete column._children;
  22570. delete column.childNodes;
  22571. }, {
  22572. children: 'children'
  22573. });
  22574. }
  22575. function handleExport($xetable, opts) {
  22576. var remote = opts.remote,
  22577. columns = opts.columns,
  22578. colgroups = opts.colgroups,
  22579. exportMethod = opts.exportMethod,
  22580. afterExportMethod = opts.afterExportMethod;
  22581. return new Promise(function (resolve) {
  22582. if (remote) {
  22583. var params = {
  22584. options: opts,
  22585. $table: $xetable,
  22586. $grid: $xetable.$xegrid
  22587. };
  22588. resolve(exportMethod ? exportMethod(params) : params);
  22589. } else {
  22590. var datas = getExportData($xetable, opts);
  22591. resolve($xetable.preventEvent(null, 'event.export', {
  22592. options: opts,
  22593. columns: columns,
  22594. colgroups: colgroups,
  22595. datas: datas
  22596. }, function () {
  22597. return downloadFile($xetable, opts, getContent($xetable, opts, columns, datas));
  22598. }));
  22599. }
  22600. }).then(function (params) {
  22601. clearColumnConvert(columns);
  22602. if (!opts.print) {
  22603. if (afterExportMethod) {
  22604. afterExportMethod({
  22605. status: true,
  22606. options: opts,
  22607. $table: $xetable,
  22608. $grid: $xetable.$xegrid
  22609. });
  22610. }
  22611. }
  22612. return Object.assign({
  22613. status: true
  22614. }, params);
  22615. }).catch(function () {
  22616. clearColumnConvert(columns);
  22617. if (!opts.print) {
  22618. if (afterExportMethod) {
  22619. afterExportMethod({
  22620. status: false,
  22621. options: opts,
  22622. $table: $xetable,
  22623. $grid: $xetable.$xegrid
  22624. });
  22625. }
  22626. }
  22627. var params = {
  22628. status: false
  22629. };
  22630. return Promise.reject(params);
  22631. });
  22632. }
  22633. function getElementsByTagName(elem, qualifiedName) {
  22634. return elem.getElementsByTagName(qualifiedName);
  22635. }
  22636. function getTxtCellKey(now) {
  22637. return "#".concat(now, "@").concat(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.uniqueId());
  22638. }
  22639. function replaceTxtCell(cell, vMaps) {
  22640. return cell.replace(/#\d+@\d+/g, function (key) {
  22641. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.hasOwnProp(vMaps, key) ? vMaps[key] : key;
  22642. });
  22643. }
  22644. function getTxtCellValue(val, vMaps) {
  22645. var rest = replaceTxtCell(val, vMaps);
  22646. return rest.replace(/^"+$/g, function (qVal) {
  22647. return '"'.repeat(Math.ceil(qVal.length / 2));
  22648. });
  22649. }
  22650. function parseCsvAndTxt(columns, content, cellSeparator) {
  22651. var list = content.split(enterSymbol);
  22652. var rows = [];
  22653. var fields = [];
  22654. if (list.length) {
  22655. var vMaps = {};
  22656. var now = Date.now();
  22657. list.forEach(function (rVal) {
  22658. if (rVal) {
  22659. var item = {};
  22660. rVal = rVal.replace(/("")|(\n)/g, function (text, dVal) {
  22661. var key = getTxtCellKey(now);
  22662. vMaps[key] = dVal ? '"' : '\n';
  22663. return key;
  22664. }).replace(/"(.*?)"/g, function (text, cVal) {
  22665. var key = getTxtCellKey(now);
  22666. vMaps[key] = replaceTxtCell(cVal, vMaps);
  22667. return key;
  22668. });
  22669. var cells = rVal.split(cellSeparator);
  22670. if (!fields.length) {
  22671. fields = cells.map(function (val) {
  22672. return getTxtCellValue(val.trim(), vMaps);
  22673. });
  22674. } else {
  22675. cells.forEach(function (val, colIndex) {
  22676. if (colIndex < fields.length) {
  22677. item[fields[colIndex]] = getTxtCellValue(val, vMaps);
  22678. }
  22679. });
  22680. rows.push(item);
  22681. }
  22682. }
  22683. });
  22684. }
  22685. return {
  22686. fields: fields,
  22687. rows: rows
  22688. };
  22689. }
  22690. function parseCsv(columns, content) {
  22691. return parseCsvAndTxt(columns, content, ',');
  22692. }
  22693. function parseTxt(columns, content) {
  22694. return parseCsvAndTxt(columns, content, '\t');
  22695. }
  22696. function parseHTML(columns, content) {
  22697. var domParser = new DOMParser();
  22698. var xmlDoc = domParser.parseFromString(content, 'text/html');
  22699. var bodyNodes = getElementsByTagName(xmlDoc, 'body');
  22700. var rows = [];
  22701. var fields = [];
  22702. if (bodyNodes.length) {
  22703. var tableNodes = getElementsByTagName(bodyNodes[0], 'table');
  22704. if (tableNodes.length) {
  22705. var theadNodes = getElementsByTagName(tableNodes[0], 'thead');
  22706. if (theadNodes.length) {
  22707. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.arrayEach(getElementsByTagName(theadNodes[0], 'tr'), function (rowNode) {
  22708. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.arrayEach(getElementsByTagName(rowNode, 'th'), function (cellNode) {
  22709. fields.push(cellNode.textContent);
  22710. });
  22711. });
  22712. var tbodyNodes = getElementsByTagName(tableNodes[0], 'tbody');
  22713. if (tbodyNodes.length) {
  22714. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.arrayEach(getElementsByTagName(tbodyNodes[0], 'tr'), function (rowNode) {
  22715. var item = {};
  22716. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.arrayEach(getElementsByTagName(rowNode, 'td'), function (cellNode, colIndex) {
  22717. if (fields[colIndex]) {
  22718. item[fields[colIndex]] = cellNode.textContent || '';
  22719. }
  22720. });
  22721. rows.push(item);
  22722. });
  22723. }
  22724. }
  22725. }
  22726. }
  22727. return {
  22728. fields: fields,
  22729. rows: rows
  22730. };
  22731. }
  22732. function parseXML(columns, content) {
  22733. var domParser = new DOMParser();
  22734. var xmlDoc = domParser.parseFromString(content, 'application/xml');
  22735. var sheetNodes = getElementsByTagName(xmlDoc, 'Worksheet');
  22736. var rows = [];
  22737. var fields = [];
  22738. if (sheetNodes.length) {
  22739. var tableNodes = getElementsByTagName(sheetNodes[0], 'Table');
  22740. if (tableNodes.length) {
  22741. var rowNodes = getElementsByTagName(tableNodes[0], 'Row');
  22742. if (rowNodes.length) {
  22743. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.arrayEach(getElementsByTagName(rowNodes[0], 'Cell'), function (cellNode) {
  22744. fields.push(cellNode.textContent);
  22745. });
  22746. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.arrayEach(rowNodes, function (rowNode, index) {
  22747. if (index) {
  22748. var item = {};
  22749. var cellNodes = getElementsByTagName(rowNode, 'Cell');
  22750. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.arrayEach(cellNodes, function (cellNode, colIndex) {
  22751. if (fields[colIndex]) {
  22752. item[fields[colIndex]] = cellNode.textContent;
  22753. }
  22754. });
  22755. rows.push(item);
  22756. }
  22757. });
  22758. }
  22759. }
  22760. }
  22761. return {
  22762. fields: fields,
  22763. rows: rows
  22764. };
  22765. }
  22766. /**
  22767. * 检查导入的列是否完整
  22768. * @param {Array} fields 字段名列表
  22769. * @param {Array} rows 数据列表
  22770. */
  22771. function checkImportData(columns, fields) {
  22772. var tableFields = [];
  22773. columns.forEach(function (column) {
  22774. var field = column.property;
  22775. if (field) {
  22776. tableFields.push(field);
  22777. }
  22778. });
  22779. return fields.some(function (field) {
  22780. return tableFields.indexOf(field) > -1;
  22781. });
  22782. }
  22783. function handleImport($xetable, content, opts) {
  22784. var tableFullColumn = $xetable.tableFullColumn,
  22785. _importResolve = $xetable._importResolve,
  22786. _importReject = $xetable._importReject;
  22787. var rest = {
  22788. fields: [],
  22789. rows: []
  22790. };
  22791. switch (opts.type) {
  22792. case 'csv':
  22793. rest = parseCsv(tableFullColumn, content);
  22794. break;
  22795. case 'txt':
  22796. rest = parseTxt(tableFullColumn, content);
  22797. break;
  22798. case 'html':
  22799. rest = parseHTML(tableFullColumn, content);
  22800. break;
  22801. case 'xml':
  22802. rest = parseXML(tableFullColumn, content);
  22803. break;
  22804. }
  22805. var _rest = rest,
  22806. fields = _rest.fields,
  22807. rows = _rest.rows;
  22808. var status = checkImportData(tableFullColumn, fields);
  22809. if (status) {
  22810. $xetable.createData(rows).then(function (data) {
  22811. var loadRest;
  22812. if (opts.mode === 'insert') {
  22813. loadRest = $xetable.insert(data);
  22814. } else {
  22815. loadRest = $xetable.reloadData(data);
  22816. }
  22817. if (opts.message !== false) {
  22818. v_x_e_table.modal.message({
  22819. message: conf.i18n('vxe.table.impSuccess', [rows.length]),
  22820. status: 'success'
  22821. });
  22822. }
  22823. return loadRest.then(function () {
  22824. if (_importResolve) {
  22825. _importResolve({
  22826. status: true
  22827. });
  22828. }
  22829. });
  22830. });
  22831. } else if (opts.message !== false) {
  22832. v_x_e_table.modal.message({
  22833. message: conf.i18n('vxe.error.impFields'),
  22834. status: 'error'
  22835. });
  22836. if (_importReject) {
  22837. _importReject({
  22838. status: false
  22839. });
  22840. }
  22841. }
  22842. }
  22843. function handleFileImport($xetable, file, opts) {
  22844. var importMethod = opts.importMethod,
  22845. afterImportMethod = opts.afterImportMethod;
  22846. var _UtilTools$parseFile = UtilTools.parseFile(file),
  22847. type = _UtilTools$parseFile.type,
  22848. filename = _UtilTools$parseFile.filename; // 检查类型,如果为自定义导出,则不需要校验类型
  22849. if (!importMethod && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.includes(v_x_e_table.config.importTypes, type)) {
  22850. if (opts.message !== false) {
  22851. v_x_e_table.modal.message({
  22852. message: conf.i18n('vxe.error.notType', [type]),
  22853. status: 'error'
  22854. });
  22855. }
  22856. var params = {
  22857. status: false
  22858. };
  22859. return Promise.reject(params);
  22860. }
  22861. var rest = new Promise(function (resolve, reject) {
  22862. var _importResolve = function _importResolve(params) {
  22863. resolve(params);
  22864. $xetable._importResolve = null;
  22865. $xetable._importReject = null;
  22866. };
  22867. var _importReject = function _importReject(params) {
  22868. reject(params);
  22869. $xetable._importResolve = null;
  22870. $xetable._importReject = null;
  22871. };
  22872. $xetable._importResolve = _importResolve;
  22873. $xetable._importReject = _importReject;
  22874. if (window.FileReader) {
  22875. var options = Object.assign({
  22876. mode: 'insert'
  22877. }, opts, {
  22878. type: type,
  22879. filename: filename
  22880. });
  22881. if (options.remote) {
  22882. if (importMethod) {
  22883. Promise.resolve(importMethod({
  22884. file: file,
  22885. options: options,
  22886. $table: $xetable
  22887. })).then(function () {
  22888. _importResolve({
  22889. status: true
  22890. });
  22891. }).catch(function () {
  22892. _importResolve({
  22893. status: true
  22894. });
  22895. });
  22896. } else {
  22897. _importResolve({
  22898. status: true
  22899. });
  22900. }
  22901. } else {
  22902. $xetable.preventEvent(null, 'event.import', {
  22903. file: file,
  22904. options: options,
  22905. columns: $xetable.tableFullColumn
  22906. }, function () {
  22907. var reader = new FileReader();
  22908. reader.onerror = function () {
  22909. UtilTools.error('vxe.error.notType', [type]);
  22910. _importReject({
  22911. status: false
  22912. });
  22913. };
  22914. reader.onload = function (e) {
  22915. handleImport($xetable, e.target.result, options);
  22916. };
  22917. reader.readAsText(file, 'UTF-8');
  22918. });
  22919. }
  22920. } else {
  22921. // 不支持的浏览器
  22922. if (false) {}
  22923. _importResolve({
  22924. status: true
  22925. });
  22926. }
  22927. });
  22928. return rest.then(function () {
  22929. if (afterImportMethod) {
  22930. afterImportMethod({
  22931. status: true,
  22932. options: opts,
  22933. $table: $xetable
  22934. });
  22935. }
  22936. }).catch(function (e) {
  22937. if (afterImportMethod) {
  22938. afterImportMethod({
  22939. status: false,
  22940. options: opts,
  22941. $table: $xetable
  22942. });
  22943. }
  22944. return Promise.reject(e);
  22945. });
  22946. }
  22947. /**
  22948. * 读取本地文件
  22949. * @param {*} options 参数
  22950. */
  22951. function readLocalFile() {
  22952. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  22953. if (!fileForm) {
  22954. fileForm = document.createElement('form');
  22955. fileInput = document.createElement('input');
  22956. fileForm.className = 'vxe-table--file-form';
  22957. fileInput.name = 'file';
  22958. fileInput.type = 'file';
  22959. fileForm.appendChild(fileInput);
  22960. document.body.appendChild(fileForm);
  22961. }
  22962. return new Promise(function (resolve, reject) {
  22963. var types = options.types || [];
  22964. var isAllType = !types.length || types.some(function (type) {
  22965. return type === '*';
  22966. });
  22967. fileInput.multiple = !!options.multiple;
  22968. fileInput.accept = isAllType ? '' : ".".concat(types.join(', .'));
  22969. fileInput.onchange = function (evnt) {
  22970. var files = evnt.target.files;
  22971. var file = files[0];
  22972. var errType; // 校验类型
  22973. if (!isAllType) {
  22974. for (var fIndex = 0; fIndex < files.length; fIndex++) {
  22975. var _UtilTools$parseFile2 = UtilTools.parseFile(files[fIndex]),
  22976. type = _UtilTools$parseFile2.type;
  22977. if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.includes(types, type)) {
  22978. errType = type;
  22979. break;
  22980. }
  22981. }
  22982. }
  22983. if (!errType) {
  22984. resolve({
  22985. status: true,
  22986. files: files,
  22987. file: file
  22988. });
  22989. } else {
  22990. if (options.message !== false) {
  22991. v_x_e_table.modal.message({
  22992. message: conf.i18n('vxe.error.notType', [errType]),
  22993. status: 'error'
  22994. });
  22995. }
  22996. var params = {
  22997. status: false,
  22998. files: files,
  22999. file: file
  23000. };
  23001. reject(params);
  23002. }
  23003. };
  23004. fileForm.reset();
  23005. fileInput.click();
  23006. });
  23007. }
  23008. function handlePrint($xetable, opts, content) {
  23009. var beforePrintMethod = opts.beforePrintMethod;
  23010. if (beforePrintMethod) {
  23011. content = beforePrintMethod({
  23012. content: content,
  23013. options: opts,
  23014. $table: $xetable
  23015. }) || '';
  23016. }
  23017. content = createHtmlPage(opts, content);
  23018. var blob = getExportBlobByContent(content, opts);
  23019. if (DomTools.browse.msie) {
  23020. if (printFrame) {
  23021. try {
  23022. printFrame.contentDocument.write('');
  23023. printFrame.contentDocument.clear();
  23024. } catch (e) {}
  23025. document.body.removeChild(printFrame);
  23026. }
  23027. printFrame = createFrame();
  23028. document.body.appendChild(printFrame);
  23029. printFrame.contentDocument.write(content);
  23030. printFrame.contentDocument.execCommand('print');
  23031. } else {
  23032. if (!printFrame) {
  23033. printFrame = createFrame();
  23034. printFrame.onload = function (evnt) {
  23035. if (evnt.target.src) {
  23036. evnt.target.contentWindow.print();
  23037. }
  23038. };
  23039. document.body.appendChild(printFrame);
  23040. }
  23041. printFrame.src = URL.createObjectURL(blob);
  23042. }
  23043. }
  23044. function handleExportAndPrint($xetable, options, isPrint) {
  23045. var initStore = $xetable.initStore,
  23046. customOpts = $xetable.customOpts,
  23047. collectColumn = $xetable.collectColumn,
  23048. footerTableData = $xetable.footerTableData,
  23049. treeConfig = $xetable.treeConfig,
  23050. mergeList = $xetable.mergeList,
  23051. isGroup = $xetable.isGroup,
  23052. exportParams = $xetable.exportParams;
  23053. var selectRecords = $xetable.getCheckboxRecords();
  23054. var hasFooter = !!footerTableData.length;
  23055. var hasTree = treeConfig;
  23056. var hasMerge = !hasTree && mergeList.length;
  23057. var defOpts = Object.assign({
  23058. message: true,
  23059. isHeader: true
  23060. }, options);
  23061. var types = defOpts.types || v_x_e_table.config.exportTypes;
  23062. var modes = defOpts.modes;
  23063. var checkMethod = customOpts.checkMethod;
  23064. var exportColumns = collectColumn.slice(0);
  23065. var columns = defOpts.columns; // 处理类型
  23066. var typeList = types.map(function (value) {
  23067. return {
  23068. value: value,
  23069. label: "vxe.export.types.".concat(value)
  23070. };
  23071. });
  23072. var modeList = modes.map(function (value) {
  23073. return {
  23074. value: value,
  23075. label: "vxe.export.modes.".concat(value)
  23076. };
  23077. }); // 默认选中
  23078. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(exportColumns, function (column, index, items, path, parent) {
  23079. var isColGroup = column.children && column.children.length;
  23080. if (isColGroup || defaultFilterExportColumn(column)) {
  23081. column.checked = columns ? columns.some(function (item) {
  23082. if (UtilTools.isColumn(item)) {
  23083. return column === item;
  23084. } else if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isString(item)) {
  23085. return column.field === item;
  23086. } else {
  23087. var colid = item.id || item.colId;
  23088. var type = item.type;
  23089. var field = item.property || item.field;
  23090. if (colid) {
  23091. return column.id === colid;
  23092. } else if (field && type) {
  23093. return column.property === field && column.type === type;
  23094. } else if (field) {
  23095. return column.property === field;
  23096. } else if (type) {
  23097. return column.type === type;
  23098. }
  23099. }
  23100. }) : column.visible;
  23101. column.halfChecked = false;
  23102. column.disabled = parent && parent.disabled || (checkMethod ? !checkMethod({
  23103. column: column
  23104. }) : false);
  23105. }
  23106. }); // 更新条件
  23107. Object.assign($xetable.exportStore, {
  23108. columns: exportColumns,
  23109. typeList: typeList,
  23110. modeList: modeList,
  23111. hasFooter: hasFooter,
  23112. hasMerge: hasMerge,
  23113. hasTree: hasTree,
  23114. isPrint: isPrint,
  23115. hasColgroup: isGroup,
  23116. visible: true
  23117. }); // 默认参数
  23118. if (!initStore.export) {
  23119. Object.assign(exportParams, {
  23120. mode: selectRecords.length ? 'selected' : 'current'
  23121. }, defOpts);
  23122. }
  23123. if (modes.indexOf(exportParams.mode) === -1) {
  23124. exportParams.mode = modes[0];
  23125. }
  23126. if (types.indexOf(exportParams.type) === -1) {
  23127. exportParams.type = types[0];
  23128. }
  23129. initStore.export = true;
  23130. return $xetable.$nextTick();
  23131. }
  23132. var mixin_getConvertColumns = function getConvertColumns(columns) {
  23133. var result = [];
  23134. columns.forEach(function (column) {
  23135. if (column.childNodes && column.childNodes.length) {
  23136. result.push(column);
  23137. result.push.apply(result, _toConsumableArray(getConvertColumns(column.childNodes)));
  23138. } else {
  23139. result.push(column);
  23140. }
  23141. });
  23142. return result;
  23143. };
  23144. var convertToRows = function convertToRows(originColumns) {
  23145. var maxLevel = 1;
  23146. var traverse = function traverse(column, parent) {
  23147. if (parent) {
  23148. column._level = parent._level + 1;
  23149. if (maxLevel < column._level) {
  23150. maxLevel = column._level;
  23151. }
  23152. }
  23153. if (column.childNodes && column.childNodes.length) {
  23154. var colSpan = 0;
  23155. column.childNodes.forEach(function (subColumn) {
  23156. traverse(subColumn, column);
  23157. colSpan += subColumn._colSpan;
  23158. });
  23159. column._colSpan = colSpan;
  23160. } else {
  23161. column._colSpan = 1;
  23162. }
  23163. };
  23164. originColumns.forEach(function (column) {
  23165. column._level = 1;
  23166. traverse(column);
  23167. });
  23168. var rows = [];
  23169. for (var i = 0; i < maxLevel; i++) {
  23170. rows.push([]);
  23171. }
  23172. var allColumns = mixin_getConvertColumns(originColumns);
  23173. allColumns.forEach(function (column) {
  23174. if (column.childNodes && column.childNodes.length) {
  23175. column._rowSpan = 1;
  23176. } else {
  23177. column._rowSpan = maxLevel - column._level + 1;
  23178. }
  23179. rows[column._level - 1].push(column);
  23180. });
  23181. return rows;
  23182. };
  23183. /* harmony default export */ var export_src_mixin = ({
  23184. methods: {
  23185. /**
  23186. * 导出文件,支持 csv/html/xml/txt
  23187. * 如果是树表格,则默认是导出所有节点
  23188. * 如果是启用了虚拟滚动,则只能导出数据源,可以配合 dataFilterMethod 函数自行转换数据
  23189. * @param {Object} options 参数
  23190. */
  23191. _exportData: function _exportData(options) {
  23192. var _this = this;
  23193. var $xegrid = this.$xegrid,
  23194. isGroup = this.isGroup,
  23195. tableGroupColumn = this.tableGroupColumn,
  23196. tableFullColumn = this.tableFullColumn,
  23197. afterFullData = this.afterFullData,
  23198. treeConfig = this.treeConfig,
  23199. treeOpts = this.treeOpts,
  23200. exportOpts = this.exportOpts;
  23201. var opts = Object.assign({
  23202. // filename: '',
  23203. // sheetName: '',
  23204. // original: false,
  23205. // message: false,
  23206. isHeader: true,
  23207. isFooter: true,
  23208. isColgroup: true,
  23209. isMerge: false,
  23210. isAllExpand: false,
  23211. download: true,
  23212. type: 'csv',
  23213. mode: 'current' // data: null,
  23214. // remote: false,
  23215. // dataFilterMethod: null,
  23216. // footerFilterMethod: null,
  23217. // exportMethod: null,
  23218. // columnFilterMethod: null,
  23219. // beforeExportMethod: null,
  23220. // afterExportMethod: null
  23221. }, exportOpts, {
  23222. print: false
  23223. }, options);
  23224. var type = opts.type,
  23225. mode = opts.mode,
  23226. columns = opts.columns,
  23227. original = opts.original,
  23228. beforeExportMethod = opts.beforeExportMethod;
  23229. var groups = [];
  23230. var customCols = columns && columns.length ? columns : null; // 如果设置源数据,则默认导出设置了字段的列
  23231. var columnFilterMethod = opts.columnFilterMethod;
  23232. if (!customCols && !columnFilterMethod) {
  23233. columnFilterMethod = original ? function (_ref) {
  23234. var column = _ref.column;
  23235. return column.property;
  23236. } : function (_ref2) {
  23237. var column = _ref2.column;
  23238. return defaultFilterExportColumn(column);
  23239. };
  23240. }
  23241. if (customCols) {
  23242. groups = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.searchTree(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.mapTree(customCols, function (item) {
  23243. var targetColumn;
  23244. if (item) {
  23245. if (UtilTools.isColumn(item)) {
  23246. targetColumn = item;
  23247. } else if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isString(item)) {
  23248. targetColumn = _this.getColumnByField(item);
  23249. } else {
  23250. var colid = item.id || item.colId;
  23251. var _type = item.type;
  23252. var field = item.property || item.field;
  23253. if (colid) {
  23254. targetColumn = _this.getColumnById(colid);
  23255. } else if (field && _type) {
  23256. targetColumn = tableFullColumn.find(function (column) {
  23257. return column.property === field && column.type === _type;
  23258. });
  23259. } else if (field) {
  23260. targetColumn = _this.getColumnByField(field);
  23261. } else if (_type) {
  23262. targetColumn = tableFullColumn.find(function (column) {
  23263. return column.type === _type;
  23264. });
  23265. }
  23266. }
  23267. return targetColumn || {};
  23268. }
  23269. }, {
  23270. children: 'childNodes',
  23271. mapChildren: '_children'
  23272. }), function (column, index) {
  23273. return UtilTools.isColumn(column) && (!columnFilterMethod || columnFilterMethod({
  23274. column: column,
  23275. $columnIndex: index
  23276. }));
  23277. }, {
  23278. children: '_children',
  23279. mapChildren: 'childNodes',
  23280. original: true
  23281. });
  23282. } else {
  23283. groups = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.searchTree(isGroup ? tableGroupColumn : tableFullColumn, function (column, index) {
  23284. return column.visible && (!columnFilterMethod || columnFilterMethod({
  23285. column: column,
  23286. $columnIndex: index
  23287. }));
  23288. }, {
  23289. children: 'children',
  23290. mapChildren: 'childNodes',
  23291. original: true
  23292. });
  23293. } // 获取所有列
  23294. var cols = [];
  23295. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(groups, function (column) {
  23296. var isColGroup = column.children && column.children.length;
  23297. if (!isColGroup) {
  23298. cols.push(column);
  23299. }
  23300. }, {
  23301. children: 'childNodes'
  23302. }); // 构建分组层级
  23303. opts.columns = cols;
  23304. opts.colgroups = convertToRows(groups);
  23305. if (!opts.filename) {
  23306. opts.filename = conf.i18n(opts.original ? 'vxe.table.expOriginFilename' : 'vxe.table.expFilename', [external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toDateString(Date.now(), 'yyyyMMddHHmmss')]);
  23307. }
  23308. if (!opts.sheetName) {
  23309. opts.sheetName = document.title;
  23310. } // 检查类型,如果为自定义导出,则不需要校验类型
  23311. if (!opts.exportMethod && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.includes(v_x_e_table.config.exportTypes, type)) {
  23312. if (false) {}
  23313. var params = {
  23314. status: false
  23315. };
  23316. return Promise.reject(params);
  23317. }
  23318. if (!opts.print) {
  23319. if (beforeExportMethod) {
  23320. beforeExportMethod({
  23321. options: opts,
  23322. $table: this,
  23323. $grid: $xegrid
  23324. });
  23325. }
  23326. }
  23327. if (!opts.data) {
  23328. opts.data = afterFullData;
  23329. if (mode === 'selected') {
  23330. var selectRecords = this.getCheckboxRecords();
  23331. if (['html', 'pdf'].indexOf(type) > -1 && treeConfig) {
  23332. opts.data = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.searchTree(this.getTableData().fullData, function (item) {
  23333. return selectRecords.indexOf(item) > -1;
  23334. }, Object.assign({}, treeOpts, {
  23335. data: '_row'
  23336. }));
  23337. } else {
  23338. opts.data = selectRecords;
  23339. }
  23340. } else if (mode === 'all') {
  23341. if ($xegrid && !opts.remote) {
  23342. var _$xegrid$proxyOpts = $xegrid.proxyOpts,
  23343. beforeQueryAll = _$xegrid$proxyOpts.beforeQueryAll,
  23344. afterQueryAll = _$xegrid$proxyOpts.afterQueryAll,
  23345. _$xegrid$proxyOpts$aj = _$xegrid$proxyOpts.ajax,
  23346. ajax = _$xegrid$proxyOpts$aj === void 0 ? {} : _$xegrid$proxyOpts$aj,
  23347. _$xegrid$proxyOpts$pr = _$xegrid$proxyOpts.props,
  23348. props = _$xegrid$proxyOpts$pr === void 0 ? {} : _$xegrid$proxyOpts$pr;
  23349. var ajaxMethods = ajax.queryAll;
  23350. if (ajaxMethods) {
  23351. var _params = {
  23352. $table: this,
  23353. $grid: $xegrid,
  23354. sort: $xegrid.sortData,
  23355. filters: $xegrid.filterData,
  23356. form: $xegrid.formData,
  23357. target: ajaxMethods,
  23358. options: opts
  23359. };
  23360. return Promise.resolve((beforeQueryAll || ajaxMethods)(_params)).catch(function (e) {
  23361. return e;
  23362. }).then(function (rest) {
  23363. opts.data = (props.list ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(rest, props.list) : rest) || [];
  23364. if (afterQueryAll) {
  23365. afterQueryAll(_params);
  23366. }
  23367. return handleExport(_this, opts);
  23368. });
  23369. }
  23370. }
  23371. }
  23372. }
  23373. return handleExport(this, opts);
  23374. },
  23375. _importByFile: function _importByFile(file, options) {
  23376. var opts = Object.assign({}, options);
  23377. var beforeImportMethod = opts.beforeImportMethod;
  23378. if (beforeImportMethod) {
  23379. beforeImportMethod({
  23380. options: opts,
  23381. $table: this
  23382. });
  23383. }
  23384. return handleFileImport(this, file, opts);
  23385. },
  23386. _importData: function _importData(options) {
  23387. var _this2 = this;
  23388. var opts = Object.assign({
  23389. types: v_x_e_table.config.importTypes // beforeImportMethod: null,
  23390. // afterImportMethod: null
  23391. }, this.importOpts, options);
  23392. var beforeImportMethod = opts.beforeImportMethod,
  23393. afterImportMethod = opts.afterImportMethod;
  23394. if (beforeImportMethod) {
  23395. beforeImportMethod({
  23396. options: opts,
  23397. $table: this
  23398. });
  23399. }
  23400. return readLocalFile(opts).catch(function (e) {
  23401. if (afterImportMethod) {
  23402. afterImportMethod({
  23403. status: false,
  23404. options: opts,
  23405. $table: _this2
  23406. });
  23407. }
  23408. return Promise.reject(e);
  23409. }).then(function (params) {
  23410. var file = params.file;
  23411. return handleFileImport(_this2, file, opts);
  23412. });
  23413. },
  23414. _saveFile: function _saveFile(options) {
  23415. return saveLocalFile(options);
  23416. },
  23417. _readFile: function _readFile(options) {
  23418. return readLocalFile(options);
  23419. },
  23420. _print: function _print(options) {
  23421. var _this3 = this;
  23422. var opts = Object.assign({
  23423. original: false // beforePrintMethod
  23424. }, this.printOpts, options, {
  23425. type: 'html',
  23426. download: false,
  23427. remote: false,
  23428. print: true
  23429. });
  23430. if (!opts.sheetName) {
  23431. opts.sheetName = document.title;
  23432. }
  23433. return new Promise(function (resolve) {
  23434. if (opts.content) {
  23435. resolve(handlePrint(_this3, opts, opts.content));
  23436. } else {
  23437. resolve(_this3.exportData(opts).then(function (_ref3) {
  23438. var content = _ref3.content;
  23439. return handlePrint(_this3, opts, content);
  23440. }));
  23441. }
  23442. });
  23443. },
  23444. _openImport: function _openImport(options) {
  23445. var defOpts = Object.assign({
  23446. mode: 'insert',
  23447. message: true,
  23448. types: v_x_e_table.config.importTypes
  23449. }, options, this.importOpts);
  23450. var types = defOpts.types;
  23451. var isTree = !!this.getTreeStatus();
  23452. if (isTree) {
  23453. if (defOpts.message) {
  23454. v_x_e_table.modal.message({
  23455. message: conf.i18n('vxe.error.treeNotImp'),
  23456. status: 'error'
  23457. });
  23458. }
  23459. return;
  23460. }
  23461. if (!this.importConfig) {
  23462. UtilTools.error('vxe.error.reqProp', ['import-config']);
  23463. } // 处理类型
  23464. var typeList = types.map(function (value) {
  23465. return {
  23466. value: value,
  23467. label: "vxe.export.types.".concat(value)
  23468. };
  23469. });
  23470. var modeList = defOpts.modes.map(function (value) {
  23471. return {
  23472. value: value,
  23473. label: "vxe.import.modes.".concat(value)
  23474. };
  23475. });
  23476. Object.assign(this.importStore, {
  23477. file: null,
  23478. type: '',
  23479. filename: '',
  23480. modeList: modeList,
  23481. typeList: typeList,
  23482. visible: true
  23483. });
  23484. Object.assign(this.importParams, defOpts);
  23485. this.initStore.import = true;
  23486. },
  23487. _openExport: function _openExport(options) {
  23488. var exportOpts = this.exportOpts;
  23489. if (false) {}
  23490. return handleExportAndPrint(this, Object.assign({}, exportOpts, options));
  23491. },
  23492. _openPrint: function _openPrint(options) {
  23493. var printOpts = this.printOpts;
  23494. if (false) {}
  23495. return handleExportAndPrint(this, Object.assign({}, printOpts, options), true);
  23496. }
  23497. }
  23498. });
  23499. // CONCATENATED MODULE: ./packages/export/index.js
  23500. function print(options) {
  23501. var opts = Object.assign({}, options, {
  23502. type: 'html'
  23503. });
  23504. handlePrint(null, opts, opts.content);
  23505. }
  23506. var Export = {
  23507. ExportPanel: export_panel,
  23508. ImportPanel: import_panel,
  23509. install: function install(Vue) {
  23510. v_x_e_table.reg('export');
  23511. v_x_e_table.saveFile = saveLocalFile;
  23512. v_x_e_table.readFile = readLocalFile;
  23513. v_x_e_table.print = print;
  23514. v_x_e_table.setup({
  23515. export: {
  23516. types: {
  23517. csv: 0,
  23518. html: 0,
  23519. xml: 0,
  23520. txt: 0
  23521. }
  23522. }
  23523. });
  23524. packages_table.mixins.push(export_src_mixin);
  23525. Vue.component(export_panel.name, export_panel);
  23526. Vue.component(import_panel.name, import_panel);
  23527. }
  23528. };
  23529. /* harmony default export */ var packages_export = (Export);
  23530. // CONCATENATED MODULE: ./packages/keyboard/src/mixin.js
  23531. var mixin_browse = DomTools.browse;
  23532. function getTargetOffset(target, container) {
  23533. var offsetTop = 0;
  23534. var offsetLeft = 0;
  23535. var triggerCheckboxLabel = !mixin_browse.firefox && DomTools.hasClass(target, 'vxe-checkbox--label');
  23536. if (triggerCheckboxLabel) {
  23537. var checkboxLabelStyle = getComputedStyle(target);
  23538. offsetTop -= external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(checkboxLabelStyle.paddingTop);
  23539. offsetLeft -= external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(checkboxLabelStyle.paddingLeft);
  23540. }
  23541. while (target && target !== container) {
  23542. offsetTop += target.offsetTop;
  23543. offsetLeft += target.offsetLeft;
  23544. target = target.offsetParent;
  23545. if (triggerCheckboxLabel) {
  23546. var checkboxStyle = getComputedStyle(target);
  23547. offsetTop -= external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(checkboxStyle.paddingTop);
  23548. offsetLeft -= external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(checkboxStyle.paddingLeft);
  23549. }
  23550. }
  23551. return {
  23552. offsetTop: offsetTop,
  23553. offsetLeft: offsetLeft
  23554. };
  23555. }
  23556. function getCheckboxRangeRows(_vm, params, targetTrElem, moveRange) {
  23557. var countHeight = 0;
  23558. var rangeRows = [];
  23559. var isDown = moveRange > 0;
  23560. var moveSize = moveRange > 0 ? moveRange : Math.abs(moveRange) + targetTrElem.offsetHeight;
  23561. var afterFullData = _vm.afterFullData,
  23562. scrollYStore = _vm.scrollYStore,
  23563. scrollYLoad = _vm.scrollYLoad;
  23564. if (scrollYLoad) {
  23565. var _rowIndex = _vm.getVTRowIndex(params.row);
  23566. if (isDown) {
  23567. rangeRows = afterFullData.slice(_rowIndex, _rowIndex + Math.ceil(moveSize / scrollYStore.rowHeight));
  23568. } else {
  23569. rangeRows = afterFullData.slice(_rowIndex - Math.floor(moveSize / scrollYStore.rowHeight) + 1, _rowIndex + 1);
  23570. }
  23571. } else {
  23572. var siblingProp = isDown ? 'next' : 'previous';
  23573. while (targetTrElem && countHeight < moveSize) {
  23574. rangeRows.push(_vm.getRowNode(targetTrElem).item);
  23575. countHeight += targetTrElem.offsetHeight;
  23576. targetTrElem = targetTrElem["".concat(siblingProp, "ElementSibling")];
  23577. }
  23578. }
  23579. return rangeRows;
  23580. }
  23581. /* harmony default export */ var keyboard_src_mixin = ({
  23582. methods: {
  23583. // 处理 Tab 键移动
  23584. moveTabSelected: function moveTabSelected(args, isLeft, evnt) {
  23585. var _this = this;
  23586. var afterFullData = this.afterFullData,
  23587. visibleColumn = this.visibleColumn,
  23588. editConfig = this.editConfig,
  23589. editOpts = this.editOpts;
  23590. var targetRow;
  23591. var targetRowIndex;
  23592. var targetColumnIndex;
  23593. var params = Object.assign({}, args);
  23594. var _rowIndex = this.getVTRowIndex(params.row);
  23595. var _columnIndex = this.getVTColumnIndex(params.column);
  23596. evnt.preventDefault();
  23597. if (isLeft) {
  23598. // 向左
  23599. if (_columnIndex <= 0) {
  23600. // 如果已经是第一列,则移动到上一行
  23601. if (_rowIndex > 0) {
  23602. targetRowIndex = _rowIndex - 1;
  23603. targetRow = afterFullData[targetRowIndex];
  23604. targetColumnIndex = visibleColumn.length - 1;
  23605. }
  23606. } else {
  23607. targetColumnIndex = _columnIndex - 1;
  23608. }
  23609. } else {
  23610. if (_columnIndex >= visibleColumn.length - 1) {
  23611. // 如果已经是第一列,则移动到上一行
  23612. if (_rowIndex < afterFullData.length - 1) {
  23613. targetRowIndex = _rowIndex + 1;
  23614. targetRow = afterFullData[targetRowIndex];
  23615. targetColumnIndex = 0;
  23616. }
  23617. } else {
  23618. targetColumnIndex = _columnIndex + 1;
  23619. }
  23620. }
  23621. var targetColumn = visibleColumn[targetColumnIndex];
  23622. if (targetColumn) {
  23623. if (targetRow) {
  23624. params.rowIndex = targetRowIndex;
  23625. params.row = targetRow;
  23626. } else {
  23627. params.rowIndex = _rowIndex;
  23628. }
  23629. params.columnIndex = targetColumnIndex;
  23630. params.column = targetColumn;
  23631. params.cell = this.getCell(params.row, params.column);
  23632. if (editConfig) {
  23633. if (editOpts.trigger === 'click' || editOpts.trigger === 'dblclick') {
  23634. if (editOpts.mode === 'row') {
  23635. this.handleActived(params, evnt);
  23636. } else {
  23637. this.scrollToRow(params.row, params.column).then(function () {
  23638. return _this.handleSelected(params, evnt);
  23639. });
  23640. }
  23641. }
  23642. } else {
  23643. this.scrollToRow(params.row, params.column).then(function () {
  23644. return _this.handleSelected(params, evnt);
  23645. });
  23646. }
  23647. }
  23648. },
  23649. // 处理当前行方向键移动
  23650. moveCurrentRow: function moveCurrentRow(isUpArrow, isDwArrow, evnt) {
  23651. var _this2 = this;
  23652. var currentRow = this.currentRow,
  23653. treeConfig = this.treeConfig,
  23654. treeOpts = this.treeOpts,
  23655. afterFullData = this.afterFullData;
  23656. var targetRow;
  23657. evnt.preventDefault();
  23658. if (currentRow) {
  23659. if (treeConfig) {
  23660. var _XEUtils$findTree = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.findTree(afterFullData, function (item) {
  23661. return item === currentRow;
  23662. }, treeOpts),
  23663. index = _XEUtils$findTree.index,
  23664. items = _XEUtils$findTree.items;
  23665. if (isUpArrow && index > 0) {
  23666. targetRow = items[index - 1];
  23667. } else if (isDwArrow && index < items.length - 1) {
  23668. targetRow = items[index + 1];
  23669. }
  23670. } else {
  23671. var _rowIndex = this.getVTRowIndex(currentRow);
  23672. if (isUpArrow && _rowIndex > 0) {
  23673. targetRow = afterFullData[_rowIndex - 1];
  23674. } else if (isDwArrow && _rowIndex < afterFullData.length - 1) {
  23675. targetRow = afterFullData[_rowIndex + 1];
  23676. }
  23677. }
  23678. } else {
  23679. targetRow = afterFullData[0];
  23680. }
  23681. if (targetRow) {
  23682. var params = {
  23683. $table: this,
  23684. row: targetRow
  23685. };
  23686. this.scrollToRow(targetRow).then(function () {
  23687. return _this2.triggerCurrentRowEvent(evnt, params);
  23688. });
  23689. }
  23690. },
  23691. // 处理可编辑方向键移动
  23692. moveSelected: function moveSelected(args, isLeftArrow, isUpArrow, isRightArrow, isDwArrow, evnt) {
  23693. var _this3 = this;
  23694. var afterFullData = this.afterFullData,
  23695. visibleColumn = this.visibleColumn;
  23696. var params = Object.assign({}, args);
  23697. var _rowIndex = this.getVTRowIndex(params.row);
  23698. var _columnIndex = this.getVTColumnIndex(params.column);
  23699. evnt.preventDefault();
  23700. if (isUpArrow && _rowIndex > 0) {
  23701. // 移动到上一行
  23702. params.rowIndex = _rowIndex - 1;
  23703. params.row = afterFullData[params.rowIndex];
  23704. } else if (isDwArrow && _rowIndex < afterFullData.length - 1) {
  23705. // 移动到下一行
  23706. params.rowIndex = _rowIndex + 1;
  23707. params.row = afterFullData[params.rowIndex];
  23708. } else if (isLeftArrow && _columnIndex) {
  23709. // 移动到左侧单元格
  23710. params.columnIndex = _columnIndex - 1;
  23711. params.column = visibleColumn[params.columnIndex];
  23712. } else if (isRightArrow && _columnIndex < visibleColumn.length - 1) {
  23713. // 移动到右侧单元格
  23714. params.columnIndex = _columnIndex + 1;
  23715. params.column = visibleColumn[params.columnIndex];
  23716. }
  23717. this.scrollToRow(params.row, params.column).then(function () {
  23718. params.cell = _this3.getCell(params.row, params.column);
  23719. _this3.handleSelected(params, evnt);
  23720. });
  23721. },
  23722. /**
  23723. * 表头单元格按下事件
  23724. */
  23725. triggerHeaderCellMousedownEvent: function triggerHeaderCellMousedownEvent(evnt, params) {
  23726. var mouseConfig = this.mouseConfig,
  23727. mouseOpts = this.mouseOpts;
  23728. if (mouseConfig && mouseOpts.area && this.handleHeaderCellAreaEvent) {
  23729. var cell = evnt.currentTarget;
  23730. var triggerSort = DomTools.getEventTargetNode(evnt, cell, 'vxe-cell--sort').flag;
  23731. var triggerFilter = DomTools.getEventTargetNode(evnt, cell, 'vxe-cell--filter').flag;
  23732. this.handleHeaderCellAreaEvent(evnt, Object.assign({
  23733. cell: cell,
  23734. triggerSort: triggerSort,
  23735. triggerFilter: triggerFilter
  23736. }, params));
  23737. }
  23738. this.focus();
  23739. this.closeMenu();
  23740. },
  23741. /**
  23742. * 单元格按下事件
  23743. */
  23744. triggerCellMousedownEvent: function triggerCellMousedownEvent(evnt, params) {
  23745. var cell = evnt.currentTarget;
  23746. params.cell = cell;
  23747. this.handleCellMousedownEvent(evnt, params);
  23748. this.focus();
  23749. this.closeFilter();
  23750. this.closeMenu();
  23751. },
  23752. handleCellMousedownEvent: function handleCellMousedownEvent(evnt, params) {
  23753. var editConfig = this.editConfig,
  23754. editOpts = this.editOpts,
  23755. handleSelected = this.handleSelected,
  23756. checkboxConfig = this.checkboxConfig,
  23757. checkboxOpts = this.checkboxOpts,
  23758. mouseConfig = this.mouseConfig,
  23759. mouseOpts = this.mouseOpts;
  23760. if (mouseConfig && mouseOpts.area && this.handleCellAreaEvent) {
  23761. return this.handleCellAreaEvent(evnt, params);
  23762. } else {
  23763. if (checkboxConfig && checkboxOpts.range) {
  23764. this.handleCheckboxRangeEvent(evnt, params);
  23765. }
  23766. if (mouseConfig && mouseOpts.selected) {
  23767. if (!editConfig || editOpts.mode === 'cell') {
  23768. handleSelected(params, evnt);
  23769. }
  23770. }
  23771. }
  23772. },
  23773. handleCheckboxRangeEvent: function handleCheckboxRangeEvent(evnt, params) {
  23774. var _this4 = this;
  23775. var column = params.column,
  23776. cell = params.cell;
  23777. if (column.type === 'checkbox') {
  23778. var $el = this.$el,
  23779. elemStore = this.elemStore;
  23780. var disX = evnt.clientX;
  23781. var disY = evnt.clientY;
  23782. var bodyWrapperElem = elemStore["".concat(column.fixed || 'main', "-body-wrapper")] || elemStore['main-body-wrapper'];
  23783. var checkboxRangeElem = bodyWrapperElem.querySelector('.vxe-table--checkbox-range');
  23784. var domMousemove = document.onmousemove;
  23785. var domMouseup = document.onmouseup;
  23786. var trElem = cell.parentNode;
  23787. var selectRecords = this.getCheckboxRecords();
  23788. var lastRangeRows = [];
  23789. var marginSize = 1;
  23790. var offsetRest = getTargetOffset(evnt.target, bodyWrapperElem);
  23791. var startTop = offsetRest.offsetTop + evnt.offsetY;
  23792. var startLeft = offsetRest.offsetLeft + evnt.offsetX;
  23793. var startScrollTop = bodyWrapperElem.scrollTop;
  23794. var rowHeight = trElem.offsetHeight;
  23795. var mouseScrollTimeout = null;
  23796. var isMouseScrollDown = false;
  23797. var mouseScrollSpaceSize = 1;
  23798. var triggerEvent = function triggerEvent(type, evnt) {
  23799. _this4.emitEvent("checkbox-range-".concat(type), {
  23800. records: _this4.getCheckboxRecords(),
  23801. reserves: _this4.getCheckboxReserveRecords()
  23802. }, evnt);
  23803. };
  23804. var handleChecked = function handleChecked(evnt) {
  23805. var clientX = evnt.clientX,
  23806. clientY = evnt.clientY;
  23807. var offsetLeft = clientX - disX;
  23808. var offsetTop = clientY - disY + (bodyWrapperElem.scrollTop - startScrollTop);
  23809. var rangeHeight = Math.abs(offsetTop);
  23810. var rangeWidth = Math.abs(offsetLeft);
  23811. var rangeTop = startTop;
  23812. var rangeLeft = startLeft;
  23813. if (offsetTop < marginSize) {
  23814. // 向上
  23815. rangeTop += offsetTop;
  23816. if (rangeTop < marginSize) {
  23817. rangeTop = marginSize;
  23818. rangeHeight = startTop;
  23819. }
  23820. } else {
  23821. // 向下
  23822. rangeHeight = Math.min(rangeHeight, bodyWrapperElem.scrollHeight - startTop - marginSize);
  23823. }
  23824. if (offsetLeft < marginSize) {
  23825. // 向左
  23826. rangeLeft += offsetLeft;
  23827. if (rangeWidth > startLeft) {
  23828. rangeLeft = marginSize;
  23829. rangeWidth = startLeft;
  23830. }
  23831. } else {
  23832. // 向右
  23833. rangeWidth = Math.min(rangeWidth, bodyWrapperElem.clientWidth - startLeft - marginSize);
  23834. }
  23835. checkboxRangeElem.style.height = "".concat(rangeHeight, "px");
  23836. checkboxRangeElem.style.width = "".concat(rangeWidth, "px");
  23837. checkboxRangeElem.style.left = "".concat(rangeLeft, "px");
  23838. checkboxRangeElem.style.top = "".concat(rangeTop, "px");
  23839. checkboxRangeElem.style.display = 'block';
  23840. var rangeRows = getCheckboxRangeRows(_this4, params, trElem, offsetTop < marginSize ? -rangeHeight : rangeHeight); // 至少滑动 10px 才能有效匹配
  23841. if (rangeHeight > 10 && rangeRows.length !== lastRangeRows.length) {
  23842. lastRangeRows = rangeRows;
  23843. if (evnt.ctrlKey) {
  23844. rangeRows.forEach(function (row) {
  23845. _this4.handleSelectRow({
  23846. row: row
  23847. }, selectRecords.indexOf(row) === -1);
  23848. });
  23849. } else {
  23850. _this4.setAllCheckboxRow(false);
  23851. _this4.setCheckboxRow(rangeRows, true);
  23852. }
  23853. triggerEvent('change', evnt);
  23854. }
  23855. }; // 停止鼠标滚动
  23856. var stopMouseScroll = function stopMouseScroll() {
  23857. clearTimeout(mouseScrollTimeout);
  23858. mouseScrollTimeout = null;
  23859. }; // 开始鼠标滚动
  23860. var startMouseScroll = function startMouseScroll(evnt) {
  23861. stopMouseScroll();
  23862. mouseScrollTimeout = setTimeout(function () {
  23863. if (mouseScrollTimeout) {
  23864. var scrollLeft = bodyWrapperElem.scrollLeft,
  23865. scrollTop = bodyWrapperElem.scrollTop,
  23866. clientHeight = bodyWrapperElem.clientHeight,
  23867. scrollHeight = bodyWrapperElem.scrollHeight;
  23868. var topSize = Math.ceil(mouseScrollSpaceSize * 50 / rowHeight);
  23869. if (isMouseScrollDown) {
  23870. if (scrollTop + clientHeight < scrollHeight) {
  23871. _this4.scrollTo(scrollLeft, scrollTop + topSize);
  23872. startMouseScroll(evnt);
  23873. handleChecked(evnt);
  23874. } else {
  23875. stopMouseScroll();
  23876. }
  23877. } else {
  23878. if (scrollTop) {
  23879. _this4.scrollTo(scrollLeft, scrollTop - topSize);
  23880. startMouseScroll(evnt);
  23881. handleChecked(evnt);
  23882. } else {
  23883. stopMouseScroll();
  23884. }
  23885. }
  23886. }
  23887. }, 50);
  23888. };
  23889. DomTools.addClass($el, 'drag--range');
  23890. document.onmousemove = function (evnt) {
  23891. evnt.preventDefault();
  23892. evnt.stopPropagation();
  23893. var clientY = evnt.clientY;
  23894. var _DomTools$getAbsolute = DomTools.getAbsolutePos(bodyWrapperElem),
  23895. boundingTop = _DomTools$getAbsolute.boundingTop; // 如果超过可视区,触发滚动
  23896. if (clientY < boundingTop) {
  23897. isMouseScrollDown = false;
  23898. mouseScrollSpaceSize = boundingTop - clientY;
  23899. if (!mouseScrollTimeout) {
  23900. startMouseScroll(evnt);
  23901. }
  23902. } else if (clientY > boundingTop + bodyWrapperElem.clientHeight) {
  23903. isMouseScrollDown = true;
  23904. mouseScrollSpaceSize = clientY - boundingTop - bodyWrapperElem.clientHeight;
  23905. if (!mouseScrollTimeout) {
  23906. startMouseScroll(evnt);
  23907. }
  23908. } else if (mouseScrollTimeout) {
  23909. stopMouseScroll();
  23910. }
  23911. handleChecked(evnt);
  23912. };
  23913. document.onmouseup = function (evnt) {
  23914. stopMouseScroll();
  23915. DomTools.removeClass($el, 'drag--range');
  23916. checkboxRangeElem.removeAttribute('style');
  23917. document.onmousemove = domMousemove;
  23918. document.onmouseup = domMouseup;
  23919. triggerEvent('end', evnt);
  23920. };
  23921. triggerEvent('start', evnt);
  23922. }
  23923. }
  23924. }
  23925. });
  23926. // CONCATENATED MODULE: ./packages/keyboard/index.js
  23927. var Keyboard = {
  23928. install: function install() {
  23929. v_x_e_table.reg('keyboard');
  23930. packages_table.mixins.push(keyboard_src_mixin);
  23931. }
  23932. };
  23933. /* harmony default export */ var packages_keyboard = (Keyboard);
  23934. // CONCATENATED MODULE: ./packages/validator/src/mixin.js
  23935. /**
  23936. * 校验规则
  23937. */
  23938. var mixin_Rule = /*#__PURE__*/function () {
  23939. function Rule(rule) {
  23940. _classCallCheck(this, Rule);
  23941. Object.assign(this, {
  23942. $options: rule,
  23943. required: rule.required,
  23944. min: rule.min,
  23945. max: rule.max,
  23946. type: rule.type,
  23947. pattern: rule.pattern,
  23948. validator: rule.validator,
  23949. trigger: rule.trigger,
  23950. maxWidth: rule.maxWidth
  23951. });
  23952. }
  23953. /**
  23954. * 获取校验不通过的消息
  23955. * 支持国际化翻译
  23956. */
  23957. _createClass(Rule, [{
  23958. key: "message",
  23959. get: function get() {
  23960. return UtilTools.getFuncText(this.$options.message);
  23961. }
  23962. }]);
  23963. return Rule;
  23964. }();
  23965. /* harmony default export */ var validator_src_mixin = ({
  23966. methods: {
  23967. /**
  23968. * 完整校验,和 validate 的区别就是会给有效数据中的每一行进行校验
  23969. */
  23970. _fullValidate: function _fullValidate(rows, cb) {
  23971. return this.beginValidate(rows, cb, true);
  23972. },
  23973. /**
  23974. * 快速校验,如果存在记录不通过的记录,则返回不再继续校验(异步校验除外)
  23975. */
  23976. _validate: function _validate(rows, cb) {
  23977. return this.beginValidate(rows, cb);
  23978. },
  23979. /**
  23980. * 聚焦到校验通过的单元格并弹出校验错误提示
  23981. */
  23982. handleValidError: function handleValidError(params) {
  23983. var _this = this;
  23984. return new Promise(function (resolve) {
  23985. if (_this.validOpts.autoPos === false) {
  23986. _this.emitEvent('valid-error', params);
  23987. resolve();
  23988. } else {
  23989. _this.handleActived(params, {
  23990. type: 'valid-error',
  23991. trigger: 'call'
  23992. }).then(function () {
  23993. setTimeout(function () {
  23994. resolve(_this.showValidTooltip(params));
  23995. }, 10);
  23996. });
  23997. }
  23998. });
  23999. },
  24000. /**
  24001. * 对表格数据进行校验
  24002. * 如果不指定数据,则默认只校验临时变动的数据,例如新增或修改
  24003. * 如果传 true 则校验当前表格数据
  24004. * 如果传 row 指定行记录,则只验证传入的行
  24005. * 如果传 rows 为多行记录,则只验证传入的行
  24006. * 如果只传 callback 否则默认验证整个表格数据
  24007. * 返回 Promise 对象,或者使用回调方式
  24008. */
  24009. beginValidate: function beginValidate(rows, cb, isFull) {
  24010. var _this2 = this;
  24011. var validRest = {};
  24012. var editRules = this.editRules,
  24013. afterFullData = this.afterFullData,
  24014. treeConfig = this.treeConfig,
  24015. treeOpts = this.treeOpts;
  24016. var vaildDatas;
  24017. if (rows === true) {
  24018. vaildDatas = afterFullData;
  24019. } else if (rows) {
  24020. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(rows)) {
  24021. cb = rows;
  24022. } else {
  24023. vaildDatas = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(rows) ? rows : [rows];
  24024. }
  24025. }
  24026. if (!vaildDatas) {
  24027. vaildDatas = this.getInsertRecords().concat(this.getUpdateRecords());
  24028. }
  24029. var rowValids = [];
  24030. this.lastCallTime = Date.now();
  24031. this.validRuleErr = false; // 如果为快速校验,当存在某列校验不通过时将终止执行
  24032. this.clearValidate();
  24033. if (editRules) {
  24034. var columns = this.getColumns();
  24035. var handleVaild = function handleVaild(row) {
  24036. if (isFull || !_this2.validRuleErr) {
  24037. var colVailds = [];
  24038. columns.forEach(function (column) {
  24039. if ((isFull || !_this2.validRuleErr) && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.has(editRules, column.property)) {
  24040. colVailds.push(_this2.validCellRules('all', row, column).catch(function (_ref) {
  24041. var rule = _ref.rule,
  24042. rules = _ref.rules;
  24043. var rest = {
  24044. rule: rule,
  24045. rules: rules,
  24046. rowIndex: _this2.getRowIndex(row),
  24047. row: row,
  24048. columnIndex: _this2.getColumnIndex(column),
  24049. column: column,
  24050. $table: _this2
  24051. };
  24052. if (!validRest[column.property]) {
  24053. validRest[column.property] = [];
  24054. }
  24055. validRest[column.property].push(rest);
  24056. if (!isFull) {
  24057. _this2.validRuleErr = true;
  24058. return Promise.reject(rest);
  24059. }
  24060. }));
  24061. }
  24062. });
  24063. rowValids.push(Promise.all(colVailds));
  24064. }
  24065. };
  24066. if (treeConfig) {
  24067. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(vaildDatas, handleVaild, treeOpts);
  24068. } else {
  24069. vaildDatas.forEach(handleVaild);
  24070. }
  24071. return Promise.all(rowValids).then(function () {
  24072. var ruleProps = Object.keys(validRest);
  24073. return _this2.$nextTick().then(function () {
  24074. if (ruleProps.length) {
  24075. return Promise.reject(validRest[ruleProps[0]][0]);
  24076. }
  24077. if (cb) {
  24078. cb();
  24079. }
  24080. });
  24081. }).catch(function (firstErrParams) {
  24082. return new Promise(function (resolve, reject) {
  24083. var finish = function finish() {
  24084. _this2.$nextTick(function () {
  24085. if (cb) {
  24086. cb(validRest);
  24087. resolve();
  24088. } else {
  24089. reject(validRest);
  24090. }
  24091. });
  24092. };
  24093. var posAndFinish = function posAndFinish() {
  24094. firstErrParams.cell = _this2.getCell(firstErrParams.row, firstErrParams.column);
  24095. DomTools.toView(firstErrParams.cell);
  24096. _this2.handleValidError(firstErrParams).then(finish);
  24097. };
  24098. /**
  24099. * 当校验不通过时
  24100. * 将表格滚动到可视区
  24101. * 由于提示信息至少需要占一行,定位向上偏移一行
  24102. */
  24103. var row = firstErrParams.row;
  24104. var rowIndex = afterFullData.indexOf(row);
  24105. var locatRow = rowIndex > 0 ? afterFullData[rowIndex - 1] : row;
  24106. if (_this2.validOpts.autoPos === false) {
  24107. finish();
  24108. } else {
  24109. if (treeConfig) {
  24110. _this2.scrollToTreeRow(locatRow).then(posAndFinish);
  24111. } else {
  24112. _this2.scrollToRow(locatRow).then(posAndFinish);
  24113. }
  24114. }
  24115. });
  24116. });
  24117. }
  24118. return this.$nextTick().then(function () {
  24119. if (cb) {
  24120. cb();
  24121. }
  24122. });
  24123. },
  24124. hasCellRules: function hasCellRules(type, row, column) {
  24125. var editRules = this.editRules;
  24126. var property = column.property;
  24127. if (property && editRules) {
  24128. var rules = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(editRules, property);
  24129. return rules && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.find(rules, function (rule) {
  24130. return type === 'all' || !rule.trigger || type === rule.trigger;
  24131. });
  24132. }
  24133. return false;
  24134. },
  24135. /**
  24136. * 校验数据
  24137. * 按表格行、列顺序依次校验(同步或异步)
  24138. * 校验规则根据索引顺序依次校验,如果是异步则会等待校验完成才会继续校验下一列
  24139. * 如果校验失败则,触发回调或者Promise<不通过列的错误消息>
  24140. * 如果是传回调方式这返回一个校验不通过列的错误消息
  24141. *
  24142. * rule 配置:
  24143. * required=Boolean 是否必填
  24144. * min=Number 最小长度
  24145. * max=Number 最大长度
  24146. * validator=Function({ cellValue, rule, rules, row, column, rowIndex, columnIndex }) 自定义校验,接收一个 Promise
  24147. * trigger=blur|change 触发方式(除非特殊场景,否则默认为空就行)
  24148. */
  24149. validCellRules: function validCellRules(type, row, column, val) {
  24150. var _this3 = this;
  24151. var editRules = this.editRules;
  24152. var property = column.property;
  24153. var errorRules = [];
  24154. var syncVailds = [];
  24155. if (property && editRules) {
  24156. var rules = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(editRules, property);
  24157. if (rules) {
  24158. var cellValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isUndefined(val) ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, property) : val;
  24159. rules.forEach(function (rule) {
  24160. if (type === 'all' || !rule.trigger || type === rule.trigger) {
  24161. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(rule.validator)) {
  24162. var customValid = rule.validator({
  24163. cellValue: cellValue,
  24164. rule: rule,
  24165. rules: rules,
  24166. row: row,
  24167. rowIndex: _this3.getRowIndex(row),
  24168. column: column,
  24169. columnIndex: _this3.getColumnIndex(column),
  24170. $table: _this3
  24171. });
  24172. if (customValid) {
  24173. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isError(customValid)) {
  24174. _this3.validRuleErr = true;
  24175. errorRules.push(new mixin_Rule({
  24176. type: 'custom',
  24177. trigger: rule.trigger,
  24178. message: customValid.message,
  24179. rule: new mixin_Rule(rule)
  24180. }));
  24181. } else if (customValid.catch) {
  24182. // 如果为异步校验(注:异步校验是并发无序的)
  24183. syncVailds.push(customValid.catch(function (e) {
  24184. _this3.validRuleErr = true;
  24185. errorRules.push(new mixin_Rule({
  24186. type: 'custom',
  24187. trigger: rule.trigger,
  24188. message: e ? e.message : rule.message,
  24189. rule: new mixin_Rule(rule)
  24190. }));
  24191. }));
  24192. }
  24193. }
  24194. } else {
  24195. var isNumType = rule.type === 'number';
  24196. var isArrType = rule.type === 'array';
  24197. var numVal = isNumType ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(cellValue) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getSize(cellValue);
  24198. if (rule.required && (isArrType ? !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(cellValue) || !cellValue.length : cellValue === null || cellValue === undefined || cellValue === '')) {
  24199. _this3.validRuleErr = true;
  24200. errorRules.push(new mixin_Rule(rule));
  24201. } 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)) {
  24202. _this3.validRuleErr = true;
  24203. errorRules.push(new mixin_Rule(rule));
  24204. }
  24205. }
  24206. }
  24207. });
  24208. }
  24209. }
  24210. return Promise.all(syncVailds).then(function () {
  24211. if (errorRules.length) {
  24212. var rest = {
  24213. rules: errorRules,
  24214. rule: errorRules[0]
  24215. };
  24216. return Promise.reject(rest);
  24217. }
  24218. });
  24219. },
  24220. _clearValidate: function _clearValidate() {
  24221. var validTip = this.$refs.validTip;
  24222. Object.assign(this.validStore, {
  24223. visible: false,
  24224. row: null,
  24225. column: null,
  24226. content: '',
  24227. rule: null
  24228. });
  24229. if (validTip && validTip.visible) {
  24230. validTip.close();
  24231. }
  24232. return this.$nextTick();
  24233. },
  24234. /**
  24235. * 触发校验
  24236. */
  24237. triggerValidate: function triggerValidate(type) {
  24238. var _this4 = this;
  24239. var editConfig = this.editConfig,
  24240. editStore = this.editStore,
  24241. editRules = this.editRules,
  24242. validStore = this.validStore;
  24243. var actived = editStore.actived;
  24244. if (actived.row && editRules) {
  24245. var _actived$args = actived.args,
  24246. row = _actived$args.row,
  24247. column = _actived$args.column,
  24248. cell = _actived$args.cell;
  24249. if (this.hasCellRules(type, row, column)) {
  24250. return this.validCellRules(type, row, column).then(function () {
  24251. if (editConfig.mode === 'row') {
  24252. if (validStore.visible && validStore.row === row && validStore.column === column) {
  24253. _this4.clearValidate();
  24254. }
  24255. }
  24256. }).catch(function (_ref2) {
  24257. var rule = _ref2.rule;
  24258. // 如果校验不通过与触发方式一致,则聚焦提示错误,否则跳过并不作任何处理
  24259. if (!rule.trigger || type === rule.trigger) {
  24260. var rest = {
  24261. rule: rule,
  24262. row: row,
  24263. column: column,
  24264. cell: cell
  24265. };
  24266. _this4.showValidTooltip(rest);
  24267. return Promise.reject(rest);
  24268. }
  24269. return Promise.resolve();
  24270. });
  24271. }
  24272. }
  24273. return Promise.resolve();
  24274. },
  24275. /**
  24276. * 弹出校验错误提示
  24277. */
  24278. showValidTooltip: function showValidTooltip(params) {
  24279. var _this5 = this;
  24280. var $refs = this.$refs,
  24281. height = this.height,
  24282. tableData = this.tableData,
  24283. validOpts = this.validOpts;
  24284. var rule = params.rule,
  24285. row = params.row,
  24286. column = params.column,
  24287. cell = params.cell;
  24288. var validTip = $refs.validTip;
  24289. var content = rule.message;
  24290. return this.$nextTick(function () {
  24291. Object.assign(_this5.validStore, {
  24292. row: row,
  24293. column: column,
  24294. rule: rule,
  24295. content: content,
  24296. visible: true
  24297. });
  24298. _this5.emitEvent('valid-error', params);
  24299. if (validTip && (validOpts.message === 'tooltip' || validOpts.message === 'default' && !height && tableData.length < 2)) {
  24300. return validTip.open(cell, content);
  24301. }
  24302. });
  24303. }
  24304. }
  24305. });
  24306. // CONCATENATED MODULE: ./packages/validator/index.js
  24307. var Validator = {
  24308. install: function install() {
  24309. v_x_e_table.reg('valid');
  24310. packages_table.mixins.push(validator_src_mixin);
  24311. }
  24312. };
  24313. /* harmony default export */ var validator = (Validator);
  24314. // CONCATENATED MODULE: ./packages/header/src/util.js
  24315. var util_getAllColumns = function getAllColumns(columns, parentColumn) {
  24316. var result = [];
  24317. columns.forEach(function (column) {
  24318. column.parentId = parentColumn ? parentColumn.id : null;
  24319. if (column.visible) {
  24320. if (column.children && column.children.length && column.children.some(function (column) {
  24321. return column.visible;
  24322. })) {
  24323. result.push(column);
  24324. result.push.apply(result, _toConsumableArray(getAllColumns(column.children, column)));
  24325. } else {
  24326. result.push(column);
  24327. }
  24328. }
  24329. });
  24330. return result;
  24331. };
  24332. var util_convertToRows = function convertToRows(originColumns) {
  24333. var maxLevel = 1;
  24334. var traverse = function traverse(column, parent) {
  24335. if (parent) {
  24336. column.level = parent.level + 1;
  24337. if (maxLevel < column.level) {
  24338. maxLevel = column.level;
  24339. }
  24340. }
  24341. if (column.children && column.children.length && column.children.some(function (column) {
  24342. return column.visible;
  24343. })) {
  24344. var colSpan = 0;
  24345. column.children.forEach(function (subColumn) {
  24346. if (subColumn.visible) {
  24347. traverse(subColumn, column);
  24348. colSpan += subColumn.colSpan;
  24349. }
  24350. });
  24351. column.colSpan = colSpan;
  24352. } else {
  24353. column.colSpan = 1;
  24354. }
  24355. };
  24356. originColumns.forEach(function (column) {
  24357. column.level = 1;
  24358. traverse(column);
  24359. });
  24360. var rows = [];
  24361. for (var i = 0; i < maxLevel; i++) {
  24362. rows.push([]);
  24363. }
  24364. var allColumns = util_getAllColumns(originColumns);
  24365. allColumns.forEach(function (column) {
  24366. if (column.children && column.children.length && column.children.some(function (column) {
  24367. return column.visible;
  24368. })) {
  24369. column.rowSpan = 1;
  24370. } else {
  24371. column.rowSpan = maxLevel - column.level + 1;
  24372. }
  24373. rows[column.level - 1].push(column);
  24374. });
  24375. return rows;
  24376. };
  24377. // CONCATENATED MODULE: ./packages/header/src/header.js
  24378. var header_cellType = 'header';
  24379. /* harmony default export */ var header = ({
  24380. name: 'VxeTableHeader',
  24381. props: {
  24382. tableData: Array,
  24383. tableColumn: Array,
  24384. tableGroupColumn: Array,
  24385. fixedColumn: Array,
  24386. size: String,
  24387. fixedType: String
  24388. },
  24389. data: function data() {
  24390. return {
  24391. headerColumn: []
  24392. };
  24393. },
  24394. watch: {
  24395. tableColumn: function tableColumn() {
  24396. this.uploadColumn();
  24397. }
  24398. },
  24399. created: function created() {
  24400. this.uploadColumn();
  24401. },
  24402. mounted: function mounted() {
  24403. var $xetable = this.$parent,
  24404. $el = this.$el,
  24405. $refs = this.$refs,
  24406. fixedType = this.fixedType;
  24407. var elemStore = $xetable.elemStore;
  24408. var prefix = "".concat(fixedType || 'main', "-header-");
  24409. elemStore["".concat(prefix, "wrapper")] = $el;
  24410. elemStore["".concat(prefix, "table")] = $refs.table;
  24411. elemStore["".concat(prefix, "colgroup")] = $refs.colgroup;
  24412. elemStore["".concat(prefix, "list")] = $refs.thead;
  24413. elemStore["".concat(prefix, "xSpace")] = $refs.xSpace;
  24414. elemStore["".concat(prefix, "repair")] = $refs.repair;
  24415. },
  24416. render: function render(h) {
  24417. var _this = this;
  24418. var _e = this._e,
  24419. $xetable = this.$parent,
  24420. fixedType = this.fixedType,
  24421. headerColumn = this.headerColumn,
  24422. fixedColumn = this.fixedColumn;
  24423. var tableListeners = $xetable.$listeners,
  24424. tId = $xetable.tId,
  24425. isGroup = $xetable.isGroup,
  24426. resizable = $xetable.resizable,
  24427. border = $xetable.border,
  24428. columnKey = $xetable.columnKey,
  24429. headerRowClassName = $xetable.headerRowClassName,
  24430. headerCellClassName = $xetable.headerCellClassName,
  24431. headerRowStyle = $xetable.headerRowStyle,
  24432. headerCellStyle = $xetable.headerCellStyle,
  24433. allColumnHeaderOverflow = $xetable.showHeaderOverflow,
  24434. allHeaderAlign = $xetable.headerAlign,
  24435. allAlign = $xetable.align,
  24436. highlightCurrentColumn = $xetable.highlightCurrentColumn,
  24437. currentColumn = $xetable.currentColumn,
  24438. scrollXLoad = $xetable.scrollXLoad,
  24439. overflowX = $xetable.overflowX,
  24440. scrollbarWidth = $xetable.scrollbarWidth,
  24441. sortOpts = $xetable.sortOpts,
  24442. mouseConfig = $xetable.mouseConfig;
  24443. var tableColumn = this.tableColumn;
  24444. var headerGroups = headerColumn; // 如果是使用优化模式
  24445. if (!isGroup) {
  24446. if (fixedType) {
  24447. if (scrollXLoad || allColumnHeaderOverflow) {
  24448. tableColumn = fixedColumn;
  24449. }
  24450. }
  24451. headerGroups = [tableColumn];
  24452. }
  24453. return h('div', {
  24454. class: ['vxe-table--header-wrapper', fixedType ? "fixed-".concat(fixedType, "--wrapper") : 'body--wrapper'],
  24455. attrs: {
  24456. xid: tId
  24457. }
  24458. }, [fixedType ? _e() : h('div', {
  24459. class: 'vxe-body--x-space',
  24460. ref: 'xSpace'
  24461. }), h('table', {
  24462. class: 'vxe-table--header',
  24463. attrs: {
  24464. xid: tId,
  24465. cellspacing: 0,
  24466. cellpadding: 0,
  24467. border: 0
  24468. },
  24469. ref: 'table'
  24470. }, [
  24471. /**
  24472. * 列宽
  24473. */
  24474. h('colgroup', {
  24475. ref: 'colgroup'
  24476. }, tableColumn.map(function (column, $columnIndex) {
  24477. return h('col', {
  24478. attrs: {
  24479. name: column.id
  24480. },
  24481. key: $columnIndex
  24482. });
  24483. }).concat(scrollbarWidth ? [h('col', {
  24484. attrs: {
  24485. name: 'col_gutter'
  24486. }
  24487. })] : [])),
  24488. /**
  24489. * 头部
  24490. */
  24491. h('thead', {
  24492. ref: 'thead'
  24493. }, headerGroups.map(function (cols, $rowIndex) {
  24494. return h('tr', {
  24495. class: ['vxe-header--row', headerRowClassName ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(headerRowClassName) ? headerRowClassName({
  24496. $table: $xetable,
  24497. $rowIndex: $rowIndex,
  24498. fixed: fixedType,
  24499. type: header_cellType
  24500. }) : headerRowClassName : ''],
  24501. style: headerRowStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(headerRowStyle) ? headerRowStyle({
  24502. $table: $xetable,
  24503. $rowIndex: $rowIndex,
  24504. fixed: fixedType,
  24505. type: header_cellType
  24506. }) : headerRowStyle : null
  24507. }, cols.map(function (column, $columnIndex) {
  24508. var _ref;
  24509. var type = column.type,
  24510. showHeaderOverflow = column.showHeaderOverflow,
  24511. headerAlign = column.headerAlign,
  24512. align = column.align,
  24513. headerClassName = column.headerClassName; // const { enabled } = tooltipOpts
  24514. var isColGroup = column.children && column.children.length;
  24515. var fixedHiddenColumn = fixedType ? column.fixed !== fixedType && !isColGroup : column.fixed && overflowX;
  24516. var headOverflow = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isUndefined(showHeaderOverflow) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow;
  24517. var headAlign = headerAlign || align || allHeaderAlign || allAlign;
  24518. var showEllipsis = headOverflow === 'ellipsis';
  24519. var showTitle = headOverflow === 'title';
  24520. var showTooltip = headOverflow === true || headOverflow === 'tooltip';
  24521. var hasEllipsis = showTitle || showTooltip || showEllipsis;
  24522. var thOns = {};
  24523. var hasFilter = column.filters && column.filters.some(function (item) {
  24524. return item.checked;
  24525. });
  24526. var columnIndex = $xetable.getColumnIndex(column);
  24527. var _columnIndex = $xetable.getVTColumnIndex(column);
  24528. var params = {
  24529. $table: $xetable,
  24530. $rowIndex: $rowIndex,
  24531. column: column,
  24532. columnIndex: columnIndex,
  24533. $columnIndex: $columnIndex,
  24534. _columnIndex: _columnIndex,
  24535. fixed: fixedType,
  24536. type: header_cellType,
  24537. isHidden: fixedHiddenColumn,
  24538. hasFilter: hasFilter
  24539. }; // 虚拟滚动不支持动态高度
  24540. if (scrollXLoad && !hasEllipsis) {
  24541. showEllipsis = hasEllipsis = true;
  24542. }
  24543. if (highlightCurrentColumn || tableListeners['header-cell-click'] || sortOpts.trigger === 'cell') {
  24544. thOns.click = function (evnt) {
  24545. return $xetable.triggerHeaderCellClickEvent(evnt, params);
  24546. };
  24547. }
  24548. if (tableListeners['header-cell-dblclick']) {
  24549. thOns.dblclick = function (evnt) {
  24550. return $xetable.triggerHeaderCellDBLClickEvent(evnt, params);
  24551. };
  24552. } // 按下事件处理
  24553. if (mouseConfig) {
  24554. thOns.mousedown = function (evnt) {
  24555. return $xetable.triggerHeaderCellMousedownEvent(evnt, params);
  24556. };
  24557. }
  24558. return h('th', {
  24559. 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)],
  24560. attrs: {
  24561. colid: column.id,
  24562. colspan: column.colSpan > 1 ? column.colSpan : null,
  24563. rowspan: column.rowSpan > 1 ? column.rowSpan : null
  24564. },
  24565. style: headerCellStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(headerCellStyle) ? headerCellStyle(params) : headerCellStyle : null,
  24566. on: thOns,
  24567. key: columnKey || isColGroup ? column.id : $columnIndex
  24568. }, [h('div', {
  24569. class: ['vxe-cell', {
  24570. 'c--title': showTitle,
  24571. 'c--tooltip': showTooltip,
  24572. 'c--ellipsis': showEllipsis
  24573. }]
  24574. }, column.renderHeader(h, params)),
  24575. /**
  24576. * 列宽拖动
  24577. */
  24578. !fixedHiddenColumn && !isColGroup && (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isBoolean(column.resizable) ? column.resizable : resizable) ? h('div', {
  24579. class: ['vxe-resizable', {
  24580. 'is--line': !border || border === 'none'
  24581. }],
  24582. on: {
  24583. mousedown: function mousedown(evnt) {
  24584. return _this.resizeMousedown(evnt, params);
  24585. }
  24586. }
  24587. }) : null]);
  24588. }).concat(scrollbarWidth ? [h('th', {
  24589. class: 'vxe-header--gutter col--gutter'
  24590. })] : []));
  24591. }))]),
  24592. /**
  24593. * 其他
  24594. */
  24595. h('div', {
  24596. class: 'vxe-table--header-border-line',
  24597. ref: 'repair'
  24598. })]);
  24599. },
  24600. methods: {
  24601. uploadColumn: function uploadColumn() {
  24602. var $xetable = this.$parent;
  24603. this.headerColumn = $xetable.isGroup ? util_convertToRows(this.tableGroupColumn) : [];
  24604. },
  24605. resizeMousedown: function resizeMousedown(evnt, params) {
  24606. var column = params.column;
  24607. var $xetable = this.$parent,
  24608. $el = this.$el,
  24609. fixedType = this.fixedType;
  24610. var _$xetable$$refs = $xetable.$refs,
  24611. tableBody = _$xetable$$refs.tableBody,
  24612. leftContainer = _$xetable$$refs.leftContainer,
  24613. rightContainer = _$xetable$$refs.rightContainer,
  24614. resizeBarElem = _$xetable$$refs.resizeBar;
  24615. var dragBtnElem = evnt.target,
  24616. dragClientX = evnt.clientX;
  24617. var cell = params.cell = dragBtnElem.parentNode;
  24618. var dragLeft = 0;
  24619. var tableBodyElem = tableBody.$el;
  24620. var pos = DomTools.getOffsetPos(dragBtnElem, $el);
  24621. var dragBtnWidth = dragBtnElem.clientWidth;
  24622. var dragBtnOffsetWidth = Math.floor(dragBtnWidth / 2);
  24623. var minInterval = getColMinWidth(params) - dragBtnOffsetWidth; // 列之间的最小间距
  24624. var dragMinLeft = pos.left - cell.clientWidth + dragBtnWidth + minInterval;
  24625. var dragPosLeft = pos.left + dragBtnOffsetWidth;
  24626. var domMousemove = document.onmousemove;
  24627. var domMouseup = document.onmouseup;
  24628. var isLeftFixed = fixedType === 'left';
  24629. var isRightFixed = fixedType === 'right'; // 计算左右侧固定列偏移量
  24630. var fixedOffsetWidth = 0;
  24631. if (isLeftFixed || isRightFixed) {
  24632. var siblingProp = isLeftFixed ? 'nextElementSibling' : 'previousElementSibling';
  24633. var tempCellElem = cell[siblingProp];
  24634. while (tempCellElem) {
  24635. if (DomTools.hasClass(tempCellElem, 'fixed--hidden')) {
  24636. break;
  24637. } else if (!DomTools.hasClass(tempCellElem, 'col--group')) {
  24638. fixedOffsetWidth += tempCellElem.offsetWidth;
  24639. }
  24640. tempCellElem = tempCellElem[siblingProp];
  24641. }
  24642. if (isRightFixed && rightContainer) {
  24643. dragPosLeft = rightContainer.offsetLeft + fixedOffsetWidth;
  24644. }
  24645. } // 处理拖动事件
  24646. var updateEvent = function updateEvent(evnt) {
  24647. evnt.stopPropagation();
  24648. evnt.preventDefault();
  24649. var offsetX = evnt.clientX - dragClientX;
  24650. var left = dragPosLeft + offsetX;
  24651. var scrollLeft = fixedType ? 0 : tableBodyElem.scrollLeft;
  24652. if (isLeftFixed) {
  24653. // 左固定列(不允许超过右侧固定列、不允许超过右边距)
  24654. left = Math.min(left, (rightContainer ? rightContainer.offsetLeft : tableBodyElem.clientWidth) - fixedOffsetWidth - minInterval);
  24655. } else if (isRightFixed) {
  24656. // 右侧固定列(不允许超过左侧固定列、不允许超过左边距)
  24657. dragMinLeft = (leftContainer ? leftContainer.clientWidth : 0) + fixedOffsetWidth + minInterval;
  24658. left = Math.min(left, dragPosLeft + cell.clientWidth - minInterval);
  24659. } else {
  24660. dragMinLeft = Math.max(tableBodyElem.scrollLeft, dragMinLeft); // left = Math.min(left, tableBodyElem.clientWidth + tableBodyElem.scrollLeft - 40)
  24661. }
  24662. dragLeft = Math.max(left, dragMinLeft);
  24663. resizeBarElem.style.left = "".concat(dragLeft - scrollLeft, "px");
  24664. };
  24665. $xetable._isResize = true;
  24666. DomTools.addClass($xetable.$el, 'drag--resize');
  24667. resizeBarElem.style.display = 'block';
  24668. document.onmousemove = updateEvent;
  24669. document.onmouseup = function (evnt) {
  24670. document.onmousemove = domMousemove;
  24671. document.onmouseup = domMouseup;
  24672. column.resizeWidth = column.renderWidth + (isRightFixed ? dragPosLeft - dragLeft : dragLeft - dragPosLeft);
  24673. resizeBarElem.style.display = 'none';
  24674. $xetable._isResize = false;
  24675. $xetable._lastResizeTime = Date.now();
  24676. $xetable.analyColumnWidth();
  24677. $xetable.recalculate(true).then(function () {
  24678. $xetable.saveCustomResizable();
  24679. $xetable.updateCellAreas();
  24680. $xetable.emitEvent('resizable-change', params, evnt);
  24681. });
  24682. DomTools.removeClass($xetable.$el, 'drag--resize');
  24683. };
  24684. updateEvent(evnt);
  24685. $xetable.closeMenu();
  24686. }
  24687. }
  24688. });
  24689. // CONCATENATED MODULE: ./packages/header/index.js
  24690. var Header = Object.assign(header, {
  24691. install: function install(Vue) {
  24692. Vue.component(header.name, header);
  24693. }
  24694. });
  24695. /* harmony default export */ var packages_header = (Header);
  24696. // CONCATENATED MODULE: ./packages/footer/src/footer.js
  24697. var footer_cellType = 'footer';
  24698. function mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex) {
  24699. for (var mIndex = 0; mIndex < mergeFooterList.length; mIndex++) {
  24700. var _mergeFooterList$mInd = mergeFooterList[mIndex],
  24701. mergeRowIndex = _mergeFooterList$mInd.row,
  24702. mergeColIndex = _mergeFooterList$mInd.col,
  24703. mergeRowspan = _mergeFooterList$mInd.rowspan,
  24704. mergeColspan = _mergeFooterList$mInd.colspan;
  24705. if (mergeColIndex > -1 && mergeRowIndex > -1 && mergeRowspan && mergeColspan) {
  24706. if (mergeRowIndex === _rowIndex && mergeColIndex === _columnIndex) {
  24707. return {
  24708. rowspan: mergeRowspan,
  24709. colspan: mergeColspan
  24710. };
  24711. }
  24712. if (_rowIndex >= mergeRowIndex && _rowIndex < mergeRowIndex + mergeRowspan && _columnIndex >= mergeColIndex && _columnIndex < mergeColIndex + mergeColspan) {
  24713. return {
  24714. rowspan: 0,
  24715. colspan: 0
  24716. };
  24717. }
  24718. }
  24719. }
  24720. }
  24721. /* harmony default export */ var footer = ({
  24722. name: 'VxeTableFooter',
  24723. props: {
  24724. footerTableData: Array,
  24725. tableColumn: Array,
  24726. fixedColumn: Array,
  24727. fixedType: String,
  24728. size: String
  24729. },
  24730. mounted: function mounted() {
  24731. var $xetable = this.$parent,
  24732. $el = this.$el,
  24733. $refs = this.$refs,
  24734. fixedType = this.fixedType;
  24735. var elemStore = $xetable.elemStore;
  24736. var prefix = "".concat(fixedType || 'main', "-footer-");
  24737. elemStore["".concat(prefix, "wrapper")] = $el;
  24738. elemStore["".concat(prefix, "table")] = $refs.table;
  24739. elemStore["".concat(prefix, "colgroup")] = $refs.colgroup;
  24740. elemStore["".concat(prefix, "list")] = $refs.tfoot;
  24741. elemStore["".concat(prefix, "xSpace")] = $refs.xSpace;
  24742. },
  24743. render: function render(h) {
  24744. var _e = this._e,
  24745. $xetable = this.$parent,
  24746. fixedType = this.fixedType,
  24747. fixedColumn = this.fixedColumn,
  24748. tableColumn = this.tableColumn,
  24749. footerTableData = this.footerTableData;
  24750. var tableListeners = $xetable.$listeners,
  24751. tId = $xetable.tId,
  24752. footerRowClassName = $xetable.footerRowClassName,
  24753. footerCellClassName = $xetable.footerCellClassName,
  24754. footerRowStyle = $xetable.footerRowStyle,
  24755. footerCellStyle = $xetable.footerCellStyle,
  24756. allFooterAlign = $xetable.footerAlign,
  24757. mergeFooterList = $xetable.mergeFooterList,
  24758. footerSpanMethod = $xetable.footerSpanMethod,
  24759. allAlign = $xetable.align,
  24760. scrollXLoad = $xetable.scrollXLoad,
  24761. columnKey = $xetable.columnKey,
  24762. allColumnFooterOverflow = $xetable.showFooterOverflow,
  24763. currentColumn = $xetable.currentColumn,
  24764. overflowX = $xetable.overflowX,
  24765. scrollbarWidth = $xetable.scrollbarWidth,
  24766. tooltipOpts = $xetable.tooltipOpts; // 如果是使用优化模式
  24767. if (fixedType) {
  24768. if ((!mergeFooterList.length || !footerSpanMethod) && (scrollXLoad || allColumnFooterOverflow)) {
  24769. tableColumn = fixedColumn;
  24770. }
  24771. }
  24772. return h('div', {
  24773. class: ['vxe-table--footer-wrapper', fixedType ? "fixed-".concat(fixedType, "--wrapper") : 'body--wrapper'],
  24774. attrs: {
  24775. xid: tId
  24776. },
  24777. on: {
  24778. scroll: this.scrollEvent
  24779. }
  24780. }, [fixedType ? _e() : h('div', {
  24781. class: 'vxe-body--x-space',
  24782. ref: 'xSpace'
  24783. }), h('table', {
  24784. class: 'vxe-table--footer',
  24785. attrs: {
  24786. xid: tId,
  24787. cellspacing: 0,
  24788. cellpadding: 0,
  24789. border: 0
  24790. },
  24791. ref: 'table'
  24792. }, [
  24793. /**
  24794. * 列宽
  24795. */
  24796. h('colgroup', {
  24797. ref: 'colgroup'
  24798. }, tableColumn.map(function (column, $columnIndex) {
  24799. return h('col', {
  24800. attrs: {
  24801. name: column.id
  24802. },
  24803. key: $columnIndex
  24804. });
  24805. }).concat(scrollbarWidth ? [h('col', {
  24806. attrs: {
  24807. name: 'col_gutter'
  24808. }
  24809. })] : [])),
  24810. /**
  24811. * 底部
  24812. */
  24813. h('tfoot', {
  24814. ref: 'tfoot'
  24815. }, footerTableData.map(function (list, _rowIndex) {
  24816. var $rowIndex = _rowIndex;
  24817. return h('tr', {
  24818. class: ['vxe-footer--row', footerRowClassName ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(footerRowClassName) ? footerRowClassName({
  24819. $table: $xetable,
  24820. _rowIndex: _rowIndex,
  24821. $rowIndex: $rowIndex,
  24822. fixed: fixedType,
  24823. type: footer_cellType
  24824. }) : footerRowClassName : ''],
  24825. style: footerRowStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(footerRowStyle) ? footerRowStyle({
  24826. $table: $xetable,
  24827. _rowIndex: _rowIndex,
  24828. $rowIndex: $rowIndex,
  24829. fixed: fixedType,
  24830. type: footer_cellType
  24831. }) : footerRowStyle : null
  24832. }, tableColumn.map(function (column, $columnIndex) {
  24833. var _ref2;
  24834. var type = column.type,
  24835. showFooterOverflow = column.showFooterOverflow,
  24836. footerAlign = column.footerAlign,
  24837. align = column.align,
  24838. footerClassName = column.footerClassName;
  24839. var showAllTip = tooltipOpts.showAll || tooltipOpts.enabled;
  24840. var isColGroup = column.children && column.children.length;
  24841. var fixedHiddenColumn = fixedType ? column.fixed !== fixedType && !isColGroup : column.fixed && overflowX;
  24842. var footOverflow = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isUndefined(showFooterOverflow) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNull(showFooterOverflow) ? allColumnFooterOverflow : showFooterOverflow;
  24843. var footAlign = footerAlign || align || allFooterAlign || allAlign;
  24844. var showEllipsis = footOverflow === 'ellipsis';
  24845. var showTitle = footOverflow === 'title';
  24846. var showTooltip = footOverflow === true || footOverflow === 'tooltip';
  24847. var hasEllipsis = showTitle || showTooltip || showEllipsis;
  24848. var attrs = {
  24849. colid: column.id
  24850. };
  24851. var tfOns = {};
  24852. var columnIndex = $xetable.getColumnIndex(column);
  24853. var _columnIndex = $xetable.getVTColumnIndex(column);
  24854. var itemIndex = _columnIndex;
  24855. var params = {
  24856. $table: $xetable,
  24857. _rowIndex: _rowIndex,
  24858. $rowIndex: $rowIndex,
  24859. column: column,
  24860. columnIndex: columnIndex,
  24861. $columnIndex: $columnIndex,
  24862. _columnIndex: _columnIndex,
  24863. itemIndex: itemIndex,
  24864. items: list,
  24865. fixed: fixedType,
  24866. type: footer_cellType,
  24867. data: footerTableData
  24868. }; // 虚拟滚动不支持动态高度
  24869. if (scrollXLoad && !hasEllipsis) {
  24870. showEllipsis = hasEllipsis = true;
  24871. }
  24872. if (showTitle || showTooltip || showAllTip) {
  24873. tfOns.mouseenter = function (evnt) {
  24874. if (showTitle) {
  24875. DomTools.updateCellTitle(evnt.currentTarget, column);
  24876. } else if (showTooltip || showAllTip) {
  24877. $xetable.triggerFooterTooltipEvent(evnt, params);
  24878. }
  24879. };
  24880. }
  24881. if (showTooltip || showAllTip) {
  24882. tfOns.mouseleave = function (evnt) {
  24883. if (showTooltip || showAllTip) {
  24884. $xetable.handleTargetLeaveEvent(evnt);
  24885. }
  24886. };
  24887. }
  24888. if (tableListeners['footer-cell-click']) {
  24889. tfOns.click = function (evnt) {
  24890. $xetable.emitEvent('footer-cell-click', Object.assign({
  24891. cell: evnt.currentTarget
  24892. }, params), evnt);
  24893. };
  24894. }
  24895. if (tableListeners['footer-cell-dblclick']) {
  24896. tfOns.dblclick = function (evnt) {
  24897. $xetable.emitEvent('footer-cell-dblclick', Object.assign({
  24898. cell: evnt.currentTarget
  24899. }, params), evnt);
  24900. };
  24901. } // 合并行或列
  24902. if (mergeFooterList.length) {
  24903. var spanRest = mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex);
  24904. if (spanRest) {
  24905. var rowspan = spanRest.rowspan,
  24906. colspan = spanRest.colspan;
  24907. if (!rowspan || !colspan) {
  24908. return null;
  24909. }
  24910. if (rowspan > 1) {
  24911. attrs.rowspan = rowspan;
  24912. }
  24913. if (colspan > 1) {
  24914. attrs.colspan = colspan;
  24915. }
  24916. }
  24917. } else if (footerSpanMethod) {
  24918. // 自定义合并方法
  24919. var _ref = footerSpanMethod(params) || {},
  24920. _ref$rowspan = _ref.rowspan,
  24921. _rowspan = _ref$rowspan === void 0 ? 1 : _ref$rowspan,
  24922. _ref$colspan = _ref.colspan,
  24923. _colspan = _ref$colspan === void 0 ? 1 : _ref$colspan;
  24924. if (!_rowspan || !_colspan) {
  24925. return null;
  24926. }
  24927. if (_rowspan > 1) {
  24928. attrs.rowspan = _rowspan;
  24929. }
  24930. if (_colspan > 1) {
  24931. attrs.colspan = _colspan;
  24932. }
  24933. }
  24934. return h('td', {
  24935. 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)],
  24936. attrs: attrs,
  24937. style: footerCellStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(footerCellStyle) ? footerCellStyle(params) : footerCellStyle : null,
  24938. on: tfOns,
  24939. key: columnKey ? column.id : $columnIndex
  24940. }, [h('div', {
  24941. class: ['vxe-cell', {
  24942. 'c--title': showTitle,
  24943. 'c--tooltip': showTooltip,
  24944. 'c--ellipsis': showEllipsis
  24945. }]
  24946. }, column.renderFooter(h, params))]);
  24947. }).concat(scrollbarWidth ? [h('td', {
  24948. class: 'vxe-footer--gutter col--gutter'
  24949. })] : []));
  24950. }))])]);
  24951. },
  24952. methods: {
  24953. /**
  24954. * 滚动处理
  24955. * 如果存在列固定左侧,同步更新滚动状态
  24956. * 如果存在列固定右侧,同步更新滚动状态
  24957. */
  24958. scrollEvent: function scrollEvent(evnt) {
  24959. var $xetable = this.$parent,
  24960. fixedType = this.fixedType;
  24961. var $refs = $xetable.$refs,
  24962. scrollXLoad = $xetable.scrollXLoad,
  24963. triggerScrollXEvent = $xetable.triggerScrollXEvent,
  24964. lastScrollLeft = $xetable.lastScrollLeft;
  24965. var tableHeader = $refs.tableHeader,
  24966. tableBody = $refs.tableBody,
  24967. tableFooter = $refs.tableFooter,
  24968. validTip = $refs.validTip;
  24969. var headerElem = tableHeader ? tableHeader.$el : null;
  24970. var footerElem = tableFooter ? tableFooter.$el : null;
  24971. var bodyElem = tableBody.$el;
  24972. var scrollLeft = footerElem ? footerElem.scrollLeft : 0;
  24973. var isX = scrollLeft !== lastScrollLeft;
  24974. $xetable.lastScrollLeft = scrollLeft;
  24975. $xetable.lastScrollTime = Date.now();
  24976. if (headerElem) {
  24977. headerElem.scrollLeft = scrollLeft;
  24978. }
  24979. if (bodyElem) {
  24980. bodyElem.scrollLeft = scrollLeft;
  24981. }
  24982. if (scrollXLoad && isX) {
  24983. triggerScrollXEvent(evnt);
  24984. }
  24985. if (isX && validTip && validTip.visible) {
  24986. validTip.updatePlacement();
  24987. }
  24988. $xetable.emitEvent('scroll', {
  24989. type: footer_cellType,
  24990. fixed: fixedType,
  24991. scrollTop: bodyElem.scrollTop,
  24992. scrollLeft: scrollLeft,
  24993. isX: isX,
  24994. isY: false
  24995. }, evnt);
  24996. }
  24997. }
  24998. });
  24999. // CONCATENATED MODULE: ./packages/footer/index.js
  25000. var Footer = Object.assign(footer, {
  25001. install: function install(Vue) {
  25002. Vue.component(footer.name, footer);
  25003. }
  25004. });
  25005. /* harmony default export */ var packages_footer = (Footer);
  25006. // CONCATENATED MODULE: ./packages/table/src/column.js
  25007. var column_props = {
  25008. // 列唯一主键
  25009. colId: [String, Number],
  25010. // 渲染类型 seq,radio,checkbox,expand,html
  25011. type: String,
  25012. // 列字段名
  25013. field: String,
  25014. // 列标题
  25015. title: String,
  25016. // 列宽度
  25017. width: [Number, String],
  25018. // 列最小宽度,把剩余宽度按比例分配
  25019. minWidth: [Number, String],
  25020. // 是否允许拖动列宽调整大小
  25021. resizable: {
  25022. type: Boolean,
  25023. default: null
  25024. },
  25025. // 将列固定在左侧或者右侧
  25026. fixed: String,
  25027. // 列对其方式
  25028. align: String,
  25029. // 表头对齐方式
  25030. headerAlign: String,
  25031. // 表尾列的对齐方式
  25032. footerAlign: String,
  25033. // 当内容过长时显示为省略号
  25034. showOverflow: {
  25035. type: [Boolean, String],
  25036. default: null
  25037. },
  25038. // 当表头内容过长时显示为省略号
  25039. showHeaderOverflow: {
  25040. type: [Boolean, String],
  25041. default: null
  25042. },
  25043. // 当表尾内容过长时显示为省略号
  25044. showFooterOverflow: {
  25045. type: [Boolean, String],
  25046. default: null
  25047. },
  25048. // 给单元格附加 className
  25049. className: [String, Function],
  25050. // 给表头单元格附加 className
  25051. headerClassName: [String, Function],
  25052. // 给表尾单元格附加 className
  25053. footerClassName: [String, Function],
  25054. // 格式化显示内容
  25055. formatter: [Function, Array, String],
  25056. // 是否允许排序
  25057. sortable: Boolean,
  25058. // 在 v3 中废弃
  25059. remoteSort: {
  25060. type: Boolean,
  25061. default: null
  25062. },
  25063. // 在 v3 中只支持字符串类型
  25064. sortBy: [String, Function],
  25065. // 排序的字段类型,比如字符串转数值等
  25066. sortType: String,
  25067. // 在 v3 中废弃
  25068. sortMethod: Function,
  25069. // 配置筛选条件数组
  25070. filters: {
  25071. type: Array,
  25072. default: null
  25073. },
  25074. // 筛选是否允许多选
  25075. filterMultiple: {
  25076. type: Boolean,
  25077. default: true
  25078. },
  25079. // 自定义筛选方法
  25080. filterMethod: Function,
  25081. // 筛选重置方法
  25082. filterResetMethod: Function,
  25083. // 筛选复原方法
  25084. filterRecoverMethod: Function,
  25085. // 筛选模板配置项
  25086. filterRender: Object,
  25087. // 指定为树节点
  25088. treeNode: Boolean,
  25089. // 是否可视
  25090. visible: {
  25091. type: Boolean,
  25092. default: null
  25093. },
  25094. // 单元格数据导出方法
  25095. exportMethod: Function,
  25096. // 表尾单元格数据导出方法
  25097. footerExportMethod: Function,
  25098. // 标题帮助图标配置项
  25099. titleHelp: Object,
  25100. // 单元格值类型
  25101. cellType: String,
  25102. // 单元格渲染配置项
  25103. cellRender: Object,
  25104. // 单元格编辑渲染配置项
  25105. editRender: Object,
  25106. // 内容渲染配置项
  25107. contentRender: Object,
  25108. // 额外的参数
  25109. params: Object
  25110. };
  25111. var column_watch = {};
  25112. Object.keys(column_props).forEach(function (name) {
  25113. column_watch[name] = function (value) {
  25114. this.columnConfig.update(name, value);
  25115. };
  25116. });
  25117. /* harmony default export */ var src_column = ({
  25118. name: 'VxeColumn',
  25119. props: column_props,
  25120. provide: function provide() {
  25121. return {
  25122. $xecolumn: this,
  25123. $xegrid: null
  25124. };
  25125. },
  25126. inject: {
  25127. $xetable: {
  25128. default: null
  25129. },
  25130. $xecolumn: {
  25131. default: null
  25132. }
  25133. },
  25134. watch: column_watch,
  25135. created: function created() {
  25136. this.columnConfig = this.createColumn(this.$xetable, this);
  25137. },
  25138. mounted: function mounted() {
  25139. UtilTools.assemColumn(this);
  25140. },
  25141. destroyed: function destroyed() {
  25142. UtilTools.destroyColumn(this);
  25143. },
  25144. render: function render(h) {
  25145. return h('div', this.$slots.default);
  25146. },
  25147. methods: src_cell
  25148. });
  25149. // CONCATENATED MODULE: ./packages/column/index.js
  25150. var Column = Object.assign(src_column, {
  25151. install: function install(Vue) {
  25152. Vue.component(src_column.name, src_column);
  25153. Vue.component('VxeTableColumn', src_column);
  25154. }
  25155. });
  25156. /* harmony default export */ var packages_column = (Column);
  25157. // CONCATENATED MODULE: ./packages/table/src/group.js
  25158. /* harmony default export */ var src_group = ({
  25159. name: 'VxeColgroup',
  25160. extends: src_column,
  25161. provide: function provide() {
  25162. return {
  25163. xecolgroup: this,
  25164. $xegrid: null
  25165. };
  25166. }
  25167. });
  25168. // CONCATENATED MODULE: ./packages/colgroup/index.js
  25169. var Colgroup = Object.assign(src_group, {
  25170. install: function install(Vue) {
  25171. Vue.component(src_group.name, src_group);
  25172. Vue.component('VxeTableColgroup', src_group);
  25173. }
  25174. });
  25175. /* harmony default export */ var colgroup = (Colgroup);
  25176. // CONCATENATED MODULE: ./packages/grid/src/grid.js
  25177. var grid_methods = {};
  25178. var propKeys = Object.keys(packages_table.props);
  25179. function getOffsetHeight(elem) {
  25180. return elem ? elem.offsetHeight : 0;
  25181. }
  25182. function getPaddingTopBottomSize(elem) {
  25183. if (elem) {
  25184. var computedStyle = getComputedStyle(elem);
  25185. var paddingTop = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(computedStyle.paddingTop);
  25186. var paddingBottom = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(computedStyle.paddingBottom);
  25187. return paddingTop + paddingBottom;
  25188. }
  25189. return 0;
  25190. }
  25191. function renderDefaultForm(h, _vm) {
  25192. var $scopedSlots = _vm.$scopedSlots,
  25193. proxyConfig = _vm.proxyConfig,
  25194. proxyOpts = _vm.proxyOpts,
  25195. formData = _vm.formData,
  25196. formConfig = _vm.formConfig,
  25197. formOpts = _vm.formOpts;
  25198. if (isEnableConf(formConfig) && formOpts.items && formOpts.items.length) {
  25199. var formSlots = {};
  25200. if (!formOpts.inited) {
  25201. formOpts.inited = true;
  25202. var beforeItem = proxyOpts.beforeItem;
  25203. if (proxyOpts && beforeItem) {
  25204. formOpts.items.forEach(function (item) {
  25205. beforeItem.call(_vm, {
  25206. $grid: _vm,
  25207. item: item
  25208. });
  25209. });
  25210. }
  25211. } // 处理插槽
  25212. formOpts.items.forEach(function (item) {
  25213. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.each(item.slots, function (func) {
  25214. if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(func)) {
  25215. if ($scopedSlots[func]) {
  25216. formSlots[func] = $scopedSlots[func];
  25217. }
  25218. }
  25219. });
  25220. });
  25221. return [h('vxe-form', {
  25222. props: Object.assign({}, formOpts, {
  25223. data: proxyConfig && proxyOpts.form ? formData : formOpts.data
  25224. }),
  25225. on: {
  25226. submit: _vm.submitEvent,
  25227. reset: _vm.resetEvent,
  25228. 'submit-invalid': _vm.submitInvalidEvent,
  25229. 'toggle-collapse': _vm.togglCollapseEvent
  25230. },
  25231. scopedSlots: formSlots
  25232. })];
  25233. }
  25234. return [];
  25235. }
  25236. function getFuncSlot(_vm, optSlots, slotKey) {
  25237. var $scopedSlots = _vm.$scopedSlots;
  25238. var funcSlot = optSlots[slotKey];
  25239. if (funcSlot) {
  25240. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isString(funcSlot)) {
  25241. if ($scopedSlots[funcSlot]) {
  25242. return $scopedSlots[funcSlot];
  25243. } else {
  25244. if (false) {}
  25245. }
  25246. } else {
  25247. return funcSlot;
  25248. }
  25249. }
  25250. return null;
  25251. }
  25252. function getToolbarSlots(_vm) {
  25253. var $scopedSlots = _vm.$scopedSlots,
  25254. toolbarOpts = _vm.toolbarOpts;
  25255. var toolbarOptSlots = toolbarOpts.slots;
  25256. var buttonsSlot;
  25257. var toolsSlot;
  25258. var slots = {};
  25259. if (false) {}
  25260. if (toolbarOptSlots) {
  25261. buttonsSlot = getFuncSlot(_vm, toolbarOptSlots, 'buttons');
  25262. toolsSlot = getFuncSlot(_vm, toolbarOptSlots, 'tools');
  25263. if (buttonsSlot) {
  25264. slots.buttons = buttonsSlot;
  25265. }
  25266. if (toolsSlot) {
  25267. slots.tools = toolsSlot;
  25268. }
  25269. }
  25270. return slots;
  25271. }
  25272. function getPagerSlots(_vm) {
  25273. var pagerOpts = _vm.pagerOpts;
  25274. var pagerOptSlots = pagerOpts.slots;
  25275. var slots = {};
  25276. var leftSlot;
  25277. var rightSlot;
  25278. if (pagerOptSlots) {
  25279. leftSlot = getFuncSlot(_vm, pagerOptSlots, 'left');
  25280. rightSlot = getFuncSlot(_vm, pagerOptSlots, 'right');
  25281. if (leftSlot) {
  25282. slots.left = leftSlot;
  25283. }
  25284. if (rightSlot) {
  25285. slots.right = rightSlot;
  25286. }
  25287. }
  25288. return slots;
  25289. }
  25290. function getTableOns(_vm) {
  25291. var $listeners = _vm.$listeners,
  25292. proxyConfig = _vm.proxyConfig,
  25293. proxyOpts = _vm.proxyOpts;
  25294. var ons = {};
  25295. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.each($listeners, function (cb, type) {
  25296. ons[type] = function () {
  25297. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  25298. args[_key] = arguments[_key];
  25299. }
  25300. _vm.$emit.apply(_vm, [type].concat(args));
  25301. };
  25302. });
  25303. if (proxyConfig) {
  25304. if (proxyOpts.sort) {
  25305. ons['sort-change'] = _vm.sortChangeEvent;
  25306. }
  25307. if (proxyOpts.filter) {
  25308. ons['filter-change'] = _vm.filterChangeEvent;
  25309. }
  25310. }
  25311. return ons;
  25312. }
  25313. Object.keys(packages_table.methods).forEach(function (name) {
  25314. grid_methods[name] = function () {
  25315. var _this$$refs$xTable;
  25316. return this.$refs.xTable && (_this$$refs$xTable = this.$refs.xTable)[name].apply(_this$$refs$xTable, arguments);
  25317. };
  25318. });
  25319. /* harmony default export */ var grid = ({
  25320. name: 'VxeGrid',
  25321. mixins: [size],
  25322. props: _objectSpread2(_objectSpread2({}, packages_table.props), {}, {
  25323. columns: Array,
  25324. pagerConfig: [Boolean, Object],
  25325. proxyConfig: Object,
  25326. toolbar: [Boolean, Object],
  25327. toolbarConfig: [Boolean, Object],
  25328. formConfig: [Boolean, Object],
  25329. zoomConfig: Object,
  25330. size: {
  25331. type: String,
  25332. default: function _default() {
  25333. return conf.grid.size || conf.size;
  25334. }
  25335. }
  25336. }),
  25337. provide: function provide() {
  25338. return {
  25339. $xegrid: this
  25340. };
  25341. },
  25342. data: function data() {
  25343. return {
  25344. tableLoading: false,
  25345. isZMax: false,
  25346. tableData: [],
  25347. pendingRecords: [],
  25348. filterData: [],
  25349. formData: {},
  25350. sortData: [],
  25351. tZindex: 0,
  25352. tablePage: {
  25353. total: 0,
  25354. pageSize: 10,
  25355. currentPage: 1
  25356. }
  25357. };
  25358. },
  25359. computed: {
  25360. isMsg: function isMsg() {
  25361. return this.proxyOpts.message !== false;
  25362. },
  25363. proxyOpts: function proxyOpts() {
  25364. return Object.assign({}, conf.grid.proxyConfig, this.proxyConfig);
  25365. },
  25366. pagerOpts: function pagerOpts() {
  25367. return Object.assign({}, conf.grid.pagerConfig, this.pagerConfig);
  25368. },
  25369. formOpts: function formOpts() {
  25370. return Object.assign({}, conf.grid.formConfig, this.formConfig);
  25371. },
  25372. toolbarOpts: function toolbarOpts() {
  25373. return Object.assign({}, conf.grid.toolbarConfig, this.toolbarConfig || this.toolbar);
  25374. },
  25375. zoomOpts: function zoomOpts() {
  25376. return Object.assign({}, conf.grid.zoomConfig, this.zoomConfig);
  25377. },
  25378. renderStyle: function renderStyle() {
  25379. return this.isZMax ? {
  25380. zIndex: this.tZindex
  25381. } : null;
  25382. },
  25383. tableExtendProps: function tableExtendProps() {
  25384. var _this = this;
  25385. var rest = {};
  25386. propKeys.forEach(function (key) {
  25387. rest[key] = _this[key];
  25388. });
  25389. return rest;
  25390. },
  25391. tableProps: function tableProps() {
  25392. var isZMax = this.isZMax,
  25393. seqConfig = this.seqConfig,
  25394. pagerConfig = this.pagerConfig,
  25395. loading = this.loading,
  25396. editConfig = this.editConfig,
  25397. proxyConfig = this.proxyConfig,
  25398. proxyOpts = this.proxyOpts,
  25399. tableExtendProps = this.tableExtendProps,
  25400. tableLoading = this.tableLoading,
  25401. tablePage = this.tablePage,
  25402. tableData = this.tableData;
  25403. var tableProps = Object.assign({}, tableExtendProps);
  25404. if (isZMax) {
  25405. if (tableExtendProps.maxHeight) {
  25406. tableProps.maxHeight = 'auto';
  25407. } else {
  25408. tableProps.height = 'auto';
  25409. }
  25410. }
  25411. if (proxyConfig) {
  25412. tableProps.loading = loading || tableLoading;
  25413. tableProps.data = tableData;
  25414. tableProps.rowClassName = this.handleRowClassName;
  25415. if (proxyOpts.seq && isEnableConf(pagerConfig)) {
  25416. tableProps.seqConfig = Object.assign({}, seqConfig, {
  25417. startIndex: (tablePage.currentPage - 1) * tablePage.pageSize
  25418. });
  25419. }
  25420. }
  25421. if (editConfig) {
  25422. tableProps.editConfig = Object.assign({}, editConfig, {
  25423. activeMethod: this.handleActiveMethod
  25424. });
  25425. }
  25426. return tableProps;
  25427. },
  25428. pagerProps: function pagerProps() {
  25429. return Object.assign({}, this.pagerOpts, this.proxyConfig ? this.tablePage : {});
  25430. }
  25431. },
  25432. watch: {
  25433. columns: function columns(value) {
  25434. var _this2 = this;
  25435. this.$nextTick(function () {
  25436. return _this2.loadColumn(value);
  25437. });
  25438. },
  25439. toolbar: function toolbar(value) {
  25440. if (value) {
  25441. this.initToolbar();
  25442. }
  25443. },
  25444. toolbarConfig: function toolbarConfig(value) {
  25445. if (value) {
  25446. this.initToolbar();
  25447. }
  25448. },
  25449. proxyConfig: function proxyConfig() {
  25450. this.initProxy();
  25451. },
  25452. pagerConfig: function pagerConfig() {
  25453. this.initPages();
  25454. }
  25455. },
  25456. created: function created() {
  25457. var data = this.data,
  25458. formOpts = this.formOpts,
  25459. proxyOpts = this.proxyOpts,
  25460. proxyConfig = this.proxyConfig;
  25461. if (proxyConfig && (data || proxyOpts.form && formOpts.data)) {
  25462. console.error('[vxe-grid] There is a conflict between the props proxy-config and data.');
  25463. }
  25464. if (false) {}
  25465. GlobalEvent.on(this, 'keydown', this.handleGlobalKeydownEvent);
  25466. },
  25467. mounted: function mounted() {
  25468. if (this.columns && this.columns.length) {
  25469. this.loadColumn(this.columns);
  25470. }
  25471. this.initToolbar();
  25472. this.initPages();
  25473. this.initProxy();
  25474. },
  25475. destroyed: function destroyed() {
  25476. GlobalEvent.off(this, 'keydown');
  25477. },
  25478. render: function render(h) {
  25479. var _ref;
  25480. var $scopedSlots = this.$scopedSlots,
  25481. vSize = this.vSize,
  25482. isZMax = this.isZMax;
  25483. var hasForm = !!($scopedSlots.form || isEnableConf(this.formConfig));
  25484. var hasToolbar = !!($scopedSlots.toolbar || isEnableConf(this.toolbarConfig) || this.toolbar);
  25485. var hasPager = !!($scopedSlots.pager || isEnableConf(this.pagerConfig));
  25486. return h('div', {
  25487. class: ['vxe-grid', (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, 'is--animat', !!this.animat), _defineProperty(_ref, 'is--round', this.round), _defineProperty(_ref, 'is--maximize', isZMax), _defineProperty(_ref, 'is--loading', this.loading || this.tableLoading), _ref)],
  25488. style: this.renderStyle
  25489. }, [
  25490. /**
  25491. * 渲染表单
  25492. */
  25493. hasForm ? h('div', {
  25494. ref: 'formWrapper',
  25495. class: 'vxe-grid--form-wrapper'
  25496. }, $scopedSlots.form ? $scopedSlots.form.call(this, {
  25497. $grid: this
  25498. }, h) : renderDefaultForm(h, this)) : null,
  25499. /**
  25500. * 渲染工具栏
  25501. */
  25502. hasToolbar ? h('div', {
  25503. ref: 'toolbarWrapper',
  25504. class: 'vxe-grid--toolbar-wrapper'
  25505. }, $scopedSlots.toolbar ? $scopedSlots.toolbar.call(this, {
  25506. $grid: this
  25507. }, h) : [h('vxe-toolbar', {
  25508. props: this.toolbarOpts,
  25509. ref: 'xToolbar',
  25510. scopedSlots: getToolbarSlots(this)
  25511. })]) : null,
  25512. /**
  25513. * 渲染表格顶部区域
  25514. */
  25515. $scopedSlots.top ? h('div', {
  25516. ref: 'topWrapper',
  25517. class: 'vxe-grid--top-wrapper'
  25518. }, $scopedSlots.top.call(this, {
  25519. $grid: this
  25520. }, h)) : null,
  25521. /**
  25522. * 渲染表格
  25523. */
  25524. h('vxe-table', {
  25525. props: this.tableProps,
  25526. on: getTableOns(this),
  25527. scopedSlots: $scopedSlots,
  25528. ref: 'xTable'
  25529. }),
  25530. /**
  25531. * 渲染表格底部区域
  25532. */
  25533. $scopedSlots.bottom ? h('div', {
  25534. ref: 'bottomWrapper',
  25535. class: 'vxe-grid--bottom-wrapper'
  25536. }, $scopedSlots.bottom.call(this, {
  25537. $grid: this
  25538. }, h)) : null,
  25539. /**
  25540. * 渲染分页
  25541. */
  25542. hasPager ? h('div', {
  25543. ref: 'pagerWrapper',
  25544. class: 'vxe-grid--pager-wrapper'
  25545. }, $scopedSlots.pager ? $scopedSlots.pager.call(this, {
  25546. $grid: this
  25547. }, h) : [h('vxe-pager', {
  25548. props: this.pagerProps,
  25549. on: {
  25550. 'page-change': this.pageChangeEvent
  25551. },
  25552. scopedSlots: getPagerSlots(this)
  25553. })]) : null]);
  25554. },
  25555. methods: _objectSpread2(_objectSpread2({}, grid_methods), {}, {
  25556. callSlot: function callSlot(slotFunc, params, h, vNodes) {
  25557. if (slotFunc) {
  25558. var $scopedSlots = this.$scopedSlots;
  25559. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isString(slotFunc)) {
  25560. slotFunc = $scopedSlots[slotFunc] || null;
  25561. }
  25562. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(slotFunc)) {
  25563. return slotFunc.call(this, params, h, vNodes);
  25564. }
  25565. }
  25566. return [];
  25567. },
  25568. getParentHeight: function getParentHeight() {
  25569. var $el = this.$el,
  25570. isZMax = this.isZMax;
  25571. return (isZMax ? DomTools.getDomNode().visibleHeight : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(getComputedStyle($el.parentNode).height)) - this.getExcludeHeight();
  25572. },
  25573. /**
  25574. * 获取需要排除的高度
  25575. */
  25576. getExcludeHeight: function getExcludeHeight() {
  25577. var $refs = this.$refs,
  25578. $el = this.$el,
  25579. isZMax = this.isZMax,
  25580. height = this.height;
  25581. var formWrapper = $refs.formWrapper,
  25582. toolbarWrapper = $refs.toolbarWrapper,
  25583. topWrapper = $refs.topWrapper,
  25584. bottomWrapper = $refs.bottomWrapper,
  25585. pagerWrapper = $refs.pagerWrapper;
  25586. var parentPaddingSize = isZMax || height !== 'auto' ? 0 : getPaddingTopBottomSize($el.parentNode);
  25587. return parentPaddingSize + getPaddingTopBottomSize($el) + getOffsetHeight(formWrapper) + getOffsetHeight(toolbarWrapper) + getOffsetHeight(topWrapper) + getOffsetHeight(bottomWrapper) + getOffsetHeight(pagerWrapper);
  25588. },
  25589. handleRowClassName: function handleRowClassName(params) {
  25590. var rowClassName = this.rowClassName;
  25591. var clss = [];
  25592. if (this.pendingRecords.some(function (item) {
  25593. return item === params.row;
  25594. })) {
  25595. clss.push('row--pending');
  25596. }
  25597. clss.push(rowClassName ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(rowClassName) ? rowClassName(params) : rowClassName : '');
  25598. return clss;
  25599. },
  25600. handleActiveMethod: function handleActiveMethod(params) {
  25601. var editConfig = this.editConfig;
  25602. var activeMethod = editConfig ? editConfig.activeMethod : null;
  25603. return this.pendingRecords.indexOf(params.row) === -1 && (!activeMethod || activeMethod(params));
  25604. },
  25605. initToolbar: function initToolbar() {
  25606. var _this3 = this;
  25607. this.$nextTick(function () {
  25608. var _this3$$refs = _this3.$refs,
  25609. xTable = _this3$$refs.xTable,
  25610. xToolbar = _this3$$refs.xToolbar;
  25611. if (xTable && xToolbar) {
  25612. xTable.connect(xToolbar);
  25613. }
  25614. });
  25615. },
  25616. initPages: function initPages() {
  25617. var tablePage = this.tablePage,
  25618. pagerConfig = this.pagerConfig,
  25619. pagerOpts = this.pagerOpts;
  25620. var currentPage = pagerOpts.currentPage,
  25621. pageSize = pagerOpts.pageSize;
  25622. if (pagerConfig) {
  25623. if (currentPage) {
  25624. tablePage.currentPage = currentPage;
  25625. }
  25626. if (pageSize) {
  25627. tablePage.pageSize = pageSize;
  25628. }
  25629. }
  25630. },
  25631. initProxy: function initProxy() {
  25632. var _this4 = this;
  25633. var proxyInited = this.proxyInited,
  25634. proxyConfig = this.proxyConfig,
  25635. proxyOpts = this.proxyOpts,
  25636. formConfig = this.formConfig,
  25637. formOpts = this.formOpts;
  25638. if (proxyConfig) {
  25639. if (isEnableConf(formConfig) && proxyOpts.form && formOpts.items) {
  25640. var formData = {};
  25641. formOpts.items.forEach(function (_ref2) {
  25642. var field = _ref2.field,
  25643. itemRender = _ref2.itemRender;
  25644. if (field) {
  25645. formData[field] = itemRender && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isUndefined(itemRender.defaultValue) ? itemRender.defaultValue : undefined;
  25646. }
  25647. });
  25648. this.formData = formData;
  25649. }
  25650. if (!proxyInited && proxyOpts.autoLoad !== false) {
  25651. this.proxyInited = true;
  25652. this.$nextTick(function () {
  25653. return _this4.commitProxy('_init');
  25654. });
  25655. }
  25656. }
  25657. },
  25658. handleGlobalKeydownEvent: function handleGlobalKeydownEvent(evnt) {
  25659. var isEsc = evnt.keyCode === 27;
  25660. if (isEsc && this.isZMax && this.zoomOpts.escRestore !== false) {
  25661. this.triggerZoomEvent(evnt);
  25662. }
  25663. },
  25664. /**
  25665. * 提交指令,支持 code 或 button
  25666. * @param {String/Object} code 字符串或对象
  25667. */
  25668. commitProxy: function commitProxy(proxyTarget) {
  25669. var _this5 = this;
  25670. var $refs = this.$refs,
  25671. toolbar = this.toolbar,
  25672. toolbarConfig = this.toolbarConfig,
  25673. toolbarOpts = this.toolbarOpts,
  25674. proxyOpts = this.proxyOpts,
  25675. tablePage = this.tablePage,
  25676. pagerConfig = this.pagerConfig,
  25677. formData = this.formData,
  25678. isMsg = this.isMsg;
  25679. var beforeQuery = proxyOpts.beforeQuery,
  25680. afterQuery = proxyOpts.afterQuery,
  25681. beforeDelete = proxyOpts.beforeDelete,
  25682. afterDelete = proxyOpts.afterDelete,
  25683. beforeSave = proxyOpts.beforeSave,
  25684. afterSave = proxyOpts.afterSave,
  25685. _proxyOpts$ajax = proxyOpts.ajax,
  25686. ajax = _proxyOpts$ajax === void 0 ? {} : _proxyOpts$ajax,
  25687. _proxyOpts$props = proxyOpts.props,
  25688. proxyProps = _proxyOpts$props === void 0 ? {} : _proxyOpts$props;
  25689. var $xetable = $refs.xTable;
  25690. var button;
  25691. var code;
  25692. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isString(proxyTarget)) {
  25693. var matchObj = toolbarConfig || toolbar ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.findTree(toolbarOpts.buttons, function (item) {
  25694. return item.code === proxyTarget;
  25695. }, {
  25696. children: 'dropdowns'
  25697. }) : null;
  25698. code = proxyTarget;
  25699. button = matchObj ? matchObj.item : null;
  25700. } else {
  25701. button = proxyTarget;
  25702. code = button.code;
  25703. }
  25704. var btnParams = button ? button.params : null;
  25705. for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
  25706. args[_key2 - 1] = arguments[_key2];
  25707. }
  25708. switch (code) {
  25709. case 'insert':
  25710. this.insert();
  25711. break;
  25712. case 'insert_actived':
  25713. this.insert().then(function (_ref3) {
  25714. var row = _ref3.row;
  25715. return _this5.setActiveRow(row);
  25716. });
  25717. break;
  25718. case 'mark_cancel':
  25719. this.triggerPendingEvent(code);
  25720. break;
  25721. case 'remove':
  25722. return this.handleDeleteRow(code, 'vxe.grid.removeSelectRecord', function () {
  25723. return _this5.removeCheckboxRow();
  25724. });
  25725. case 'import':
  25726. this.importData(btnParams);
  25727. break;
  25728. case 'open_import':
  25729. this.openImport(btnParams);
  25730. break;
  25731. case 'export':
  25732. this.exportData(btnParams);
  25733. break;
  25734. case 'open_export':
  25735. this.openExport(btnParams);
  25736. break;
  25737. case 'reset_custom':
  25738. this.resetColumn(true);
  25739. break;
  25740. case '_init':
  25741. case 'reload':
  25742. case 'query':
  25743. {
  25744. var ajaxMethods = ajax.query;
  25745. if (ajaxMethods) {
  25746. var isInited = code === '_init';
  25747. var isReload = code === 'reload';
  25748. var sortList = [];
  25749. var filterList = [];
  25750. var pageParams = {};
  25751. if (pagerConfig) {
  25752. if (isInited || isReload) {
  25753. tablePage.currentPage = 1;
  25754. }
  25755. if (isEnableConf(pagerConfig)) {
  25756. pageParams = _objectSpread2({}, tablePage);
  25757. }
  25758. }
  25759. if (isInited) {
  25760. var sortOpts = $xetable.sortOpts;
  25761. var defaultSort = sortOpts.defaultSort; // 如果使用默认排序
  25762. if (defaultSort) {
  25763. if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(defaultSort)) {
  25764. defaultSort = [defaultSort];
  25765. }
  25766. sortList = defaultSort.map(function (item) {
  25767. return {
  25768. property: item.field,
  25769. order: item.order
  25770. };
  25771. });
  25772. }
  25773. filterList = $xetable.getCheckedFilters();
  25774. } else {
  25775. if (isReload) {
  25776. this.pendingRecords = [];
  25777. $xetable.clearAll();
  25778. } else {
  25779. sortList = $xetable.getSortColumns();
  25780. filterList = $xetable.getCheckedFilters();
  25781. }
  25782. }
  25783. var params = {
  25784. code: code,
  25785. button: button,
  25786. $grid: this,
  25787. page: pageParams,
  25788. sort: sortList.length ? sortList[0] : {},
  25789. sorts: sortList,
  25790. filters: filterList,
  25791. form: formData,
  25792. options: ajaxMethods
  25793. };
  25794. this.sortData = sortList;
  25795. this.filterData = filterList;
  25796. this.tableLoading = true;
  25797. var applyArgs = [params].concat(args);
  25798. return Promise.resolve((beforeQuery || ajaxMethods).apply(void 0, _toConsumableArray(applyArgs))).catch(function (e) {
  25799. return e;
  25800. }).then(function (rest) {
  25801. _this5.tableLoading = false;
  25802. if (rest) {
  25803. if (isEnableConf(pagerConfig)) {
  25804. var total = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(rest, proxyProps.total || 'page.total') || 0;
  25805. tablePage.total = total;
  25806. _this5.tableData = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(rest, proxyProps.result || 'result') || []; // 检验当前页码,不能超出当前最大页数
  25807. var pageCount = Math.max(Math.ceil(total / tablePage.pageSize), 1);
  25808. if (tablePage.currentPage > pageCount) {
  25809. tablePage.currentPage = pageCount;
  25810. }
  25811. } else {
  25812. _this5.tableData = (proxyProps.list ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(rest, proxyProps.list) : rest) || [];
  25813. }
  25814. } else {
  25815. _this5.tableData = [];
  25816. }
  25817. if (afterQuery) {
  25818. afterQuery.apply(void 0, _toConsumableArray(applyArgs));
  25819. }
  25820. });
  25821. } else {
  25822. UtilTools.error('vxe.error.notFunc', ['query']);
  25823. }
  25824. break;
  25825. }
  25826. case 'delete':
  25827. {
  25828. var _ajaxMethods = ajax.delete;
  25829. if (_ajaxMethods) {
  25830. var removeRecords = this.getCheckboxRecords();
  25831. var body = {
  25832. removeRecords: removeRecords
  25833. };
  25834. var _applyArgs = [{
  25835. $grid: this,
  25836. code: code,
  25837. button: button,
  25838. body: body,
  25839. options: _ajaxMethods
  25840. }].concat(args);
  25841. if (removeRecords.length) {
  25842. return this.handleDeleteRow(code, 'vxe.grid.deleteSelectRecord', function () {
  25843. _this5.tableLoading = true;
  25844. return Promise.resolve((beforeDelete || _ajaxMethods).apply(void 0, _toConsumableArray(_applyArgs))).then(function (rest) {
  25845. _this5.tableLoading = false;
  25846. _this5.pendingRecords = _this5.pendingRecords.filter(function (row) {
  25847. return removeRecords.indexOf(row) === -1;
  25848. });
  25849. if (isMsg) {
  25850. v_x_e_table.modal.message({
  25851. message: _this5.getRespMsg(rest, 'vxe.grid.delSuccess'),
  25852. status: 'success'
  25853. });
  25854. }
  25855. if (afterDelete) {
  25856. afterDelete.apply(void 0, _toConsumableArray(_applyArgs));
  25857. } else {
  25858. _this5.commitProxy('query');
  25859. }
  25860. }).catch(function (rest) {
  25861. _this5.tableLoading = false;
  25862. if (isMsg) {
  25863. v_x_e_table.modal.message({
  25864. id: code,
  25865. message: _this5.getRespMsg(rest, 'vxe.grid.operError'),
  25866. status: 'error'
  25867. });
  25868. }
  25869. });
  25870. });
  25871. } else {
  25872. if (isMsg) {
  25873. v_x_e_table.modal.message({
  25874. id: code,
  25875. message: conf.i18n('vxe.grid.selectOneRecord'),
  25876. status: 'warning'
  25877. });
  25878. }
  25879. }
  25880. } else {
  25881. UtilTools.error('vxe.error.notFunc', [code]);
  25882. }
  25883. break;
  25884. }
  25885. case 'save':
  25886. {
  25887. var _ajaxMethods2 = ajax.save;
  25888. if (_ajaxMethods2) {
  25889. var _body = Object.assign({
  25890. pendingRecords: this.pendingRecords
  25891. }, this.getRecordset());
  25892. var insertRecords = _body.insertRecords,
  25893. _removeRecords = _body.removeRecords,
  25894. updateRecords = _body.updateRecords,
  25895. pendingRecords = _body.pendingRecords;
  25896. var _applyArgs2 = [{
  25897. $grid: this,
  25898. code: code,
  25899. button: button,
  25900. body: _body,
  25901. options: _ajaxMethods2
  25902. }].concat(args); // 排除掉新增且标记为删除的数据
  25903. if (insertRecords.length) {
  25904. _body.pendingRecords = pendingRecords.filter(function (row) {
  25905. return insertRecords.indexOf(row) === -1;
  25906. });
  25907. } // 排除已标记为删除的数据
  25908. if (pendingRecords.length) {
  25909. _body.insertRecords = insertRecords.filter(function (row) {
  25910. return pendingRecords.indexOf(row) === -1;
  25911. });
  25912. } // 只校验新增和修改的数据
  25913. return this.validate(_body.insertRecords.concat(updateRecords)).then(function () {
  25914. if (_body.insertRecords.length || _removeRecords.length || updateRecords.length || _body.pendingRecords.length) {
  25915. _this5.tableLoading = true;
  25916. return Promise.resolve((beforeSave || _ajaxMethods2).apply(void 0, _toConsumableArray(_applyArgs2))).then(function (rest) {
  25917. _this5.tableLoading = false;
  25918. _this5.pendingRecords = [];
  25919. if (isMsg) {
  25920. v_x_e_table.modal.message({
  25921. message: _this5.getRespMsg(rest, 'vxe.grid.saveSuccess'),
  25922. status: 'success'
  25923. });
  25924. }
  25925. if (afterSave) {
  25926. afterSave.apply(void 0, _toConsumableArray(_applyArgs2));
  25927. } else {
  25928. _this5.commitProxy('query');
  25929. }
  25930. }).catch(function (rest) {
  25931. _this5.tableLoading = false;
  25932. if (isMsg) {
  25933. v_x_e_table.modal.message({
  25934. id: code,
  25935. message: _this5.getRespMsg(rest, 'vxe.grid.operError'),
  25936. status: 'error'
  25937. });
  25938. }
  25939. });
  25940. } else {
  25941. if (isMsg) {
  25942. v_x_e_table.modal.message({
  25943. id: code,
  25944. message: conf.i18n('vxe.grid.dataUnchanged'),
  25945. status: 'info'
  25946. });
  25947. }
  25948. }
  25949. }).catch(function (errMap) {
  25950. return errMap;
  25951. });
  25952. } else {
  25953. UtilTools.error('vxe.error.notFunc', [code]);
  25954. }
  25955. break;
  25956. }
  25957. default:
  25958. {
  25959. var btnMethod = v_x_e_table.commands.get(code);
  25960. if (btnMethod) {
  25961. btnMethod.apply(void 0, [{
  25962. code: code,
  25963. button: button,
  25964. $grid: this,
  25965. $table: $xetable
  25966. }].concat(args));
  25967. }
  25968. }
  25969. }
  25970. return this.$nextTick();
  25971. },
  25972. getRespMsg: function getRespMsg(rest, defaultMsg) {
  25973. var _this$proxyOpts$props = this.proxyOpts.props,
  25974. proxyProps = _this$proxyOpts$props === void 0 ? {} : _this$proxyOpts$props;
  25975. var msg;
  25976. if (rest && proxyProps.message) {
  25977. msg = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(rest, proxyProps.message);
  25978. }
  25979. return msg || conf.i18n(defaultMsg);
  25980. },
  25981. handleDeleteRow: function handleDeleteRow(code, alertKey, callback) {
  25982. var selectRecords = this.getCheckboxRecords();
  25983. if (this.isMsg) {
  25984. if (selectRecords.length) {
  25985. return v_x_e_table.modal.confirm({
  25986. id: "cfm_".concat(code),
  25987. message: conf.i18n(alertKey),
  25988. escClosable: true
  25989. }).then(function (type) {
  25990. if (type === 'confirm') {
  25991. callback();
  25992. }
  25993. });
  25994. } else {
  25995. v_x_e_table.modal.message({
  25996. id: "msg_".concat(code),
  25997. message: conf.i18n('vxe.grid.selectOneRecord'),
  25998. status: 'warning'
  25999. });
  26000. }
  26001. } else {
  26002. if (selectRecords.length) {
  26003. callback();
  26004. }
  26005. }
  26006. return Promise.resolve();
  26007. },
  26008. getFormItems: function getFormItems(itemIndex) {
  26009. var formConfig = this.formConfig,
  26010. formOpts = this.formOpts;
  26011. var itemList = [];
  26012. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(isEnableConf(formConfig) && formOpts.items ? formOpts.items : [], function (item) {
  26013. itemList.push(item);
  26014. }, {
  26015. children: 'children'
  26016. });
  26017. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isUndefined(itemIndex) ? itemList : itemList[itemIndex];
  26018. },
  26019. getPendingRecords: function getPendingRecords() {
  26020. return this.pendingRecords;
  26021. },
  26022. triggerToolbarBtnEvent: function triggerToolbarBtnEvent(button, evnt) {
  26023. this.commitProxy(button, evnt);
  26024. this.$emit('toolbar-button-click', {
  26025. code: button.code,
  26026. button: button,
  26027. $grid: this,
  26028. $event: evnt
  26029. });
  26030. },
  26031. triggerPendingEvent: function triggerPendingEvent(code) {
  26032. var pendingRecords = this.pendingRecords,
  26033. isMsg = this.isMsg;
  26034. var selectRecords = this.getCheckboxRecords();
  26035. if (selectRecords.length) {
  26036. var plus = [];
  26037. var minus = [];
  26038. selectRecords.forEach(function (data) {
  26039. if (pendingRecords.some(function (item) {
  26040. return data === item;
  26041. })) {
  26042. minus.push(data);
  26043. } else {
  26044. plus.push(data);
  26045. }
  26046. });
  26047. if (minus.length) {
  26048. this.pendingRecords = pendingRecords.filter(function (item) {
  26049. return minus.indexOf(item) === -1;
  26050. }).concat(plus);
  26051. } else if (plus.length) {
  26052. this.pendingRecords = pendingRecords.concat(plus);
  26053. }
  26054. this.clearCheckboxRow();
  26055. } else {
  26056. if (isMsg) {
  26057. v_x_e_table.modal.message({
  26058. id: code,
  26059. message: conf.i18n('vxe.grid.selectOneRecord'),
  26060. status: 'warning'
  26061. });
  26062. }
  26063. }
  26064. },
  26065. pageChangeEvent: function pageChangeEvent(params) {
  26066. var proxyConfig = this.proxyConfig,
  26067. tablePage = this.tablePage;
  26068. var currentPage = params.currentPage,
  26069. pageSize = params.pageSize;
  26070. tablePage.currentPage = currentPage;
  26071. tablePage.pageSize = pageSize;
  26072. this.$emit('page-change', Object.assign({
  26073. $grid: this
  26074. }, params));
  26075. if (proxyConfig) {
  26076. this.commitProxy('query');
  26077. }
  26078. },
  26079. sortChangeEvent: function sortChangeEvent(params) {
  26080. var $table = params.$table,
  26081. column = params.column,
  26082. sortList = params.sortList;
  26083. var isRemote = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isBoolean(column.remoteSort) ? column.remoteSort : $table.sortOpts.remote; // 如果是服务端排序
  26084. if (isRemote) {
  26085. this.sortData = sortList;
  26086. if (this.proxyConfig) {
  26087. this.tablePage.currentPage = 1;
  26088. this.commitProxy('query');
  26089. }
  26090. }
  26091. this.$emit('sort-change', Object.assign({
  26092. $grid: this
  26093. }, params));
  26094. },
  26095. filterChangeEvent: function filterChangeEvent(params) {
  26096. var $table = params.$table,
  26097. filterList = params.filterList; // 如果是服务端过滤
  26098. if ($table.filterOpts.remote) {
  26099. this.filterData = filterList;
  26100. if (this.proxyConfig) {
  26101. this.tablePage.currentPage = 1;
  26102. this.commitProxy('query');
  26103. }
  26104. }
  26105. this.$emit('filter-change', Object.assign({
  26106. $grid: this
  26107. }, params));
  26108. },
  26109. submitEvent: function submitEvent(params) {
  26110. var proxyConfig = this.proxyConfig;
  26111. if (proxyConfig) {
  26112. this.commitProxy('reload');
  26113. }
  26114. this.$emit('form-submit', Object.assign({
  26115. $grid: this
  26116. }, params));
  26117. },
  26118. resetEvent: function resetEvent(params) {
  26119. var proxyConfig = this.proxyConfig;
  26120. if (proxyConfig) {
  26121. this.commitProxy('reload');
  26122. }
  26123. this.$emit('form-reset', Object.assign({
  26124. $grid: this
  26125. }, params));
  26126. },
  26127. submitInvalidEvent: function submitInvalidEvent(params) {
  26128. this.$emit('form-submit-invalid', Object.assign({
  26129. $grid: this
  26130. }, params));
  26131. },
  26132. togglCollapseEvent: function togglCollapseEvent(params) {
  26133. var _this6 = this;
  26134. this.$nextTick(function () {
  26135. return _this6.recalculate(true);
  26136. });
  26137. this.$emit('form-toggle-collapse', Object.assign({
  26138. $grid: this
  26139. }, params));
  26140. },
  26141. triggerZoomEvent: function triggerZoomEvent(evnt) {
  26142. this.zoom();
  26143. this.$emit('zoom', {
  26144. $grid: this,
  26145. type: this.isZMax ? 'max' : 'revert',
  26146. $event: evnt
  26147. });
  26148. },
  26149. zoom: function zoom() {
  26150. return this[this.isZMax ? 'revert' : 'maximize']();
  26151. },
  26152. isMaximized: function isMaximized() {
  26153. return this.isZMax;
  26154. },
  26155. maximize: function maximize() {
  26156. return this.handleZoom(true);
  26157. },
  26158. revert: function revert() {
  26159. return this.handleZoom();
  26160. },
  26161. handleZoom: function handleZoom(isMax) {
  26162. var _this7 = this;
  26163. var isZMax = this.isZMax;
  26164. if (isMax ? !isZMax : isZMax) {
  26165. this.isZMax = !isZMax;
  26166. if (this.tZindex < UtilTools.getLastZIndex()) {
  26167. this.tZindex = UtilTools.nextZIndex();
  26168. }
  26169. }
  26170. return this.$nextTick().then(function () {
  26171. return _this7.recalculate(true);
  26172. }).then(function () {
  26173. return _this7.isZMax;
  26174. });
  26175. },
  26176. getProxyInfo: function getProxyInfo() {
  26177. var sortData = this.sortData,
  26178. proxyConfig = this.proxyConfig;
  26179. if (proxyConfig) {
  26180. return {
  26181. data: this.tableData,
  26182. filter: this.filterData,
  26183. form: this.formData,
  26184. sort: sortData.length ? sortData[0] : {},
  26185. sorts: sortData,
  26186. pager: this.tablePage,
  26187. pendingRecords: this.pendingRecords
  26188. };
  26189. }
  26190. return null;
  26191. }
  26192. }, false ? undefined : null)
  26193. });
  26194. // CONCATENATED MODULE: ./packages/grid/index.js
  26195. var Grid = Object.assign(grid, {
  26196. install: function install(Vue) {
  26197. v_x_e_table.Grid = grid;
  26198. v_x_e_table.GridComponent = grid;
  26199. Vue.component(grid.name, grid);
  26200. }
  26201. });
  26202. /* harmony default export */ var packages_grid = (Grid);
  26203. // CONCATENATED MODULE: ./packages/toolbar/src/toolbar.js
  26204. /**
  26205. * 渲染按钮
  26206. */
  26207. function renderBtns(h, _vm) {
  26208. var _e = _vm._e,
  26209. $scopedSlots = _vm.$scopedSlots,
  26210. $xegrid = _vm.$xegrid,
  26211. $xetable = _vm.$xetable,
  26212. _vm$buttons = _vm.buttons,
  26213. buttons = _vm$buttons === void 0 ? [] : _vm$buttons;
  26214. if ($scopedSlots.buttons) {
  26215. return $scopedSlots.buttons.call(_vm, {
  26216. $grid: $xegrid,
  26217. $table: $xetable
  26218. }, h);
  26219. }
  26220. return buttons.map(function (item) {
  26221. var _dropdowns = item.dropdowns,
  26222. buttonRender = item.buttonRender;
  26223. var compConf = buttonRender ? v_x_e_table.renderer.get(buttonRender.name) : null;
  26224. if (item.visible === false) {
  26225. return _e();
  26226. }
  26227. if (compConf) {
  26228. var renderToolbarButton = compConf.renderToolbarButton || compConf.renderButton;
  26229. if (renderToolbarButton) {
  26230. return h('span', {
  26231. class: 'vxe-button--item'
  26232. }, renderToolbarButton.call(_vm, h, buttonRender, {
  26233. $grid: $xegrid,
  26234. $table: $xetable,
  26235. button: item
  26236. }));
  26237. }
  26238. }
  26239. return h('vxe-button', {
  26240. on: {
  26241. click: function click(evnt) {
  26242. return _vm.btnEvent(evnt, item);
  26243. }
  26244. },
  26245. props: {
  26246. disabled: item.disabled,
  26247. loading: item.loading,
  26248. type: item.type,
  26249. icon: item.icon,
  26250. circle: item.circle,
  26251. round: item.round,
  26252. status: item.status,
  26253. content: UtilTools.getFuncText(item.name),
  26254. destroyOnClose: item.destroyOnClose,
  26255. placement: item.placement,
  26256. transfer: item.transfer
  26257. },
  26258. scopedSlots: _dropdowns && _dropdowns.length ? {
  26259. dropdowns: function dropdowns() {
  26260. return _dropdowns.map(function (child) {
  26261. return child.visible === false ? _e() : h('vxe-button', {
  26262. on: {
  26263. click: function click(evnt) {
  26264. return _vm.btnEvent(evnt, child);
  26265. }
  26266. },
  26267. props: {
  26268. disabled: child.disabled,
  26269. loading: child.loading,
  26270. type: child.type,
  26271. icon: child.icon,
  26272. circle: child.circle,
  26273. round: child.round,
  26274. status: child.status,
  26275. content: UtilTools.getFuncText(child.name)
  26276. }
  26277. });
  26278. });
  26279. }
  26280. } : null
  26281. });
  26282. });
  26283. }
  26284. /**
  26285. * 渲染右侧工具
  26286. */
  26287. function renderRightTools(h, _vm) {
  26288. var $scopedSlots = _vm.$scopedSlots,
  26289. $xegrid = _vm.$xegrid,
  26290. $xetable = _vm.$xetable;
  26291. if ($scopedSlots.tools) {
  26292. return $scopedSlots.tools.call(_vm, {
  26293. $grid: $xegrid,
  26294. $table: $xetable
  26295. }, h);
  26296. }
  26297. return [];
  26298. }
  26299. function renderCustoms(h, _vm) {
  26300. var $xetable = _vm.$xetable,
  26301. customStore = _vm.customStore,
  26302. customOpts = _vm.customOpts,
  26303. columns = _vm.columns;
  26304. var cols = [];
  26305. var customBtnOns = {};
  26306. var customWrapperOns = {};
  26307. var checkMethod = $xetable ? $xetable.customOpts.checkMethod : null;
  26308. if (customOpts.trigger === 'manual') {// 手动触发
  26309. } else if (customOpts.trigger === 'hover') {
  26310. // hover 触发
  26311. customBtnOns.mouseenter = _vm.handleMouseenterSettingEvent;
  26312. customBtnOns.mouseleave = _vm.handleMouseleaveSettingEvent;
  26313. customWrapperOns.mouseenter = _vm.handleWrapperMouseenterEvent;
  26314. customWrapperOns.mouseleave = _vm.handleWrapperMouseleaveEvent;
  26315. } else {
  26316. // 点击触发
  26317. customBtnOns.click = _vm.handleClickSettingEvent;
  26318. }
  26319. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(columns, function (column) {
  26320. var colTitle = UtilTools.formatText(column.getTitle(), 1);
  26321. var colKey = column.getKey();
  26322. var isColGroup = column.children && column.children.length;
  26323. var isDisabled = checkMethod ? !checkMethod({
  26324. column: column
  26325. }) : false;
  26326. if (isColGroup || colKey) {
  26327. cols.push(h('li', {
  26328. class: ['vxe-custom--option', "level--".concat(column.level), {
  26329. 'is--group': isColGroup,
  26330. 'is--checked': column.visible,
  26331. 'is--indeterminate': column.halfVisible,
  26332. 'is--disabled': isDisabled
  26333. }],
  26334. attrs: {
  26335. title: colTitle
  26336. },
  26337. on: {
  26338. click: function click() {
  26339. if (!isDisabled) {
  26340. _vm.changeCustomOption(column);
  26341. }
  26342. }
  26343. }
  26344. }, [h('span', {
  26345. class: 'vxe-checkbox--icon vxe-checkbox--checked-icon'
  26346. }), h('span', {
  26347. class: 'vxe-checkbox--icon vxe-checkbox--unchecked-icon'
  26348. }), h('span', {
  26349. class: 'vxe-checkbox--icon vxe-checkbox--indeterminate-icon'
  26350. }), h('span', {
  26351. class: 'vxe-checkbox--label'
  26352. }, colTitle)]));
  26353. }
  26354. });
  26355. return h('div', {
  26356. class: ['vxe-custom--wrapper', {
  26357. 'is--active': customStore.visible
  26358. }],
  26359. ref: 'customWrapper'
  26360. }, [h('vxe-button', {
  26361. props: {
  26362. circle: true,
  26363. icon: customOpts.icon || conf.icon.TOOLBAR_TOOLS_CUSTOM
  26364. },
  26365. attrs: {
  26366. title: conf.i18n('vxe.toolbar.custom')
  26367. },
  26368. on: customBtnOns
  26369. }), h('div', {
  26370. class: 'vxe-custom--option-wrapper'
  26371. }, [h('ul', {
  26372. class: 'vxe-custom--header'
  26373. }, [h('li', {
  26374. class: ['vxe-custom--option', {
  26375. 'is--checked': customStore.isAll,
  26376. 'is--indeterminate': customStore.isIndeterminate
  26377. }],
  26378. attrs: {
  26379. title: conf.i18n('vxe.table.allTitle')
  26380. },
  26381. on: {
  26382. click: _vm.allCustomEvent
  26383. }
  26384. }, [h('span', {
  26385. class: 'vxe-checkbox--icon vxe-checkbox--checked-icon'
  26386. }), h('span', {
  26387. class: 'vxe-checkbox--icon vxe-checkbox--unchecked-icon'
  26388. }), h('span', {
  26389. class: 'vxe-checkbox--icon vxe-checkbox--indeterminate-icon'
  26390. }), h('span', {
  26391. class: 'vxe-checkbox--label'
  26392. }, conf.i18n('vxe.toolbar.customAll'))])]), h('ul', {
  26393. class: 'vxe-custom--body',
  26394. on: customWrapperOns
  26395. }, cols), customOpts.isFooter === false ? null : h('div', {
  26396. class: 'vxe-custom--footer'
  26397. }, [h('button', {
  26398. class: 'btn--confirm',
  26399. on: {
  26400. click: _vm.confirmCustomEvent
  26401. }
  26402. }, conf.i18n('vxe.toolbar.customConfirm')), h('button', {
  26403. class: 'btn--reset',
  26404. on: {
  26405. click: _vm.resetCustomEvent
  26406. }
  26407. }, conf.i18n('vxe.toolbar.customRestore'))])])]);
  26408. }
  26409. /* harmony default export */ var src_toolbar = ({
  26410. name: 'VxeToolbar',
  26411. mixins: [size],
  26412. props: {
  26413. loading: Boolean,
  26414. refresh: [Boolean, Object],
  26415. import: [Boolean, Object],
  26416. export: [Boolean, Object],
  26417. print: [Boolean, Object],
  26418. zoom: [Boolean, Object],
  26419. custom: [Boolean, Object],
  26420. buttons: {
  26421. type: Array,
  26422. default: function _default() {
  26423. return conf.toolbar.buttons;
  26424. }
  26425. },
  26426. perfect: {
  26427. type: Boolean,
  26428. default: function _default() {
  26429. return conf.toolbar.perfect;
  26430. }
  26431. },
  26432. size: {
  26433. type: String,
  26434. default: function _default() {
  26435. return conf.toolbar.size || conf.size;
  26436. }
  26437. }
  26438. },
  26439. inject: {
  26440. $xegrid: {
  26441. default: null
  26442. }
  26443. },
  26444. data: function data() {
  26445. return {
  26446. $xetable: null,
  26447. isRefresh: false,
  26448. columns: [],
  26449. customStore: {
  26450. isAll: false,
  26451. isIndeterminate: false,
  26452. visible: false
  26453. }
  26454. };
  26455. },
  26456. computed: {
  26457. refreshOpts: function refreshOpts() {
  26458. return Object.assign({}, conf.toolbar.refresh, this.refresh);
  26459. },
  26460. importOpts: function importOpts() {
  26461. return Object.assign({}, conf.toolbar.import, this.import);
  26462. },
  26463. exportOpts: function exportOpts() {
  26464. return Object.assign({}, conf.toolbar.export, this.export);
  26465. },
  26466. printOpts: function printOpts() {
  26467. return Object.assign({}, conf.toolbar.print, this.print);
  26468. },
  26469. zoomOpts: function zoomOpts() {
  26470. return Object.assign({}, conf.toolbar.zoom, this.zoom);
  26471. },
  26472. customOpts: function customOpts() {
  26473. return Object.assign({}, conf.toolbar.custom, this.custom);
  26474. }
  26475. },
  26476. created: function created() {
  26477. var _this = this;
  26478. var refresh = this.refresh,
  26479. refreshOpts = this.refreshOpts;
  26480. this.$nextTick(function () {
  26481. var $xetable = _this.fintTable();
  26482. if (refresh && !_this.$xegrid && !refreshOpts.query) {
  26483. UtilTools.warn('vxe.error.notFunc', ['query']);
  26484. }
  26485. if ($xetable) {
  26486. $xetable.connect(_this);
  26487. }
  26488. if (false) {}
  26489. });
  26490. GlobalEvent.on(this, 'mousedown', this.handleGlobalMousedownEvent);
  26491. GlobalEvent.on(this, 'blur', this.handleGlobalBlurEvent);
  26492. },
  26493. destroyed: function destroyed() {
  26494. GlobalEvent.off(this, 'mousedown');
  26495. GlobalEvent.off(this, 'blur');
  26496. },
  26497. render: function render(h) {
  26498. var _ref;
  26499. var _e = this._e,
  26500. $xegrid = this.$xegrid,
  26501. perfect = this.perfect,
  26502. loading = this.loading,
  26503. importOpts = this.importOpts,
  26504. exportOpts = this.exportOpts,
  26505. refresh = this.refresh,
  26506. refreshOpts = this.refreshOpts,
  26507. zoom = this.zoom,
  26508. zoomOpts = this.zoomOpts,
  26509. custom = this.custom,
  26510. vSize = this.vSize;
  26511. return h('div', {
  26512. class: ['vxe-toolbar', (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, 'is--perfect', perfect), _defineProperty(_ref, 'is--loading', loading), _ref)]
  26513. }, [h('div', {
  26514. class: 'vxe-button--wrapper'
  26515. }, renderBtns(h, this)), h('div', {
  26516. class: 'vxe-tools--wrapper'
  26517. }, renderRightTools(h, this)), h('div', {
  26518. class: 'vxe-tools--operate'
  26519. }, [this.import ? h('vxe-button', {
  26520. props: {
  26521. circle: true,
  26522. icon: importOpts.icon || conf.icon.TOOLBAR_TOOLS_IMPORT
  26523. },
  26524. attrs: {
  26525. title: conf.i18n('vxe.toolbar.import')
  26526. },
  26527. on: {
  26528. click: this.importEvent
  26529. }
  26530. }) : _e(), this.export ? h('vxe-button', {
  26531. props: {
  26532. circle: true,
  26533. icon: exportOpts.icon || conf.icon.TOOLBAR_TOOLS_EXPORT
  26534. },
  26535. attrs: {
  26536. title: conf.i18n('vxe.toolbar.export')
  26537. },
  26538. on: {
  26539. click: this.exportEvent
  26540. }
  26541. }) : _e(), this.print ? h('vxe-button', {
  26542. props: {
  26543. circle: true,
  26544. icon: this.printOpts.icon || conf.icon.TOOLBAR_TOOLS_PRINT
  26545. },
  26546. attrs: {
  26547. title: conf.i18n('vxe.toolbar.print')
  26548. },
  26549. on: {
  26550. click: this.printEvent
  26551. }
  26552. }) : _e(), refresh ? h('vxe-button', {
  26553. props: {
  26554. circle: true,
  26555. icon: this.isRefresh ? refreshOpts.iconLoading || conf.icon.TOOLBAR_TOOLS_REFRESH_LOADING : refreshOpts.icon || conf.icon.TOOLBAR_TOOLS_REFRESH
  26556. },
  26557. attrs: {
  26558. title: conf.i18n('vxe.toolbar.refresh')
  26559. },
  26560. on: {
  26561. click: this.refreshEvent
  26562. }
  26563. }) : _e(), zoom && $xegrid ? h('vxe-button', {
  26564. props: {
  26565. circle: true,
  26566. icon: $xegrid.isMaximized() ? zoomOpts.iconOut || conf.icon.TOOLBAR_TOOLS_ZOOM_OUT : zoomOpts.iconIn || conf.icon.TOOLBAR_TOOLS_ZOOM_IN
  26567. },
  26568. attrs: {
  26569. title: conf.i18n("vxe.toolbar.zoom".concat($xegrid.isMaximized() ? 'Out' : 'In'))
  26570. },
  26571. on: {
  26572. click: $xegrid.triggerZoomEvent
  26573. }
  26574. }) : _e(), custom ? renderCustoms(h, this) : _e()])]);
  26575. },
  26576. methods: {
  26577. syncUpdate: function syncUpdate(params) {
  26578. var collectColumn = params.collectColumn,
  26579. $table = params.$table;
  26580. this.$xetable = $table;
  26581. this.columns = collectColumn;
  26582. },
  26583. fintTable: function fintTable() {
  26584. var $children = this.$parent.$children;
  26585. var selfIndex = $children.indexOf(this);
  26586. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.find($children, function (comp, index) {
  26587. return comp && comp.refreshColumn && index > selfIndex && comp.$vnode.componentOptions.tag === 'vxe-table';
  26588. });
  26589. },
  26590. checkTable: function checkTable() {
  26591. if (this.$xetable) {
  26592. return true;
  26593. }
  26594. UtilTools.error('vxe.error.barUnableLink');
  26595. },
  26596. showCustom: function showCustom() {
  26597. this.customStore.visible = true;
  26598. this.checkCustomStatus();
  26599. },
  26600. closeCustom: function closeCustom() {
  26601. var custom = this.custom,
  26602. customStore = this.customStore;
  26603. if (customStore.visible) {
  26604. customStore.visible = false;
  26605. if (custom && !customStore.immediate) {
  26606. this.handleCustoms();
  26607. }
  26608. }
  26609. },
  26610. confirmCustomEvent: function confirmCustomEvent(evnt) {
  26611. this.closeCustom();
  26612. this.emitCustomEvent('confirm', evnt);
  26613. },
  26614. customOpenEvent: function customOpenEvent(evnt) {
  26615. var customStore = this.customStore;
  26616. if (this.checkTable()) {
  26617. if (!customStore.visible) {
  26618. this.showCustom();
  26619. this.emitCustomEvent('open', evnt);
  26620. }
  26621. }
  26622. },
  26623. customColseEvent: function customColseEvent(evnt) {
  26624. var customStore = this.customStore;
  26625. if (customStore.visible) {
  26626. this.closeCustom();
  26627. this.emitCustomEvent('close', evnt);
  26628. }
  26629. },
  26630. resetCustomEvent: function resetCustomEvent(evnt) {
  26631. var $xetable = this.$xetable,
  26632. columns = this.columns;
  26633. var checkMethod = $xetable.customOpts.checkMethod;
  26634. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(columns, function (column) {
  26635. if (!checkMethod || checkMethod({
  26636. column: column
  26637. })) {
  26638. column.visible = column.defaultVisible;
  26639. column.halfVisible = false;
  26640. }
  26641. column.resizeWidth = 0;
  26642. });
  26643. $xetable.saveCustomResizable(true);
  26644. this.closeCustom();
  26645. this.emitCustomEvent('reset', evnt);
  26646. },
  26647. emitCustomEvent: function emitCustomEvent(type, evnt) {
  26648. var $xetable = this.$xetable,
  26649. $xegrid = this.$xegrid;
  26650. var comp = $xegrid || $xetable;
  26651. comp.$emit('custom', {
  26652. type: type,
  26653. $table: $xetable,
  26654. $grid: $xegrid,
  26655. $event: evnt
  26656. });
  26657. },
  26658. changeCustomOption: function changeCustomOption(column) {
  26659. var isChecked = !column.visible;
  26660. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree([column], function (item) {
  26661. item.visible = isChecked;
  26662. item.halfVisible = false;
  26663. });
  26664. this.handleOptionCheck(column);
  26665. if (this.custom && this.customOpts.immediate) {
  26666. this.handleCustoms();
  26667. }
  26668. this.checkCustomStatus();
  26669. },
  26670. handleOptionCheck: function handleOptionCheck(column) {
  26671. var matchObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.findTree(this.columns, function (item) {
  26672. return item === column;
  26673. });
  26674. if (matchObj && matchObj.parent) {
  26675. var parent = matchObj.parent;
  26676. if (parent.children && parent.children.length) {
  26677. parent.visible = parent.children.every(function (column) {
  26678. return column.visible;
  26679. });
  26680. parent.halfVisible = !parent.visible && parent.children.some(function (column) {
  26681. return column.visible || column.halfVisible;
  26682. });
  26683. this.handleOptionCheck(parent);
  26684. }
  26685. }
  26686. },
  26687. handleCustoms: function handleCustoms() {
  26688. var $xetable = this.$xetable;
  26689. $xetable.saveCustomVisible();
  26690. $xetable.analyColumnWidth();
  26691. $xetable.refreshColumn();
  26692. },
  26693. checkCustomStatus: function checkCustomStatus() {
  26694. var $xetable = this.$xetable,
  26695. columns = this.columns;
  26696. var checkMethod = $xetable.customOpts.checkMethod;
  26697. this.customStore.isAll = columns.every(function (column) {
  26698. return (checkMethod ? !checkMethod({
  26699. column: column
  26700. }) : false) || column.visible;
  26701. });
  26702. this.customStore.isIndeterminate = !this.customStore.isAll && columns.some(function (column) {
  26703. return (!checkMethod || checkMethod({
  26704. column: column
  26705. })) && (column.visible || column.halfVisible);
  26706. });
  26707. },
  26708. allCustomEvent: function allCustomEvent() {
  26709. var $xetable = this.$xetable,
  26710. columns = this.columns,
  26711. customStore = this.customStore;
  26712. var checkMethod = $xetable.customOpts.checkMethod;
  26713. var isAll = !customStore.isAll;
  26714. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(columns, function (column) {
  26715. if (!checkMethod || checkMethod({
  26716. column: column
  26717. })) {
  26718. column.visible = isAll;
  26719. column.halfVisible = false;
  26720. }
  26721. });
  26722. customStore.isAll = isAll;
  26723. this.checkCustomStatus();
  26724. },
  26725. handleGlobalMousedownEvent: function handleGlobalMousedownEvent(evnt) {
  26726. if (!DomTools.getEventTargetNode(evnt, this.$refs.customWrapper).flag) {
  26727. this.customColseEvent(evnt);
  26728. }
  26729. },
  26730. handleGlobalBlurEvent: function handleGlobalBlurEvent(evnt) {
  26731. this.customColseEvent(evnt);
  26732. },
  26733. handleClickSettingEvent: function handleClickSettingEvent(evnt) {
  26734. if (this.customStore.visible) {
  26735. this.customColseEvent(evnt);
  26736. } else {
  26737. this.customOpenEvent(evnt);
  26738. }
  26739. },
  26740. handleMouseenterSettingEvent: function handleMouseenterSettingEvent(evnt) {
  26741. this.customStore.activeBtn = true;
  26742. this.customOpenEvent(evnt);
  26743. },
  26744. handleMouseleaveSettingEvent: function handleMouseleaveSettingEvent(evnt) {
  26745. var _this2 = this;
  26746. var customStore = this.customStore;
  26747. customStore.activeBtn = false;
  26748. setTimeout(function () {
  26749. if (!customStore.activeBtn && !customStore.activeWrapper) {
  26750. _this2.customColseEvent(evnt);
  26751. }
  26752. }, 300);
  26753. },
  26754. handleWrapperMouseenterEvent: function handleWrapperMouseenterEvent(evnt) {
  26755. this.customStore.activeWrapper = true;
  26756. this.customOpenEvent(evnt);
  26757. },
  26758. handleWrapperMouseleaveEvent: function handleWrapperMouseleaveEvent(evnt) {
  26759. var _this3 = this;
  26760. var customStore = this.customStore;
  26761. customStore.activeWrapper = false;
  26762. setTimeout(function () {
  26763. if (!customStore.activeBtn && !customStore.activeWrapper) {
  26764. _this3.customColseEvent(evnt);
  26765. }
  26766. }, 300);
  26767. },
  26768. refreshEvent: function refreshEvent() {
  26769. var _this4 = this;
  26770. var $xegrid = this.$xegrid,
  26771. refreshOpts = this.refreshOpts,
  26772. isRefresh = this.isRefresh;
  26773. if (!isRefresh) {
  26774. if (refreshOpts.query) {
  26775. this.isRefresh = true;
  26776. try {
  26777. Promise.resolve(refreshOpts.query()).catch(function (e) {
  26778. return e;
  26779. }).then(function () {
  26780. _this4.isRefresh = false;
  26781. });
  26782. } catch (e) {
  26783. this.isRefresh = false;
  26784. }
  26785. } else if ($xegrid) {
  26786. this.isRefresh = true;
  26787. $xegrid.commitProxy('reload').catch(function (e) {
  26788. return e;
  26789. }).then(function () {
  26790. _this4.isRefresh = false;
  26791. });
  26792. }
  26793. }
  26794. },
  26795. btnEvent: function btnEvent(evnt, item) {
  26796. var $xegrid = this.$xegrid,
  26797. $xetable = this.$xetable;
  26798. var code = item.code;
  26799. if (code) {
  26800. if ($xegrid) {
  26801. $xegrid.triggerToolbarBtnEvent(item, evnt);
  26802. } else {
  26803. var commandMethod = v_x_e_table.commands.get(code);
  26804. var params = {
  26805. code: code,
  26806. button: item,
  26807. $xegrid: $xegrid,
  26808. $table: $xetable,
  26809. $event: evnt
  26810. };
  26811. if (commandMethod) {
  26812. commandMethod.call(this, params, evnt);
  26813. }
  26814. this.$emit('button-click', params);
  26815. }
  26816. }
  26817. },
  26818. importEvent: function importEvent() {
  26819. if (this.checkTable()) {
  26820. this.$xetable.openImport(this.importOpts);
  26821. }
  26822. },
  26823. exportEvent: function exportEvent() {
  26824. if (this.checkTable()) {
  26825. this.$xetable.openExport(this.exportOpts);
  26826. }
  26827. },
  26828. printEvent: function printEvent() {
  26829. if (this.checkTable()) {
  26830. this.$xetable.openPrint(this.printOpts);
  26831. }
  26832. }
  26833. }
  26834. });
  26835. // CONCATENATED MODULE: ./packages/toolbar/index.js
  26836. var Toolbar = Object.assign(src_toolbar, {
  26837. install: function install(Vue) {
  26838. Vue.component(src_toolbar.name, src_toolbar);
  26839. }
  26840. });
  26841. /* harmony default export */ var packages_toolbar = (Toolbar);
  26842. // CONCATENATED MODULE: ./packages/pager/src/pager.js
  26843. /* harmony default export */ var pager = ({
  26844. name: 'VxePager',
  26845. mixins: [size],
  26846. props: {
  26847. size: {
  26848. type: String,
  26849. default: function _default() {
  26850. return conf.pager.size || conf.size;
  26851. }
  26852. },
  26853. // 自定义布局
  26854. layouts: {
  26855. type: Array,
  26856. default: function _default() {
  26857. return conf.pager.layouts || ['PrevJump', 'PrevPage', 'Jump', 'PageCount', 'NextPage', 'NextJump', 'Sizes', 'Total'];
  26858. }
  26859. },
  26860. // 当前页
  26861. currentPage: {
  26862. type: Number,
  26863. default: 1
  26864. },
  26865. // 加载中
  26866. loading: Boolean,
  26867. // 每页大小
  26868. pageSize: {
  26869. type: Number,
  26870. default: function _default() {
  26871. return conf.pager.pageSize || 10;
  26872. }
  26873. },
  26874. // 总条数
  26875. total: {
  26876. type: Number,
  26877. default: 0
  26878. },
  26879. // 显示页码按钮的数量
  26880. pagerCount: {
  26881. type: Number,
  26882. default: function _default() {
  26883. return conf.pager.pagerCount || 7;
  26884. }
  26885. },
  26886. // 每页大小选项列表
  26887. pageSizes: {
  26888. type: Array,
  26889. default: function _default() {
  26890. return conf.pager.pageSizes || [10, 15, 20, 50, 100];
  26891. }
  26892. },
  26893. // 列对其方式
  26894. align: {
  26895. type: String,
  26896. default: function _default() {
  26897. return conf.pager.align;
  26898. }
  26899. },
  26900. // 带边框
  26901. border: {
  26902. type: Boolean,
  26903. default: function _default() {
  26904. return conf.pager.border;
  26905. }
  26906. },
  26907. // 带背景颜色
  26908. background: {
  26909. type: Boolean,
  26910. default: function _default() {
  26911. return conf.pager.background;
  26912. }
  26913. },
  26914. // 配套的样式
  26915. perfect: {
  26916. type: Boolean,
  26917. default: function _default() {
  26918. return conf.pager.perfect;
  26919. }
  26920. },
  26921. // 当只有一页时隐藏
  26922. autoHidden: {
  26923. type: Boolean,
  26924. default: function _default() {
  26925. return conf.pager.autoHidden;
  26926. }
  26927. },
  26928. transfer: {
  26929. type: Boolean,
  26930. default: function _default() {
  26931. return conf.pager.transfer;
  26932. }
  26933. },
  26934. // 自定义图标
  26935. iconPrevPage: String,
  26936. iconJumpPrev: String,
  26937. iconJumpNext: String,
  26938. iconNextPage: String,
  26939. iconJumpMore: String
  26940. },
  26941. inject: {
  26942. $xegrid: {
  26943. default: null
  26944. }
  26945. },
  26946. computed: {
  26947. isSizes: function isSizes() {
  26948. return this.layouts.some(function (name) {
  26949. return name === 'Sizes';
  26950. });
  26951. },
  26952. pageCount: function pageCount() {
  26953. return this.getPageCount(this.total, this.pageSize);
  26954. },
  26955. numList: function numList() {
  26956. var len = this.pageCount > this.pagerCount ? this.pagerCount - 2 : this.pagerCount;
  26957. var rest = [];
  26958. for (var index = 0; index < len; index++) {
  26959. rest.push(index);
  26960. }
  26961. return rest;
  26962. },
  26963. offsetNumber: function offsetNumber() {
  26964. return Math.floor((this.pagerCount - 2) / 2);
  26965. },
  26966. sizeList: function sizeList() {
  26967. return this.pageSizes.map(function (item) {
  26968. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNumber(item)) {
  26969. return {
  26970. value: item,
  26971. label: "".concat(conf.i18n('vxe.pager.pagesize', [item]))
  26972. };
  26973. }
  26974. return _objectSpread2({
  26975. value: '',
  26976. label: ''
  26977. }, item);
  26978. });
  26979. }
  26980. },
  26981. render: function render(h) {
  26982. var _this = this,
  26983. _ref;
  26984. var $scopedSlots = this.$scopedSlots,
  26985. $xegrid = this.$xegrid,
  26986. vSize = this.vSize,
  26987. align = this.align;
  26988. var childNodes = [];
  26989. if ($scopedSlots.left) {
  26990. childNodes.push(h('span', {
  26991. class: 'vxe-pager--left-wrapper'
  26992. }, $scopedSlots.left.call(this, {
  26993. $grid: $xegrid
  26994. })));
  26995. }
  26996. this.layouts.forEach(function (name) {
  26997. childNodes.push(_this["render".concat(name)](h));
  26998. });
  26999. if ($scopedSlots.right) {
  27000. childNodes.push(h('span', {
  27001. class: 'vxe-pager--right-wrapper'
  27002. }, $scopedSlots.right.call(this, {
  27003. $grid: $xegrid
  27004. })));
  27005. }
  27006. return h('div', {
  27007. 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)]
  27008. }, [h('div', {
  27009. class: 'vxe-pager--wrapper'
  27010. }, childNodes)]);
  27011. },
  27012. methods: {
  27013. // 上一页
  27014. renderPrevPage: function renderPrevPage(h) {
  27015. return h('button', {
  27016. class: ['vxe-pager--prev-btn', {
  27017. 'is--disabled': this.currentPage <= 1
  27018. }],
  27019. attrs: {
  27020. title: conf.i18n('vxe.pager.prevPage')
  27021. },
  27022. on: {
  27023. click: this.prevPage
  27024. }
  27025. }, [h('i', {
  27026. class: ['vxe-pager--btn-icon', this.iconPrevPage || conf.icon.PAGER_PREV_PAGE]
  27027. })]);
  27028. },
  27029. // 向上翻页
  27030. renderPrevJump: function renderPrevJump(h, tagName) {
  27031. return h(tagName || 'button', {
  27032. class: ['vxe-pager--jump-prev', {
  27033. 'is--fixed': !tagName,
  27034. 'is--disabled': this.currentPage <= 1
  27035. }],
  27036. attrs: {
  27037. title: conf.i18n('vxe.pager.prevJump')
  27038. },
  27039. on: {
  27040. click: this.prevJump
  27041. }
  27042. }, [tagName ? h('i', {
  27043. class: ['vxe-pager--jump-more-icon', this.iconJumpMore || conf.icon.PAGER_JUMP_MORE]
  27044. }) : null, h('i', {
  27045. class: ['vxe-pager--jump-icon', this.iconJumpPrev || conf.icon.PAGER_JUMP_PREV]
  27046. })]);
  27047. },
  27048. // number
  27049. renderNumber: function renderNumber(h) {
  27050. return h('span', {
  27051. class: 'vxe-pager--btn-wrapper'
  27052. }, this.renderPageBtn(h));
  27053. },
  27054. // jumpNumber
  27055. renderJumpNumber: function renderJumpNumber(h) {
  27056. return h('span', {
  27057. class: 'vxe-pager--btn-wrapper'
  27058. }, this.renderPageBtn(h, true));
  27059. },
  27060. // 向下翻页
  27061. renderNextJump: function renderNextJump(h, tagName) {
  27062. return h(tagName || 'button', {
  27063. class: ['vxe-pager--jump-next', {
  27064. 'is--fixed': !tagName,
  27065. 'is--disabled': this.currentPage >= this.pageCount
  27066. }],
  27067. attrs: {
  27068. title: conf.i18n('vxe.pager.nextJump')
  27069. },
  27070. on: {
  27071. click: this.nextJump
  27072. }
  27073. }, [tagName ? h('i', {
  27074. class: ['vxe-pager--jump-more-icon', this.iconJumpMore || conf.icon.PAGER_JUMP_MORE]
  27075. }) : null, h('i', {
  27076. class: ['vxe-pager--jump-icon', this.iconJumpNext || conf.icon.PAGER_JUMP_NEXT]
  27077. })]);
  27078. },
  27079. // 下一页
  27080. renderNextPage: function renderNextPage(h) {
  27081. return h('button', {
  27082. class: ['vxe-pager--next-btn', {
  27083. 'is--disabled': this.currentPage >= this.pageCount
  27084. }],
  27085. attrs: {
  27086. title: conf.i18n('vxe.pager.nextPage')
  27087. },
  27088. on: {
  27089. click: this.nextPage
  27090. }
  27091. }, [h('i', {
  27092. class: ['vxe-pager--btn-icon', this.iconNextPage || conf.icon.PAGER_NEXT_PAGE]
  27093. })]);
  27094. },
  27095. // sizes
  27096. renderSizes: function renderSizes(h) {
  27097. var _this2 = this;
  27098. return h('vxe-select', {
  27099. class: 'vxe-pager--sizes',
  27100. props: {
  27101. value: this.pageSize,
  27102. placement: 'top',
  27103. transfer: this.transfer,
  27104. options: this.sizeList
  27105. },
  27106. on: {
  27107. change: function change(_ref2) {
  27108. var value = _ref2.value;
  27109. _this2.pageSizeEvent(value);
  27110. }
  27111. }
  27112. });
  27113. },
  27114. // FullJump
  27115. renderFullJump: function renderFullJump(h) {
  27116. return this.renderJump(h, true);
  27117. },
  27118. // Jump
  27119. renderJump: function renderJump(h, isFull) {
  27120. return h('span', {
  27121. class: 'vxe-pager--jump'
  27122. }, [isFull ? h('span', {
  27123. class: 'vxe-pager--goto-text'
  27124. }, conf.i18n('vxe.pager.goto')) : null, h('input', {
  27125. class: 'vxe-pager--goto',
  27126. domProps: {
  27127. value: this.currentPage
  27128. },
  27129. attrs: {
  27130. type: 'text',
  27131. autocomplete: 'off'
  27132. },
  27133. on: {
  27134. keydown: this.jumpKeydownEvent,
  27135. blur: this.triggerJumpEvent
  27136. }
  27137. }), isFull ? h('span', {
  27138. class: 'vxe-pager--classifier-text'
  27139. }, conf.i18n('vxe.pager.pageClassifier')) : null]);
  27140. },
  27141. // PageCount
  27142. renderPageCount: function renderPageCount(h) {
  27143. return h('span', {
  27144. class: 'vxe-pager--count'
  27145. }, [h('span', {
  27146. class: 'vxe-pager--separator'
  27147. }), h('span', this.pageCount)]);
  27148. },
  27149. // total
  27150. renderTotal: function renderTotal(h) {
  27151. return h('span', {
  27152. class: 'vxe-pager--total'
  27153. }, conf.i18n('vxe.pager.total', [this.total]));
  27154. },
  27155. // number
  27156. renderPageBtn: function renderPageBtn(h, showJump) {
  27157. var _this3 = this;
  27158. var numList = this.numList,
  27159. currentPage = this.currentPage,
  27160. pageCount = this.pageCount,
  27161. pagerCount = this.pagerCount,
  27162. offsetNumber = this.offsetNumber;
  27163. var nums = [];
  27164. var isOv = pageCount > pagerCount;
  27165. var isLt = isOv && currentPage > offsetNumber + 1;
  27166. var isGt = isOv && currentPage < pageCount - offsetNumber;
  27167. var startNumber = 1;
  27168. if (isOv) {
  27169. if (currentPage >= pageCount - offsetNumber) {
  27170. startNumber = Math.max(pageCount - numList.length + 1, 1);
  27171. } else {
  27172. startNumber = Math.max(currentPage - offsetNumber, 1);
  27173. }
  27174. }
  27175. if (showJump && isLt) {
  27176. nums.push(h('button', {
  27177. class: 'vxe-pager--num-btn',
  27178. on: {
  27179. click: function click() {
  27180. return _this3.jumpPage(1);
  27181. }
  27182. }
  27183. }, 1), this.renderPrevJump(h, 'span'));
  27184. }
  27185. numList.forEach(function (item, index) {
  27186. var number = startNumber + index;
  27187. if (number <= pageCount) {
  27188. nums.push(h('button', {
  27189. class: ['vxe-pager--num-btn', {
  27190. 'is--active': currentPage === number
  27191. }],
  27192. on: {
  27193. click: function click() {
  27194. return _this3.jumpPage(number);
  27195. }
  27196. },
  27197. key: number
  27198. }, number));
  27199. }
  27200. });
  27201. if (showJump && isGt) {
  27202. nums.push(this.renderNextJump(h, 'button'), h('button', {
  27203. class: 'vxe-pager--num-btn',
  27204. on: {
  27205. click: function click() {
  27206. return _this3.jumpPage(pageCount);
  27207. }
  27208. }
  27209. }, pageCount));
  27210. }
  27211. return nums;
  27212. },
  27213. getPageCount: function getPageCount(total, size) {
  27214. return Math.max(Math.ceil(total / size), 1);
  27215. },
  27216. prevPage: function prevPage() {
  27217. var currentPage = this.currentPage,
  27218. pageCount = this.pageCount;
  27219. if (currentPage > 1) {
  27220. this.jumpPage(Math.min(pageCount, Math.max(currentPage - 1, 1)));
  27221. }
  27222. },
  27223. nextPage: function nextPage() {
  27224. var currentPage = this.currentPage,
  27225. pageCount = this.pageCount;
  27226. if (currentPage < pageCount) {
  27227. this.jumpPage(Math.min(pageCount, currentPage + 1));
  27228. }
  27229. },
  27230. prevJump: function prevJump() {
  27231. this.jumpPage(Math.max(this.currentPage - this.numList.length, 1));
  27232. },
  27233. nextJump: function nextJump() {
  27234. this.jumpPage(Math.min(this.currentPage + this.numList.length, this.pageCount));
  27235. },
  27236. jumpPage: function jumpPage(currentPage) {
  27237. if (currentPage !== this.currentPage) {
  27238. this.$emit('update:currentPage', currentPage);
  27239. this.$emit('page-change', {
  27240. type: 'current',
  27241. pageSize: this.pageSize,
  27242. currentPage: currentPage
  27243. });
  27244. }
  27245. },
  27246. pageSizeEvent: function pageSizeEvent(pageSize) {
  27247. this.changePageSize(pageSize);
  27248. },
  27249. changePageSize: function changePageSize(pageSize) {
  27250. if (pageSize !== this.pageSize) {
  27251. this.$emit('update:pageSize', pageSize);
  27252. this.$emit('page-change', {
  27253. type: 'size',
  27254. pageSize: pageSize,
  27255. currentPage: Math.min(this.currentPage, this.getPageCount(this.total, pageSize))
  27256. });
  27257. }
  27258. },
  27259. jumpKeydownEvent: function jumpKeydownEvent(evnt) {
  27260. if (evnt.keyCode === 13) {
  27261. this.triggerJumpEvent(evnt);
  27262. } else if (evnt.keyCode === 38) {
  27263. evnt.preventDefault();
  27264. this.nextPage();
  27265. } else if (evnt.keyCode === 40) {
  27266. evnt.preventDefault();
  27267. this.prevPage();
  27268. }
  27269. },
  27270. triggerJumpEvent: function triggerJumpEvent(evnt) {
  27271. var value = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(evnt.target.value);
  27272. var current = value <= 0 ? 1 : value >= this.pageCount ? this.pageCount : value;
  27273. evnt.target.value = current;
  27274. this.jumpPage(current);
  27275. }
  27276. }
  27277. });
  27278. // CONCATENATED MODULE: ./packages/pager/index.js
  27279. var Pager = Object.assign(pager, {
  27280. install: function install(Vue) {
  27281. Vue.component(pager.name, pager);
  27282. }
  27283. });
  27284. /* harmony default export */ var packages_pager = (Pager);
  27285. // CONCATENATED MODULE: ./packages/checkbox/index.js
  27286. var Checkbox = Object.assign(src_checkbox, {
  27287. install: function install(Vue) {
  27288. Vue.component(src_checkbox.name, src_checkbox);
  27289. }
  27290. });
  27291. /* harmony default export */ var packages_checkbox = (Checkbox);
  27292. // CONCATENATED MODULE: ./packages/checkbox/src/group.js
  27293. /* harmony default export */ var checkbox_src_group = ({
  27294. name: 'VxeCheckboxGroup',
  27295. props: {
  27296. value: Array,
  27297. disabled: Boolean,
  27298. size: {
  27299. type: String,
  27300. default: function _default() {
  27301. return conf.checkbox.size || conf.size;
  27302. }
  27303. }
  27304. },
  27305. provide: function provide() {
  27306. return {
  27307. $xecheckboxgroup: this
  27308. };
  27309. },
  27310. computed: {
  27311. vSize: function vSize() {
  27312. return this.size || this.$parent.size || this.$parent.vSize;
  27313. }
  27314. },
  27315. render: function render(h) {
  27316. var $scopedSlots = this.$scopedSlots;
  27317. return h('div', {
  27318. class: 'vxe-checkbox-group'
  27319. }, $scopedSlots.default ? $scopedSlots.default.call(this, {}) : []);
  27320. },
  27321. methods: {
  27322. handleChecked: function handleChecked(params) {
  27323. var checked = params.checked,
  27324. label = params.label;
  27325. var checklist = this.value || [];
  27326. var checkIndex = checklist.indexOf(label);
  27327. if (checked) {
  27328. if (checkIndex === -1) {
  27329. checklist.push(label);
  27330. }
  27331. } else {
  27332. checklist.splice(checkIndex, 1);
  27333. }
  27334. this.$emit('input', checklist);
  27335. this.$emit('change', Object.assign({
  27336. checklist: checklist
  27337. }, params));
  27338. }
  27339. }
  27340. });
  27341. // CONCATENATED MODULE: ./packages/checkbox-group/index.js
  27342. var CheckboxGroup = Object.assign(checkbox_src_group, {
  27343. install: function install(Vue) {
  27344. Vue.component(checkbox_src_group.name, checkbox_src_group);
  27345. }
  27346. });
  27347. /* harmony default export */ var checkbox_group = (CheckboxGroup);
  27348. // CONCATENATED MODULE: ./packages/radio/index.js
  27349. var Radio = Object.assign(src_radio, {
  27350. install: function install(Vue) {
  27351. Vue.component(src_radio.name, src_radio);
  27352. }
  27353. });
  27354. /* harmony default export */ var packages_radio = (Radio);
  27355. // CONCATENATED MODULE: ./packages/radio/src/group.js
  27356. /* harmony default export */ var radio_src_group = ({
  27357. name: 'VxeRadioGroup',
  27358. props: {
  27359. value: [String, Number, Boolean],
  27360. disabled: Boolean,
  27361. size: {
  27362. type: String,
  27363. default: function _default() {
  27364. return conf.radio.size || conf.size;
  27365. }
  27366. }
  27367. },
  27368. provide: function provide() {
  27369. return {
  27370. $xeradiogroup: this
  27371. };
  27372. },
  27373. computed: {
  27374. vSize: function vSize() {
  27375. return this.size || this.$parent.size || this.$parent.vSize;
  27376. }
  27377. },
  27378. data: function data() {
  27379. return {
  27380. name: external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.uniqueId('xegroup_')
  27381. };
  27382. },
  27383. render: function render(h) {
  27384. var $scopedSlots = this.$scopedSlots;
  27385. return h('div', {
  27386. class: 'vxe-radio-group'
  27387. }, $scopedSlots.default ? $scopedSlots.default.call(this, {}) : []);
  27388. },
  27389. methods: {
  27390. handleChecked: function handleChecked(params) {
  27391. this.$emit('input', params.label);
  27392. this.$emit('change', params);
  27393. }
  27394. }
  27395. });
  27396. // CONCATENATED MODULE: ./packages/radio-group/index.js
  27397. var RadioGroup = Object.assign(radio_src_group, {
  27398. install: function install(Vue) {
  27399. Vue.component(radio_src_group.name, radio_src_group);
  27400. }
  27401. });
  27402. /* harmony default export */ var radio_group = (RadioGroup);
  27403. // CONCATENATED MODULE: ./packages/radio/src/button.js
  27404. /* harmony default export */ var src_button = ({
  27405. name: 'VxeRadioButton',
  27406. props: {
  27407. value: [String, Number, Boolean],
  27408. label: [String, Number, Boolean],
  27409. title: [String, Number],
  27410. content: [String, Number],
  27411. disabled: Boolean,
  27412. size: {
  27413. type: String,
  27414. default: function _default() {
  27415. return conf.radio.size || conf.size;
  27416. }
  27417. }
  27418. },
  27419. inject: {
  27420. $xeradiogroup: {
  27421. default: null
  27422. }
  27423. },
  27424. computed: {
  27425. vSize: function vSize() {
  27426. return this.size || this.$parent.size || this.$parent.vSize;
  27427. },
  27428. isDisabled: function isDisabled() {
  27429. var $xeradiogroup = this.$xeradiogroup;
  27430. return this.disabled || $xeradiogroup && $xeradiogroup.disabled;
  27431. }
  27432. },
  27433. render: function render(h) {
  27434. var _ref;
  27435. var $scopedSlots = this.$scopedSlots,
  27436. $xeradiogroup = this.$xeradiogroup,
  27437. isDisabled = this.isDisabled,
  27438. title = this.title,
  27439. vSize = this.vSize,
  27440. value = this.value,
  27441. label = this.label,
  27442. content = this.content;
  27443. var attrs = {};
  27444. if (title) {
  27445. attrs.title = title;
  27446. }
  27447. return h('label', {
  27448. class: ['vxe-radio', 'vxe-radio-button', (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, 'is--disabled', isDisabled), _ref)],
  27449. attrs: attrs
  27450. }, [h('input', {
  27451. class: 'vxe-radio--input',
  27452. attrs: {
  27453. type: 'radio',
  27454. name: $xeradiogroup ? $xeradiogroup.name : null,
  27455. disabled: isDisabled
  27456. },
  27457. domProps: {
  27458. checked: $xeradiogroup ? $xeradiogroup.value === label : value === label
  27459. },
  27460. on: {
  27461. change: this.changeEvent
  27462. }
  27463. }), h('span', {
  27464. class: 'vxe-radio--label'
  27465. }, $scopedSlots.default ? $scopedSlots.default.call(this, {}) : [UtilTools.getFuncText(content)])]);
  27466. },
  27467. methods: {
  27468. changeEvent: function changeEvent(evnt) {
  27469. var $xeradiogroup = this.$xeradiogroup,
  27470. isDisabled = this.isDisabled,
  27471. label = this.label;
  27472. if (!isDisabled) {
  27473. var params = {
  27474. label: label,
  27475. $event: evnt
  27476. };
  27477. if ($xeradiogroup) {
  27478. $xeradiogroup.handleChecked(params);
  27479. } else {
  27480. this.$emit('input', label);
  27481. this.$emit('change', params);
  27482. }
  27483. }
  27484. }
  27485. }
  27486. });
  27487. // CONCATENATED MODULE: ./packages/radio-button/index.js
  27488. var RadioButton = Object.assign(src_button, {
  27489. install: function install(Vue) {
  27490. Vue.component(src_button.name, src_button);
  27491. }
  27492. });
  27493. /* harmony default export */ var radio_button = (RadioButton);
  27494. // CONCATENATED MODULE: ./packages/input/index.js
  27495. var Input = Object.assign(input, {
  27496. install: function install(Vue) {
  27497. Vue.component(input.name, input);
  27498. }
  27499. });
  27500. /* harmony default export */ var packages_input = (Input);
  27501. // CONCATENATED MODULE: ./packages/textarea/src/textarea.js
  27502. var autoTxtElem;
  27503. /* harmony default export */ var src_textarea = ({
  27504. name: 'VxeTextarea',
  27505. mixins: [size],
  27506. model: {
  27507. prop: 'value',
  27508. event: 'modelValue'
  27509. },
  27510. props: {
  27511. value: [String, Number],
  27512. immediate: {
  27513. type: Boolean,
  27514. default: true
  27515. },
  27516. name: String,
  27517. readonly: Boolean,
  27518. disabled: Boolean,
  27519. placeholder: String,
  27520. maxlength: [String, Number],
  27521. rows: {
  27522. type: [String, Number],
  27523. default: 2
  27524. },
  27525. showWordCount: Boolean,
  27526. autosize: [Boolean, Object],
  27527. form: String,
  27528. resize: {
  27529. type: String,
  27530. default: function _default() {
  27531. return conf.textarea.resize;
  27532. }
  27533. },
  27534. size: {
  27535. type: String,
  27536. default: function _default() {
  27537. return conf.textarea.size || conf.size;
  27538. }
  27539. }
  27540. },
  27541. data: function data() {
  27542. return {
  27543. inputValue: this.value
  27544. };
  27545. },
  27546. computed: {
  27547. inputCount: function inputCount() {
  27548. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getSize(this.inputValue);
  27549. },
  27550. isCountError: function isCountError() {
  27551. return this.maxlength && this.inputCount > external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(this.maxlength);
  27552. },
  27553. defaultEvents: function defaultEvents() {
  27554. var _this = this;
  27555. var evnts = {};
  27556. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.each(this.$listeners, function (cb, name) {
  27557. if (['input', 'change', 'blur'].indexOf(name) === -1) {
  27558. evnts[name] = _this.triggerEvent;
  27559. }
  27560. });
  27561. evnts.input = this.inputEvent;
  27562. evnts.change = this.changeEvent;
  27563. evnts.blur = this.blurEvent;
  27564. return evnts;
  27565. },
  27566. sizeOpts: function sizeOpts() {
  27567. return Object.assign({
  27568. minRows: 1,
  27569. maxRows: 10
  27570. }, conf.textarea.autosize, this.autosize);
  27571. }
  27572. },
  27573. watch: {
  27574. value: function value(val) {
  27575. this.inputValue = val;
  27576. this.updateAutoTxt();
  27577. }
  27578. },
  27579. mounted: function mounted() {
  27580. var autosize = this.autosize;
  27581. if (autosize) {
  27582. this.updateAutoTxt();
  27583. this.handleResize();
  27584. }
  27585. },
  27586. render: function render(h) {
  27587. var _ref;
  27588. var defaultEvents = this.defaultEvents,
  27589. inputValue = this.inputValue,
  27590. vSize = this.vSize,
  27591. name = this.name,
  27592. form = this.form,
  27593. resize = this.resize,
  27594. placeholder = this.placeholder,
  27595. readonly = this.readonly,
  27596. disabled = this.disabled,
  27597. maxlength = this.maxlength,
  27598. autosize = this.autosize,
  27599. showWordCount = this.showWordCount;
  27600. var attrs = {
  27601. name: name,
  27602. form: form,
  27603. placeholder: placeholder,
  27604. maxlength: maxlength,
  27605. readonly: readonly,
  27606. disabled: disabled
  27607. };
  27608. if (placeholder) {
  27609. attrs.placeholder = UtilTools.getFuncText(placeholder);
  27610. }
  27611. return h('div', {
  27612. class: ['vxe-textarea', (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, 'is--autosize', autosize), _defineProperty(_ref, 'is--disabled', disabled), _ref)]
  27613. }, [h('textarea', {
  27614. ref: 'textarea',
  27615. class: 'vxe-textarea--inner',
  27616. domProps: {
  27617. value: inputValue
  27618. },
  27619. attrs: attrs,
  27620. style: resize ? {
  27621. resize: resize
  27622. } : null,
  27623. on: defaultEvents
  27624. }), showWordCount ? h('span', {
  27625. class: ['vxe-textarea--count', {
  27626. 'is--error': this.isCountError
  27627. }]
  27628. }, "".concat(this.inputCount).concat(maxlength ? "/".concat(maxlength) : '')) : null]);
  27629. },
  27630. methods: {
  27631. focus: function focus() {
  27632. this.$refs.textarea.focus();
  27633. return this.$nextTick();
  27634. },
  27635. blur: function blur() {
  27636. this.$refs.textarea.blur();
  27637. return this.$nextTick();
  27638. },
  27639. triggerEvent: function triggerEvent(evnt) {
  27640. var inputValue = this.inputValue;
  27641. this.$emit(evnt.type, {
  27642. value: inputValue,
  27643. $event: evnt
  27644. });
  27645. },
  27646. emitUpdate: function emitUpdate(value, evnt) {
  27647. this.inputValue = value;
  27648. this.$emit('modelValue', value);
  27649. if (this.value !== value) {
  27650. this.$emit('change', {
  27651. value: value,
  27652. $event: evnt
  27653. });
  27654. }
  27655. },
  27656. inputEvent: function inputEvent(evnt) {
  27657. var immediate = this.immediate;
  27658. var value = evnt.target.value;
  27659. this.inputValue = value;
  27660. if (immediate) {
  27661. this.emitUpdate(value, evnt);
  27662. }
  27663. this.handleResize();
  27664. this.triggerEvent(evnt);
  27665. },
  27666. changeEvent: function changeEvent(evnt) {
  27667. var immediate = this.immediate;
  27668. if (immediate) {
  27669. this.triggerEvent(evnt);
  27670. } else {
  27671. this.emitUpdate(this.inputValue, evnt);
  27672. }
  27673. },
  27674. blurEvent: function blurEvent(evnt) {
  27675. var inputValue = this.inputValue,
  27676. immediate = this.immediate;
  27677. if (!immediate) {
  27678. this.emitUpdate(inputValue, evnt);
  27679. }
  27680. this.$emit('blur', {
  27681. value: inputValue,
  27682. $event: evnt
  27683. });
  27684. },
  27685. updateAutoTxt: function updateAutoTxt() {
  27686. var $refs = this.$refs,
  27687. inputValue = this.inputValue,
  27688. size = this.size,
  27689. autosize = this.autosize;
  27690. if (autosize) {
  27691. if (!autoTxtElem) {
  27692. autoTxtElem = document.createElement('div');
  27693. }
  27694. if (!autoTxtElem.parentNode) {
  27695. document.body.appendChild(autoTxtElem);
  27696. }
  27697. var textElem = $refs.textarea;
  27698. var textStyle = getComputedStyle(textElem);
  27699. autoTxtElem.className = ['vxe-textarea--autosize', size ? "size--".concat(size) : ''].join(' ');
  27700. autoTxtElem.style.width = "".concat(textElem.clientWidth, "px");
  27701. autoTxtElem.style.padding = textStyle.padding;
  27702. autoTxtElem.innerHTML = ('' + (inputValue || ' ')).replace(/\n$/, '\n ');
  27703. }
  27704. },
  27705. handleResize: function handleResize() {
  27706. var _this2 = this;
  27707. if (this.autosize) {
  27708. this.$nextTick(function () {
  27709. var $refs = _this2.$refs,
  27710. sizeOpts = _this2.sizeOpts;
  27711. var minRows = sizeOpts.minRows,
  27712. maxRows = sizeOpts.maxRows;
  27713. var textElem = $refs.textarea;
  27714. var sizeHeight = autoTxtElem.clientHeight;
  27715. var textStyle = getComputedStyle(textElem);
  27716. var lineHeight = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(textStyle.lineHeight);
  27717. var paddingTop = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(textStyle.paddingTop);
  27718. var paddingBottom = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(textStyle.paddingBottom);
  27719. var borderTopWidth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(textStyle.borderTopWidth);
  27720. var borderBottomWidth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(textStyle.borderBottomWidth);
  27721. var intervalHeight = paddingTop + paddingBottom + borderTopWidth + borderBottomWidth;
  27722. var rowNum = (sizeHeight - intervalHeight) / lineHeight;
  27723. var textRows = rowNum && /[0-9]/.test(rowNum) ? rowNum : Math.floor(rowNum) + 1;
  27724. var vaildRows = textRows;
  27725. if (textRows < minRows) {
  27726. vaildRows = minRows;
  27727. } else if (textRows > maxRows) {
  27728. vaildRows = maxRows;
  27729. }
  27730. textElem.style.height = "".concat(vaildRows * lineHeight + intervalHeight, "px");
  27731. });
  27732. }
  27733. }
  27734. }
  27735. });
  27736. // CONCATENATED MODULE: ./packages/textarea/index.js
  27737. var Textarea = Object.assign(src_textarea, {
  27738. install: function install(Vue) {
  27739. Vue.component(src_textarea.name, src_textarea);
  27740. }
  27741. });
  27742. /* harmony default export */ var packages_textarea = (Textarea);
  27743. // CONCATENATED MODULE: ./packages/button/src/button.js
  27744. /* harmony default export */ var button_src_button = ({
  27745. name: 'VxeButton',
  27746. mixins: [size],
  27747. props: {
  27748. type: String,
  27749. size: {
  27750. type: String,
  27751. default: function _default() {
  27752. return conf.button.size || conf.size;
  27753. }
  27754. },
  27755. name: [String, Number],
  27756. content: String,
  27757. placement: String,
  27758. status: String,
  27759. icon: String,
  27760. round: Boolean,
  27761. circle: Boolean,
  27762. disabled: Boolean,
  27763. loading: Boolean,
  27764. destroyOnClose: Boolean,
  27765. transfer: {
  27766. type: Boolean,
  27767. default: function _default() {
  27768. return conf.button.transfer;
  27769. }
  27770. }
  27771. },
  27772. data: function data() {
  27773. return {
  27774. inited: false,
  27775. showPanel: false,
  27776. animatVisible: false,
  27777. panelIndex: 0,
  27778. panelStyle: null,
  27779. panelPlacement: null
  27780. };
  27781. },
  27782. computed: {
  27783. isText: function isText() {
  27784. return this.type === 'text';
  27785. },
  27786. isFormBtn: function isFormBtn() {
  27787. return ['submit', 'reset', 'button'].indexOf(this.type) > -1;
  27788. },
  27789. btnType: function btnType() {
  27790. return this.isText ? this.type : 'button';
  27791. }
  27792. },
  27793. created: function created() {
  27794. GlobalEvent.on(this, 'mousewheel', this.handleGlobalMousewheelEvent);
  27795. },
  27796. beforeDestroy: function beforeDestroy() {
  27797. var panelElem = this.$refs.panel;
  27798. if (panelElem && panelElem.parentNode) {
  27799. panelElem.parentNode.removeChild(panelElem);
  27800. }
  27801. },
  27802. destroyed: function destroyed() {
  27803. GlobalEvent.off(this, 'mousewheel');
  27804. },
  27805. render: function render(h) {
  27806. var _ref,
  27807. _ref2,
  27808. _this = this,
  27809. _ref3,
  27810. _ref4;
  27811. var $scopedSlots = this.$scopedSlots,
  27812. $listeners = this.$listeners,
  27813. inited = this.inited,
  27814. type = this.type,
  27815. destroyOnClose = this.destroyOnClose,
  27816. isFormBtn = this.isFormBtn,
  27817. status = this.status,
  27818. btnType = this.btnType,
  27819. vSize = this.vSize,
  27820. name = this.name,
  27821. disabled = this.disabled,
  27822. loading = this.loading,
  27823. showPanel = this.showPanel,
  27824. animatVisible = this.animatVisible,
  27825. panelPlacement = this.panelPlacement;
  27826. var downsSlot = $scopedSlots.dropdowns;
  27827. return downsSlot ? h('div', {
  27828. class: ['vxe-button--dropdown', (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, 'is--active', showPanel), _ref)]
  27829. }, [h('button', {
  27830. ref: 'xBtn',
  27831. class: ['vxe-button', "type--".concat(btnType), (_ref2 = {}, _defineProperty(_ref2, "size--".concat(vSize), vSize), _defineProperty(_ref2, "theme--".concat(status), status), _defineProperty(_ref2, 'is--round', this.round), _defineProperty(_ref2, 'is--circle', this.circle), _defineProperty(_ref2, 'is--disabled', disabled || loading), _defineProperty(_ref2, 'is--loading', loading), _ref2)],
  27832. attrs: {
  27833. name: name,
  27834. type: isFormBtn ? type : 'button',
  27835. disabled: disabled || loading
  27836. },
  27837. on: Object.assign({
  27838. mouseenter: this.mouseenterTargetEvent,
  27839. mouseleave: this.mouseleaveEvent
  27840. }, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.objectMap($listeners, function (cb, type) {
  27841. return function (evnt) {
  27842. return _this.$emit(type, {
  27843. $event: evnt
  27844. });
  27845. };
  27846. }))
  27847. }, this.renderContent(h).concat([h('i', {
  27848. class: "vxe-button--dropdown-arrow ".concat(conf.icon.BUTTON_DROPDOWN)
  27849. })])), h('div', {
  27850. ref: 'panel',
  27851. class: ['vxe-button--dropdown-panel', (_ref3 = {}, _defineProperty(_ref3, "size--".concat(vSize), vSize), _defineProperty(_ref3, 'animat--leave', animatVisible), _defineProperty(_ref3, 'animat--enter', showPanel), _ref3)],
  27852. attrs: {
  27853. placement: panelPlacement
  27854. },
  27855. style: this.panelStyle
  27856. }, inited ? [h('div', {
  27857. class: 'vxe-button--dropdown-wrapper',
  27858. on: {
  27859. click: this.clickDropdownEvent,
  27860. mouseenter: this.mouseenterEvent,
  27861. mouseleave: this.mouseleaveEvent
  27862. }
  27863. }, destroyOnClose && !showPanel ? [] : downsSlot.call(this, {}, h))] : null)]) : h('button', {
  27864. ref: 'xBtn',
  27865. class: ['vxe-button', "type--".concat(btnType), (_ref4 = {}, _defineProperty(_ref4, "size--".concat(vSize), vSize), _defineProperty(_ref4, "theme--".concat(status), status), _defineProperty(_ref4, 'is--round', this.round), _defineProperty(_ref4, 'is--circle', this.circle), _defineProperty(_ref4, 'is--disabled', disabled || loading), _defineProperty(_ref4, 'is--loading', loading), _ref4)],
  27866. attrs: {
  27867. name: name,
  27868. type: isFormBtn ? type : 'button',
  27869. disabled: disabled || loading
  27870. },
  27871. on: external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.objectMap($listeners, function (cb, type) {
  27872. return function (evnt) {
  27873. return _this.$emit(type, {
  27874. $event: evnt
  27875. });
  27876. };
  27877. })
  27878. }, this.renderContent(h));
  27879. },
  27880. methods: {
  27881. renderContent: function renderContent(h) {
  27882. var $scopedSlots = this.$scopedSlots,
  27883. content = this.content,
  27884. icon = this.icon,
  27885. loading = this.loading;
  27886. var contents = [];
  27887. if (loading) {
  27888. contents.push(h('i', {
  27889. class: ['vxe-button--loading-icon', conf.icon.BUTTON_LOADING]
  27890. }));
  27891. } else if (icon) {
  27892. contents.push(h('i', {
  27893. class: ['vxe-button--icon', icon]
  27894. }));
  27895. }
  27896. if ($scopedSlots.default) {
  27897. contents.push(h('span', {
  27898. class: 'vxe-button--content'
  27899. }, $scopedSlots.default.call(this)));
  27900. } else if (content) {
  27901. contents.push(h('span', {
  27902. class: 'vxe-button--content'
  27903. }, [UtilTools.getFuncText(content)]));
  27904. }
  27905. return contents;
  27906. },
  27907. handleGlobalMousewheelEvent: function handleGlobalMousewheelEvent(evnt) {
  27908. if (this.showPanel && !DomTools.getEventTargetNode(evnt, this.$refs.panel).flag) {
  27909. this.closePanel();
  27910. }
  27911. },
  27912. updateZindex: function updateZindex() {
  27913. if (this.panelIndex < UtilTools.getLastZIndex()) {
  27914. this.panelIndex = UtilTools.nextZIndex();
  27915. }
  27916. },
  27917. clickDropdownEvent: function clickDropdownEvent(evnt) {
  27918. var _this2 = this;
  27919. var dropdownElem = evnt.currentTarget;
  27920. var panelElem = this.$refs.panel;
  27921. var _DomTools$getEventTar = DomTools.getEventTargetNode(evnt, dropdownElem, 'vxe-button'),
  27922. flag = _DomTools$getEventTar.flag,
  27923. targetElem = _DomTools$getEventTar.targetElem;
  27924. if (flag) {
  27925. if (panelElem) {
  27926. panelElem.dataset.active = 'N';
  27927. }
  27928. this.showPanel = false;
  27929. setTimeout(function () {
  27930. if (!panelElem || panelElem.dataset.active !== 'Y') {
  27931. _this2.animatVisible = false;
  27932. }
  27933. }, 350);
  27934. this.$emit('dropdown-click', {
  27935. name: targetElem.getAttribute('name'),
  27936. $event: evnt
  27937. });
  27938. }
  27939. },
  27940. mouseenterTargetEvent: function mouseenterTargetEvent() {
  27941. var _this3 = this;
  27942. var panelElem = this.$refs.panel;
  27943. panelElem.dataset.active = 'Y';
  27944. if (!this.inited) {
  27945. this.inited = true;
  27946. if (this.transfer) {
  27947. document.body.appendChild(panelElem);
  27948. }
  27949. }
  27950. this.showTime = setTimeout(function () {
  27951. if (panelElem.dataset.active === 'Y') {
  27952. _this3.mouseenterEvent();
  27953. } else {
  27954. _this3.animatVisible = false;
  27955. }
  27956. }, 250);
  27957. },
  27958. mouseenterEvent: function mouseenterEvent() {
  27959. var _this4 = this;
  27960. var panelElem = this.$refs.panel;
  27961. panelElem.dataset.active = 'Y';
  27962. this.animatVisible = true;
  27963. setTimeout(function () {
  27964. if (panelElem.dataset.active === 'Y') {
  27965. _this4.showPanel = true;
  27966. _this4.updateZindex();
  27967. _this4.updatePlacement();
  27968. setTimeout(function () {
  27969. if (_this4.showPanel) {
  27970. _this4.updatePlacement();
  27971. }
  27972. }, 50);
  27973. }
  27974. }, 20);
  27975. },
  27976. mouseleaveEvent: function mouseleaveEvent() {
  27977. this.closePanel();
  27978. },
  27979. closePanel: function closePanel() {
  27980. var _this5 = this;
  27981. var panelElem = this.$refs.panel;
  27982. clearTimeout(this.showTime);
  27983. if (panelElem) {
  27984. panelElem.dataset.active = 'N';
  27985. setTimeout(function () {
  27986. if (panelElem.dataset.active !== 'Y') {
  27987. _this5.showPanel = false;
  27988. setTimeout(function () {
  27989. if (panelElem.dataset.active !== 'Y') {
  27990. _this5.animatVisible = false;
  27991. }
  27992. }, 350);
  27993. }
  27994. }, 100);
  27995. } else {
  27996. this.animatVisible = false;
  27997. this.showPanel = false;
  27998. }
  27999. },
  28000. updatePlacement: function updatePlacement() {
  28001. var _this6 = this;
  28002. return this.$nextTick().then(function () {
  28003. var $refs = _this6.$refs,
  28004. transfer = _this6.transfer,
  28005. placement = _this6.placement,
  28006. panelIndex = _this6.panelIndex;
  28007. var targetElem = $refs.xBtn;
  28008. var panelElem = $refs.panel;
  28009. if (panelElem && targetElem) {
  28010. var targetHeight = targetElem.offsetHeight;
  28011. var targetWidth = targetElem.offsetWidth;
  28012. var panelHeight = panelElem.offsetHeight;
  28013. var panelWidth = panelElem.offsetWidth;
  28014. var marginSize = 5;
  28015. var panelStyle = {
  28016. zIndex: panelIndex
  28017. };
  28018. var _DomTools$getAbsolute = DomTools.getAbsolutePos(targetElem),
  28019. boundingTop = _DomTools$getAbsolute.boundingTop,
  28020. boundingLeft = _DomTools$getAbsolute.boundingLeft,
  28021. visibleHeight = _DomTools$getAbsolute.visibleHeight,
  28022. visibleWidth = _DomTools$getAbsolute.visibleWidth;
  28023. var panelPlacement = 'bottom';
  28024. if (transfer) {
  28025. var left = boundingLeft + targetWidth - panelWidth;
  28026. var top = boundingTop + targetHeight;
  28027. if (placement === 'top') {
  28028. panelPlacement = 'top';
  28029. top = boundingTop - panelHeight;
  28030. } else if (!placement) {
  28031. // 如果下面不够放,则向上
  28032. if (top + panelHeight + marginSize > visibleHeight) {
  28033. panelPlacement = 'top';
  28034. top = boundingTop - panelHeight;
  28035. } // 如果上面不够放,则向下(优先)
  28036. if (top < marginSize) {
  28037. panelPlacement = 'bottom';
  28038. top = boundingTop + targetHeight;
  28039. }
  28040. } // 如果溢出右边
  28041. if (left + panelWidth + marginSize > visibleWidth) {
  28042. left -= left + panelWidth + marginSize - visibleWidth;
  28043. } // 如果溢出左边
  28044. if (left < marginSize) {
  28045. left = marginSize;
  28046. }
  28047. Object.assign(panelStyle, {
  28048. left: "".concat(left, "px"),
  28049. right: 'auto',
  28050. top: "".concat(top, "px"),
  28051. minWidth: "".concat(targetWidth, "px")
  28052. });
  28053. } else {
  28054. if (placement === 'top') {
  28055. panelPlacement = 'top';
  28056. panelStyle.bottom = "".concat(targetHeight, "px");
  28057. } else if (!placement) {
  28058. // 如果下面不够放,则向上
  28059. if (boundingTop + targetHeight + panelHeight > visibleHeight) {
  28060. // 如果上面不够放,则向下(优先)
  28061. if (boundingTop - targetHeight - panelHeight > marginSize) {
  28062. panelPlacement = 'top';
  28063. panelStyle.bottom = "".concat(targetHeight, "px");
  28064. }
  28065. }
  28066. }
  28067. }
  28068. _this6.panelStyle = panelStyle;
  28069. _this6.panelPlacement = panelPlacement;
  28070. return _this6.$nextTick();
  28071. }
  28072. });
  28073. },
  28074. focus: function focus() {
  28075. this.$el.focus();
  28076. return this.$nextTick();
  28077. },
  28078. blur: function blur() {
  28079. this.$el.blur();
  28080. return this.$nextTick();
  28081. }
  28082. }
  28083. });
  28084. // CONCATENATED MODULE: ./packages/button/index.js
  28085. var Button = Object.assign(button_src_button, {
  28086. install: function install(Vue) {
  28087. Vue.component(button_src_button.name, button_src_button);
  28088. }
  28089. });
  28090. /* harmony default export */ var packages_button = (Button);
  28091. // CONCATENATED MODULE: ./packages/modal/index.js
  28092. /* eslint-disable @typescript-eslint/no-use-before-define */
  28093. var ModalClass = null;
  28094. function openModal(opts) {
  28095. var options = Object.assign({}, opts, {
  28096. transfer: true
  28097. });
  28098. return new Promise(function (resolve) {
  28099. if (options && options.id && allActivedModals.some(function (comp) {
  28100. return comp.id === options.id;
  28101. })) {
  28102. resolve('exist');
  28103. } else {
  28104. var events = options.events || {};
  28105. options.events = Object.assign({}, events, {
  28106. hide: function hide(params) {
  28107. if (events.hide) {
  28108. events.hide.call(this, params);
  28109. }
  28110. setTimeout(function () {
  28111. return $modal.$destroy();
  28112. }, $modal.isMsg ? 500 : 100);
  28113. resolve(params.type);
  28114. }
  28115. });
  28116. var $modal = new ModalClass({
  28117. el: document.createElement('div'),
  28118. propsData: options
  28119. });
  28120. setTimeout(function () {
  28121. if ($modal.isDestroy) {
  28122. $modal.close();
  28123. } else {
  28124. $modal.open();
  28125. }
  28126. });
  28127. }
  28128. });
  28129. }
  28130. /**
  28131. * 全局关闭动态的活动窗口(只能用于关闭动态的创建的活动窗口)
  28132. * 如果传 id 则关闭指定的窗口
  28133. * 如果不传则关闭所有窗口
  28134. */
  28135. function closeModal(id) {
  28136. var modals = arguments.length ? [getModal(id)] : allActivedModals;
  28137. modals.forEach(function ($modal) {
  28138. if ($modal) {
  28139. $modal.isDestroy = true;
  28140. $modal.close('close');
  28141. }
  28142. });
  28143. return Promise.resolve();
  28144. }
  28145. function getModal(id) {
  28146. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.find(allActivedModals, function ($modal) {
  28147. return $modal.id === id;
  28148. });
  28149. }
  28150. var ModalController = {
  28151. get: getModal,
  28152. close: closeModal,
  28153. open: openModal
  28154. };
  28155. var modal_modal = ModalController;
  28156. var shortcutTypes = ['alert', 'confirm', 'message'];
  28157. shortcutTypes.forEach(function (type, index) {
  28158. var defOpts = index === 2 ? {
  28159. mask: false,
  28160. lockView: false,
  28161. showHeader: false
  28162. } : {
  28163. showFooter: true
  28164. };
  28165. defOpts.type = type;
  28166. defOpts.dblclickZoom = false;
  28167. if (index === 1) {
  28168. defOpts.status = 'question';
  28169. }
  28170. ModalController[type] = function (message, title, options) {
  28171. var opts;
  28172. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isObject(message)) {
  28173. opts = message;
  28174. } else {
  28175. if (title) {
  28176. opts = index === 2 ? {
  28177. status: title
  28178. } : {
  28179. title: title
  28180. };
  28181. }
  28182. }
  28183. return openModal(Object.assign({
  28184. message: external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toValueString(message),
  28185. type: type
  28186. }, defOpts, opts, options));
  28187. };
  28188. });
  28189. var Modal = Object.assign(modal, {
  28190. install: function install(Vue) {
  28191. v_x_e_table._modal = 1;
  28192. Vue.component(modal.name, modal);
  28193. ModalClass = Vue.extend(modal);
  28194. v_x_e_table.modal = ModalController;
  28195. if (!Vue.prototype.$vxe) {
  28196. Vue.prototype.$vxe = {
  28197. modal: ModalController
  28198. };
  28199. } else {
  28200. Vue.prototype.$vxe.modal = ModalController;
  28201. }
  28202. }
  28203. });
  28204. /* harmony default export */ var packages_modal = (Modal);
  28205. // CONCATENATED MODULE: ./packages/tooltip/src/tooltip.js
  28206. function updateTipStyle(_vm) {
  28207. var wrapperElem = _vm.$el,
  28208. tipTarget = _vm.tipTarget,
  28209. tipStore = _vm.tipStore;
  28210. if (tipTarget) {
  28211. var _DomTools$getDomNode = DomTools.getDomNode(),
  28212. scrollTop = _DomTools$getDomNode.scrollTop,
  28213. scrollLeft = _DomTools$getDomNode.scrollLeft,
  28214. visibleWidth = _DomTools$getDomNode.visibleWidth;
  28215. var _DomTools$getAbsolute = DomTools.getAbsolutePos(tipTarget),
  28216. top = _DomTools$getAbsolute.top,
  28217. left = _DomTools$getAbsolute.left;
  28218. var marginSize = 6;
  28219. var offsetHeight = wrapperElem.offsetHeight;
  28220. var offsetWidth = wrapperElem.offsetWidth;
  28221. var tipTop = top - offsetHeight - marginSize;
  28222. var tipLeft = Math.max(marginSize, left + Math.floor((tipTarget.offsetWidth - offsetWidth) / 2));
  28223. if (tipLeft + offsetWidth + marginSize > scrollLeft + visibleWidth) {
  28224. tipLeft = scrollLeft + visibleWidth - offsetWidth - marginSize;
  28225. }
  28226. if (top - offsetHeight < scrollTop + marginSize) {
  28227. tipStore.placement = 'bottom';
  28228. tipTop = top + tipTarget.offsetHeight + marginSize;
  28229. }
  28230. tipStore.style.top = "".concat(tipTop, "px");
  28231. tipStore.style.left = "".concat(tipLeft, "px");
  28232. tipStore.arrowStyle.left = "".concat(left - tipLeft + tipTarget.offsetWidth / 2, "px");
  28233. }
  28234. }
  28235. /* harmony default export */ var src_tooltip = ({
  28236. name: 'VxeTooltip',
  28237. mixins: [size],
  28238. props: {
  28239. value: Boolean,
  28240. size: {
  28241. type: String,
  28242. default: function _default() {
  28243. return conf.tooltip.size || conf.size;
  28244. }
  28245. },
  28246. trigger: {
  28247. type: String,
  28248. default: function _default() {
  28249. return conf.tooltip.trigger;
  28250. }
  28251. },
  28252. theme: {
  28253. type: String,
  28254. default: function _default() {
  28255. return conf.tooltip.theme;
  28256. }
  28257. },
  28258. content: [String, Number],
  28259. zIndex: [String, Number],
  28260. isArrow: {
  28261. type: Boolean,
  28262. default: true
  28263. },
  28264. enterable: Boolean,
  28265. leaveDelay: {
  28266. type: Number,
  28267. default: conf.tooltip.leaveDelay
  28268. },
  28269. leaveMethod: Function
  28270. },
  28271. data: function data() {
  28272. return {
  28273. isUpdate: false,
  28274. isHover: false,
  28275. visible: false,
  28276. message: '',
  28277. tipTarget: null,
  28278. tipZindex: 0,
  28279. tipStore: {
  28280. style: {},
  28281. placement: '',
  28282. arrowStyle: null
  28283. }
  28284. };
  28285. },
  28286. watch: {
  28287. content: function content(value) {
  28288. this.message = value;
  28289. },
  28290. value: function value(_value) {
  28291. if (!this.isUpdate) {
  28292. this[_value ? 'open' : 'close']();
  28293. }
  28294. this.isUpdate = false;
  28295. }
  28296. },
  28297. mounted: function mounted() {
  28298. var $el = this.$el,
  28299. trigger = this.trigger,
  28300. content = this.content,
  28301. value = this.value;
  28302. var parentNode = $el.parentNode;
  28303. var target;
  28304. this.message = content;
  28305. this.tipZindex = UtilTools.nextZIndex();
  28306. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.arrayEach($el.children, function (elem, index) {
  28307. if (index > 1) {
  28308. parentNode.insertBefore(elem, $el);
  28309. if (!target) {
  28310. target = elem;
  28311. }
  28312. }
  28313. });
  28314. parentNode.removeChild($el);
  28315. this.target = target;
  28316. if (target) {
  28317. if (trigger === 'hover') {
  28318. target.onmouseleave = this.targetMouseleaveEvent;
  28319. target.onmouseenter = this.targetMouseenterEvent;
  28320. } else if (trigger === 'click') {
  28321. target.onclick = this.clickEvent;
  28322. }
  28323. }
  28324. if (value) {
  28325. this.open();
  28326. }
  28327. },
  28328. beforeDestroy: function beforeDestroy() {
  28329. var $el = this.$el,
  28330. target = this.target,
  28331. trigger = this.trigger;
  28332. var parentNode = $el.parentNode;
  28333. if (parentNode) {
  28334. parentNode.removeChild($el);
  28335. }
  28336. if (target) {
  28337. if (trigger === 'hover') {
  28338. target.onmouseenter = null;
  28339. target.onmouseleave = null;
  28340. } else if (trigger === 'click') {
  28341. target.onclick = null;
  28342. }
  28343. }
  28344. },
  28345. render: function render(h) {
  28346. var _ref;
  28347. var $scopedSlots = this.$scopedSlots,
  28348. vSize = this.vSize,
  28349. theme = this.theme,
  28350. message = this.message,
  28351. isHover = this.isHover,
  28352. isArrow = this.isArrow,
  28353. visible = this.visible,
  28354. tipStore = this.tipStore,
  28355. enterable = this.enterable;
  28356. var on;
  28357. if (enterable) {
  28358. on = {
  28359. mouseenter: this.wrapperMouseenterEvent,
  28360. mouseleave: this.wrapperMouseleaveEvent
  28361. };
  28362. }
  28363. return h('div', {
  28364. 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)],
  28365. style: tipStore.style,
  28366. ref: 'tipWrapper',
  28367. on: on
  28368. }, [h('div', {
  28369. class: 'vxe-table--tooltip-content'
  28370. }, $scopedSlots.content ? $scopedSlots.content.call(this, {}) : message), h('div', {
  28371. class: 'vxe-table--tooltip-arrow',
  28372. style: tipStore.arrowStyle
  28373. })].concat($scopedSlots.default ? $scopedSlots.default.call(this, {}) : []));
  28374. },
  28375. methods: {
  28376. open: function open(target, message) {
  28377. return this.toVisible(target || this.target, message);
  28378. },
  28379. close: function close() {
  28380. this.tipTarget = null;
  28381. Object.assign(this.tipStore, {
  28382. style: {},
  28383. placement: '',
  28384. arrowStyle: null
  28385. });
  28386. this.update(false);
  28387. return this.$nextTick();
  28388. },
  28389. update: function update(value) {
  28390. if (value !== this.visible) {
  28391. this.visible = value;
  28392. this.isUpdate = true;
  28393. if (this.$listeners.input) {
  28394. this.$emit('input', this.visible);
  28395. }
  28396. }
  28397. },
  28398. updateZindex: function updateZindex() {
  28399. if (this.tipZindex < UtilTools.getLastZIndex()) {
  28400. this.tipZindex = UtilTools.nextZIndex();
  28401. }
  28402. },
  28403. toVisible: function toVisible(target, message) {
  28404. this.targetActive = true;
  28405. if (target) {
  28406. var $el = this.$el,
  28407. tipStore = this.tipStore,
  28408. zIndex = this.zIndex;
  28409. var parentNode = $el.parentNode;
  28410. if (!parentNode) {
  28411. document.body.appendChild($el);
  28412. }
  28413. if (message) {
  28414. this.message = message;
  28415. }
  28416. this.tipTarget = target;
  28417. this.update(true);
  28418. this.updateZindex();
  28419. tipStore.placement = 'top';
  28420. tipStore.style = {
  28421. width: 'auto',
  28422. left: 0,
  28423. top: 0,
  28424. zIndex: zIndex || this.tipZindex
  28425. };
  28426. tipStore.arrowStyle = {
  28427. left: '50%'
  28428. };
  28429. return this.updatePlacement();
  28430. }
  28431. return this.$nextTick();
  28432. },
  28433. updatePlacement: function updatePlacement() {
  28434. var _this = this;
  28435. return this.$nextTick().then(function () {
  28436. var wrapperElem = _this.$el,
  28437. tipTarget = _this.tipTarget;
  28438. if (tipTarget && wrapperElem) {
  28439. updateTipStyle(_this);
  28440. return _this.$nextTick().then(function () {
  28441. return updateTipStyle(_this);
  28442. });
  28443. }
  28444. });
  28445. },
  28446. clickEvent: function clickEvent() {
  28447. this[this.visible ? 'close' : 'open']();
  28448. },
  28449. targetMouseenterEvent: function targetMouseenterEvent() {
  28450. this.open();
  28451. },
  28452. targetMouseleaveEvent: function targetMouseleaveEvent() {
  28453. var _this2 = this;
  28454. var trigger = this.trigger,
  28455. enterable = this.enterable,
  28456. leaveDelay = this.leaveDelay;
  28457. this.targetActive = false;
  28458. if (enterable && trigger === 'hover') {
  28459. setTimeout(function () {
  28460. if (!_this2.isHover) {
  28461. _this2.close();
  28462. }
  28463. }, leaveDelay);
  28464. } else {
  28465. this.close();
  28466. }
  28467. },
  28468. wrapperMouseenterEvent: function wrapperMouseenterEvent() {
  28469. this.isHover = true;
  28470. },
  28471. wrapperMouseleaveEvent: function wrapperMouseleaveEvent(evnt) {
  28472. var _this3 = this;
  28473. var leaveMethod = this.leaveMethod,
  28474. trigger = this.trigger,
  28475. enterable = this.enterable,
  28476. leaveDelay = this.leaveDelay;
  28477. this.isHover = false;
  28478. if (!leaveMethod || leaveMethod({
  28479. $event: evnt
  28480. }) !== false) {
  28481. if (enterable && trigger === 'hover') {
  28482. setTimeout(function () {
  28483. if (!_this3.targetActive) {
  28484. _this3.close();
  28485. }
  28486. }, leaveDelay);
  28487. }
  28488. }
  28489. }
  28490. }
  28491. });
  28492. // CONCATENATED MODULE: ./packages/tooltip/index.js
  28493. var Tooltip = Object.assign(src_tooltip, {
  28494. install: function install(Vue) {
  28495. v_x_e_table._tooltip = 1;
  28496. Vue.component(src_tooltip.name, src_tooltip);
  28497. }
  28498. });
  28499. /* harmony default export */ var packages_tooltip = (Tooltip);
  28500. // CONCATENATED MODULE: ./packages/form/src/util.js
  28501. var util_ItemConfig = /*#__PURE__*/function () {
  28502. function ItemConfig($xeform, item) {
  28503. _classCallCheck(this, ItemConfig);
  28504. Object.assign(this, {
  28505. id: external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.uniqueId('item_'),
  28506. title: item.title,
  28507. field: item.field,
  28508. span: item.span,
  28509. align: item.align,
  28510. titleAlign: item.titleAlign,
  28511. titleWidth: item.titleWidth,
  28512. titlePrefix: item.titlePrefix,
  28513. titleSuffix: item.titleSuffix,
  28514. titleOverflow: item.titleOverflow,
  28515. resetValue: item.resetValue,
  28516. visible: item.visible,
  28517. visibleMethod: item.visibleMethod,
  28518. folding: item.folding,
  28519. collapseNode: item.collapseNode,
  28520. className: item.className,
  28521. itemRender: item.itemRender,
  28522. // 渲染属性
  28523. showError: false,
  28524. errRule: null,
  28525. slots: item.slots,
  28526. children: []
  28527. });
  28528. if (false) { var compConf; }
  28529. }
  28530. _createClass(ItemConfig, [{
  28531. key: "update",
  28532. value: function update(name, value) {
  28533. this[name] = value;
  28534. }
  28535. }]);
  28536. return ItemConfig;
  28537. }();
  28538. function isItem(option) {
  28539. return option instanceof util_ItemConfig;
  28540. }
  28541. function getItemConfig($xeform, _vm, options) {
  28542. return isItem(_vm) ? _vm : new util_ItemConfig($xeform, _vm, options);
  28543. }
  28544. function createItem($xeform, _vm) {
  28545. return getItemConfig($xeform, _vm);
  28546. }
  28547. function destroyItem(_vm) {
  28548. var $xeform = _vm.$xeform,
  28549. itemConfig = _vm.itemConfig;
  28550. var matchObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.findTree($xeform.staticItems, function (option) {
  28551. return option === itemConfig;
  28552. });
  28553. if (matchObj) {
  28554. matchObj.items.splice(matchObj.index, 1);
  28555. }
  28556. }
  28557. function assemItem(_vm) {
  28558. var $el = _vm.$el,
  28559. $xeform = _vm.$xeform,
  28560. xeformgather = _vm.xeformgather,
  28561. itemConfig = _vm.itemConfig;
  28562. var itemGather = xeformgather ? xeformgather.itemConfig : null;
  28563. itemConfig.slots = _vm.$scopedSlots;
  28564. if (itemGather) {
  28565. if (!itemGather.children) {
  28566. itemGather.children = [];
  28567. }
  28568. itemGather.children.splice([].indexOf.call(xeformgather.$el.children, $el), 0, itemConfig);
  28569. } else {
  28570. $xeform.staticItems.splice([].indexOf.call($xeform.$refs.hideItem.children, $el), 0, itemConfig);
  28571. }
  28572. }
  28573. // CONCATENATED MODULE: ./packages/form/src/form.js
  28574. var form_Rule = /*#__PURE__*/function () {
  28575. function Rule(rule) {
  28576. _classCallCheck(this, Rule);
  28577. Object.assign(this, {
  28578. $options: rule,
  28579. required: rule.required,
  28580. min: rule.min,
  28581. max: rule.min,
  28582. type: rule.type,
  28583. pattern: rule.pattern,
  28584. validator: rule.validator,
  28585. trigger: rule.trigger,
  28586. maxWidth: rule.maxWidth
  28587. });
  28588. }
  28589. _createClass(Rule, [{
  28590. key: "message",
  28591. get: function get() {
  28592. return UtilTools.getFuncText(this.$options.message);
  28593. }
  28594. }]);
  28595. return Rule;
  28596. }();
  28597. function getResetValue(value, resetValue) {
  28598. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(value)) {
  28599. resetValue = [];
  28600. }
  28601. return resetValue;
  28602. }
  28603. function form_callSlot(_vm, slotFunc, params, h) {
  28604. if (slotFunc) {
  28605. var $scopedSlots = _vm.$scopedSlots;
  28606. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isString(slotFunc)) {
  28607. slotFunc = $scopedSlots[slotFunc] || null;
  28608. }
  28609. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(slotFunc)) {
  28610. return slotFunc.call(_vm, params, h);
  28611. }
  28612. }
  28613. return [];
  28614. }
  28615. function renderPrefixIcon(h, titlePrefix) {
  28616. return h('span', {
  28617. class: 'vxe-form--item-title-prefix'
  28618. }, [h('i', {
  28619. class: titlePrefix.icon || conf.icon.FORM_PREFIX
  28620. })]);
  28621. }
  28622. function form_renderSuffixIcon(h, titleSuffix) {
  28623. return h('span', {
  28624. class: 'vxe-form--item-title-suffix'
  28625. }, [h('i', {
  28626. class: titleSuffix.icon || conf.icon.FORM_SUFFIX
  28627. })]);
  28628. }
  28629. function renderTitle(h, _vm, item) {
  28630. var data = _vm.data;
  28631. var slots = item.slots,
  28632. field = item.field,
  28633. itemRender = item.itemRender,
  28634. titlePrefix = item.titlePrefix,
  28635. titleSuffix = item.titleSuffix;
  28636. var compConf = isEnableConf(itemRender) ? v_x_e_table.renderer.get(itemRender.name) : null;
  28637. var params = {
  28638. data: data,
  28639. property: field,
  28640. item: item,
  28641. $form: _vm
  28642. };
  28643. var tss = [];
  28644. if (titlePrefix) {
  28645. tss.push(titlePrefix.message ? h('vxe-tooltip', {
  28646. props: {
  28647. content: UtilTools.getFuncText(titlePrefix.message),
  28648. enterable: titlePrefix.enterable,
  28649. theme: titlePrefix.theme
  28650. }
  28651. }, [renderPrefixIcon(h, titlePrefix)]) : renderPrefixIcon(h, titlePrefix));
  28652. }
  28653. tss.push(h('span', {
  28654. class: 'vxe-form--item-title-label'
  28655. }, compConf && compConf.renderItemTitle ? compConf.renderItemTitle(itemRender, params) : slots && slots.title ? form_callSlot(_vm, slots.title, params, h) : UtilTools.getFuncText(item.title)));
  28656. if (titleSuffix) {
  28657. tss.push(titleSuffix.message ? h('vxe-tooltip', {
  28658. props: {
  28659. content: UtilTools.getFuncText(titleSuffix.message),
  28660. enterable: titleSuffix.enterable,
  28661. theme: titleSuffix.theme
  28662. }
  28663. }, [form_renderSuffixIcon(h, titleSuffix)]) : form_renderSuffixIcon(h, titleSuffix));
  28664. }
  28665. return tss;
  28666. }
  28667. function renderItems(h, _vm, itemList) {
  28668. var _e = _vm._e,
  28669. rules = _vm.rules,
  28670. data = _vm.data,
  28671. collapseAll = _vm.collapseAll,
  28672. validOpts = _vm.validOpts,
  28673. allTitleOverflow = _vm.titleOverflow;
  28674. return itemList.map(function (item, index) {
  28675. var slots = item.slots,
  28676. title = item.title,
  28677. folding = item.folding,
  28678. visible = item.visible,
  28679. visibleMethod = item.visibleMethod,
  28680. field = item.field,
  28681. collapseNode = item.collapseNode,
  28682. itemRender = item.itemRender,
  28683. showError = item.showError,
  28684. errRule = item.errRule,
  28685. className = item.className,
  28686. titleOverflow = item.titleOverflow,
  28687. children = item.children;
  28688. var compConf = isEnableConf(itemRender) ? v_x_e_table.renderer.get(itemRender.name) : null;
  28689. var span = item.span || _vm.span;
  28690. var align = item.align || _vm.align;
  28691. var titleAlign = item.titleAlign || _vm.titleAlign;
  28692. var titleWidth = item.titleWidth || _vm.titleWidth;
  28693. var itemVisibleMethod = visibleMethod;
  28694. var itemOverflow = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isUndefined(titleOverflow) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNull(titleOverflow) ? allTitleOverflow : titleOverflow;
  28695. var showEllipsis = itemOverflow === 'ellipsis';
  28696. var showTitle = itemOverflow === 'title';
  28697. var showTooltip = itemOverflow === true || itemOverflow === 'tooltip';
  28698. var hasEllipsis = showTitle || showTooltip || showEllipsis;
  28699. var params = {
  28700. data: data,
  28701. property: field,
  28702. item: item,
  28703. $form: _vm
  28704. };
  28705. var isRequired;
  28706. if (visible === false) {
  28707. return _e();
  28708. } // 如果为项集合
  28709. var isGather = children && children.length > 0;
  28710. if (isGather) {
  28711. var childVNs = renderItems(h, _vm, item.children);
  28712. return childVNs.length ? h('div', {
  28713. class: ['vxe-form--gather vxe-row', item.id, span ? "vxe-col--".concat(span, " is--span") : '', className ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(className) ? className(params) : className : '']
  28714. }, childVNs) : _e();
  28715. }
  28716. if (!itemVisibleMethod && compConf && compConf.itemVisibleMethod) {
  28717. itemVisibleMethod = compConf.itemVisibleMethod;
  28718. }
  28719. if (rules) {
  28720. var itemRules = rules[field];
  28721. if (itemRules) {
  28722. isRequired = itemRules.some(function (rule) {
  28723. return rule.required;
  28724. });
  28725. }
  28726. }
  28727. var contentVNs = [];
  28728. if (slots && slots.default) {
  28729. contentVNs = form_callSlot(_vm, slots.default, params, h);
  28730. } else if (compConf && compConf.renderItemContent) {
  28731. contentVNs = compConf.renderItemContent.call(_vm, h, itemRender, params);
  28732. } else if (compConf && compConf.renderItem) {
  28733. contentVNs = compConf.renderItem.call(_vm, h, itemRender, params);
  28734. } else if (field) {
  28735. contentVNs = ["".concat(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(data, field))];
  28736. }
  28737. var ons = showTooltip ? {
  28738. mouseenter: function mouseenter(evnt) {
  28739. _vm.triggerHeaderHelpEvent(evnt, params);
  28740. },
  28741. mouseleave: _vm.handleTargetLeaveEvent
  28742. } : {};
  28743. return h('div', {
  28744. class: ['vxe-form--item', item.id, span ? "vxe-col--".concat(span, " is--span") : null, className ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(className) ? className(params) : className : '', {
  28745. 'is--title': title,
  28746. 'is--required': isRequired,
  28747. 'is--hidden': folding && collapseAll,
  28748. 'is--active': !itemVisibleMethod || itemVisibleMethod(params),
  28749. 'is--error': showError
  28750. }],
  28751. key: index
  28752. }, [h('div', {
  28753. class: 'vxe-form--item-inner'
  28754. }, [title || slots && slots.title ? h('div', {
  28755. class: ['vxe-form--item-title', titleAlign ? "align--".concat(titleAlign) : null, {
  28756. 'is--ellipsis': hasEllipsis
  28757. }],
  28758. style: titleWidth ? {
  28759. width: isNaN(titleWidth) ? titleWidth : "".concat(titleWidth, "px")
  28760. } : null,
  28761. attrs: {
  28762. title: showTitle ? UtilTools.getFuncText(title) : null
  28763. },
  28764. on: ons
  28765. }, renderTitle(h, _vm, item)) : null, h('div', {
  28766. class: ['vxe-form--item-content', align ? "align--".concat(align) : null]
  28767. }, contentVNs.concat([collapseNode ? h('div', {
  28768. class: 'vxe-form--item-trigger-node',
  28769. on: {
  28770. click: _vm.toggleCollapseEvent
  28771. }
  28772. }, [h('span', {
  28773. class: 'vxe-form--item-trigger-text'
  28774. }, collapseAll ? conf.i18n('vxe.form.unfolding') : conf.i18n('vxe.form.folding')), h('i', {
  28775. class: ['vxe-form--item-trigger-icon', collapseAll ? conf.icon.FORM_FOLDING : conf.icon.FORM_UNFOLDING]
  28776. })]) : null, errRule && validOpts.showMessage ? h('div', {
  28777. class: 'vxe-form--item-valid',
  28778. style: errRule.maxWidth ? {
  28779. width: "".concat(errRule.maxWidth, "px")
  28780. } : null
  28781. }, errRule.message) : null]))])]);
  28782. });
  28783. }
  28784. /* harmony default export */ var src_form = ({
  28785. name: 'VxeForm',
  28786. mixins: [size],
  28787. props: {
  28788. loading: Boolean,
  28789. data: Object,
  28790. size: {
  28791. type: String,
  28792. default: function _default() {
  28793. return conf.form.size || conf.size;
  28794. }
  28795. },
  28796. span: [String, Number],
  28797. align: {
  28798. type: String,
  28799. default: function _default() {
  28800. return conf.form.align;
  28801. }
  28802. },
  28803. titleAlign: {
  28804. type: String,
  28805. default: function _default() {
  28806. return conf.form.titleAlign;
  28807. }
  28808. },
  28809. titleWidth: [String, Number],
  28810. titleColon: {
  28811. type: Boolean,
  28812. default: function _default() {
  28813. return conf.form.titleColon;
  28814. }
  28815. },
  28816. titleAsterisk: {
  28817. type: Boolean,
  28818. default: function _default() {
  28819. return conf.form.titleAsterisk;
  28820. }
  28821. },
  28822. titleOverflow: {
  28823. type: [Boolean, String],
  28824. default: null
  28825. },
  28826. items: Array,
  28827. rules: Object,
  28828. preventSubmit: {
  28829. type: Boolean,
  28830. default: function _default() {
  28831. return conf.form.preventSubmit;
  28832. }
  28833. },
  28834. validConfig: Object
  28835. },
  28836. data: function data() {
  28837. return {
  28838. collapseAll: true,
  28839. staticItems: [],
  28840. formItems: [],
  28841. tooltipTimeout: null,
  28842. tooltipActive: false,
  28843. tooltipStore: {
  28844. item: null,
  28845. visible: false
  28846. }
  28847. };
  28848. },
  28849. provide: function provide() {
  28850. return {
  28851. $xeform: this
  28852. };
  28853. },
  28854. computed: {
  28855. validOpts: function validOpts() {
  28856. return Object.assign({}, conf.form.validConfig, this.validConfig);
  28857. },
  28858. tooltipOpts: function tooltipOpts() {
  28859. var opts = Object.assign({
  28860. leaveDelay: 300
  28861. }, conf.form.tooltipConfig, this.tooltipConfig);
  28862. if (opts.enterable) {
  28863. opts.leaveMethod = this.handleTooltipLeaveMethod;
  28864. }
  28865. return opts;
  28866. }
  28867. },
  28868. created: function created() {
  28869. var _this = this;
  28870. this.$nextTick(function () {
  28871. var items = _this.items;
  28872. if (items) {
  28873. _this.loadItem(items);
  28874. }
  28875. });
  28876. },
  28877. watch: {
  28878. staticItems: function staticItems(value) {
  28879. this.formItems = value;
  28880. },
  28881. items: function items(value) {
  28882. this.loadItem(value);
  28883. }
  28884. },
  28885. render: function render(h) {
  28886. var _ref;
  28887. var _e = this._e,
  28888. loading = this.loading,
  28889. vSize = this.vSize,
  28890. tooltipOpts = this.tooltipOpts,
  28891. formItems = this.formItems;
  28892. var hasUseTooltip = v_x_e_table._tooltip;
  28893. return h('form', {
  28894. class: ['vxe-form', (_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)],
  28895. on: {
  28896. submit: this.submitEvent,
  28897. reset: this.resetEvent
  28898. }
  28899. }, [h('div', {
  28900. class: 'vxe-form--wrapper vxe-row'
  28901. }, renderItems(h, this, formItems)), h('div', {
  28902. class: 'vxe-form-slots',
  28903. ref: 'hideItem'
  28904. }, this.$slots.default), h('div', {
  28905. class: ['vxe-loading', {
  28906. 'is--visible': loading
  28907. }]
  28908. }, [h('div', {
  28909. class: 'vxe-loading--spinner'
  28910. })]),
  28911. /**
  28912. * 工具提示
  28913. */
  28914. hasUseTooltip ? h('vxe-tooltip', _objectSpread2({
  28915. ref: 'tooltip'
  28916. }, tooltipOpts)) : _e()]);
  28917. },
  28918. methods: {
  28919. loadItem: function loadItem(list) {
  28920. var _this2 = this;
  28921. if (false) { var $scopedSlots; }
  28922. this.staticItems = list.map(function (item) {
  28923. return createItem(_this2, item);
  28924. });
  28925. return this.$nextTick();
  28926. },
  28927. getItems: function getItems() {
  28928. var itemList = [];
  28929. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(this.formItems, function (item) {
  28930. itemList.push(item);
  28931. }, {
  28932. children: 'children'
  28933. });
  28934. return itemList;
  28935. },
  28936. toggleCollapse: function toggleCollapse() {
  28937. this.collapseAll = !this.collapseAll;
  28938. return this.$nextTick();
  28939. },
  28940. toggleCollapseEvent: function toggleCollapseEvent(evnt) {
  28941. this.toggleCollapse();
  28942. this.$emit('toggle-collapse', {
  28943. collapse: !this.collapseAll,
  28944. data: this.data,
  28945. $form: this,
  28946. $event: evnt
  28947. }, evnt);
  28948. },
  28949. submitEvent: function submitEvent(evnt) {
  28950. var _this3 = this;
  28951. evnt.preventDefault();
  28952. if (!this.preventSubmit) {
  28953. this.beginValidate().then(function () {
  28954. _this3.$emit('submit', {
  28955. data: _this3.data,
  28956. $form: _this3,
  28957. $event: evnt
  28958. });
  28959. }).catch(function (errMap) {
  28960. _this3.$emit('submit-invalid', {
  28961. data: _this3.data,
  28962. errMap: errMap,
  28963. $form: _this3,
  28964. $event: evnt
  28965. });
  28966. });
  28967. }
  28968. },
  28969. reset: function reset() {
  28970. var _this4 = this;
  28971. var data = this.data;
  28972. if (data) {
  28973. var itemList = this.getItems();
  28974. itemList.forEach(function (item) {
  28975. var field = item.field,
  28976. resetValue = item.resetValue,
  28977. itemRender = item.itemRender;
  28978. if (isEnableConf(itemRender)) {
  28979. var compConf = v_x_e_table.renderer.get(itemRender.name);
  28980. if (compConf && compConf.itemResetMethod) {
  28981. compConf.itemResetMethod({
  28982. data: data,
  28983. property: field,
  28984. item: item,
  28985. $form: _this4
  28986. });
  28987. } else if (field) {
  28988. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.set(data, field, resetValue === null ? getResetValue(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(data, field), undefined) : resetValue);
  28989. }
  28990. }
  28991. });
  28992. }
  28993. return this.clearValidate();
  28994. },
  28995. resetEvent: function resetEvent(evnt) {
  28996. evnt.preventDefault();
  28997. this.reset();
  28998. this.$emit('reset', {
  28999. data: this.data,
  29000. $form: this,
  29001. $event: evnt
  29002. });
  29003. },
  29004. handleTooltipLeaveMethod: function handleTooltipLeaveMethod() {
  29005. var _this5 = this;
  29006. var tooltipOpts = this.tooltipOpts;
  29007. setTimeout(function () {
  29008. if (!_this5.tooltipActive) {
  29009. _this5.closeTooltip();
  29010. }
  29011. }, tooltipOpts.leaveDelay);
  29012. return false;
  29013. },
  29014. closeTooltip: function closeTooltip() {
  29015. var tooltipStore = this.tooltipStore;
  29016. var $tooltip = this.$refs.tooltip;
  29017. if (tooltipStore.visible) {
  29018. Object.assign(tooltipStore, {
  29019. item: null,
  29020. visible: false
  29021. });
  29022. if ($tooltip) {
  29023. $tooltip.close();
  29024. }
  29025. }
  29026. return this.$nextTick();
  29027. },
  29028. triggerHeaderHelpEvent: function triggerHeaderHelpEvent(evnt, params) {
  29029. var item = params.item;
  29030. var tooltipStore = this.tooltipStore;
  29031. var $tooltip = this.$refs.tooltip;
  29032. var overflowElem = evnt.currentTarget;
  29033. var content = (overflowElem.textContent || '').trim();
  29034. var isCellOverflow = overflowElem.scrollWidth > overflowElem.clientWidth;
  29035. clearTimeout(this.tooltipTimeout);
  29036. this.tooltipActive = true;
  29037. this.closeTooltip();
  29038. if (content && isCellOverflow) {
  29039. Object.assign(tooltipStore, {
  29040. item: item,
  29041. visible: true
  29042. });
  29043. if ($tooltip) {
  29044. $tooltip.open(overflowElem, content);
  29045. }
  29046. }
  29047. },
  29048. handleTargetLeaveEvent: function handleTargetLeaveEvent() {
  29049. var _this6 = this;
  29050. var tooltipOpts = this.tooltipOpts;
  29051. this.tooltipActive = false;
  29052. if (tooltipOpts.enterable) {
  29053. this.tooltipTimeout = setTimeout(function () {
  29054. var $tooltip = _this6.$refs.tooltip;
  29055. if ($tooltip && !$tooltip.isHover) {
  29056. _this6.closeTooltip();
  29057. }
  29058. }, tooltipOpts.leaveDelay);
  29059. } else {
  29060. this.closeTooltip();
  29061. }
  29062. },
  29063. clearValidate: function clearValidate(field) {
  29064. var itemList = this.getItems();
  29065. if (field) {
  29066. var item = itemList.find(function (item) {
  29067. return item.field === field;
  29068. });
  29069. if (item) {
  29070. item.showError = false;
  29071. }
  29072. } else {
  29073. itemList.forEach(function (item) {
  29074. item.showError = false;
  29075. });
  29076. }
  29077. return this.$nextTick();
  29078. },
  29079. validate: function validate(callback) {
  29080. return this.beginValidate('', callback);
  29081. },
  29082. beginValidate: function beginValidate(type, callback) {
  29083. var _this7 = this;
  29084. var data = this.data,
  29085. formRules = this.rules,
  29086. validOpts = this.validOpts;
  29087. var validRest = {};
  29088. var validFields = [];
  29089. var itemValids = [];
  29090. var itemList = this.getItems();
  29091. this.clearValidate();
  29092. clearTimeout(this.showErrTime);
  29093. if (data && formRules) {
  29094. itemList.forEach(function (item) {
  29095. var field = item.field;
  29096. if (field) {
  29097. itemValids.push(_this7.validItemRules(type || 'all', field).then(function () {
  29098. item.errRule = null;
  29099. }).catch(function (_ref2) {
  29100. var rule = _ref2.rule,
  29101. rules = _ref2.rules;
  29102. var rest = {
  29103. rule: rule,
  29104. rules: rules,
  29105. data: data,
  29106. property: field,
  29107. $form: _this7
  29108. };
  29109. if (!validRest[field]) {
  29110. validRest[field] = [];
  29111. }
  29112. validRest[field].push(rest);
  29113. validFields.push(field);
  29114. item.errRule = rule;
  29115. return Promise.reject(rest);
  29116. }));
  29117. }
  29118. });
  29119. return Promise.all(itemValids).then(function () {
  29120. if (callback) {
  29121. callback();
  29122. }
  29123. }).catch(function () {
  29124. _this7.showErrTime = setTimeout(function () {
  29125. itemList.forEach(function (item) {
  29126. if (item.errRule) {
  29127. item.showError = true;
  29128. }
  29129. });
  29130. }, 20);
  29131. if (callback) {
  29132. callback(validRest);
  29133. }
  29134. if (validOpts.autoPos) {
  29135. _this7.$nextTick(function () {
  29136. _this7.handleFocus(validFields);
  29137. });
  29138. }
  29139. return Promise.reject(validRest);
  29140. });
  29141. }
  29142. if (callback) {
  29143. callback();
  29144. }
  29145. return Promise.resolve();
  29146. },
  29147. /**
  29148. * 校验数据
  29149. * 按表格行、列顺序依次校验(同步或异步)
  29150. * 校验规则根据索引顺序依次校验,如果是异步则会等待校验完成才会继续校验下一列
  29151. * 如果校验失败则,触发回调或者 Promise<(ErrMap 校验不通过列的信息)>
  29152. * 如果是传回调方式这返回一个 (ErrMap 校验不通过列的信息)
  29153. *
  29154. * rule 配置:
  29155. * required=Boolean 是否必填
  29156. * min=Number 最小长度
  29157. * max=Number 最大长度
  29158. * validator=Function({ itemValue, rule, rules, data, property }) 自定义校验,接收一个 Promise
  29159. * trigger=change 触发方式
  29160. */
  29161. validItemRules: function validItemRules(type, property, val) {
  29162. var _this8 = this;
  29163. var data = this.data,
  29164. formRules = this.rules;
  29165. var errorRules = [];
  29166. var syncVailds = [];
  29167. if (property && formRules) {
  29168. var rules = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(formRules, property);
  29169. if (rules) {
  29170. var itemValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isUndefined(val) ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(data, property) : val;
  29171. rules.forEach(function (rule) {
  29172. if (type === 'all' || !rule.trigger || type === rule.trigger) {
  29173. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(rule.validator)) {
  29174. var customValid = rule.validator({
  29175. itemValue: itemValue,
  29176. rule: rule,
  29177. rules: rules,
  29178. data: data,
  29179. property: property,
  29180. $form: _this8
  29181. });
  29182. if (customValid) {
  29183. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isError(customValid)) {
  29184. errorRules.push(new form_Rule({
  29185. type: 'custom',
  29186. trigger: rule.trigger,
  29187. message: customValid.message,
  29188. rule: new form_Rule(rule)
  29189. }));
  29190. } else if (customValid.catch) {
  29191. // 如果为异步校验(注:异步校验是并发无序的)
  29192. syncVailds.push(customValid.catch(function (e) {
  29193. errorRules.push(new form_Rule({
  29194. type: 'custom',
  29195. trigger: rule.trigger,
  29196. message: e ? e.message : rule.message,
  29197. rule: new form_Rule(rule)
  29198. }));
  29199. }));
  29200. }
  29201. }
  29202. } else {
  29203. var isNumber = rule.type === 'number';
  29204. var numVal = isNumber ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(itemValue) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getSize(itemValue);
  29205. if (itemValue === null || itemValue === undefined || itemValue === '') {
  29206. if (rule.required) {
  29207. errorRules.push(new form_Rule(rule));
  29208. }
  29209. } 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)) {
  29210. errorRules.push(new form_Rule(rule));
  29211. }
  29212. }
  29213. }
  29214. });
  29215. }
  29216. }
  29217. return Promise.all(syncVailds).then(function () {
  29218. if (errorRules.length) {
  29219. var rest = {
  29220. rules: errorRules,
  29221. rule: errorRules[0]
  29222. };
  29223. return Promise.reject(rest);
  29224. }
  29225. });
  29226. },
  29227. handleFocus: function handleFocus(fields) {
  29228. var $el = this.$el;
  29229. var itemList = this.getItems();
  29230. fields.some(function (property) {
  29231. var item = itemList.find(function (item) {
  29232. return item.field === property;
  29233. });
  29234. if (item && isEnableConf(item.itemRender)) {
  29235. var itemRender = item.itemRender;
  29236. var compConf = v_x_e_table.renderer.get(itemRender.name);
  29237. var inputElem; // 如果指定了聚焦 class
  29238. if (itemRender.autofocus) {
  29239. inputElem = $el.querySelector(".".concat(item.id, " ").concat(itemRender.autofocus));
  29240. } // 渲染器的聚焦处理
  29241. if (!inputElem && compConf && compConf.autofocus) {
  29242. inputElem = $el.querySelector(".".concat(item.id, " ").concat(compConf.autofocus));
  29243. }
  29244. if (inputElem) {
  29245. inputElem.focus(); // 保持一致行为,光标移到末端
  29246. if (DomTools.browse.msie) {
  29247. var textRange = inputElem.createTextRange();
  29248. textRange.collapse(false);
  29249. textRange.select();
  29250. }
  29251. return true;
  29252. }
  29253. }
  29254. });
  29255. },
  29256. /**
  29257. * 更新项状态
  29258. * 如果组件值 v-model 发生 change 时,调用改函数用于更新某一项编辑状态
  29259. * 如果单元格配置了校验规则,则会进行校验
  29260. */
  29261. updateStatus: function updateStatus(scope, itemValue) {
  29262. var _this9 = this;
  29263. var property = scope.property;
  29264. if (property) {
  29265. this.validItemRules('change', property, itemValue).then(function () {
  29266. _this9.clearValidate(property);
  29267. }).catch(function (_ref3) {
  29268. var rule = _ref3.rule;
  29269. var itemList = _this9.getItems();
  29270. var item = itemList.find(function (item) {
  29271. return item.field === property;
  29272. });
  29273. if (item) {
  29274. item.showError = true;
  29275. item.errRule = rule;
  29276. }
  29277. });
  29278. }
  29279. }
  29280. }
  29281. });
  29282. // CONCATENATED MODULE: ./packages/form/index.js
  29283. var Form = Object.assign(src_form, {
  29284. install: function install(Vue) {
  29285. Vue.component(src_form.name, src_form);
  29286. }
  29287. });
  29288. /* harmony default export */ var packages_form = (Form);
  29289. // CONCATENATED MODULE: ./packages/form/src/form-item.js
  29290. var form_item_props = {
  29291. title: String,
  29292. field: String,
  29293. size: String,
  29294. span: [String, Number],
  29295. align: String,
  29296. titleAlign: String,
  29297. titleWidth: [String, Number],
  29298. className: [String, Function],
  29299. titleOverflow: {
  29300. type: [Boolean, String],
  29301. default: null
  29302. },
  29303. titlePrefix: Object,
  29304. titleSuffix: Object,
  29305. resetValue: {
  29306. default: null
  29307. },
  29308. visible: {
  29309. type: Boolean,
  29310. default: null
  29311. },
  29312. visibleMethod: Function,
  29313. folding: Boolean,
  29314. collapseNode: Boolean,
  29315. itemRender: Object
  29316. };
  29317. var form_item_watch = {};
  29318. Object.keys(form_item_props).forEach(function (name) {
  29319. form_item_watch[name] = function (value) {
  29320. this.itemConfig.update(name, value);
  29321. };
  29322. });
  29323. /* harmony default export */ var form_item = ({
  29324. name: 'VxeFormItem',
  29325. props: form_item_props,
  29326. inject: {
  29327. $xeform: {
  29328. default: null
  29329. },
  29330. xeformgather: {
  29331. default: null
  29332. }
  29333. },
  29334. watch: form_item_watch,
  29335. mounted: function mounted() {
  29336. assemItem(this);
  29337. },
  29338. created: function created() {
  29339. this.itemConfig = createItem(this.$xeform, this);
  29340. },
  29341. destroyed: function destroyed() {
  29342. destroyItem(this);
  29343. },
  29344. render: function render(h) {
  29345. return h('div');
  29346. }
  29347. });
  29348. // CONCATENATED MODULE: ./packages/form-item/index.js
  29349. var FormItem = Object.assign(form_item, {
  29350. install: function install(Vue) {
  29351. Vue.component(form_item.name, form_item);
  29352. }
  29353. });
  29354. /* harmony default export */ var packages_form_item = (FormItem);
  29355. // CONCATENATED MODULE: ./packages/form/src/form-gather.js
  29356. /* harmony default export */ var form_gather = ({
  29357. name: 'VxeFormGather',
  29358. extends: form_item,
  29359. provide: function provide() {
  29360. return {
  29361. xeformgather: this
  29362. };
  29363. },
  29364. render: function render(h) {
  29365. return h('div', this.$slots.default);
  29366. }
  29367. });
  29368. // CONCATENATED MODULE: ./packages/form-gather/index.js
  29369. var FormGather = Object.assign(form_gather, {
  29370. install: function install(Vue) {
  29371. Vue.component(form_gather.name, form_gather);
  29372. }
  29373. });
  29374. /* harmony default export */ var packages_form_gather = (FormGather);
  29375. // CONCATENATED MODULE: ./packages/select/src/optgroup.js
  29376. var optgroup_props = {
  29377. label: {
  29378. type: [String, Number, Boolean],
  29379. default: ''
  29380. },
  29381. visible: {
  29382. type: Boolean,
  29383. default: null
  29384. },
  29385. disabled: Boolean
  29386. };
  29387. var optgroup_watch = {};
  29388. Object.keys(optgroup_props).forEach(function (name) {
  29389. optgroup_watch[name] = function (value) {
  29390. this.optionConfig.update(name, value);
  29391. };
  29392. });
  29393. /* harmony default export */ var optgroup = ({
  29394. name: 'VxeOptgroup',
  29395. props: optgroup_props,
  29396. provide: function provide() {
  29397. return {
  29398. $xeoptgroup: this
  29399. };
  29400. },
  29401. inject: {
  29402. $xeselect: {
  29403. default: null
  29404. }
  29405. },
  29406. computed: {
  29407. vSize: function vSize() {
  29408. return this.size || this.$parent.size || this.$parent.vSize;
  29409. }
  29410. },
  29411. watch: optgroup_watch,
  29412. mounted: function mounted() {
  29413. assemOption(this);
  29414. },
  29415. created: function created() {
  29416. this.optionConfig = createOption(this.$xeselect, this);
  29417. },
  29418. destroyed: function destroyed() {
  29419. destroyOption(this);
  29420. },
  29421. render: function render(h) {
  29422. return h('div', this.$slots.default);
  29423. }
  29424. });
  29425. // CONCATENATED MODULE: ./packages/select/index.js
  29426. var Select = Object.assign(src_select, {
  29427. Option: src_option,
  29428. Optgroup: optgroup,
  29429. install: function install(Vue) {
  29430. Vue.component(src_select.name, src_select);
  29431. Vue.component(src_option.name, src_option);
  29432. Vue.component(optgroup.name, optgroup);
  29433. }
  29434. });
  29435. /* harmony default export */ var packages_select = (Select);
  29436. // CONCATENATED MODULE: ./packages/optgroup/index.js
  29437. var Optgroup = Object.assign(optgroup, {
  29438. install: function install(Vue) {
  29439. Vue.component(optgroup.name, optgroup);
  29440. }
  29441. });
  29442. /* harmony default export */ var packages_optgroup = (Optgroup);
  29443. // CONCATENATED MODULE: ./packages/option/index.js
  29444. var Option = Object.assign(src_option, {
  29445. install: function install(Vue) {
  29446. Vue.component(src_option.name, src_option);
  29447. }
  29448. });
  29449. /* harmony default export */ var packages_option = (Option);
  29450. // CONCATENATED MODULE: ./packages/switch/src/switch.js
  29451. var switch_browse = DomTools.browse;
  29452. /* harmony default export */ var src_switch = ({
  29453. name: 'VxeSwitch',
  29454. mixins: [size],
  29455. props: {
  29456. value: [String, Number, Boolean],
  29457. disabled: Boolean,
  29458. size: {
  29459. type: String,
  29460. default: function _default() {
  29461. return conf.switch.size || conf.size;
  29462. }
  29463. },
  29464. openLabel: String,
  29465. closeLabel: String,
  29466. openValue: {
  29467. type: [String, Number, Boolean],
  29468. default: true
  29469. },
  29470. closeValue: {
  29471. type: [String, Number, Boolean],
  29472. default: false
  29473. },
  29474. openIcon: String,
  29475. closeIcon: String
  29476. },
  29477. data: function data() {
  29478. return {
  29479. isActivated: false,
  29480. hasAnimat: false,
  29481. offsetLeft: 0
  29482. };
  29483. },
  29484. computed: {
  29485. isChecked: function isChecked() {
  29486. return this.value === this.openValue;
  29487. },
  29488. onShowLabel: function onShowLabel() {
  29489. return UtilTools.getFuncText(this.openLabel);
  29490. },
  29491. offShowLabel: function offShowLabel() {
  29492. return UtilTools.getFuncText(this.closeLabel);
  29493. },
  29494. styles: function styles() {
  29495. return switch_browse.msie && this.isChecked ? {
  29496. left: "".concat(this.offsetLeft, "px")
  29497. } : null;
  29498. }
  29499. },
  29500. created: function created() {
  29501. var _this = this;
  29502. if (switch_browse.msie) {
  29503. this.$nextTick(function () {
  29504. return _this.updateStyle();
  29505. });
  29506. }
  29507. },
  29508. render: function render(h) {
  29509. var _ref;
  29510. var isChecked = this.isChecked,
  29511. vSize = this.vSize,
  29512. disabled = this.disabled,
  29513. openIcon = this.openIcon,
  29514. closeIcon = this.closeIcon;
  29515. return h('div', {
  29516. 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)]
  29517. }, [h('button', {
  29518. ref: 'btn',
  29519. class: 'vxe-switch--button',
  29520. attrs: {
  29521. type: 'button',
  29522. disabled: disabled
  29523. },
  29524. on: {
  29525. click: this.clickEvent,
  29526. focus: this.focusEvent,
  29527. blur: this.blurEvent
  29528. }
  29529. }, [h('span', {
  29530. class: 'vxe-switch--label vxe-switch--label-on'
  29531. }, [openIcon ? h('i', {
  29532. class: ['vxe-switch--label-icon', openIcon]
  29533. }) : null, this.onShowLabel]), h('span', {
  29534. class: 'vxe-switch--label vxe-switch--label-off'
  29535. }, [closeIcon ? h('i', {
  29536. class: ['vxe-switch--label-icon', closeIcon]
  29537. }) : null, this.offShowLabel]), h('span', {
  29538. class: 'vxe-switch--icon',
  29539. style: this.styles
  29540. })])]);
  29541. },
  29542. methods: {
  29543. updateStyle: function updateStyle() {
  29544. // 兼容 IE
  29545. this.hasAnimat = true;
  29546. this.offsetLeft = this.$refs.btn.offsetWidth;
  29547. },
  29548. clickEvent: function clickEvent(evnt) {
  29549. var _this2 = this;
  29550. if (!this.disabled) {
  29551. clearTimeout(this.activeTimeout);
  29552. var value = this.isChecked ? this.closeValue : this.openValue;
  29553. this.hasAnimat = true;
  29554. if (switch_browse.msie) {
  29555. this.updateStyle();
  29556. }
  29557. this.$emit('input', value);
  29558. this.$emit('change', {
  29559. value: value,
  29560. $event: evnt
  29561. });
  29562. this.activeTimeout = setTimeout(function () {
  29563. _this2.hasAnimat = false;
  29564. }, 400);
  29565. }
  29566. },
  29567. focusEvent: function focusEvent(evnt) {
  29568. this.isActivated = true;
  29569. this.$emit('focus', {
  29570. value: this.value,
  29571. $event: evnt
  29572. });
  29573. },
  29574. blurEvent: function blurEvent(evnt) {
  29575. this.isActivated = false;
  29576. this.$emit('blur', {
  29577. value: this.value,
  29578. $event: evnt
  29579. });
  29580. }
  29581. }
  29582. });
  29583. // CONCATENATED MODULE: ./packages/switch/index.js
  29584. var Switch = Object.assign(src_switch, {
  29585. install: function install(Vue) {
  29586. Vue.component(src_switch.name, src_switch);
  29587. }
  29588. });
  29589. /* harmony default export */ var packages_switch = (Switch);
  29590. // CONCATENATED MODULE: ./packages/list/src/list.js
  29591. var list_browse = DomTools.browse;
  29592. /* harmony default export */ var src_list = ({
  29593. name: 'VxeList',
  29594. mixins: [size],
  29595. props: {
  29596. data: Array,
  29597. height: [Number, String],
  29598. maxHeight: [Number, String],
  29599. loading: Boolean,
  29600. size: {
  29601. type: String,
  29602. default: function _default() {
  29603. return conf.list.size || conf.size;
  29604. }
  29605. },
  29606. autoResize: {
  29607. type: Boolean,
  29608. default: function _default() {
  29609. return conf.list.autoResize;
  29610. }
  29611. },
  29612. syncResize: [Boolean, String, Number],
  29613. scrollY: Object
  29614. },
  29615. data: function data() {
  29616. return {
  29617. scrollYLoad: false,
  29618. bodyHeight: 0,
  29619. topSpaceHeight: 0,
  29620. items: []
  29621. };
  29622. },
  29623. computed: {
  29624. sYOpts: function sYOpts() {
  29625. return Object.assign({}, conf.list.scrollY, this.scrollY);
  29626. },
  29627. styles: function styles() {
  29628. var height = this.height,
  29629. maxHeight = this.maxHeight;
  29630. var style = {};
  29631. if (height) {
  29632. style.height = isNaN(height) ? height : "".concat(height, "px");
  29633. } else if (maxHeight) {
  29634. style.height = 'auto';
  29635. style.maxHeight = isNaN(maxHeight) ? maxHeight : "".concat(maxHeight, "px");
  29636. }
  29637. return style;
  29638. }
  29639. },
  29640. watch: {
  29641. data: function data(value) {
  29642. this.loadData(value);
  29643. },
  29644. syncResize: function syncResize(value) {
  29645. var _this = this;
  29646. if (value) {
  29647. this.recalculate();
  29648. this.$nextTick(function () {
  29649. return setTimeout(function () {
  29650. return _this.recalculate();
  29651. });
  29652. });
  29653. }
  29654. }
  29655. },
  29656. created: function created() {
  29657. Object.assign(this, {
  29658. fullData: [],
  29659. lastScrollLeft: 0,
  29660. lastScrollTop: 0,
  29661. scrollYStore: {
  29662. startIndex: 0,
  29663. endIndex: 0,
  29664. visibleSize: 0
  29665. }
  29666. });
  29667. this.loadData(this.data);
  29668. GlobalEvent.on(this, 'resize', this.handleGlobalResizeEvent);
  29669. },
  29670. mounted: function mounted() {
  29671. var _this2 = this;
  29672. if (this.autoResize) {
  29673. var resizeObserver = createResizeEvent(function () {
  29674. return _this2.recalculate();
  29675. });
  29676. resizeObserver.observe(this.$el);
  29677. this.$resize = resizeObserver;
  29678. }
  29679. },
  29680. beforeDestroy: function beforeDestroy() {
  29681. if (this.$resize) {
  29682. this.$resize.disconnect();
  29683. }
  29684. },
  29685. destroyed: function destroyed() {
  29686. GlobalEvent.off(this, 'resize');
  29687. },
  29688. render: function render(h) {
  29689. var $scopedSlots = this.$scopedSlots,
  29690. styles = this.styles,
  29691. bodyHeight = this.bodyHeight,
  29692. topSpaceHeight = this.topSpaceHeight,
  29693. items = this.items,
  29694. loading = this.loading;
  29695. return h('div', {
  29696. class: ['vxe-list', {
  29697. 'is--loading': loading
  29698. }]
  29699. }, [h('div', {
  29700. ref: 'virtualWrapper',
  29701. class: 'vxe-list--virtual-wrapper',
  29702. style: styles,
  29703. on: {
  29704. scroll: this.scrollEvent
  29705. }
  29706. }, [h('div', {
  29707. ref: 'ySpace',
  29708. class: 'vxe-list--y-space',
  29709. style: {
  29710. height: bodyHeight ? "".concat(bodyHeight, "px") : ''
  29711. }
  29712. }), h('div', {
  29713. ref: 'body',
  29714. class: 'vxe-list--body',
  29715. style: {
  29716. marginTop: topSpaceHeight ? "".concat(topSpaceHeight, "px") : ''
  29717. }
  29718. }, $scopedSlots.default ? $scopedSlots.default.call(this, {
  29719. items: items,
  29720. $list: this
  29721. }, h) : [])]), h('div', {
  29722. class: ['vxe-list--loading vxe-loading', {
  29723. 'is--visible': loading
  29724. }]
  29725. }, [h('div', {
  29726. class: 'vxe-loading--spinner'
  29727. })])]);
  29728. },
  29729. methods: {
  29730. getParentElem: function getParentElem() {
  29731. return this.$el.parentNode;
  29732. },
  29733. /**
  29734. * 加载数据
  29735. * @param {Array} datas 数据
  29736. */
  29737. loadData: function loadData(datas) {
  29738. var _this3 = this;
  29739. var sYOpts = this.sYOpts,
  29740. scrollYStore = this.scrollYStore;
  29741. var fullData = datas || [];
  29742. scrollYStore.startIndex = 0;
  29743. scrollYStore.visibleIndex = 0;
  29744. this.fullData = fullData;
  29745. this.scrollYLoad = sYOpts.enabled && sYOpts.gt > -1 && sYOpts.gt <= fullData.length;
  29746. this.handleData();
  29747. return this.computeScrollLoad().then(function () {
  29748. _this3.refreshScroll();
  29749. });
  29750. },
  29751. /**
  29752. * 重新加载数据
  29753. * @param {Array} datas 数据
  29754. */
  29755. reloadData: function reloadData(datas) {
  29756. this.clearScroll();
  29757. return this.loadData(datas);
  29758. },
  29759. handleData: function handleData() {
  29760. var fullData = this.fullData,
  29761. scrollYLoad = this.scrollYLoad,
  29762. scrollYStore = this.scrollYStore;
  29763. this.items = scrollYLoad ? fullData.slice(scrollYStore.startIndex, scrollYStore.endIndex) : fullData.slice(0);
  29764. return this.$nextTick();
  29765. },
  29766. /**
  29767. * 重新计算列表
  29768. */
  29769. recalculate: function recalculate() {
  29770. var $el = this.$el;
  29771. if ($el.clientWidth && $el.clientHeight) {
  29772. return this.computeScrollLoad();
  29773. }
  29774. return Promise.resolve();
  29775. },
  29776. /**
  29777. * 清除滚动条
  29778. */
  29779. clearScroll: function clearScroll() {
  29780. var _this4 = this;
  29781. var scrollBodyElem = this.$refs.virtualWrapper;
  29782. if (scrollBodyElem) {
  29783. scrollBodyElem.scrollTop = 0;
  29784. }
  29785. return new Promise(function (resolve) {
  29786. setTimeout(function () {
  29787. resolve(_this4.$nextTick());
  29788. });
  29789. });
  29790. },
  29791. /**
  29792. * 刷新滚动条
  29793. */
  29794. refreshScroll: function refreshScroll() {
  29795. var _this5 = this;
  29796. var lastScrollLeft = this.lastScrollLeft,
  29797. lastScrollTop = this.lastScrollTop;
  29798. return this.clearScroll().then(function () {
  29799. if (lastScrollLeft || lastScrollTop) {
  29800. _this5.lastScrollLeft = 0;
  29801. _this5.lastScrollTop = 0;
  29802. return _this5.scrollTo(lastScrollLeft, lastScrollTop);
  29803. }
  29804. });
  29805. },
  29806. /**
  29807. * 如果有滚动条,则滚动到对应的位置
  29808. * @param {Number} scrollLeft 左距离
  29809. * @param {Number} scrollTop 上距离
  29810. */
  29811. scrollTo: function scrollTo(scrollLeft, scrollTop) {
  29812. var _this6 = this;
  29813. var scrollBodyElem = this.$refs.virtualWrapper;
  29814. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNumber(scrollLeft)) {
  29815. scrollBodyElem.scrollLeft = scrollLeft;
  29816. }
  29817. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNumber(scrollTop)) {
  29818. scrollBodyElem.scrollTop = scrollTop;
  29819. }
  29820. if (this.scrollYLoad) {
  29821. return new Promise(function (resolve) {
  29822. return setTimeout(function () {
  29823. return resolve(_this6.$nextTick());
  29824. }, 50);
  29825. });
  29826. }
  29827. return this.$nextTick();
  29828. },
  29829. computeScrollLoad: function computeScrollLoad() {
  29830. var _this7 = this;
  29831. return this.$nextTick().then(function () {
  29832. var $refs = _this7.$refs,
  29833. sYOpts = _this7.sYOpts,
  29834. scrollYLoad = _this7.scrollYLoad,
  29835. scrollYStore = _this7.scrollYStore;
  29836. var rowHeight = 0;
  29837. var firstItemElem;
  29838. if (sYOpts.sItem) {
  29839. firstItemElem = $refs.body.querySelector(sYOpts.sItem);
  29840. }
  29841. if (!firstItemElem) {
  29842. firstItemElem = $refs.body.children[0];
  29843. }
  29844. if (firstItemElem) {
  29845. rowHeight = firstItemElem.offsetHeight;
  29846. }
  29847. rowHeight = Math.max(20, rowHeight);
  29848. scrollYStore.rowHeight = rowHeight; // 计算 Y 逻辑
  29849. if (scrollYLoad) {
  29850. var visibleYSize = Math.max(8, Math.ceil($refs.virtualWrapper.clientHeight / rowHeight));
  29851. var offsetYSize = sYOpts.oSize ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(sYOpts.oSize) : list_browse.msie ? 20 : list_browse.edge ? 10 : 0;
  29852. scrollYStore.offsetSize = offsetYSize;
  29853. scrollYStore.visibleSize = visibleYSize;
  29854. scrollYStore.endIndex = Math.max(scrollYStore.startIndex, visibleYSize + offsetYSize, scrollYStore.endIndex);
  29855. _this7.updateYData();
  29856. } else {
  29857. _this7.updateYSpace();
  29858. }
  29859. _this7.rowHeight = rowHeight;
  29860. });
  29861. },
  29862. scrollEvent: function scrollEvent(evnt) {
  29863. var scrollBodyElem = evnt.target;
  29864. var scrollTop = scrollBodyElem.scrollTop;
  29865. var scrollLeft = scrollBodyElem.scrollLeft;
  29866. var isX = scrollLeft !== this.lastScrollLeft;
  29867. var isY = scrollTop !== this.lastScrollTop;
  29868. this.lastScrollTop = scrollTop;
  29869. this.lastScrollLeft = scrollLeft;
  29870. if (this.scrollYLoad) {
  29871. this.loadYData(evnt);
  29872. }
  29873. this.$emit('scroll', {
  29874. scrollLeft: scrollLeft,
  29875. scrollTop: scrollTop,
  29876. isX: isX,
  29877. isY: isY,
  29878. $event: evnt
  29879. });
  29880. },
  29881. loadYData: function loadYData(evnt) {
  29882. var scrollYStore = this.scrollYStore;
  29883. var startIndex = scrollYStore.startIndex,
  29884. endIndex = scrollYStore.endIndex,
  29885. visibleSize = scrollYStore.visibleSize,
  29886. offsetSize = scrollYStore.offsetSize,
  29887. rowHeight = scrollYStore.rowHeight;
  29888. var scrollBodyElem = evnt.target;
  29889. var scrollTop = scrollBodyElem.scrollTop;
  29890. var toVisibleIndex = Math.floor(scrollTop / rowHeight);
  29891. var offsetStartIndex = Math.max(0, toVisibleIndex - 1 - offsetSize);
  29892. var offsetEndIndex = toVisibleIndex + visibleSize + offsetSize;
  29893. if (toVisibleIndex <= startIndex || toVisibleIndex >= endIndex - visibleSize - 1) {
  29894. if (startIndex !== offsetStartIndex || endIndex !== offsetEndIndex) {
  29895. scrollYStore.startIndex = offsetStartIndex;
  29896. scrollYStore.endIndex = offsetEndIndex;
  29897. this.updateYData();
  29898. }
  29899. }
  29900. },
  29901. updateYData: function updateYData() {
  29902. this.handleData();
  29903. this.updateYSpace();
  29904. },
  29905. updateYSpace: function updateYSpace() {
  29906. var scrollYStore = this.scrollYStore,
  29907. scrollYLoad = this.scrollYLoad,
  29908. fullData = this.fullData;
  29909. this.bodyHeight = scrollYLoad ? fullData.length * scrollYStore.rowHeight : 0;
  29910. this.topSpaceHeight = scrollYLoad ? Math.max(scrollYStore.startIndex * scrollYStore.rowHeight, 0) : 0;
  29911. },
  29912. handleGlobalResizeEvent: function handleGlobalResizeEvent() {
  29913. this.recalculate();
  29914. }
  29915. }
  29916. });
  29917. // CONCATENATED MODULE: ./packages/list/index.js
  29918. var List = Object.assign(src_list, {
  29919. install: function install(Vue) {
  29920. Vue.component(src_list.name, src_list);
  29921. }
  29922. });
  29923. /* harmony default export */ var packages_list = (List);
  29924. // CONCATENATED MODULE: ./packages/pulldown/src/pulldown.js
  29925. /* harmony default export */ var pulldown = ({
  29926. name: 'VxePulldown',
  29927. mixins: [size],
  29928. props: {
  29929. disabled: Boolean,
  29930. placement: String,
  29931. size: {
  29932. type: String,
  29933. default: function _default() {
  29934. return conf.size;
  29935. }
  29936. },
  29937. destroyOnClose: Boolean,
  29938. transfer: Boolean
  29939. },
  29940. data: function data() {
  29941. return {
  29942. inited: false,
  29943. panelIndex: 0,
  29944. panelStyle: null,
  29945. panelPlacement: null,
  29946. currentValue: null,
  29947. visiblePanel: false,
  29948. animatVisible: false,
  29949. isActivated: false
  29950. };
  29951. },
  29952. created: function created() {
  29953. GlobalEvent.on(this, 'mousewheel', this.handleGlobalMousewheelEvent);
  29954. GlobalEvent.on(this, 'mousedown', this.handleGlobalMousedownEvent);
  29955. GlobalEvent.on(this, 'blur', this.handleGlobalBlurEvent);
  29956. },
  29957. beforeDestroy: function beforeDestroy() {
  29958. var panelElem = this.$refs.panel;
  29959. if (panelElem && panelElem.parentNode) {
  29960. panelElem.parentNode.removeChild(panelElem);
  29961. }
  29962. },
  29963. destroyed: function destroyed() {
  29964. GlobalEvent.off(this, 'mousewheel');
  29965. GlobalEvent.off(this, 'mousedown');
  29966. GlobalEvent.off(this, 'blur');
  29967. },
  29968. render: function render(h) {
  29969. var _ref, _ref2;
  29970. var $scopedSlots = this.$scopedSlots,
  29971. inited = this.inited,
  29972. vSize = this.vSize,
  29973. destroyOnClose = this.destroyOnClose,
  29974. transfer = this.transfer,
  29975. isActivated = this.isActivated,
  29976. disabled = this.disabled,
  29977. animatVisible = this.animatVisible,
  29978. visiblePanel = this.visiblePanel,
  29979. panelStyle = this.panelStyle,
  29980. panelPlacement = this.panelPlacement;
  29981. var defaultSlot = $scopedSlots.default;
  29982. var downSlot = $scopedSlots.dropdown;
  29983. return h('div', {
  29984. 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)]
  29985. }, [h('div', {
  29986. ref: 'content',
  29987. class: 'vxe-pulldown--content'
  29988. }, defaultSlot ? defaultSlot.call(this, {
  29989. $pulldown: this
  29990. }, h) : []), h('div', {
  29991. ref: 'panel',
  29992. 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)],
  29993. attrs: {
  29994. placement: panelPlacement
  29995. },
  29996. style: panelStyle
  29997. }, downSlot ? !inited || destroyOnClose && !visiblePanel && !animatVisible ? [] : downSlot.call(this, {
  29998. $pulldown: this
  29999. }, h) : [])]);
  30000. },
  30001. methods: {
  30002. handleGlobalMousewheelEvent: function handleGlobalMousewheelEvent(evnt) {
  30003. var $refs = this.$refs,
  30004. disabled = this.disabled,
  30005. visiblePanel = this.visiblePanel;
  30006. if (!disabled) {
  30007. if (visiblePanel) {
  30008. if (DomTools.getEventTargetNode(evnt, $refs.panel).flag) {
  30009. this.updatePlacement();
  30010. } else {
  30011. this.hidePanel();
  30012. this.$emit('hide-panel', {
  30013. $event: evnt
  30014. });
  30015. }
  30016. }
  30017. }
  30018. },
  30019. handleGlobalMousedownEvent: function handleGlobalMousedownEvent(evnt) {
  30020. var $refs = this.$refs,
  30021. $el = this.$el,
  30022. disabled = this.disabled,
  30023. visiblePanel = this.visiblePanel;
  30024. if (!disabled) {
  30025. this.isActivated = DomTools.getEventTargetNode(evnt, $el).flag || DomTools.getEventTargetNode(evnt, $refs.panel).flag;
  30026. if (visiblePanel && !this.isActivated) {
  30027. this.hidePanel();
  30028. this.$emit('hide-panel', {
  30029. $event: evnt
  30030. });
  30031. }
  30032. }
  30033. },
  30034. handleGlobalBlurEvent: function handleGlobalBlurEvent(evnt) {
  30035. if (this.visiblePanel) {
  30036. this.hidePanel();
  30037. this.$emit('hide-panel', {
  30038. $event: evnt
  30039. });
  30040. }
  30041. },
  30042. updateZindex: function updateZindex() {
  30043. if (this.panelIndex < UtilTools.getLastZIndex()) {
  30044. this.panelIndex = UtilTools.nextZIndex();
  30045. }
  30046. },
  30047. isPanelVisible: function isPanelVisible() {
  30048. return this.visiblePanel;
  30049. },
  30050. /**
  30051. * 切换下拉面板
  30052. */
  30053. togglePanel: function togglePanel() {
  30054. if (this.visiblePanel) {
  30055. return this.hidePanel();
  30056. }
  30057. return this.showPanel();
  30058. },
  30059. /**
  30060. * 显示下拉面板
  30061. */
  30062. showPanel: function showPanel() {
  30063. var _this = this;
  30064. if (!this.inited) {
  30065. this.inited = true;
  30066. if (this.transfer) {
  30067. document.body.appendChild(this.$refs.panel);
  30068. }
  30069. }
  30070. return new Promise(function (resolve) {
  30071. if (!_this.disabled) {
  30072. clearTimeout(_this.hidePanelTimeout);
  30073. _this.isActivated = true;
  30074. _this.animatVisible = true;
  30075. setTimeout(function () {
  30076. _this.visiblePanel = true;
  30077. _this.updatePlacement();
  30078. setTimeout(function () {
  30079. resolve(_this.updatePlacement());
  30080. }, 40);
  30081. }, 10);
  30082. _this.updateZindex();
  30083. } else {
  30084. resolve(_this.$nextTick());
  30085. }
  30086. });
  30087. },
  30088. /**
  30089. * 隐藏下拉面板
  30090. */
  30091. hidePanel: function hidePanel() {
  30092. var _this2 = this;
  30093. this.visiblePanel = false;
  30094. return new Promise(function (resolve) {
  30095. if (_this2.animatVisible) {
  30096. _this2.hidePanelTimeout = setTimeout(function () {
  30097. _this2.animatVisible = false;
  30098. resolve(_this2.$nextTick());
  30099. }, 350);
  30100. } else {
  30101. resolve(_this2.$nextTick());
  30102. }
  30103. });
  30104. },
  30105. /**
  30106. * 手动更新位置
  30107. */
  30108. updatePlacement: function updatePlacement() {
  30109. var _this3 = this;
  30110. return this.$nextTick().then(function () {
  30111. var $refs = _this3.$refs,
  30112. transfer = _this3.transfer,
  30113. placement = _this3.placement,
  30114. panelIndex = _this3.panelIndex,
  30115. visiblePanel = _this3.visiblePanel;
  30116. if (visiblePanel) {
  30117. var panelElem = $refs.panel;
  30118. var targetElem = $refs.content;
  30119. if (panelElem && targetElem) {
  30120. var targetHeight = targetElem.offsetHeight;
  30121. var targetWidth = targetElem.offsetWidth;
  30122. var panelHeight = panelElem.offsetHeight;
  30123. var panelWidth = panelElem.offsetWidth;
  30124. var marginSize = 5;
  30125. var panelStyle = {
  30126. zIndex: panelIndex
  30127. };
  30128. var _DomTools$getAbsolute = DomTools.getAbsolutePos(targetElem),
  30129. boundingTop = _DomTools$getAbsolute.boundingTop,
  30130. boundingLeft = _DomTools$getAbsolute.boundingLeft,
  30131. visibleHeight = _DomTools$getAbsolute.visibleHeight,
  30132. visibleWidth = _DomTools$getAbsolute.visibleWidth;
  30133. var panelPlacement = 'bottom';
  30134. if (transfer) {
  30135. var left = boundingLeft;
  30136. var top = boundingTop + targetHeight;
  30137. if (placement === 'top') {
  30138. panelPlacement = 'top';
  30139. top = boundingTop - panelHeight;
  30140. } else if (!placement) {
  30141. // 如果下面不够放,则向上
  30142. if (top + panelHeight + marginSize > visibleHeight) {
  30143. panelPlacement = 'top';
  30144. top = boundingTop - panelHeight;
  30145. } // 如果上面不够放,则向下(优先)
  30146. if (top < marginSize) {
  30147. panelPlacement = 'bottom';
  30148. top = boundingTop + targetHeight;
  30149. }
  30150. } // 如果溢出右边
  30151. if (left + panelWidth + marginSize > visibleWidth) {
  30152. left -= left + panelWidth + marginSize - visibleWidth;
  30153. } // 如果溢出左边
  30154. if (left < marginSize) {
  30155. left = marginSize;
  30156. }
  30157. Object.assign(panelStyle, {
  30158. left: "".concat(left, "px"),
  30159. top: "".concat(top, "px"),
  30160. minWidth: "".concat(targetWidth, "px")
  30161. });
  30162. } else {
  30163. if (placement === 'top') {
  30164. panelPlacement = 'top';
  30165. panelStyle.bottom = "".concat(targetHeight, "px");
  30166. } else if (!placement) {
  30167. // 如果下面不够放,则向上
  30168. if (boundingTop + targetHeight + panelHeight > visibleHeight) {
  30169. // 如果上面不够放,则向下(优先)
  30170. if (boundingTop - targetHeight - panelHeight > marginSize) {
  30171. panelPlacement = 'top';
  30172. panelStyle.bottom = "".concat(targetHeight, "px");
  30173. }
  30174. }
  30175. }
  30176. }
  30177. _this3.panelStyle = panelStyle;
  30178. _this3.panelPlacement = panelPlacement;
  30179. }
  30180. }
  30181. return _this3.$nextTick();
  30182. });
  30183. }
  30184. }
  30185. });
  30186. // CONCATENATED MODULE: ./packages/pulldown/index.js
  30187. var Pulldown = Object.assign(pulldown, {
  30188. install: function install(Vue) {
  30189. Vue.component(pulldown.name, pulldown);
  30190. }
  30191. });
  30192. /* harmony default export */ var packages_pulldown = (Pulldown);
  30193. // CONCATENATED MODULE: ./packages/locale/lang/zh-CN.js
  30194. /* harmony default export */ var zh_CN = ({
  30195. vxe: {
  30196. error: {
  30197. groupFixed: '如果使用分组表头,固定列必须按组设置',
  30198. groupMouseRange: '分组表头与 "{0}" 不能同时使用,这可能会出现错误',
  30199. groupTag: '分组列头应该使用 "{0}" 而不是 "{1}",这可能会出现错误',
  30200. scrollErrProp: '启用虚拟滚动后不支持该参数 "{0}"',
  30201. scrollXNotGroup: '横向虚拟滚动不支持分组表头,需要设置 "scroll-x.enabled=false" 参数,否则可能会导致出现错误',
  30202. errConflicts: '参数 "{0}" 与 "{1}" 有冲突',
  30203. unableInsert: '无法插入到指定位置,请检查参数是否正确',
  30204. useErr: '安装 "{0}" 模块时发生错误,可能顺序不正确,依赖的模块需要在 Table 之前安装',
  30205. barUnableLink: '工具栏无法关联表格',
  30206. expandContent: '展开行的插槽应该是 "content",请检查是否正确',
  30207. reqModule: '缺少 "{0}" 模块',
  30208. reqProp: '缺少必要的 "{0}" 参数,这可能会导致出现错误',
  30209. emptyProp: '参数 "{0}" 不允许为空',
  30210. errProp: '不支持的参数 "{0}",可能为 "{1}"',
  30211. colRepet: 'column.{0}="{1}" 重复了,这可能会导致某些功能无法使用',
  30212. notFunc: '方法 "{0}" 不存在',
  30213. notSlot: '插槽 "{0}" 不存在',
  30214. noTree: '树结构不支持 "{0}"',
  30215. notProp: '不支持的参数 "{0}"',
  30216. coverProp: '"{0}" 的参数 "{1}" 被覆盖,这可能会出现错误',
  30217. delFunc: '方法 "{0}" 已废弃,请使用 "{1}"',
  30218. delProp: '参数 "{0}" 已废弃,请使用 "{1}"',
  30219. delEvent: '事件 "{0}" 已废弃,请使用 "{1}"',
  30220. removeProp: '参数 "{0}" 已废弃,不建议使用,这可能会导致出现错误',
  30221. errFormat: '全局的格式化内容应该使用 "VXETable.formats" 定义,挂载 "formatter={0}" 的方式已不建议使用',
  30222. notType: '不支持的文件类型 "{0}"',
  30223. notExp: '该浏览器不支持导入/导出功能',
  30224. impFields: '导入失败,请检查字段名和数据格式是否正确',
  30225. treeNotImp: '树表格不支持导入'
  30226. },
  30227. renderer: {
  30228. search: '搜索',
  30229. cases: {
  30230. equal: '等于',
  30231. unequal: '不等于',
  30232. gt: '大于',
  30233. ge: '大于或等于',
  30234. lt: '小于',
  30235. le: '小于或等于',
  30236. begin: '开头是',
  30237. notbegin: '开头不是',
  30238. endin: '结尾是',
  30239. notendin: '结尾不是',
  30240. include: '包含',
  30241. exclude: '不包含',
  30242. between: '介于',
  30243. custom: '自定义筛选',
  30244. insensitive: '不区分大小写',
  30245. isSensitive: '区分大小写'
  30246. },
  30247. combination: {
  30248. menus: {
  30249. sortAsc: '升序',
  30250. sortDesc: '降序',
  30251. fixedColumn: '锁定列',
  30252. fixedGroup: '锁定组',
  30253. cancelFixed: '取消锁定',
  30254. fixedLeft: '锁定左侧',
  30255. fixedRight: '锁定右侧',
  30256. clearFilter: '清除筛选',
  30257. textOption: '文本筛选',
  30258. numberOption: '数值筛选'
  30259. },
  30260. popup: {
  30261. title: '自定义筛选的方式',
  30262. currColumnTitle: '当前列:',
  30263. and: '与',
  30264. or: '或',
  30265. describeHtml: '可用 ? 代表单个字符<br/>用 * 代表任意多个字符'
  30266. },
  30267. empty: '(空白)',
  30268. notData: '无匹配项'
  30269. }
  30270. },
  30271. pro: {
  30272. area: {
  30273. mergeErr: '无法对合并单元格进行该操作',
  30274. multiErr: '无法对多重选择区域进行该操作',
  30275. extendErr: '如果延伸的区域包含被合并的单元格,所有合并的单元格需大小相同'
  30276. },
  30277. fnr: {
  30278. title: '查找和替换',
  30279. findLabel: '查找',
  30280. replaceLabel: '替换',
  30281. findTitle: '查找内容:',
  30282. replaceTitle: '替换为:',
  30283. tabs: {
  30284. find: '查找',
  30285. replace: '替换'
  30286. },
  30287. filter: {
  30288. re: '正则表达式',
  30289. whole: '全词匹配',
  30290. sensitive: '区分大小写'
  30291. },
  30292. btns: {
  30293. findNext: '查找下一个',
  30294. findAll: '查找全部',
  30295. replace: '替换',
  30296. replaceAll: '替换全部',
  30297. cancel: '取消'
  30298. },
  30299. header: {
  30300. seq: '#',
  30301. cell: '单元格',
  30302. value: '值'
  30303. },
  30304. empty: '(空值)',
  30305. reError: '无效的正则表达式',
  30306. recordCount: '已找到 {0} 个单元格',
  30307. notCell: '找不到匹配的单元格',
  30308. replaceSuccess: '成功替换 {0} 个单元格'
  30309. }
  30310. },
  30311. table: {
  30312. emptyText: '暂无数据',
  30313. allTitle: '全选/取消',
  30314. seqTitle: '#',
  30315. confirmFilter: '筛选',
  30316. resetFilter: '重置',
  30317. allFilter: '全部',
  30318. sortAsc: '升序:最低到最高',
  30319. sortDesc: '降序:最高到最低',
  30320. filter: '对所选的列启用筛选',
  30321. impSuccess: '成功导入 {0} 条记录',
  30322. expLoading: '正在导出中',
  30323. expSuccess: '导出成功',
  30324. expFilename: '导出_{0}',
  30325. expOriginFilename: '导出_源_{0}',
  30326. customTitle: '列设置',
  30327. customAll: '全部',
  30328. customConfirm: '确认',
  30329. customRestore: '还原'
  30330. },
  30331. grid: {
  30332. selectOneRecord: '请至少选择一条记录!',
  30333. deleteSelectRecord: '您确定要删除所选记录吗?',
  30334. removeSelectRecord: '您确定要移除所选记录吗?',
  30335. dataUnchanged: '数据未改动!',
  30336. delSuccess: '成功删除所选记录!',
  30337. saveSuccess: '保存成功!',
  30338. operError: '发生错误,操作失败!'
  30339. },
  30340. select: {
  30341. emptyText: '暂无数据'
  30342. },
  30343. pager: {
  30344. goto: '前往',
  30345. pagesize: '{0}条/页',
  30346. total: '共 {0} 条记录',
  30347. pageClassifier: '页',
  30348. prevPage: '上一页',
  30349. nextPage: '下一页',
  30350. prevJump: '向上跳页',
  30351. nextJump: '向下跳页'
  30352. },
  30353. alert: {
  30354. title: '消息提示'
  30355. },
  30356. button: {
  30357. confirm: '确认',
  30358. cancel: '取消'
  30359. },
  30360. import: {
  30361. modes: {
  30362. covering: '覆盖',
  30363. insert: '新增'
  30364. },
  30365. impTitle: '导入数据',
  30366. impFile: '文件名',
  30367. impSelect: '选择文件',
  30368. impType: '文件类型',
  30369. impOpts: '参数设置',
  30370. impConfirm: '导入',
  30371. impCancel: '取消'
  30372. },
  30373. export: {
  30374. types: {
  30375. csv: 'CSV (逗号分隔)(*.csv)',
  30376. html: '网页(*.html)',
  30377. xml: 'XML 数据(*.xml)',
  30378. txt: '文本文件(制表符分隔)(*.txt)',
  30379. xls: 'Excel 97-2003 工作簿(*.xls)',
  30380. xlsx: 'Excel 工作簿(*.xlsx)',
  30381. pdf: 'PDF (*.pdf)'
  30382. },
  30383. modes: {
  30384. current: '当前数据(当前页的数据)',
  30385. selected: '选中数据(当前页选中的数据)',
  30386. all: '全量数据(包括所有分页的数据)'
  30387. },
  30388. printTitle: '打印数据',
  30389. expTitle: '导出数据',
  30390. expName: '文件名',
  30391. expNamePlaceholder: '请输入文件名',
  30392. expSheetName: '标题',
  30393. expSheetNamePlaceholder: '请输入标题',
  30394. expType: '保存类型',
  30395. expMode: '选择数据',
  30396. expCurrentColumn: '全部字段',
  30397. expColumn: '选择字段',
  30398. expOpts: '参数设置',
  30399. expOptHeader: '表头',
  30400. expHeaderTitle: '是否需要表头',
  30401. expOptFooter: '表尾',
  30402. expFooterTitle: '是否需要表尾',
  30403. expOptColgroup: '分组表头',
  30404. expColgroupTitle: '如果存在,则支持带有分组结构的表头',
  30405. expOptMerge: '合并',
  30406. expMergeTitle: '如果存在,则支持带有合并结构的单元格',
  30407. expOptAllExpand: '展开层级',
  30408. expAllExpandTitle: '如果存在,则支持将带有层级结构的数据全部展开',
  30409. expOptUseStyle: '样式',
  30410. expUseStyleTitle: '如果存在,则支持带样式的单元格',
  30411. expOptOriginal: '源数据',
  30412. expOriginalTitle: '如果为源数据,则支持导入到表格中',
  30413. expPrint: '打印',
  30414. expConfirm: '导出',
  30415. expCancel: '取消'
  30416. },
  30417. modal: {
  30418. zoomIn: '最大化',
  30419. zoomOut: '还原',
  30420. close: '关闭'
  30421. },
  30422. form: {
  30423. folding: '收起',
  30424. unfolding: '展开'
  30425. },
  30426. toolbar: {
  30427. import: '导入',
  30428. export: '导出',
  30429. print: '打印',
  30430. refresh: '刷新',
  30431. zoomIn: '全屏',
  30432. zoomOut: '还原',
  30433. custom: '列设置',
  30434. customAll: '全部',
  30435. customConfirm: '确认',
  30436. customRestore: '还原'
  30437. },
  30438. input: {
  30439. date: {
  30440. m1: '01 月',
  30441. m2: '02 月',
  30442. m3: '03 月',
  30443. m4: '04 月',
  30444. m5: '05 月',
  30445. m6: '06 月',
  30446. m7: '07 月',
  30447. m8: '08 月',
  30448. m9: '09 月',
  30449. m10: '10 月',
  30450. m11: '11 月',
  30451. m12: '12 月',
  30452. monthLabel: '{0} 年',
  30453. dayLabel: '{0} 年 {1}',
  30454. labelFormat: {
  30455. date: 'yyyy-MM-dd',
  30456. time: 'HH:mm:ss',
  30457. datetime: 'yyyy-MM-dd HH:mm:ss',
  30458. week: 'yyyy 年第 WW 周',
  30459. month: 'yyyy-MM',
  30460. year: 'yyyy'
  30461. },
  30462. weeks: {
  30463. w: '周',
  30464. w0: '周日',
  30465. w1: '周一',
  30466. w2: '周二',
  30467. w3: '周三',
  30468. w4: '周四',
  30469. w5: '周五',
  30470. w6: '周六'
  30471. },
  30472. months: {
  30473. m0: '一月',
  30474. m1: '二月',
  30475. m2: '三月',
  30476. m3: '四月',
  30477. m4: '五月',
  30478. m5: '六月',
  30479. m6: '七月',
  30480. m7: '八月',
  30481. m8: '九月',
  30482. m9: '十月',
  30483. m10: '十一月',
  30484. m11: '十二月'
  30485. }
  30486. }
  30487. }
  30488. }
  30489. });
  30490. // CONCATENATED MODULE: ./packages/all.js
  30491. // 按需加载的组件
  30492. var components = [// 功能模块
  30493. Header, Footer, Icon, Filter, Menu, Edit, Export, Keyboard, Validator, // 可选组件
  30494. Column, Colgroup, Grid, Toolbar, Pager, Checkbox, CheckboxGroup, Radio, RadioGroup, RadioButton, Input, Textarea, Button, Modal, Tooltip, Form, FormItem, FormGather, Select, Optgroup, Option, Switch, List, Pulldown, // 核心
  30495. Table]; // 默认安装
  30496. function all_install(Vue, options) {
  30497. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isPlainObject(options)) {
  30498. VXETable.setup(options);
  30499. }
  30500. components.map(function (component) {
  30501. return component.install(Vue);
  30502. });
  30503. } // 默认中文
  30504. VXETable.setup({
  30505. i18n: function i18n(key, args) {
  30506. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toFormatString(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(zh_CN, key), args);
  30507. }
  30508. });
  30509. // EXTERNAL MODULE: ./styles/index.scss
  30510. var styles = __webpack_require__("1a97");
  30511. // CONCATENATED MODULE: ./index.js
  30512. if (typeof window !== 'undefined' && window.Vue) {
  30513. window.Vue.use(all_namespaceObject);
  30514. }
  30515. /* harmony default export */ var index_0 = (all_namespaceObject);
  30516. // CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js
  30517. /* harmony default export */ var entry_lib = __webpack_exports__["default"] = (index_0);
  30518. /***/ }),
  30519. /***/ "fb6a":
  30520. /***/ (function(module, exports, __webpack_require__) {
  30521. "use strict";
  30522. var $ = __webpack_require__("23e7");
  30523. var isObject = __webpack_require__("861d");
  30524. var isArray = __webpack_require__("e8b5");
  30525. var toAbsoluteIndex = __webpack_require__("23cb");
  30526. var toLength = __webpack_require__("50c4");
  30527. var toIndexedObject = __webpack_require__("fc6a");
  30528. var createProperty = __webpack_require__("8418");
  30529. var wellKnownSymbol = __webpack_require__("b622");
  30530. var arrayMethodHasSpeciesSupport = __webpack_require__("1dde");
  30531. var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('slice');
  30532. var SPECIES = wellKnownSymbol('species');
  30533. var nativeSlice = [].slice;
  30534. var max = Math.max;
  30535. // `Array.prototype.slice` method
  30536. // https://tc39.es/ecma262/#sec-array.prototype.slice
  30537. // fallback for not array-like ES3 strings and DOM objects
  30538. $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
  30539. slice: function slice(start, end) {
  30540. var O = toIndexedObject(this);
  30541. var length = toLength(O.length);
  30542. var k = toAbsoluteIndex(start, length);
  30543. var fin = toAbsoluteIndex(end === undefined ? length : end, length);
  30544. // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible
  30545. var Constructor, result, n;
  30546. if (isArray(O)) {
  30547. Constructor = O.constructor;
  30548. // cross-realm fallback
  30549. if (typeof Constructor == 'function' && (Constructor === Array || isArray(Constructor.prototype))) {
  30550. Constructor = undefined;
  30551. } else if (isObject(Constructor)) {
  30552. Constructor = Constructor[SPECIES];
  30553. if (Constructor === null) Constructor = undefined;
  30554. }
  30555. if (Constructor === Array || Constructor === undefined) {
  30556. return nativeSlice.call(O, k, fin);
  30557. }
  30558. }
  30559. result = new (Constructor === undefined ? Array : Constructor)(max(fin - k, 0));
  30560. for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);
  30561. result.length = n;
  30562. return result;
  30563. }
  30564. });
  30565. /***/ }),
  30566. /***/ "fc6a":
  30567. /***/ (function(module, exports, __webpack_require__) {
  30568. // toObject with fallback for non-array-like ES3 strings
  30569. var IndexedObject = __webpack_require__("44ad");
  30570. var requireObjectCoercible = __webpack_require__("1d80");
  30571. module.exports = function (it) {
  30572. return IndexedObject(requireObjectCoercible(it));
  30573. };
  30574. /***/ }),
  30575. /***/ "fdbc":
  30576. /***/ (function(module, exports) {
  30577. // iterable DOM collections
  30578. // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
  30579. module.exports = {
  30580. CSSRuleList: 0,
  30581. CSSStyleDeclaration: 0,
  30582. CSSValueList: 0,
  30583. ClientRectList: 0,
  30584. DOMRectList: 0,
  30585. DOMStringList: 0,
  30586. DOMTokenList: 1,
  30587. DataTransferItemList: 0,
  30588. FileList: 0,
  30589. HTMLAllCollection: 0,
  30590. HTMLCollection: 0,
  30591. HTMLFormElement: 0,
  30592. HTMLSelectElement: 0,
  30593. MediaList: 0,
  30594. MimeTypeArray: 0,
  30595. NamedNodeMap: 0,
  30596. NodeList: 1,
  30597. PaintRequestList: 0,
  30598. Plugin: 0,
  30599. PluginArray: 0,
  30600. SVGLengthList: 0,
  30601. SVGNumberList: 0,
  30602. SVGPathSegList: 0,
  30603. SVGPointList: 0,
  30604. SVGStringList: 0,
  30605. SVGTransformList: 0,
  30606. SourceBufferList: 0,
  30607. StyleSheetList: 0,
  30608. TextTrackCueList: 0,
  30609. TextTrackList: 0,
  30610. TouchList: 0
  30611. };
  30612. /***/ }),
  30613. /***/ "fdbf":
  30614. /***/ (function(module, exports, __webpack_require__) {
  30615. var NATIVE_SYMBOL = __webpack_require__("4930");
  30616. module.exports = NATIVE_SYMBOL
  30617. /* global Symbol -- safe */
  30618. && !Symbol.sham
  30619. && typeof Symbol.iterator == 'symbol';
  30620. /***/ }),
  30621. /***/ "fea9":
  30622. /***/ (function(module, exports, __webpack_require__) {
  30623. var global = __webpack_require__("da84");
  30624. module.exports = global.Promise;
  30625. /***/ })
  30626. /******/ });
  30627. });