index.umd.js 1.2 MB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042280432804428045280462804728048280492805028051280522805328054280552805628057280582805928060280612806228063280642806528066280672806828069280702807128072280732807428075280762807728078280792808028081280822808328084280852808628087280882808928090280912809228093280942809528096280972809828099281002810128102281032810428105281062810728108281092811028111281122811328114281152811628117281182811928120281212812228123281242812528126281272812828129281302813128132281332813428135281362813728138281392814028141281422814328144281452814628147281482814928150281512815228153281542815528156281572815828159281602816128162281632816428165281662816728168281692817028171281722817328174281752817628177281782817928180281812818228183281842818528186281872818828189281902819128192281932819428195281962819728198281992820028201282022820328204282052820628207282082820928210282112821228213282142821528216282172821828219282202822128222282232822428225282262822728228282292823028231282322823328234282352823628237282382823928240282412824228243282442824528246282472824828249282502825128252282532825428255282562825728258282592826028261282622826328264282652826628267282682826928270282712827228273282742827528276282772827828279282802828128282282832828428285282862828728288282892829028291282922829328294282952829628297282982829928300283012830228303283042830528306283072830828309283102831128312283132831428315283162831728318283192832028321283222832328324283252832628327283282832928330283312833228333283342833528336283372833828339283402834128342283432834428345283462834728348283492835028351283522835328354283552835628357283582835928360283612836228363283642836528366283672836828369283702837128372283732837428375283762837728378283792838028381283822838328384283852838628387283882838928390283912839228393283942839528396283972839828399284002840128402284032840428405284062840728408284092841028411284122841328414284152841628417284182841928420284212842228423284242842528426284272842828429284302843128432284332843428435284362843728438284392844028441284422844328444284452844628447284482844928450284512845228453284542845528456284572845828459284602846128462284632846428465284662846728468284692847028471284722847328474284752847628477284782847928480284812848228483284842848528486284872848828489284902849128492284932849428495284962849728498284992850028501285022850328504285052850628507285082850928510285112851228513285142851528516285172851828519285202852128522285232852428525285262852728528285292853028531285322853328534285352853628537285382853928540285412854228543285442854528546285472854828549285502855128552285532855428555285562855728558285592856028561285622856328564285652856628567285682856928570285712857228573285742857528576285772857828579285802858128582285832858428585285862858728588285892859028591285922859328594285952859628597285982859928600286012860228603286042860528606286072860828609286102861128612286132861428615286162861728618286192862028621286222862328624286252862628627286282862928630286312863228633286342863528636286372863828639286402864128642286432864428645286462864728648286492865028651286522865328654286552865628657286582865928660286612866228663286642866528666286672866828669286702867128672286732867428675286762867728678286792868028681286822868328684286852868628687286882868928690286912869228693286942869528696286972869828699287002870128702287032870428705287062870728708287092871028711287122871328714287152871628717287182871928720287212872228723287242872528726287272872828729287302873128732287332873428735287362873728738287392874028741287422874328744287452874628747287482874928750287512875228753287542875528756287572875828759287602876128762287632876428765287662876728768287692877028771287722877328774287752877628777287782877928780287812878228783287842878528786287872878828789287902879128792287932879428795287962879728798287992880028801288022880328804288052880628807288082880928810288112881228813288142881528816288172881828819288202882128822288232882428825288262882728828288292883028831288322883328834288352883628837288382883928840288412884228843288442884528846288472884828849288502885128852288532885428855288562885728858288592886028861288622886328864288652886628867288682886928870288712887228873288742887528876288772887828879288802888128882288832888428885288862888728888288892889028891288922889328894288952889628897288982889928900289012890228903289042890528906289072890828909289102891128912289132891428915289162891728918289192892028921289222892328924289252892628927289282892928930289312893228933289342893528936289372893828939289402894128942289432894428945289462894728948289492895028951289522895328954289552895628957289582895928960289612896228963289642896528966289672896828969289702897128972289732897428975289762897728978289792898028981289822898328984289852898628987289882898928990289912899228993289942899528996289972899828999290002900129002290032900429005290062900729008290092901029011290122901329014290152901629017290182901929020290212902229023290242902529026290272902829029290302903129032290332903429035290362903729038290392904029041290422904329044290452904629047290482904929050290512905229053290542905529056290572905829059290602906129062290632906429065290662906729068290692907029071290722907329074290752907629077290782907929080290812908229083290842908529086290872908829089290902909129092290932909429095290962909729098290992910029101291022910329104291052910629107291082910929110291112911229113291142911529116291172911829119291202912129122291232912429125291262912729128291292913029131291322913329134291352913629137291382913929140291412914229143291442914529146291472914829149291502915129152291532915429155291562915729158291592916029161291622916329164291652916629167291682916929170291712917229173291742917529176291772917829179291802918129182291832918429185291862918729188291892919029191291922919329194291952919629197291982919929200292012920229203292042920529206292072920829209292102921129212292132921429215292162921729218292192922029221292222922329224292252922629227292282922929230292312923229233292342923529236292372923829239292402924129242292432924429245292462924729248292492925029251292522925329254292552925629257292582925929260292612926229263292642926529266292672926829269292702927129272292732927429275292762927729278292792928029281292822928329284292852928629287292882928929290292912929229293292942929529296292972929829299293002930129302293032930429305293062930729308293092931029311293122931329314293152931629317293182931929320293212932229323293242932529326293272932829329293302933129332293332933429335293362933729338293392934029341293422934329344293452934629347293482934929350293512935229353293542935529356293572935829359293602936129362293632936429365293662936729368293692937029371293722937329374293752937629377293782937929380293812938229383293842938529386293872938829389293902939129392293932939429395293962939729398293992940029401294022940329404294052940629407294082940929410294112941229413294142941529416294172941829419294202942129422294232942429425294262942729428294292943029431294322943329434294352943629437294382943929440294412944229443294442944529446294472944829449294502945129452294532945429455294562945729458294592946029461294622946329464294652946629467294682946929470294712947229473294742947529476294772947829479294802948129482294832948429485294862948729488294892949029491294922949329494294952949629497294982949929500295012950229503295042950529506295072950829509295102951129512295132951429515295162951729518295192952029521295222952329524295252952629527295282952929530295312953229533295342953529536295372953829539295402954129542295432954429545295462954729548295492955029551295522955329554295552955629557295582955929560295612956229563295642956529566295672956829569295702957129572295732957429575295762957729578295792958029581295822958329584295852958629587295882958929590295912959229593295942959529596295972959829599296002960129602296032960429605296062960729608296092961029611296122961329614296152961629617296182961929620296212962229623296242962529626296272962829629296302963129632296332963429635296362963729638296392964029641296422964329644296452964629647296482964929650296512965229653296542965529656296572965829659296602966129662296632966429665296662966729668296692967029671296722967329674296752967629677296782967929680296812968229683296842968529686296872968829689296902969129692296932969429695296962969729698296992970029701297022970329704297052970629707297082970929710297112971229713297142971529716297172971829719297202972129722297232972429725297262972729728297292973029731297322973329734297352973629737297382973929740297412974229743297442974529746297472974829749297502975129752297532975429755297562975729758297592976029761297622976329764297652976629767297682976929770297712977229773297742977529776297772977829779297802978129782297832978429785297862978729788297892979029791297922979329794297952979629797297982979929800298012980229803298042980529806298072980829809298102981129812298132981429815298162981729818298192982029821298222982329824298252982629827298282982929830298312983229833298342983529836298372983829839298402984129842298432984429845298462984729848298492985029851298522985329854298552985629857298582985929860298612986229863298642986529866298672986829869298702987129872298732987429875298762987729878298792988029881298822988329884298852988629887298882988929890298912989229893298942989529896298972989829899299002990129902299032990429905299062990729908299092991029911299122991329914299152991629917299182991929920299212992229923299242992529926299272992829929299302993129932299332993429935299362993729938299392994029941299422994329944299452994629947299482994929950299512995229953299542995529956299572995829959299602996129962299632996429965299662996729968299692997029971299722997329974299752997629977299782997929980299812998229983299842998529986299872998829989299902999129992299932999429995299962999729998299993000030001300023000330004300053000630007300083000930010300113001230013300143001530016300173001830019300203002130022300233002430025300263002730028300293003030031300323003330034300353003630037300383003930040300413004230043300443004530046300473004830049300503005130052300533005430055300563005730058300593006030061300623006330064300653006630067300683006930070300713007230073300743007530076300773007830079300803008130082300833008430085300863008730088300893009030091300923009330094300953009630097300983009930100301013010230103301043010530106301073010830109301103011130112301133011430115301163011730118301193012030121301223012330124301253012630127301283012930130301313013230133301343013530136301373013830139301403014130142301433014430145301463014730148301493015030151301523015330154301553015630157301583015930160301613016230163301643016530166301673016830169301703017130172301733017430175301763017730178301793018030181301823018330184301853018630187301883018930190301913019230193301943019530196301973019830199302003020130202302033020430205302063020730208302093021030211302123021330214302153021630217302183021930220302213022230223302243022530226302273022830229302303023130232302333023430235302363023730238302393024030241302423024330244302453024630247302483024930250302513025230253302543025530256302573025830259302603026130262302633026430265302663026730268302693027030271302723027330274302753027630277302783027930280302813028230283302843028530286302873028830289302903029130292302933029430295302963029730298302993030030301303023030330304303053030630307303083030930310303113031230313303143031530316303173031830319303203032130322303233032430325303263032730328303293033030331303323033330334303353033630337303383033930340303413034230343303443034530346303473034830349303503035130352303533035430355303563035730358303593036030361303623036330364303653036630367303683036930370303713037230373303743037530376303773037830379303803038130382303833038430385303863038730388303893039030391303923039330394303953039630397303983039930400304013040230403304043040530406304073040830409304103041130412304133041430415304163041730418304193042030421304223042330424304253042630427304283042930430304313043230433304343043530436304373043830439304403044130442304433044430445304463044730448304493045030451304523045330454304553045630457304583045930460304613046230463304643046530466304673046830469304703047130472304733047430475304763047730478304793048030481304823048330484304853048630487304883048930490304913049230493304943049530496304973049830499305003050130502305033050430505305063050730508305093051030511305123051330514305153051630517305183051930520305213052230523305243052530526305273052830529305303053130532305333053430535305363053730538305393054030541305423054330544305453054630547305483054930550305513055230553305543055530556305573055830559305603056130562305633056430565305663056730568305693057030571305723057330574305753057630577305783057930580305813058230583305843058530586305873058830589305903059130592305933059430595305963059730598305993060030601306023060330604306053060630607306083060930610306113061230613306143061530616306173061830619306203062130622306233062430625306263062730628306293063030631306323063330634306353063630637306383063930640306413064230643306443064530646306473064830649306503065130652306533065430655306563065730658306593066030661306623066330664306653066630667306683066930670306713067230673306743067530676306773067830679306803068130682306833068430685306863068730688306893069030691306923069330694306953069630697306983069930700307013070230703307043070530706307073070830709307103071130712307133071430715307163071730718307193072030721307223072330724307253072630727307283072930730307313073230733307343073530736307373073830739307403074130742307433074430745307463074730748307493075030751307523075330754307553075630757307583075930760307613076230763307643076530766307673076830769307703077130772307733077430775307763077730778307793078030781307823078330784307853078630787307883078930790307913079230793307943079530796307973079830799308003080130802308033080430805308063080730808308093081030811308123081330814308153081630817308183081930820308213082230823308243082530826308273082830829308303083130832308333083430835308363083730838308393084030841308423084330844308453084630847308483084930850308513085230853308543085530856308573085830859308603086130862308633086430865308663086730868308693087030871308723087330874308753087630877308783087930880308813088230883308843088530886308873088830889308903089130892308933089430895308963089730898308993090030901309023090330904309053090630907309083090930910309113091230913309143091530916309173091830919309203092130922309233092430925309263092730928309293093030931309323093330934309353093630937309383093930940309413094230943309443094530946309473094830949309503095130952309533095430955309563095730958309593096030961309623096330964309653096630967309683096930970309713097230973309743097530976309773097830979309803098130982309833098430985309863098730988309893099030991309923099330994309953099630997309983099931000310013100231003310043100531006310073100831009310103101131012310133101431015310163101731018310193102031021310223102331024310253102631027310283102931030310313103231033310343103531036310373103831039310403104131042310433104431045310463104731048310493105031051310523105331054310553105631057310583105931060310613106231063310643106531066310673106831069310703107131072310733107431075310763107731078310793108031081310823108331084310853108631087310883108931090310913109231093310943109531096310973109831099311003110131102311033110431105311063110731108311093111031111311123111331114311153111631117311183111931120311213112231123311243112531126311273112831129311303113131132311333113431135311363113731138311393114031141311423114331144311453114631147311483114931150311513115231153311543115531156311573115831159311603116131162311633116431165311663116731168311693117031171311723117331174311753117631177311783117931180311813118231183311843118531186311873118831189311903119131192311933119431195311963119731198311993120031201312023120331204312053120631207312083120931210312113121231213312143121531216312173121831219312203122131222312233122431225312263122731228312293123031231312323123331234312353123631237312383123931240312413124231243312443124531246312473124831249312503125131252312533125431255312563125731258312593126031261312623126331264312653126631267312683126931270312713127231273312743127531276312773127831279312803128131282312833128431285312863128731288312893129031291312923129331294312953129631297312983129931300313013130231303313043130531306313073130831309313103131131312313133131431315313163131731318313193132031321313223132331324313253132631327313283132931330313313133231333313343133531336313373133831339313403134131342313433134431345313463134731348313493135031351313523135331354313553135631357313583135931360313613136231363313643136531366313673136831369313703137131372313733137431375313763137731378313793138031381313823138331384313853138631387313883138931390313913139231393313943139531396313973139831399314003140131402314033140431405314063140731408314093141031411314123141331414314153141631417314183141931420314213142231423314243142531426314273142831429314303143131432314333143431435314363143731438314393144031441314423144331444314453144631447314483144931450314513145231453314543145531456314573145831459314603146131462314633146431465314663146731468314693147031471314723147331474314753147631477314783147931480314813148231483314843148531486314873148831489314903149131492314933149431495314963149731498314993150031501315023150331504315053150631507315083150931510315113151231513315143151531516315173151831519315203152131522315233152431525315263152731528315293153031531315323153331534315353153631537315383153931540315413154231543315443154531546315473154831549315503155131552315533155431555315563155731558315593156031561315623156331564315653156631567315683156931570315713157231573315743157531576315773157831579315803158131582315833158431585315863158731588315893159031591315923159331594315953159631597315983159931600316013160231603316043160531606316073160831609316103161131612316133161431615316163161731618316193162031621316223162331624316253162631627316283162931630316313163231633316343163531636316373163831639316403164131642316433164431645316463164731648316493165031651316523165331654316553165631657316583165931660316613166231663316643166531666316673166831669316703167131672316733167431675316763167731678316793168031681316823168331684316853168631687316883168931690316913169231693316943169531696316973169831699317003170131702317033170431705317063170731708317093171031711317123171331714317153171631717317183171931720317213172231723317243172531726317273172831729317303173131732317333173431735317363173731738317393174031741317423174331744317453174631747317483174931750317513175231753317543175531756317573175831759317603176131762317633176431765317663176731768317693177031771317723177331774317753177631777317783177931780317813178231783317843178531786317873178831789317903179131792317933179431795317963179731798317993180031801318023180331804318053180631807318083180931810318113181231813318143181531816318173181831819318203182131822318233182431825318263182731828318293183031831318323183331834318353183631837318383183931840318413184231843318443184531846318473184831849318503185131852318533185431855318563185731858318593186031861318623186331864318653186631867318683186931870318713187231873318743187531876318773187831879318803188131882318833188431885318863188731888318893189031891318923189331894318953189631897318983189931900319013190231903319043190531906319073190831909319103191131912319133191431915319163191731918319193192031921319223192331924319253192631927319283192931930319313193231933319343193531936319373193831939319403194131942319433194431945319463194731948319493195031951319523195331954319553195631957319583195931960319613196231963319643196531966319673196831969319703197131972319733197431975319763197731978319793198031981319823198331984319853198631987319883198931990319913199231993319943199531996319973199831999320003200132002320033200432005320063200732008320093201032011320123201332014320153201632017320183201932020320213202232023320243202532026320273202832029320303203132032320333203432035320363203732038320393204032041320423204332044320453204632047320483204932050320513205232053320543205532056320573205832059320603206132062320633206432065320663206732068320693207032071320723207332074320753207632077320783207932080320813208232083320843208532086320873208832089320903209132092320933209432095320963209732098320993210032101321023210332104321053210632107321083210932110321113211232113321143211532116321173211832119321203212132122321233212432125321263212732128321293213032131321323213332134321353213632137321383213932140321413214232143321443214532146321473214832149321503215132152321533215432155321563215732158321593216032161321623216332164321653216632167321683216932170321713217232173321743217532176321773217832179321803218132182321833218432185321863218732188321893219032191321923219332194321953219632197321983219932200322013220232203322043220532206322073220832209322103221132212322133221432215322163221732218322193222032221322223222332224322253222632227322283222932230322313223232233322343223532236322373223832239322403224132242322433224432245322463224732248322493225032251322523225332254322553225632257322583225932260322613226232263322643226532266322673226832269322703227132272322733227432275322763227732278322793228032281322823228332284322853228632287322883228932290322913229232293322943229532296322973229832299323003230132302323033230432305323063230732308323093231032311323123231332314323153231632317323183231932320323213232232323323243232532326323273232832329323303233132332323333233432335323363233732338323393234032341323423234332344323453234632347323483234932350323513235232353323543235532356323573235832359323603236132362323633236432365323663236732368323693237032371323723237332374323753237632377323783237932380323813238232383323843238532386323873238832389323903239132392323933239432395323963239732398323993240032401324023240332404324053240632407324083240932410324113241232413324143241532416324173241832419324203242132422324233242432425324263242732428324293243032431324323243332434324353243632437324383243932440324413244232443324443244532446324473244832449324503245132452324533245432455324563245732458324593246032461324623246332464324653246632467324683246932470324713247232473324743247532476324773247832479324803248132482324833248432485324863248732488324893249032491324923249332494324953249632497324983249932500325013250232503325043250532506325073250832509325103251132512325133251432515325163251732518325193252032521325223252332524325253252632527325283252932530325313253232533325343253532536325373253832539325403254132542325433254432545325463254732548325493255032551325523255332554325553255632557325583255932560325613256232563325643256532566325673256832569325703257132572325733257432575325763257732578325793258032581325823258332584325853258632587325883258932590325913259232593325943259532596325973259832599326003260132602326033260432605326063260732608326093261032611326123261332614326153261632617326183261932620326213262232623326243262532626326273262832629326303263132632326333263432635326363263732638326393264032641326423264332644326453264632647326483264932650326513265232653326543265532656326573265832659326603266132662326633266432665326663266732668326693267032671326723267332674326753267632677326783267932680326813268232683326843268532686326873268832689326903269132692326933269432695326963269732698326993270032701327023270332704327053270632707327083270932710327113271232713327143271532716327173271832719327203272132722327233272432725327263272732728327293273032731327323273332734327353273632737327383273932740327413274232743327443274532746327473274832749327503275132752327533275432755327563275732758327593276032761327623276332764327653276632767327683276932770327713277232773327743277532776327773277832779327803278132782327833278432785327863278732788327893279032791327923279332794327953279632797327983279932800328013280232803328043280532806328073280832809328103281132812328133281432815328163281732818328193282032821328223282332824328253282632827328283282932830328313283232833328343283532836328373283832839328403284132842328433284432845328463284732848328493285032851328523285332854328553285632857328583285932860328613286232863328643286532866328673286832869328703287132872328733287432875328763287732878328793288032881328823288332884328853288632887328883288932890328913289232893328943289532896328973289832899329003290132902329033290432905329063290732908329093291032911329123291332914329153291632917329183291932920329213292232923329243292532926329273292832929329303293132932329333293432935329363293732938329393294032941329423294332944329453294632947329483294932950329513295232953329543295532956329573295832959329603296132962329633296432965329663296732968329693297032971329723297332974329753297632977329783297932980329813298232983329843298532986329873298832989329903299132992329933299432995329963299732998329993300033001330023300333004330053300633007330083300933010330113301233013330143301533016330173301833019330203302133022330233302433025330263302733028330293303033031330323303333034330353303633037330383303933040330413304233043330443304533046330473304833049330503305133052330533305433055330563305733058330593306033061330623306333064330653306633067330683306933070330713307233073330743307533076330773307833079330803308133082330833308433085330863308733088330893309033091330923309333094330953309633097330983309933100331013310233103331043310533106331073310833109331103311133112331133311433115331163311733118331193312033121331223312333124331253312633127331283312933130331313313233133331343313533136331373313833139331403314133142331433314433145331463314733148331493315033151331523315333154331553315633157331583315933160331613316233163331643316533166331673316833169331703317133172331733317433175331763317733178331793318033181331823318333184331853318633187331883318933190331913319233193331943319533196331973319833199332003320133202332033320433205332063320733208332093321033211332123321333214332153321633217332183321933220332213322233223332243322533226332273322833229332303323133232332333323433235332363323733238332393324033241332423324333244332453324633247332483324933250332513325233253332543325533256332573325833259332603326133262332633326433265332663326733268332693327033271332723327333274332753327633277332783327933280332813328233283332843328533286332873328833289332903329133292332933329433295332963329733298332993330033301333023330333304333053330633307333083330933310333113331233313333143331533316333173331833319333203332133322333233332433325333263332733328333293333033331333323333333334333353333633337333383333933340333413334233343333443334533346333473334833349333503335133352333533335433355333563335733358333593336033361333623336333364333653336633367333683336933370333713337233373333743337533376333773337833379333803338133382333833338433385333863338733388333893339033391333923339333394333953339633397333983339933400334013340233403334043340533406334073340833409334103341133412334133341433415334163341733418334193342033421334223342333424334253342633427334283342933430334313343233433334343343533436334373343833439334403344133442334433344433445334463344733448334493345033451334523345333454334553345633457334583345933460334613346233463334643346533466334673346833469334703347133472334733347433475334763347733478334793348033481334823348333484334853348633487334883348933490334913349233493334943349533496334973349833499335003350133502335033350433505335063350733508335093351033511335123351333514335153351633517335183351933520335213352233523335243352533526335273352833529335303353133532335333353433535335363353733538335393354033541335423354333544335453354633547335483354933550335513355233553335543355533556335573355833559335603356133562335633356433565335663356733568335693357033571335723357333574335753357633577335783357933580335813358233583335843358533586335873358833589335903359133592335933359433595335963359733598335993360033601336023360333604336053360633607336083360933610336113361233613336143361533616336173361833619336203362133622336233362433625336263362733628336293363033631336323363333634336353363633637336383363933640336413364233643336443364533646336473364833649336503365133652336533365433655336563365733658336593366033661336623366333664336653366633667336683366933670336713367233673336743367533676336773367833679336803368133682336833368433685336863368733688336893369033691336923369333694336953369633697336983369933700337013370233703337043370533706337073370833709337103371133712337133371433715337163371733718337193372033721337223372333724337253372633727337283372933730337313373233733337343373533736337373373833739337403374133742337433374433745337463374733748337493375033751337523375333754337553375633757337583375933760337613376233763337643376533766337673376833769337703377133772337733377433775337763377733778337793378033781337823378333784337853378633787337883378933790337913379233793337943379533796337973379833799338003380133802338033380433805338063380733808338093381033811338123381333814338153381633817338183381933820338213382233823338243382533826338273382833829338303383133832338333383433835338363383733838338393384033841338423384333844338453384633847338483384933850338513385233853338543385533856338573385833859338603386133862338633386433865338663386733868338693387033871338723387333874338753387633877338783387933880338813388233883338843388533886338873388833889338903389133892338933389433895338963389733898338993390033901339023390333904339053390633907339083390933910339113391233913339143391533916339173391833919339203392133922339233392433925339263392733928339293393033931339323393333934339353393633937339383393933940339413394233943339443394533946339473394833949339503395133952339533395433955339563395733958339593396033961339623396333964339653396633967339683396933970339713397233973339743397533976339773397833979339803398133982339833398433985339863398733988339893399033991339923399333994339953399633997339983399934000340013400234003340043400534006340073400834009340103401134012340133401434015340163401734018340193402034021340223402334024340253402634027340283402934030340313403234033340343403534036340373403834039340403404134042340433404434045340463404734048340493405034051340523405334054340553405634057340583405934060340613406234063340643406534066340673406834069340703407134072340733407434075340763407734078340793408034081340823408334084340853408634087340883408934090340913409234093340943409534096340973409834099341003410134102341033410434105341063410734108341093411034111341123411334114341153411634117341183411934120341213412234123341243412534126341273412834129341303413134132341333413434135341363413734138341393414034141341423414334144341453414634147341483414934150341513415234153341543415534156341573415834159341603416134162341633416434165341663416734168341693417034171341723417334174341753417634177341783417934180341813418234183341843418534186341873418834189341903419134192341933419434195341963419734198341993420034201342023420334204342053420634207342083420934210342113421234213342143421534216342173421834219342203422134222342233422434225342263422734228342293423034231342323423334234342353423634237342383423934240342413424234243342443424534246342473424834249342503425134252342533425434255342563425734258342593426034261342623426334264342653426634267342683426934270342713427234273342743427534276342773427834279342803428134282342833428434285342863428734288342893429034291342923429334294342953429634297342983429934300343013430234303343043430534306343073430834309343103431134312343133431434315343163431734318343193432034321343223432334324343253432634327343283432934330343313433234333343343433534336343373433834339343403434134342343433434434345343463434734348343493435034351343523435334354343553435634357343583435934360343613436234363343643436534366343673436834369343703437134372343733437434375343763437734378343793438034381343823438334384343853438634387343883438934390343913439234393343943439534396343973439834399344003440134402344033440434405344063440734408344093441034411344123441334414344153441634417344183441934420344213442234423344243442534426344273442834429344303443134432344333443434435344363443734438344393444034441344423444334444344453444634447344483444934450344513445234453344543445534456344573445834459344603446134462344633446434465344663446734468344693447034471344723447334474344753447634477344783447934480344813448234483344843448534486344873448834489344903449134492344933449434495344963449734498344993450034501345023450334504345053450634507345083450934510345113451234513345143451534516345173451834519345203452134522345233452434525345263452734528345293453034531345323453334534345353453634537345383453934540345413454234543345443454534546345473454834549345503455134552345533455434555345563455734558345593456034561345623456334564345653456634567345683456934570345713457234573345743457534576345773457834579345803458134582345833458434585345863458734588345893459034591345923459334594345953459634597345983459934600346013460234603346043460534606346073460834609346103461134612346133461434615346163461734618346193462034621346223462334624346253462634627346283462934630346313463234633346343463534636346373463834639346403464134642346433464434645346463464734648346493465034651346523465334654346553465634657346583465934660346613466234663346643466534666346673466834669346703467134672346733467434675346763467734678346793468034681346823468334684346853468634687346883468934690346913469234693346943469534696346973469834699347003470134702347033470434705347063470734708347093471034711347123471334714347153471634717347183471934720347213472234723347243472534726347273472834729347303473134732347333473434735347363473734738347393474034741347423474334744347453474634747347483474934750347513475234753347543475534756347573475834759347603476134762347633476434765347663476734768347693477034771347723477334774347753477634777347783477934780347813478234783347843478534786347873478834789347903479134792347933479434795347963479734798347993480034801348023480334804348053480634807348083480934810348113481234813348143481534816348173481834819348203482134822348233482434825348263482734828348293483034831348323483334834348353483634837348383483934840348413484234843348443484534846348473484834849348503485134852348533485434855348563485734858348593486034861348623486334864348653486634867348683486934870348713487234873348743487534876348773487834879348803488134882348833488434885348863488734888348893489034891348923489334894348953489634897348983489934900349013490234903349043490534906349073490834909349103491134912349133491434915349163491734918349193492034921349223492334924349253492634927349283492934930349313493234933349343493534936349373493834939349403494134942349433494434945349463494734948349493495034951349523495334954349553495634957349583495934960349613496234963349643496534966349673496834969349703497134972349733497434975349763497734978349793498034981349823498334984349853498634987349883498934990349913499234993349943499534996349973499834999350003500135002350033500435005350063500735008350093501035011350123501335014350153501635017350183501935020350213502235023350243502535026350273502835029350303503135032350333503435035350363503735038350393504035041350423504335044350453504635047350483504935050350513505235053350543505535056350573505835059350603506135062350633506435065350663506735068350693507035071350723507335074350753507635077350783507935080350813508235083350843508535086350873508835089350903509135092350933509435095350963509735098350993510035101351023510335104351053510635107351083510935110351113511235113351143511535116351173511835119351203512135122351233512435125351263512735128351293513035131351323513335134351353513635137351383513935140351413514235143351443514535146351473514835149351503515135152351533515435155351563515735158351593516035161351623516335164351653516635167351683516935170351713517235173351743517535176351773517835179351803518135182351833518435185351863518735188351893519035191351923519335194351953519635197351983519935200352013520235203352043520535206352073520835209352103521135212352133521435215352163521735218352193522035221352223522335224352253522635227352283522935230352313523235233352343523535236352373523835239352403524135242352433524435245352463524735248352493525035251352523525335254352553525635257352583525935260352613526235263352643526535266352673526835269352703527135272352733527435275352763527735278352793528035281352823528335284352853528635287352883528935290352913529235293352943529535296352973529835299353003530135302353033530435305353063530735308353093531035311353123531335314353153531635317353183531935320353213532235323353243532535326353273532835329353303533135332353333533435335353363533735338353393534035341353423534335344353453534635347353483534935350353513535235353353543535535356353573535835359353603536135362353633536435365353663536735368353693537035371353723537335374353753537635377353783537935380353813538235383353843538535386353873538835389353903539135392353933539435395353963539735398353993540035401354023540335404354053540635407354083540935410354113541235413354143541535416354173541835419354203542135422354233542435425354263542735428354293543035431354323543335434354353543635437354383543935440354413544235443354443544535446354473544835449354503545135452354533545435455354563545735458354593546035461354623546335464354653546635467354683546935470354713547235473354743547535476354773547835479354803548135482354833548435485354863548735488354893549035491354923549335494354953549635497354983549935500355013550235503355043550535506355073550835509355103551135512355133551435515355163551735518355193552035521355223552335524355253552635527355283552935530355313553235533355343553535536355373553835539355403554135542355433554435545355463554735548355493555035551355523555335554355553555635557355583555935560355613556235563355643556535566355673556835569355703557135572355733557435575355763557735578355793558035581355823558335584355853558635587355883558935590355913559235593355943559535596355973559835599356003560135602356033560435605356063560735608356093561035611356123561335614356153561635617356183561935620356213562235623356243562535626356273562835629356303563135632356333563435635356363563735638356393564035641356423564335644356453564635647356483564935650356513565235653356543565535656356573565835659356603566135662356633566435665356663566735668356693567035671356723567335674356753567635677356783567935680356813568235683356843568535686356873568835689356903569135692356933569435695356963569735698356993570035701357023570335704357053570635707357083570935710357113571235713357143571535716357173571835719357203572135722357233572435725357263572735728357293573035731357323573335734357353573635737357383573935740357413574235743357443574535746357473574835749357503575135752357533575435755357563575735758357593576035761357623576335764357653576635767357683576935770357713577235773357743577535776357773577835779357803578135782357833578435785357863578735788357893579035791357923579335794357953579635797357983579935800358013580235803358043580535806358073580835809358103581135812358133581435815358163581735818358193582035821358223582335824358253582635827358283582935830358313583235833358343583535836358373583835839358403584135842358433584435845358463584735848358493585035851358523585335854358553585635857358583585935860358613586235863358643586535866358673586835869358703587135872358733587435875358763587735878358793588035881358823588335884358853588635887358883588935890358913589235893358943589535896358973589835899359003590135902359033590435905359063590735908359093591035911359123591335914359153591635917359183591935920359213592235923359243592535926359273592835929359303593135932359333593435935359363593735938359393594035941359423594335944359453594635947359483594935950359513595235953359543595535956359573595835959359603596135962359633596435965359663596735968359693597035971359723597335974359753597635977359783597935980359813598235983359843598535986359873598835989359903599135992359933599435995359963599735998359993600036001360023600336004360053600636007360083600936010360113601236013360143601536016360173601836019360203602136022360233602436025360263602736028360293603036031360323603336034360353603636037360383603936040360413604236043360443604536046360473604836049360503605136052360533605436055360563605736058360593606036061360623606336064360653606636067360683606936070360713607236073360743607536076360773607836079360803608136082360833608436085360863608736088360893609036091360923609336094360953609636097360983609936100361013610236103361043610536106361073610836109361103611136112361133611436115361163611736118361193612036121361223612336124361253612636127361283612936130361313613236133361343613536136361373613836139361403614136142361433614436145361463614736148361493615036151361523615336154361553615636157361583615936160361613616236163361643616536166361673616836169361703617136172361733617436175361763617736178361793618036181361823618336184361853618636187361883618936190361913619236193361943619536196361973619836199362003620136202362033620436205362063620736208362093621036211362123621336214362153621636217362183621936220362213622236223362243622536226362273622836229362303623136232362333623436235362363623736238362393624036241362423624336244362453624636247362483624936250362513625236253362543625536256362573625836259362603626136262362633626436265362663626736268362693627036271362723627336274362753627636277362783627936280362813628236283362843628536286362873628836289362903629136292362933629436295362963629736298362993630036301363023630336304363053630636307363083630936310363113631236313363143631536316363173631836319363203632136322363233632436325363263632736328363293633036331363323633336334363353633636337363383633936340363413634236343363443634536346363473634836349363503635136352363533635436355363563635736358363593636036361363623636336364363653636636367363683636936370363713637236373363743637536376363773637836379363803638136382363833638436385363863638736388363893639036391363923639336394363953639636397363983639936400364013640236403364043640536406364073640836409364103641136412364133641436415364163641736418364193642036421364223642336424364253642636427364283642936430364313643236433364343643536436364373643836439364403644136442364433644436445364463644736448364493645036451364523645336454364553645636457364583645936460364613646236463364643646536466364673646836469364703647136472364733647436475364763647736478364793648036481364823648336484364853648636487364883648936490364913649236493364943649536496364973649836499365003650136502365033650436505365063650736508365093651036511365123651336514365153651636517365183651936520365213652236523365243652536526365273652836529365303653136532365333653436535365363653736538365393654036541365423654336544365453654636547365483654936550365513655236553365543655536556365573655836559365603656136562365633656436565365663656736568365693657036571365723657336574365753657636577365783657936580365813658236583365843658536586365873658836589365903659136592365933659436595365963659736598365993660036601366023660336604366053660636607366083660936610366113661236613366143661536616366173661836619366203662136622366233662436625366263662736628366293663036631366323663336634366353663636637366383663936640366413664236643366443664536646366473664836649366503665136652366533665436655366563665736658366593666036661366623666336664366653666636667366683666936670366713667236673366743667536676366773667836679366803668136682366833668436685366863668736688366893669036691366923669336694366953669636697366983669936700367013670236703367043670536706367073670836709367103671136712367133671436715367163671736718367193672036721367223672336724367253672636727367283672936730367313673236733367343673536736367373673836739367403674136742367433674436745367463674736748367493675036751367523675336754367553675636757367583675936760367613676236763367643676536766367673676836769367703677136772367733677436775367763677736778367793678036781367823678336784367853678636787367883678936790367913679236793367943679536796367973679836799368003680136802368033680436805368063680736808368093681036811368123681336814368153681636817368183681936820368213682236823368243682536826368273682836829368303683136832368333683436835368363683736838368393684036841368423684336844368453684636847368483684936850368513685236853368543685536856368573685836859368603686136862368633686436865368663686736868368693687036871368723687336874368753687636877368783687936880368813688236883368843688536886368873688836889368903689136892368933689436895368963689736898368993690036901369023690336904369053690636907369083690936910369113691236913369143691536916369173691836919369203692136922369233692436925369263692736928369293693036931369323693336934369353693636937369383693936940369413694236943369443694536946369473694836949369503695136952369533695436955369563695736958369593696036961369623696336964369653696636967369683696936970369713697236973369743697536976369773697836979369803698136982369833698436985369863698736988369893699036991369923699336994369953699636997369983699937000370013700237003370043700537006370073700837009370103701137012370133701437015370163701737018370193702037021370223702337024370253702637027370283702937030370313703237033370343703537036370373703837039370403704137042370433704437045370463704737048370493705037051370523705337054370553705637057370583705937060370613706237063370643706537066370673706837069370703707137072370733707437075370763707737078370793708037081370823708337084370853708637087370883708937090370913709237093370943709537096370973709837099371003710137102371033710437105371063710737108371093711037111371123711337114371153711637117371183711937120371213712237123371243712537126371273712837129371303713137132371333713437135371363713737138371393714037141371423714337144371453714637147371483714937150371513715237153371543715537156371573715837159371603716137162371633716437165371663716737168371693717037171371723717337174371753717637177371783717937180371813718237183371843718537186371873718837189371903719137192371933719437195371963719737198371993720037201372023720337204372053720637207372083720937210372113721237213372143721537216372173721837219372203722137222372233722437225372263722737228372293723037231372323723337234372353723637237372383723937240372413724237243372443724537246372473724837249372503725137252372533725437255372563725737258372593726037261372623726337264372653726637267372683726937270372713727237273372743727537276372773727837279372803728137282372833728437285372863728737288372893729037291372923729337294372953729637297372983729937300373013730237303373043730537306373073730837309373103731137312373133731437315373163731737318373193732037321373223732337324373253732637327373283732937330373313733237333373343733537336373373733837339373403734137342373433734437345373463734737348373493735037351373523735337354373553735637357373583735937360373613736237363373643736537366373673736837369373703737137372373733737437375373763737737378373793738037381373823738337384373853738637387373883738937390373913739237393373943739537396373973739837399374003740137402374033740437405374063740737408374093741037411374123741337414374153741637417374183741937420374213742237423374243742537426374273742837429374303743137432374333743437435374363743737438374393744037441374423744337444374453744637447374483744937450374513745237453374543745537456374573745837459374603746137462374633746437465374663746737468374693747037471374723747337474374753747637477374783747937480374813748237483374843748537486374873748837489374903749137492374933749437495374963749737498374993750037501375023750337504375053750637507375083750937510375113751237513375143751537516375173751837519375203752137522375233752437525375263752737528375293753037531375323753337534375353753637537375383753937540375413754237543375443754537546375473754837549375503755137552375533755437555375563755737558375593756037561375623756337564375653756637567375683756937570375713757237573375743757537576375773757837579375803758137582375833758437585375863758737588375893759037591375923759337594375953759637597375983759937600376013760237603376043760537606376073760837609376103761137612376133761437615376163761737618376193762037621376223762337624376253762637627376283762937630376313763237633376343763537636376373763837639376403764137642376433764437645376463764737648376493765037651376523765337654376553765637657376583765937660376613766237663376643766537666376673766837669376703767137672376733767437675376763767737678376793768037681376823768337684376853768637687376883768937690376913769237693376943769537696376973769837699377003770137702377033770437705377063770737708377093771037711377123771337714377153771637717377183771937720377213772237723377243772537726377273772837729377303773137732377333773437735377363773737738377393774037741377423774337744377453774637747377483774937750377513775237753377543775537756377573775837759377603776137762377633776437765377663776737768377693777037771377723777337774377753777637777377783777937780377813778237783377843778537786377873778837789377903779137792377933779437795377963779737798377993780037801378023780337804378053780637807378083780937810378113781237813378143781537816378173781837819378203782137822378233782437825378263782737828378293783037831378323783337834378353783637837378383783937840378413784237843378443784537846378473784837849378503785137852378533785437855378563785737858378593786037861378623786337864378653786637867378683786937870378713787237873378743787537876378773787837879378803788137882378833788437885378863788737888378893789037891378923789337894378953789637897378983789937900379013790237903379043790537906379073790837909379103791137912379133791437915379163791737918379193792037921379223792337924379253792637927379283792937930379313793237933379343793537936379373793837939379403794137942379433794437945379463794737948379493795037951379523795337954379553795637957379583795937960379613796237963379643796537966379673796837969379703797137972379733797437975379763797737978379793798037981379823798337984379853798637987379883798937990379913799237993379943799537996379973799837999380003800138002380033800438005380063800738008380093801038011380123801338014380153801638017380183801938020380213802238023380243802538026380273802838029380303803138032380333803438035380363803738038380393804038041380423804338044380453804638047380483804938050380513805238053380543805538056380573805838059380603806138062380633806438065380663806738068380693807038071380723807338074380753807638077380783807938080380813808238083380843808538086380873808838089380903809138092380933809438095380963809738098380993810038101381023810338104381053810638107381083810938110381113811238113381143811538116381173811838119381203812138122381233812438125381263812738128381293813038131381323813338134381353813638137381383813938140381413814238143381443814538146381473814838149381503815138152381533815438155381563815738158381593816038161381623816338164381653816638167381683816938170381713817238173381743817538176381773817838179381803818138182381833818438185381863818738188381893819038191381923819338194381953819638197381983819938200382013820238203382043820538206382073820838209382103821138212382133821438215382163821738218382193822038221382223822338224382253822638227382283822938230382313823238233382343823538236382373823838239382403824138242382433824438245382463824738248382493825038251382523825338254382553825638257382583825938260382613826238263382643826538266382673826838269382703827138272382733827438275382763827738278382793828038281382823828338284382853828638287382883828938290382913829238293382943829538296382973829838299383003830138302383033830438305383063830738308383093831038311383123831338314383153831638317383183831938320383213832238323383243832538326383273832838329383303833138332383333833438335383363833738338383393834038341383423834338344383453834638347383483834938350383513835238353383543835538356383573835838359383603836138362383633836438365383663836738368383693837038371383723837338374383753837638377383783837938380383813838238383383843838538386383873838838389383903839138392383933839438395383963839738398383993840038401384023840338404384053840638407384083840938410384113841238413384143841538416384173841838419384203842138422384233842438425384263842738428384293843038431384323843338434384353843638437384383843938440384413844238443384443844538446384473844838449384503845138452384533845438455384563845738458384593846038461384623846338464384653846638467384683846938470384713847238473384743847538476384773847838479384803848138482384833848438485384863848738488384893849038491384923849338494384953849638497384983849938500385013850238503385043850538506385073850838509385103851138512385133851438515385163851738518385193852038521385223852338524385253852638527385283852938530385313853238533385343853538536385373853838539385403854138542385433854438545385463854738548385493855038551385523855338554385553855638557385583855938560385613856238563385643856538566385673856838569385703857138572385733857438575385763857738578385793858038581385823858338584385853858638587385883858938590385913859238593385943859538596385973859838599386003860138602386033860438605386063860738608386093861038611386123861338614386153861638617386183861938620386213862238623386243862538626386273862838629386303863138632386333863438635386363863738638386393864038641386423864338644386453864638647386483864938650386513865238653386543865538656386573865838659386603866138662386633866438665386663866738668386693867038671386723867338674386753867638677386783867938680386813868238683386843868538686386873868838689386903869138692386933869438695386963869738698386993870038701387023870338704387053870638707387083870938710387113871238713387143871538716387173871838719387203872138722387233872438725387263872738728387293873038731387323873338734387353873638737387383873938740387413874238743387443874538746387473874838749387503875138752387533875438755387563875738758387593876038761387623876338764387653876638767387683876938770387713877238773387743877538776387773877838779387803878138782387833878438785387863878738788387893879038791387923879338794387953879638797387983879938800388013880238803388043880538806388073880838809388103881138812388133881438815388163881738818388193882038821388223882338824388253882638827388283882938830388313883238833388343883538836388373883838839388403884138842388433884438845388463884738848388493885038851388523885338854388553885638857388583885938860388613886238863388643886538866388673886838869388703887138872388733887438875388763887738878388793888038881388823888338884388853888638887388883888938890388913889238893388943889538896388973889838899389003890138902389033890438905389063890738908389093891038911389123891338914389153891638917389183891938920389213892238923389243892538926389273892838929389303893138932389333893438935389363893738938389393894038941389423894338944389453894638947389483894938950389513895238953389543895538956389573895838959389603896138962389633896438965389663896738968389693897038971389723897338974389753897638977389783897938980389813898238983389843898538986389873898838989389903899138992389933899438995389963899738998389993900039001390023900339004390053900639007390083900939010390113901239013390143901539016390173901839019390203902139022390233902439025390263902739028390293903039031390323903339034390353903639037390383903939040390413904239043390443904539046390473904839049390503905139052390533905439055390563905739058390593906039061390623906339064390653906639067390683906939070390713907239073390743907539076390773907839079390803908139082390833908439085390863908739088390893909039091390923909339094390953909639097390983909939100391013910239103391043910539106391073910839109391103911139112391133911439115391163911739118391193912039121391223912339124391253912639127391283912939130391313913239133391343913539136391373913839139391403914139142391433914439145391463914739148391493915039151391523915339154391553915639157391583915939160391613916239163391643916539166391673916839169391703917139172391733917439175391763917739178391793918039181391823918339184391853918639187391883918939190391913919239193391943919539196391973919839199392003920139202392033920439205392063920739208392093921039211392123921339214392153921639217392183921939220392213922239223392243922539226392273922839229392303923139232392333923439235392363923739238392393924039241392423924339244392453924639247392483924939250392513925239253392543925539256392573925839259392603926139262392633926439265392663926739268392693927039271392723927339274392753927639277392783927939280392813928239283392843928539286392873928839289392903929139292392933929439295392963929739298392993930039301393023930339304393053930639307393083930939310393113931239313393143931539316393173931839319393203932139322393233932439325393263932739328393293933039331393323933339334393353933639337393383933939340393413934239343393443934539346393473934839349393503935139352393533935439355393563935739358393593936039361393623936339364393653936639367393683936939370393713937239373393743937539376393773937839379393803938139382393833938439385393863938739388393893939039391393923939339394393953939639397393983939939400394013940239403394043940539406394073940839409394103941139412394133941439415394163941739418394193942039421394223942339424394253942639427394283942939430394313943239433394343943539436394373943839439394403944139442394433944439445394463944739448394493945039451394523945339454394553945639457394583945939460394613946239463394643946539466394673946839469394703947139472394733947439475394763947739478394793948039481394823948339484394853948639487394883948939490394913949239493394943949539496394973949839499395003950139502395033950439505395063950739508395093951039511395123951339514395153951639517395183951939520395213952239523395243952539526395273952839529395303953139532395333953439535395363953739538395393954039541395423954339544395453954639547395483954939550395513955239553395543955539556395573955839559395603956139562395633956439565395663956739568395693957039571395723957339574395753957639577395783957939580395813958239583395843958539586395873958839589395903959139592395933959439595395963959739598395993960039601396023960339604396053960639607396083960939610396113961239613396143961539616396173961839619396203962139622396233962439625396263962739628396293963039631396323963339634396353963639637396383963939640396413964239643396443964539646396473964839649396503965139652396533965439655396563965739658396593966039661396623966339664396653966639667396683966939670396713967239673396743967539676396773967839679396803968139682396833968439685396863968739688396893969039691396923969339694396953969639697396983969939700397013970239703397043970539706397073970839709397103971139712397133971439715397163971739718397193972039721397223972339724397253972639727397283972939730397313973239733397343973539736397373973839739397403974139742397433974439745397463974739748397493975039751397523975339754397553975639757397583975939760397613976239763397643976539766397673976839769397703977139772397733977439775397763977739778397793978039781397823978339784397853978639787397883978939790397913979239793397943979539796397973979839799398003980139802398033980439805398063980739808398093981039811398123981339814398153981639817398183981939820398213982239823398243982539826398273982839829398303983139832398333983439835398363983739838398393984039841398423984339844398453984639847398483984939850398513985239853398543985539856398573985839859398603986139862398633986439865398663986739868398693987039871398723987339874398753987639877398783987939880398813988239883398843988539886398873988839889398903989139892398933989439895398963989739898398993990039901399023990339904
  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 aCallable = __webpack_require__("59ed");
  109. // optional / simple context binding
  110. module.exports = function (fn, that, length) {
  111. aCallable(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. /***/ "04d1":
  133. /***/ (function(module, exports, __webpack_require__) {
  134. var userAgent = __webpack_require__("342f");
  135. var firefox = userAgent.match(/firefox\/(\d+)/i);
  136. module.exports = !!firefox && +firefox[1];
  137. /***/ }),
  138. /***/ "057f":
  139. /***/ (function(module, exports, __webpack_require__) {
  140. /* eslint-disable es/no-object-getownpropertynames -- safe */
  141. var toIndexedObject = __webpack_require__("fc6a");
  142. var $getOwnPropertyNames = __webpack_require__("241c").f;
  143. var toString = {}.toString;
  144. var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
  145. ? Object.getOwnPropertyNames(window) : [];
  146. var getWindowNames = function (it) {
  147. try {
  148. return $getOwnPropertyNames(it);
  149. } catch (error) {
  150. return windowNames.slice();
  151. }
  152. };
  153. // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
  154. module.exports.f = function getOwnPropertyNames(it) {
  155. return windowNames && toString.call(it) == '[object Window]'
  156. ? getWindowNames(it)
  157. : $getOwnPropertyNames(toIndexedObject(it));
  158. };
  159. /***/ }),
  160. /***/ "06cf":
  161. /***/ (function(module, exports, __webpack_require__) {
  162. var DESCRIPTORS = __webpack_require__("83ab");
  163. var propertyIsEnumerableModule = __webpack_require__("d1e7");
  164. var createPropertyDescriptor = __webpack_require__("5c6c");
  165. var toIndexedObject = __webpack_require__("fc6a");
  166. var toPropertyKey = __webpack_require__("a04b");
  167. var hasOwn = __webpack_require__("1a2d");
  168. var IE8_DOM_DEFINE = __webpack_require__("0cfb");
  169. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  170. var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  171. // `Object.getOwnPropertyDescriptor` method
  172. // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
  173. exports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
  174. O = toIndexedObject(O);
  175. P = toPropertyKey(P);
  176. if (IE8_DOM_DEFINE) try {
  177. return $getOwnPropertyDescriptor(O, P);
  178. } catch (error) { /* empty */ }
  179. if (hasOwn(O, P)) return createPropertyDescriptor(!propertyIsEnumerableModule.f.call(O, P), O[P]);
  180. };
  181. /***/ }),
  182. /***/ "07fa":
  183. /***/ (function(module, exports, __webpack_require__) {
  184. var toLength = __webpack_require__("50c4");
  185. // `LengthOfArrayLike` abstract operation
  186. // https://tc39.es/ecma262/#sec-lengthofarraylike
  187. module.exports = function (obj) {
  188. return toLength(obj.length);
  189. };
  190. /***/ }),
  191. /***/ "0b42":
  192. /***/ (function(module, exports, __webpack_require__) {
  193. var isArray = __webpack_require__("e8b5");
  194. var isConstructor = __webpack_require__("68ee");
  195. var isObject = __webpack_require__("861d");
  196. var wellKnownSymbol = __webpack_require__("b622");
  197. var SPECIES = wellKnownSymbol('species');
  198. // a part of `ArraySpeciesCreate` abstract operation
  199. // https://tc39.es/ecma262/#sec-arrayspeciescreate
  200. module.exports = function (originalArray) {
  201. var C;
  202. if (isArray(originalArray)) {
  203. C = originalArray.constructor;
  204. // cross-realm fallback
  205. if (isConstructor(C) && (C === Array || isArray(C.prototype))) C = undefined;
  206. else if (isObject(C)) {
  207. C = C[SPECIES];
  208. if (C === null) C = undefined;
  209. }
  210. } return C === undefined ? Array : C;
  211. };
  212. /***/ }),
  213. /***/ "0cb2":
  214. /***/ (function(module, exports, __webpack_require__) {
  215. var toObject = __webpack_require__("7b0b");
  216. var floor = Math.floor;
  217. var replace = ''.replace;
  218. var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g;
  219. var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g;
  220. // `GetSubstitution` abstract operation
  221. // https://tc39.es/ecma262/#sec-getsubstitution
  222. module.exports = function (matched, str, position, captures, namedCaptures, replacement) {
  223. var tailPos = position + matched.length;
  224. var m = captures.length;
  225. var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
  226. if (namedCaptures !== undefined) {
  227. namedCaptures = toObject(namedCaptures);
  228. symbols = SUBSTITUTION_SYMBOLS;
  229. }
  230. return replace.call(replacement, symbols, function (match, ch) {
  231. var capture;
  232. switch (ch.charAt(0)) {
  233. case '$': return '$';
  234. case '&': return matched;
  235. case '`': return str.slice(0, position);
  236. case "'": return str.slice(tailPos);
  237. case '<':
  238. capture = namedCaptures[ch.slice(1, -1)];
  239. break;
  240. default: // \d\d?
  241. var n = +ch;
  242. if (n === 0) return match;
  243. if (n > m) {
  244. var f = floor(n / 10);
  245. if (f === 0) return match;
  246. if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);
  247. return match;
  248. }
  249. capture = captures[n - 1];
  250. }
  251. return capture === undefined ? '' : capture;
  252. });
  253. };
  254. /***/ }),
  255. /***/ "0ccb":
  256. /***/ (function(module, exports, __webpack_require__) {
  257. // https://github.com/tc39/proposal-string-pad-start-end
  258. var toLength = __webpack_require__("50c4");
  259. var toString = __webpack_require__("577e");
  260. var repeat = __webpack_require__("1148");
  261. var requireObjectCoercible = __webpack_require__("1d80");
  262. var ceil = Math.ceil;
  263. // `String.prototype.{ padStart, padEnd }` methods implementation
  264. var createMethod = function (IS_END) {
  265. return function ($this, maxLength, fillString) {
  266. var S = toString(requireObjectCoercible($this));
  267. var intMaxLength = toLength(maxLength);
  268. var stringLength = S.length;
  269. var fillStr = fillString === undefined ? ' ' : toString(fillString);
  270. var fillLen, stringFiller;
  271. if (intMaxLength <= stringLength || fillStr == '') return S;
  272. fillLen = intMaxLength - stringLength;
  273. stringFiller = repeat.call(fillStr, ceil(fillLen / fillStr.length));
  274. if (stringFiller.length > fillLen) stringFiller = stringFiller.slice(0, fillLen);
  275. return IS_END ? S + stringFiller : stringFiller + S;
  276. };
  277. };
  278. module.exports = {
  279. // `String.prototype.padStart` method
  280. // https://tc39.es/ecma262/#sec-string.prototype.padstart
  281. start: createMethod(false),
  282. // `String.prototype.padEnd` method
  283. // https://tc39.es/ecma262/#sec-string.prototype.padend
  284. end: createMethod(true)
  285. };
  286. /***/ }),
  287. /***/ "0cfb":
  288. /***/ (function(module, exports, __webpack_require__) {
  289. var DESCRIPTORS = __webpack_require__("83ab");
  290. var fails = __webpack_require__("d039");
  291. var createElement = __webpack_require__("cc12");
  292. // Thank's IE8 for his funny defineProperty
  293. module.exports = !DESCRIPTORS && !fails(function () {
  294. // eslint-disable-next-line es/no-object-defineproperty -- requied for testing
  295. return Object.defineProperty(createElement('div'), 'a', {
  296. get: function () { return 7; }
  297. }).a != 7;
  298. });
  299. /***/ }),
  300. /***/ "0d3b":
  301. /***/ (function(module, exports, __webpack_require__) {
  302. var fails = __webpack_require__("d039");
  303. var wellKnownSymbol = __webpack_require__("b622");
  304. var IS_PURE = __webpack_require__("c430");
  305. var ITERATOR = wellKnownSymbol('iterator');
  306. module.exports = !fails(function () {
  307. var url = new URL('b?a=1&b=2&c=3', 'http://a');
  308. var searchParams = url.searchParams;
  309. var result = '';
  310. url.pathname = 'c%20d';
  311. searchParams.forEach(function (value, key) {
  312. searchParams['delete']('b');
  313. result += key + value;
  314. });
  315. return (IS_PURE && !url.toJSON)
  316. || !searchParams.sort
  317. || url.href !== 'http://a/c%20d?a=1&c=3'
  318. || searchParams.get('c') !== '3'
  319. || String(new URLSearchParams('?a=1')) !== 'a=1'
  320. || !searchParams[ITERATOR]
  321. // throws in Edge
  322. || new URL('https://a@b').username !== 'a'
  323. || new URLSearchParams(new URLSearchParams('a=b')).get('a') !== 'b'
  324. // not punycoded in Edge
  325. || new URL('http://тест').host !== 'xn--e1aybc'
  326. // not escaped in Chrome 62-
  327. || new URL('http://a#б').hash !== '#%D0%B1'
  328. // fails in Chrome 66-
  329. || result !== 'a1c3'
  330. // throws in Safari
  331. || new URL('http://x', undefined).host !== 'x';
  332. });
  333. /***/ }),
  334. /***/ "0d51":
  335. /***/ (function(module, exports) {
  336. module.exports = function (argument) {
  337. try {
  338. return String(argument);
  339. } catch (error) {
  340. return 'Object';
  341. }
  342. };
  343. /***/ }),
  344. /***/ "107c":
  345. /***/ (function(module, exports, __webpack_require__) {
  346. var fails = __webpack_require__("d039");
  347. var global = __webpack_require__("da84");
  348. // babel-minify and Closure Compiler transpiles RegExp('(?<a>b)', 'g') -> /(?<a>b)/g and it causes SyntaxError
  349. var $RegExp = global.RegExp;
  350. module.exports = fails(function () {
  351. var re = $RegExp('(?<a>b)', 'g');
  352. return re.exec('b').groups.a !== 'b' ||
  353. 'b'.replace(re, '$<a>c') !== 'bc';
  354. });
  355. /***/ }),
  356. /***/ "1148":
  357. /***/ (function(module, exports, __webpack_require__) {
  358. "use strict";
  359. var toIntegerOrInfinity = __webpack_require__("5926");
  360. var toString = __webpack_require__("577e");
  361. var requireObjectCoercible = __webpack_require__("1d80");
  362. // `String.prototype.repeat` method implementation
  363. // https://tc39.es/ecma262/#sec-string.prototype.repeat
  364. module.exports = function repeat(count) {
  365. var str = toString(requireObjectCoercible(this));
  366. var result = '';
  367. var n = toIntegerOrInfinity(count);
  368. if (n < 0 || n == Infinity) throw RangeError('Wrong number of repetitions');
  369. for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) result += str;
  370. return result;
  371. };
  372. /***/ }),
  373. /***/ "1276":
  374. /***/ (function(module, exports, __webpack_require__) {
  375. "use strict";
  376. var fixRegExpWellKnownSymbolLogic = __webpack_require__("d784");
  377. var isRegExp = __webpack_require__("44e7");
  378. var anObject = __webpack_require__("825a");
  379. var requireObjectCoercible = __webpack_require__("1d80");
  380. var speciesConstructor = __webpack_require__("4840");
  381. var advanceStringIndex = __webpack_require__("8aa5");
  382. var toLength = __webpack_require__("50c4");
  383. var toString = __webpack_require__("577e");
  384. var getMethod = __webpack_require__("dc4a");
  385. var callRegExpExec = __webpack_require__("14c3");
  386. var regexpExec = __webpack_require__("9263");
  387. var stickyHelpers = __webpack_require__("9f7f");
  388. var fails = __webpack_require__("d039");
  389. var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y;
  390. var arrayPush = [].push;
  391. var min = Math.min;
  392. var MAX_UINT32 = 0xFFFFFFFF;
  393. // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
  394. // Weex JS has frozen built-in prototypes, so use try / catch wrapper
  395. var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
  396. // eslint-disable-next-line regexp/no-empty-group -- required for testing
  397. var re = /(?:)/;
  398. var originalExec = re.exec;
  399. re.exec = function () { return originalExec.apply(this, arguments); };
  400. var result = 'ab'.split(re);
  401. return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
  402. });
  403. // @@split logic
  404. fixRegExpWellKnownSymbolLogic('split', function (SPLIT, nativeSplit, maybeCallNative) {
  405. var internalSplit;
  406. if (
  407. 'abbc'.split(/(b)*/)[1] == 'c' ||
  408. // eslint-disable-next-line regexp/no-empty-group -- required for testing
  409. 'test'.split(/(?:)/, -1).length != 4 ||
  410. 'ab'.split(/(?:ab)*/).length != 2 ||
  411. '.'.split(/(.?)(.?)/).length != 4 ||
  412. // eslint-disable-next-line regexp/no-empty-capturing-group, regexp/no-empty-group -- required for testing
  413. '.'.split(/()()/).length > 1 ||
  414. ''.split(/.?/).length
  415. ) {
  416. // based on es5-shim implementation, need to rework it
  417. internalSplit = function (separator, limit) {
  418. var string = toString(requireObjectCoercible(this));
  419. var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
  420. if (lim === 0) return [];
  421. if (separator === undefined) return [string];
  422. // If `separator` is not a regex, use native split
  423. if (!isRegExp(separator)) {
  424. return nativeSplit.call(string, separator, lim);
  425. }
  426. var output = [];
  427. var flags = (separator.ignoreCase ? 'i' : '') +
  428. (separator.multiline ? 'm' : '') +
  429. (separator.unicode ? 'u' : '') +
  430. (separator.sticky ? 'y' : '');
  431. var lastLastIndex = 0;
  432. // Make `global` and avoid `lastIndex` issues by working with a copy
  433. var separatorCopy = new RegExp(separator.source, flags + 'g');
  434. var match, lastIndex, lastLength;
  435. while (match = regexpExec.call(separatorCopy, string)) {
  436. lastIndex = separatorCopy.lastIndex;
  437. if (lastIndex > lastLastIndex) {
  438. output.push(string.slice(lastLastIndex, match.index));
  439. if (match.length > 1 && match.index < string.length) arrayPush.apply(output, match.slice(1));
  440. lastLength = match[0].length;
  441. lastLastIndex = lastIndex;
  442. if (output.length >= lim) break;
  443. }
  444. if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++; // Avoid an infinite loop
  445. }
  446. if (lastLastIndex === string.length) {
  447. if (lastLength || !separatorCopy.test('')) output.push('');
  448. } else output.push(string.slice(lastLastIndex));
  449. return output.length > lim ? output.slice(0, lim) : output;
  450. };
  451. // Chakra, V8
  452. } else if ('0'.split(undefined, 0).length) {
  453. internalSplit = function (separator, limit) {
  454. return separator === undefined && limit === 0 ? [] : nativeSplit.call(this, separator, limit);
  455. };
  456. } else internalSplit = nativeSplit;
  457. return [
  458. // `String.prototype.split` method
  459. // https://tc39.es/ecma262/#sec-string.prototype.split
  460. function split(separator, limit) {
  461. var O = requireObjectCoercible(this);
  462. var splitter = separator == undefined ? undefined : getMethod(separator, SPLIT);
  463. return splitter
  464. ? splitter.call(separator, O, limit)
  465. : internalSplit.call(toString(O), separator, limit);
  466. },
  467. // `RegExp.prototype[@@split]` method
  468. // https://tc39.es/ecma262/#sec-regexp.prototype-@@split
  469. //
  470. // NOTE: This cannot be properly polyfilled in engines that don't support
  471. // the 'y' flag.
  472. function (string, limit) {
  473. var rx = anObject(this);
  474. var S = toString(string);
  475. var res = maybeCallNative(internalSplit, rx, S, limit, internalSplit !== nativeSplit);
  476. if (res.done) return res.value;
  477. var C = speciesConstructor(rx, RegExp);
  478. var unicodeMatching = rx.unicode;
  479. var flags = (rx.ignoreCase ? 'i' : '') +
  480. (rx.multiline ? 'm' : '') +
  481. (rx.unicode ? 'u' : '') +
  482. (UNSUPPORTED_Y ? 'g' : 'y');
  483. // ^(? + rx + ) is needed, in combination with some S slicing, to
  484. // simulate the 'y' flag.
  485. var splitter = new C(UNSUPPORTED_Y ? '^(?:' + rx.source + ')' : rx, flags);
  486. var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
  487. if (lim === 0) return [];
  488. if (S.length === 0) return callRegExpExec(splitter, S) === null ? [S] : [];
  489. var p = 0;
  490. var q = 0;
  491. var A = [];
  492. while (q < S.length) {
  493. splitter.lastIndex = UNSUPPORTED_Y ? 0 : q;
  494. var z = callRegExpExec(splitter, UNSUPPORTED_Y ? S.slice(q) : S);
  495. var e;
  496. if (
  497. z === null ||
  498. (e = min(toLength(splitter.lastIndex + (UNSUPPORTED_Y ? q : 0)), S.length)) === p
  499. ) {
  500. q = advanceStringIndex(S, q, unicodeMatching);
  501. } else {
  502. A.push(S.slice(p, q));
  503. if (A.length === lim) return A;
  504. for (var i = 1; i <= z.length - 1; i++) {
  505. A.push(z[i]);
  506. if (A.length === lim) return A;
  507. }
  508. q = p = e;
  509. }
  510. }
  511. A.push(S.slice(p));
  512. return A;
  513. }
  514. ];
  515. }, !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC, UNSUPPORTED_Y);
  516. /***/ }),
  517. /***/ "14c3":
  518. /***/ (function(module, exports, __webpack_require__) {
  519. var anObject = __webpack_require__("825a");
  520. var isCallable = __webpack_require__("1626");
  521. var classof = __webpack_require__("c6b6");
  522. var regexpExec = __webpack_require__("9263");
  523. // `RegExpExec` abstract operation
  524. // https://tc39.es/ecma262/#sec-regexpexec
  525. module.exports = function (R, S) {
  526. var exec = R.exec;
  527. if (isCallable(exec)) {
  528. var result = exec.call(R, S);
  529. if (result !== null) anObject(result);
  530. return result;
  531. }
  532. if (classof(R) === 'RegExp') return regexpExec.call(R, S);
  533. throw TypeError('RegExp#exec called on incompatible receiver');
  534. };
  535. /***/ }),
  536. /***/ "159b":
  537. /***/ (function(module, exports, __webpack_require__) {
  538. var global = __webpack_require__("da84");
  539. var DOMIterables = __webpack_require__("fdbc");
  540. var DOMTokenListPrototype = __webpack_require__("785a");
  541. var forEach = __webpack_require__("17c2");
  542. var createNonEnumerableProperty = __webpack_require__("9112");
  543. var handlePrototype = function (CollectionPrototype) {
  544. // some Chrome versions have non-configurable methods on DOMTokenList
  545. if (CollectionPrototype && CollectionPrototype.forEach !== forEach) try {
  546. createNonEnumerableProperty(CollectionPrototype, 'forEach', forEach);
  547. } catch (error) {
  548. CollectionPrototype.forEach = forEach;
  549. }
  550. };
  551. for (var COLLECTION_NAME in DOMIterables) {
  552. if (DOMIterables[COLLECTION_NAME]) {
  553. handlePrototype(global[COLLECTION_NAME] && global[COLLECTION_NAME].prototype);
  554. }
  555. }
  556. handlePrototype(DOMTokenListPrototype);
  557. /***/ }),
  558. /***/ "1626":
  559. /***/ (function(module, exports) {
  560. // `IsCallable` abstract operation
  561. // https://tc39.es/ecma262/#sec-iscallable
  562. module.exports = function (argument) {
  563. return typeof argument === 'function';
  564. };
  565. /***/ }),
  566. /***/ "17c2":
  567. /***/ (function(module, exports, __webpack_require__) {
  568. "use strict";
  569. var $forEach = __webpack_require__("b727").forEach;
  570. var arrayMethodIsStrict = __webpack_require__("a640");
  571. var STRICT_METHOD = arrayMethodIsStrict('forEach');
  572. // `Array.prototype.forEach` method implementation
  573. // https://tc39.es/ecma262/#sec-array.prototype.foreach
  574. module.exports = !STRICT_METHOD ? function forEach(callbackfn /* , thisArg */) {
  575. return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  576. // eslint-disable-next-line es/no-array-prototype-foreach -- safe
  577. } : [].forEach;
  578. /***/ }),
  579. /***/ "19aa":
  580. /***/ (function(module, exports) {
  581. module.exports = function (it, Constructor, name) {
  582. if (it instanceof Constructor) return it;
  583. throw TypeError('Incorrect ' + (name ? name + ' ' : '') + 'invocation');
  584. };
  585. /***/ }),
  586. /***/ "1a2d":
  587. /***/ (function(module, exports, __webpack_require__) {
  588. var toObject = __webpack_require__("7b0b");
  589. var hasOwnProperty = {}.hasOwnProperty;
  590. // `HasOwnProperty` abstract operation
  591. // https://tc39.es/ecma262/#sec-hasownproperty
  592. module.exports = Object.hasOwn || function hasOwn(it, key) {
  593. return hasOwnProperty.call(toObject(it), key);
  594. };
  595. /***/ }),
  596. /***/ "1a97":
  597. /***/ (function(module, exports, __webpack_require__) {
  598. // extracted by mini-css-extract-plugin
  599. /***/ }),
  600. /***/ "1be4":
  601. /***/ (function(module, exports, __webpack_require__) {
  602. var getBuiltIn = __webpack_require__("d066");
  603. module.exports = getBuiltIn('document', 'documentElement');
  604. /***/ }),
  605. /***/ "1c7e":
  606. /***/ (function(module, exports, __webpack_require__) {
  607. var wellKnownSymbol = __webpack_require__("b622");
  608. var ITERATOR = wellKnownSymbol('iterator');
  609. var SAFE_CLOSING = false;
  610. try {
  611. var called = 0;
  612. var iteratorWithReturn = {
  613. next: function () {
  614. return { done: !!called++ };
  615. },
  616. 'return': function () {
  617. SAFE_CLOSING = true;
  618. }
  619. };
  620. iteratorWithReturn[ITERATOR] = function () {
  621. return this;
  622. };
  623. // eslint-disable-next-line es/no-array-from, no-throw-literal -- required for testing
  624. Array.from(iteratorWithReturn, function () { throw 2; });
  625. } catch (error) { /* empty */ }
  626. module.exports = function (exec, SKIP_CLOSING) {
  627. if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
  628. var ITERATION_SUPPORT = false;
  629. try {
  630. var object = {};
  631. object[ITERATOR] = function () {
  632. return {
  633. next: function () {
  634. return { done: ITERATION_SUPPORT = true };
  635. }
  636. };
  637. };
  638. exec(object);
  639. } catch (error) { /* empty */ }
  640. return ITERATION_SUPPORT;
  641. };
  642. /***/ }),
  643. /***/ "1cdc":
  644. /***/ (function(module, exports, __webpack_require__) {
  645. var userAgent = __webpack_require__("342f");
  646. module.exports = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent);
  647. /***/ }),
  648. /***/ "1d80":
  649. /***/ (function(module, exports) {
  650. // `RequireObjectCoercible` abstract operation
  651. // https://tc39.es/ecma262/#sec-requireobjectcoercible
  652. module.exports = function (it) {
  653. if (it == undefined) throw TypeError("Can't call method on " + it);
  654. return it;
  655. };
  656. /***/ }),
  657. /***/ "1dde":
  658. /***/ (function(module, exports, __webpack_require__) {
  659. var fails = __webpack_require__("d039");
  660. var wellKnownSymbol = __webpack_require__("b622");
  661. var V8_VERSION = __webpack_require__("2d00");
  662. var SPECIES = wellKnownSymbol('species');
  663. module.exports = function (METHOD_NAME) {
  664. // We can't use this feature detection in V8 since it causes
  665. // deoptimization and serious performance degradation
  666. // https://github.com/zloirock/core-js/issues/677
  667. return V8_VERSION >= 51 || !fails(function () {
  668. var array = [];
  669. var constructor = array.constructor = {};
  670. constructor[SPECIES] = function () {
  671. return { foo: 1 };
  672. };
  673. return array[METHOD_NAME](Boolean).foo !== 1;
  674. });
  675. };
  676. /***/ }),
  677. /***/ "2266":
  678. /***/ (function(module, exports, __webpack_require__) {
  679. var anObject = __webpack_require__("825a");
  680. var isArrayIteratorMethod = __webpack_require__("e95a");
  681. var lengthOfArrayLike = __webpack_require__("07fa");
  682. var bind = __webpack_require__("0366");
  683. var getIterator = __webpack_require__("9a1f");
  684. var getIteratorMethod = __webpack_require__("35a1");
  685. var iteratorClose = __webpack_require__("2a62");
  686. var Result = function (stopped, result) {
  687. this.stopped = stopped;
  688. this.result = result;
  689. };
  690. module.exports = function (iterable, unboundFunction, options) {
  691. var that = options && options.that;
  692. var AS_ENTRIES = !!(options && options.AS_ENTRIES);
  693. var IS_ITERATOR = !!(options && options.IS_ITERATOR);
  694. var INTERRUPTED = !!(options && options.INTERRUPTED);
  695. var fn = bind(unboundFunction, that, 1 + AS_ENTRIES + INTERRUPTED);
  696. var iterator, iterFn, index, length, result, next, step;
  697. var stop = function (condition) {
  698. if (iterator) iteratorClose(iterator, 'normal', condition);
  699. return new Result(true, condition);
  700. };
  701. var callFn = function (value) {
  702. if (AS_ENTRIES) {
  703. anObject(value);
  704. return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
  705. } return INTERRUPTED ? fn(value, stop) : fn(value);
  706. };
  707. if (IS_ITERATOR) {
  708. iterator = iterable;
  709. } else {
  710. iterFn = getIteratorMethod(iterable);
  711. if (!iterFn) throw TypeError(String(iterable) + ' is not iterable');
  712. // optimisation for array iterators
  713. if (isArrayIteratorMethod(iterFn)) {
  714. for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
  715. result = callFn(iterable[index]);
  716. if (result && result instanceof Result) return result;
  717. } return new Result(false);
  718. }
  719. iterator = getIterator(iterable, iterFn);
  720. }
  721. next = iterator.next;
  722. while (!(step = next.call(iterator)).done) {
  723. try {
  724. result = callFn(step.value);
  725. } catch (error) {
  726. iteratorClose(iterator, 'throw', error);
  727. }
  728. if (typeof result == 'object' && result && result instanceof Result) return result;
  729. } return new Result(false);
  730. };
  731. /***/ }),
  732. /***/ "23cb":
  733. /***/ (function(module, exports, __webpack_require__) {
  734. var toIntegerOrInfinity = __webpack_require__("5926");
  735. var max = Math.max;
  736. var min = Math.min;
  737. // Helper for a popular repeating case of the spec:
  738. // Let integer be ? ToInteger(index).
  739. // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
  740. module.exports = function (index, length) {
  741. var integer = toIntegerOrInfinity(index);
  742. return integer < 0 ? max(integer + length, 0) : min(integer, length);
  743. };
  744. /***/ }),
  745. /***/ "23e7":
  746. /***/ (function(module, exports, __webpack_require__) {
  747. var global = __webpack_require__("da84");
  748. var getOwnPropertyDescriptor = __webpack_require__("06cf").f;
  749. var createNonEnumerableProperty = __webpack_require__("9112");
  750. var redefine = __webpack_require__("6eeb");
  751. var setGlobal = __webpack_require__("ce4e");
  752. var copyConstructorProperties = __webpack_require__("e893");
  753. var isForced = __webpack_require__("94ca");
  754. /*
  755. options.target - name of the target object
  756. options.global - target is the global object
  757. options.stat - export as static methods of target
  758. options.proto - export as prototype methods of target
  759. options.real - real prototype method for the `pure` version
  760. options.forced - export even if the native feature is available
  761. options.bind - bind methods to the target, required for the `pure` version
  762. options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
  763. options.unsafe - use the simple assignment of property instead of delete + defineProperty
  764. options.sham - add a flag to not completely full polyfills
  765. options.enumerable - export as enumerable property
  766. options.noTargetGet - prevent calling a getter on target
  767. options.name - the .name of the function if it does not match the key
  768. */
  769. module.exports = function (options, source) {
  770. var TARGET = options.target;
  771. var GLOBAL = options.global;
  772. var STATIC = options.stat;
  773. var FORCED, target, key, targetProperty, sourceProperty, descriptor;
  774. if (GLOBAL) {
  775. target = global;
  776. } else if (STATIC) {
  777. target = global[TARGET] || setGlobal(TARGET, {});
  778. } else {
  779. target = (global[TARGET] || {}).prototype;
  780. }
  781. if (target) for (key in source) {
  782. sourceProperty = source[key];
  783. if (options.noTargetGet) {
  784. descriptor = getOwnPropertyDescriptor(target, key);
  785. targetProperty = descriptor && descriptor.value;
  786. } else targetProperty = target[key];
  787. FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
  788. // contained in target
  789. if (!FORCED && targetProperty !== undefined) {
  790. if (typeof sourceProperty === typeof targetProperty) continue;
  791. copyConstructorProperties(sourceProperty, targetProperty);
  792. }
  793. // add a flag to not completely full polyfills
  794. if (options.sham || (targetProperty && targetProperty.sham)) {
  795. createNonEnumerableProperty(sourceProperty, 'sham', true);
  796. }
  797. // extend global
  798. redefine(target, key, sourceProperty, options);
  799. }
  800. };
  801. /***/ }),
  802. /***/ "241c":
  803. /***/ (function(module, exports, __webpack_require__) {
  804. var internalObjectKeys = __webpack_require__("ca84");
  805. var enumBugKeys = __webpack_require__("7839");
  806. var hiddenKeys = enumBugKeys.concat('length', 'prototype');
  807. // `Object.getOwnPropertyNames` method
  808. // https://tc39.es/ecma262/#sec-object.getownpropertynames
  809. // eslint-disable-next-line es/no-object-getownpropertynames -- safe
  810. exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  811. return internalObjectKeys(O, hiddenKeys);
  812. };
  813. /***/ }),
  814. /***/ "2532":
  815. /***/ (function(module, exports, __webpack_require__) {
  816. "use strict";
  817. var $ = __webpack_require__("23e7");
  818. var notARegExp = __webpack_require__("5a34");
  819. var requireObjectCoercible = __webpack_require__("1d80");
  820. var toString = __webpack_require__("577e");
  821. var correctIsRegExpLogic = __webpack_require__("ab13");
  822. // `String.prototype.includes` method
  823. // https://tc39.es/ecma262/#sec-string.prototype.includes
  824. $({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, {
  825. includes: function includes(searchString /* , position = 0 */) {
  826. return !!~toString(requireObjectCoercible(this))
  827. .indexOf(toString(notARegExp(searchString)), arguments.length > 1 ? arguments[1] : undefined);
  828. }
  829. });
  830. /***/ }),
  831. /***/ "25f0":
  832. /***/ (function(module, exports, __webpack_require__) {
  833. "use strict";
  834. var PROPER_FUNCTION_NAME = __webpack_require__("5e77").PROPER;
  835. var redefine = __webpack_require__("6eeb");
  836. var anObject = __webpack_require__("825a");
  837. var $toString = __webpack_require__("577e");
  838. var fails = __webpack_require__("d039");
  839. var flags = __webpack_require__("ad6d");
  840. var TO_STRING = 'toString';
  841. var RegExpPrototype = RegExp.prototype;
  842. var nativeToString = RegExpPrototype[TO_STRING];
  843. var NOT_GENERIC = fails(function () { return nativeToString.call({ source: 'a', flags: 'b' }) != '/a/b'; });
  844. // FF44- RegExp#toString has a wrong name
  845. var INCORRECT_NAME = PROPER_FUNCTION_NAME && nativeToString.name != TO_STRING;
  846. // `RegExp.prototype.toString` method
  847. // https://tc39.es/ecma262/#sec-regexp.prototype.tostring
  848. if (NOT_GENERIC || INCORRECT_NAME) {
  849. redefine(RegExp.prototype, TO_STRING, function toString() {
  850. var R = anObject(this);
  851. var p = $toString(R.source);
  852. var rf = R.flags;
  853. var f = $toString(rf === undefined && R instanceof RegExp && !('flags' in RegExpPrototype) ? flags.call(R) : rf);
  854. return '/' + p + '/' + f;
  855. }, { unsafe: true });
  856. }
  857. /***/ }),
  858. /***/ "2626":
  859. /***/ (function(module, exports, __webpack_require__) {
  860. "use strict";
  861. var getBuiltIn = __webpack_require__("d066");
  862. var definePropertyModule = __webpack_require__("9bf2");
  863. var wellKnownSymbol = __webpack_require__("b622");
  864. var DESCRIPTORS = __webpack_require__("83ab");
  865. var SPECIES = wellKnownSymbol('species');
  866. module.exports = function (CONSTRUCTOR_NAME) {
  867. var Constructor = getBuiltIn(CONSTRUCTOR_NAME);
  868. var defineProperty = definePropertyModule.f;
  869. if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) {
  870. defineProperty(Constructor, SPECIES, {
  871. configurable: true,
  872. get: function () { return this; }
  873. });
  874. }
  875. };
  876. /***/ }),
  877. /***/ "2a62":
  878. /***/ (function(module, exports, __webpack_require__) {
  879. var anObject = __webpack_require__("825a");
  880. var getMethod = __webpack_require__("dc4a");
  881. module.exports = function (iterator, kind, value) {
  882. var innerResult, innerError;
  883. anObject(iterator);
  884. try {
  885. innerResult = getMethod(iterator, 'return');
  886. if (!innerResult) {
  887. if (kind === 'throw') throw value;
  888. return value;
  889. }
  890. innerResult = innerResult.call(iterator);
  891. } catch (error) {
  892. innerError = true;
  893. innerResult = error;
  894. }
  895. if (kind === 'throw') throw value;
  896. if (innerError) throw innerResult;
  897. anObject(innerResult);
  898. return value;
  899. };
  900. /***/ }),
  901. /***/ "2b3d":
  902. /***/ (function(module, exports, __webpack_require__) {
  903. "use strict";
  904. // TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env`
  905. __webpack_require__("3ca3");
  906. var $ = __webpack_require__("23e7");
  907. var DESCRIPTORS = __webpack_require__("83ab");
  908. var USE_NATIVE_URL = __webpack_require__("0d3b");
  909. var global = __webpack_require__("da84");
  910. var defineProperties = __webpack_require__("37e8");
  911. var redefine = __webpack_require__("6eeb");
  912. var anInstance = __webpack_require__("19aa");
  913. var hasOwn = __webpack_require__("1a2d");
  914. var assign = __webpack_require__("60da");
  915. var arrayFrom = __webpack_require__("4df4");
  916. var codeAt = __webpack_require__("6547").codeAt;
  917. var toASCII = __webpack_require__("5fb2");
  918. var $toString = __webpack_require__("577e");
  919. var setToStringTag = __webpack_require__("d44e");
  920. var URLSearchParamsModule = __webpack_require__("9861");
  921. var InternalStateModule = __webpack_require__("69f3");
  922. var NativeURL = global.URL;
  923. var URLSearchParams = URLSearchParamsModule.URLSearchParams;
  924. var getInternalSearchParamsState = URLSearchParamsModule.getState;
  925. var setInternalState = InternalStateModule.set;
  926. var getInternalURLState = InternalStateModule.getterFor('URL');
  927. var floor = Math.floor;
  928. var pow = Math.pow;
  929. var INVALID_AUTHORITY = 'Invalid authority';
  930. var INVALID_SCHEME = 'Invalid scheme';
  931. var INVALID_HOST = 'Invalid host';
  932. var INVALID_PORT = 'Invalid port';
  933. var ALPHA = /[A-Za-z]/;
  934. // eslint-disable-next-line regexp/no-obscure-range -- safe
  935. var ALPHANUMERIC = /[\d+-.A-Za-z]/;
  936. var DIGIT = /\d/;
  937. var HEX_START = /^0x/i;
  938. var OCT = /^[0-7]+$/;
  939. var DEC = /^\d+$/;
  940. var HEX = /^[\dA-Fa-f]+$/;
  941. /* eslint-disable regexp/no-control-character -- safe */
  942. var FORBIDDEN_HOST_CODE_POINT = /[\0\t\n\r #%/:<>?@[\\\]^|]/;
  943. var FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT = /[\0\t\n\r #/:<>?@[\\\]^|]/;
  944. var LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE = /^[\u0000-\u0020]+|[\u0000-\u0020]+$/g;
  945. var TAB_AND_NEW_LINE = /[\t\n\r]/g;
  946. /* eslint-enable regexp/no-control-character -- safe */
  947. var EOF;
  948. var parseHost = function (url, input) {
  949. var result, codePoints, index;
  950. if (input.charAt(0) == '[') {
  951. if (input.charAt(input.length - 1) != ']') return INVALID_HOST;
  952. result = parseIPv6(input.slice(1, -1));
  953. if (!result) return INVALID_HOST;
  954. url.host = result;
  955. // opaque host
  956. } else if (!isSpecial(url)) {
  957. if (FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT.test(input)) return INVALID_HOST;
  958. result = '';
  959. codePoints = arrayFrom(input);
  960. for (index = 0; index < codePoints.length; index++) {
  961. result += percentEncode(codePoints[index], C0ControlPercentEncodeSet);
  962. }
  963. url.host = result;
  964. } else {
  965. input = toASCII(input);
  966. if (FORBIDDEN_HOST_CODE_POINT.test(input)) return INVALID_HOST;
  967. result = parseIPv4(input);
  968. if (result === null) return INVALID_HOST;
  969. url.host = result;
  970. }
  971. };
  972. var parseIPv4 = function (input) {
  973. var parts = input.split('.');
  974. var partsLength, numbers, index, part, radix, number, ipv4;
  975. if (parts.length && parts[parts.length - 1] == '') {
  976. parts.pop();
  977. }
  978. partsLength = parts.length;
  979. if (partsLength > 4) return input;
  980. numbers = [];
  981. for (index = 0; index < partsLength; index++) {
  982. part = parts[index];
  983. if (part == '') return input;
  984. radix = 10;
  985. if (part.length > 1 && part.charAt(0) == '0') {
  986. radix = HEX_START.test(part) ? 16 : 8;
  987. part = part.slice(radix == 8 ? 1 : 2);
  988. }
  989. if (part === '') {
  990. number = 0;
  991. } else {
  992. if (!(radix == 10 ? DEC : radix == 8 ? OCT : HEX).test(part)) return input;
  993. number = parseInt(part, radix);
  994. }
  995. numbers.push(number);
  996. }
  997. for (index = 0; index < partsLength; index++) {
  998. number = numbers[index];
  999. if (index == partsLength - 1) {
  1000. if (number >= pow(256, 5 - partsLength)) return null;
  1001. } else if (number > 255) return null;
  1002. }
  1003. ipv4 = numbers.pop();
  1004. for (index = 0; index < numbers.length; index++) {
  1005. ipv4 += numbers[index] * pow(256, 3 - index);
  1006. }
  1007. return ipv4;
  1008. };
  1009. // eslint-disable-next-line max-statements -- TODO
  1010. var parseIPv6 = function (input) {
  1011. var address = [0, 0, 0, 0, 0, 0, 0, 0];
  1012. var pieceIndex = 0;
  1013. var compress = null;
  1014. var pointer = 0;
  1015. var value, length, numbersSeen, ipv4Piece, number, swaps, swap;
  1016. var chr = function () {
  1017. return input.charAt(pointer);
  1018. };
  1019. if (chr() == ':') {
  1020. if (input.charAt(1) != ':') return;
  1021. pointer += 2;
  1022. pieceIndex++;
  1023. compress = pieceIndex;
  1024. }
  1025. while (chr()) {
  1026. if (pieceIndex == 8) return;
  1027. if (chr() == ':') {
  1028. if (compress !== null) return;
  1029. pointer++;
  1030. pieceIndex++;
  1031. compress = pieceIndex;
  1032. continue;
  1033. }
  1034. value = length = 0;
  1035. while (length < 4 && HEX.test(chr())) {
  1036. value = value * 16 + parseInt(chr(), 16);
  1037. pointer++;
  1038. length++;
  1039. }
  1040. if (chr() == '.') {
  1041. if (length == 0) return;
  1042. pointer -= length;
  1043. if (pieceIndex > 6) return;
  1044. numbersSeen = 0;
  1045. while (chr()) {
  1046. ipv4Piece = null;
  1047. if (numbersSeen > 0) {
  1048. if (chr() == '.' && numbersSeen < 4) pointer++;
  1049. else return;
  1050. }
  1051. if (!DIGIT.test(chr())) return;
  1052. while (DIGIT.test(chr())) {
  1053. number = parseInt(chr(), 10);
  1054. if (ipv4Piece === null) ipv4Piece = number;
  1055. else if (ipv4Piece == 0) return;
  1056. else ipv4Piece = ipv4Piece * 10 + number;
  1057. if (ipv4Piece > 255) return;
  1058. pointer++;
  1059. }
  1060. address[pieceIndex] = address[pieceIndex] * 256 + ipv4Piece;
  1061. numbersSeen++;
  1062. if (numbersSeen == 2 || numbersSeen == 4) pieceIndex++;
  1063. }
  1064. if (numbersSeen != 4) return;
  1065. break;
  1066. } else if (chr() == ':') {
  1067. pointer++;
  1068. if (!chr()) return;
  1069. } else if (chr()) return;
  1070. address[pieceIndex++] = value;
  1071. }
  1072. if (compress !== null) {
  1073. swaps = pieceIndex - compress;
  1074. pieceIndex = 7;
  1075. while (pieceIndex != 0 && swaps > 0) {
  1076. swap = address[pieceIndex];
  1077. address[pieceIndex--] = address[compress + swaps - 1];
  1078. address[compress + --swaps] = swap;
  1079. }
  1080. } else if (pieceIndex != 8) return;
  1081. return address;
  1082. };
  1083. var findLongestZeroSequence = function (ipv6) {
  1084. var maxIndex = null;
  1085. var maxLength = 1;
  1086. var currStart = null;
  1087. var currLength = 0;
  1088. var index = 0;
  1089. for (; index < 8; index++) {
  1090. if (ipv6[index] !== 0) {
  1091. if (currLength > maxLength) {
  1092. maxIndex = currStart;
  1093. maxLength = currLength;
  1094. }
  1095. currStart = null;
  1096. currLength = 0;
  1097. } else {
  1098. if (currStart === null) currStart = index;
  1099. ++currLength;
  1100. }
  1101. }
  1102. if (currLength > maxLength) {
  1103. maxIndex = currStart;
  1104. maxLength = currLength;
  1105. }
  1106. return maxIndex;
  1107. };
  1108. var serializeHost = function (host) {
  1109. var result, index, compress, ignore0;
  1110. // ipv4
  1111. if (typeof host == 'number') {
  1112. result = [];
  1113. for (index = 0; index < 4; index++) {
  1114. result.unshift(host % 256);
  1115. host = floor(host / 256);
  1116. } return result.join('.');
  1117. // ipv6
  1118. } else if (typeof host == 'object') {
  1119. result = '';
  1120. compress = findLongestZeroSequence(host);
  1121. for (index = 0; index < 8; index++) {
  1122. if (ignore0 && host[index] === 0) continue;
  1123. if (ignore0) ignore0 = false;
  1124. if (compress === index) {
  1125. result += index ? ':' : '::';
  1126. ignore0 = true;
  1127. } else {
  1128. result += host[index].toString(16);
  1129. if (index < 7) result += ':';
  1130. }
  1131. }
  1132. return '[' + result + ']';
  1133. } return host;
  1134. };
  1135. var C0ControlPercentEncodeSet = {};
  1136. var fragmentPercentEncodeSet = assign({}, C0ControlPercentEncodeSet, {
  1137. ' ': 1, '"': 1, '<': 1, '>': 1, '`': 1
  1138. });
  1139. var pathPercentEncodeSet = assign({}, fragmentPercentEncodeSet, {
  1140. '#': 1, '?': 1, '{': 1, '}': 1
  1141. });
  1142. var userinfoPercentEncodeSet = assign({}, pathPercentEncodeSet, {
  1143. '/': 1, ':': 1, ';': 1, '=': 1, '@': 1, '[': 1, '\\': 1, ']': 1, '^': 1, '|': 1
  1144. });
  1145. var percentEncode = function (chr, set) {
  1146. var code = codeAt(chr, 0);
  1147. return code > 0x20 && code < 0x7F && !hasOwn(set, chr) ? chr : encodeURIComponent(chr);
  1148. };
  1149. var specialSchemes = {
  1150. ftp: 21,
  1151. file: null,
  1152. http: 80,
  1153. https: 443,
  1154. ws: 80,
  1155. wss: 443
  1156. };
  1157. var isSpecial = function (url) {
  1158. return hasOwn(specialSchemes, url.scheme);
  1159. };
  1160. var includesCredentials = function (url) {
  1161. return url.username != '' || url.password != '';
  1162. };
  1163. var cannotHaveUsernamePasswordPort = function (url) {
  1164. return !url.host || url.cannotBeABaseURL || url.scheme == 'file';
  1165. };
  1166. var isWindowsDriveLetter = function (string, normalized) {
  1167. var second;
  1168. return string.length == 2 && ALPHA.test(string.charAt(0))
  1169. && ((second = string.charAt(1)) == ':' || (!normalized && second == '|'));
  1170. };
  1171. var startsWithWindowsDriveLetter = function (string) {
  1172. var third;
  1173. return string.length > 1 && isWindowsDriveLetter(string.slice(0, 2)) && (
  1174. string.length == 2 ||
  1175. ((third = string.charAt(2)) === '/' || third === '\\' || third === '?' || third === '#')
  1176. );
  1177. };
  1178. var shortenURLsPath = function (url) {
  1179. var path = url.path;
  1180. var pathSize = path.length;
  1181. if (pathSize && (url.scheme != 'file' || pathSize != 1 || !isWindowsDriveLetter(path[0], true))) {
  1182. path.pop();
  1183. }
  1184. };
  1185. var isSingleDot = function (segment) {
  1186. return segment === '.' || segment.toLowerCase() === '%2e';
  1187. };
  1188. var isDoubleDot = function (segment) {
  1189. segment = segment.toLowerCase();
  1190. return segment === '..' || segment === '%2e.' || segment === '.%2e' || segment === '%2e%2e';
  1191. };
  1192. // States:
  1193. var SCHEME_START = {};
  1194. var SCHEME = {};
  1195. var NO_SCHEME = {};
  1196. var SPECIAL_RELATIVE_OR_AUTHORITY = {};
  1197. var PATH_OR_AUTHORITY = {};
  1198. var RELATIVE = {};
  1199. var RELATIVE_SLASH = {};
  1200. var SPECIAL_AUTHORITY_SLASHES = {};
  1201. var SPECIAL_AUTHORITY_IGNORE_SLASHES = {};
  1202. var AUTHORITY = {};
  1203. var HOST = {};
  1204. var HOSTNAME = {};
  1205. var PORT = {};
  1206. var FILE = {};
  1207. var FILE_SLASH = {};
  1208. var FILE_HOST = {};
  1209. var PATH_START = {};
  1210. var PATH = {};
  1211. var CANNOT_BE_A_BASE_URL_PATH = {};
  1212. var QUERY = {};
  1213. var FRAGMENT = {};
  1214. // eslint-disable-next-line max-statements -- TODO
  1215. var parseURL = function (url, input, stateOverride, base) {
  1216. var state = stateOverride || SCHEME_START;
  1217. var pointer = 0;
  1218. var buffer = '';
  1219. var seenAt = false;
  1220. var seenBracket = false;
  1221. var seenPasswordToken = false;
  1222. var codePoints, chr, bufferCodePoints, failure;
  1223. if (!stateOverride) {
  1224. url.scheme = '';
  1225. url.username = '';
  1226. url.password = '';
  1227. url.host = null;
  1228. url.port = null;
  1229. url.path = [];
  1230. url.query = null;
  1231. url.fragment = null;
  1232. url.cannotBeABaseURL = false;
  1233. input = input.replace(LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE, '');
  1234. }
  1235. input = input.replace(TAB_AND_NEW_LINE, '');
  1236. codePoints = arrayFrom(input);
  1237. while (pointer <= codePoints.length) {
  1238. chr = codePoints[pointer];
  1239. switch (state) {
  1240. case SCHEME_START:
  1241. if (chr && ALPHA.test(chr)) {
  1242. buffer += chr.toLowerCase();
  1243. state = SCHEME;
  1244. } else if (!stateOverride) {
  1245. state = NO_SCHEME;
  1246. continue;
  1247. } else return INVALID_SCHEME;
  1248. break;
  1249. case SCHEME:
  1250. if (chr && (ALPHANUMERIC.test(chr) || chr == '+' || chr == '-' || chr == '.')) {
  1251. buffer += chr.toLowerCase();
  1252. } else if (chr == ':') {
  1253. if (stateOverride && (
  1254. (isSpecial(url) != hasOwn(specialSchemes, buffer)) ||
  1255. (buffer == 'file' && (includesCredentials(url) || url.port !== null)) ||
  1256. (url.scheme == 'file' && !url.host)
  1257. )) return;
  1258. url.scheme = buffer;
  1259. if (stateOverride) {
  1260. if (isSpecial(url) && specialSchemes[url.scheme] == url.port) url.port = null;
  1261. return;
  1262. }
  1263. buffer = '';
  1264. if (url.scheme == 'file') {
  1265. state = FILE;
  1266. } else if (isSpecial(url) && base && base.scheme == url.scheme) {
  1267. state = SPECIAL_RELATIVE_OR_AUTHORITY;
  1268. } else if (isSpecial(url)) {
  1269. state = SPECIAL_AUTHORITY_SLASHES;
  1270. } else if (codePoints[pointer + 1] == '/') {
  1271. state = PATH_OR_AUTHORITY;
  1272. pointer++;
  1273. } else {
  1274. url.cannotBeABaseURL = true;
  1275. url.path.push('');
  1276. state = CANNOT_BE_A_BASE_URL_PATH;
  1277. }
  1278. } else if (!stateOverride) {
  1279. buffer = '';
  1280. state = NO_SCHEME;
  1281. pointer = 0;
  1282. continue;
  1283. } else return INVALID_SCHEME;
  1284. break;
  1285. case NO_SCHEME:
  1286. if (!base || (base.cannotBeABaseURL && chr != '#')) return INVALID_SCHEME;
  1287. if (base.cannotBeABaseURL && chr == '#') {
  1288. url.scheme = base.scheme;
  1289. url.path = base.path.slice();
  1290. url.query = base.query;
  1291. url.fragment = '';
  1292. url.cannotBeABaseURL = true;
  1293. state = FRAGMENT;
  1294. break;
  1295. }
  1296. state = base.scheme == 'file' ? FILE : RELATIVE;
  1297. continue;
  1298. case SPECIAL_RELATIVE_OR_AUTHORITY:
  1299. if (chr == '/' && codePoints[pointer + 1] == '/') {
  1300. state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
  1301. pointer++;
  1302. } else {
  1303. state = RELATIVE;
  1304. continue;
  1305. } break;
  1306. case PATH_OR_AUTHORITY:
  1307. if (chr == '/') {
  1308. state = AUTHORITY;
  1309. break;
  1310. } else {
  1311. state = PATH;
  1312. continue;
  1313. }
  1314. case RELATIVE:
  1315. url.scheme = base.scheme;
  1316. if (chr == EOF) {
  1317. url.username = base.username;
  1318. url.password = base.password;
  1319. url.host = base.host;
  1320. url.port = base.port;
  1321. url.path = base.path.slice();
  1322. url.query = base.query;
  1323. } else if (chr == '/' || (chr == '\\' && isSpecial(url))) {
  1324. state = RELATIVE_SLASH;
  1325. } else if (chr == '?') {
  1326. url.username = base.username;
  1327. url.password = base.password;
  1328. url.host = base.host;
  1329. url.port = base.port;
  1330. url.path = base.path.slice();
  1331. url.query = '';
  1332. state = QUERY;
  1333. } else if (chr == '#') {
  1334. url.username = base.username;
  1335. url.password = base.password;
  1336. url.host = base.host;
  1337. url.port = base.port;
  1338. url.path = base.path.slice();
  1339. url.query = base.query;
  1340. url.fragment = '';
  1341. state = FRAGMENT;
  1342. } else {
  1343. url.username = base.username;
  1344. url.password = base.password;
  1345. url.host = base.host;
  1346. url.port = base.port;
  1347. url.path = base.path.slice();
  1348. url.path.pop();
  1349. state = PATH;
  1350. continue;
  1351. } break;
  1352. case RELATIVE_SLASH:
  1353. if (isSpecial(url) && (chr == '/' || chr == '\\')) {
  1354. state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
  1355. } else if (chr == '/') {
  1356. state = AUTHORITY;
  1357. } else {
  1358. url.username = base.username;
  1359. url.password = base.password;
  1360. url.host = base.host;
  1361. url.port = base.port;
  1362. state = PATH;
  1363. continue;
  1364. } break;
  1365. case SPECIAL_AUTHORITY_SLASHES:
  1366. state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
  1367. if (chr != '/' || buffer.charAt(pointer + 1) != '/') continue;
  1368. pointer++;
  1369. break;
  1370. case SPECIAL_AUTHORITY_IGNORE_SLASHES:
  1371. if (chr != '/' && chr != '\\') {
  1372. state = AUTHORITY;
  1373. continue;
  1374. } break;
  1375. case AUTHORITY:
  1376. if (chr == '@') {
  1377. if (seenAt) buffer = '%40' + buffer;
  1378. seenAt = true;
  1379. bufferCodePoints = arrayFrom(buffer);
  1380. for (var i = 0; i < bufferCodePoints.length; i++) {
  1381. var codePoint = bufferCodePoints[i];
  1382. if (codePoint == ':' && !seenPasswordToken) {
  1383. seenPasswordToken = true;
  1384. continue;
  1385. }
  1386. var encodedCodePoints = percentEncode(codePoint, userinfoPercentEncodeSet);
  1387. if (seenPasswordToken) url.password += encodedCodePoints;
  1388. else url.username += encodedCodePoints;
  1389. }
  1390. buffer = '';
  1391. } else if (
  1392. chr == EOF || chr == '/' || chr == '?' || chr == '#' ||
  1393. (chr == '\\' && isSpecial(url))
  1394. ) {
  1395. if (seenAt && buffer == '') return INVALID_AUTHORITY;
  1396. pointer -= arrayFrom(buffer).length + 1;
  1397. buffer = '';
  1398. state = HOST;
  1399. } else buffer += chr;
  1400. break;
  1401. case HOST:
  1402. case HOSTNAME:
  1403. if (stateOverride && url.scheme == 'file') {
  1404. state = FILE_HOST;
  1405. continue;
  1406. } else if (chr == ':' && !seenBracket) {
  1407. if (buffer == '') return INVALID_HOST;
  1408. failure = parseHost(url, buffer);
  1409. if (failure) return failure;
  1410. buffer = '';
  1411. state = PORT;
  1412. if (stateOverride == HOSTNAME) return;
  1413. } else if (
  1414. chr == EOF || chr == '/' || chr == '?' || chr == '#' ||
  1415. (chr == '\\' && isSpecial(url))
  1416. ) {
  1417. if (isSpecial(url) && buffer == '') return INVALID_HOST;
  1418. if (stateOverride && buffer == '' && (includesCredentials(url) || url.port !== null)) return;
  1419. failure = parseHost(url, buffer);
  1420. if (failure) return failure;
  1421. buffer = '';
  1422. state = PATH_START;
  1423. if (stateOverride) return;
  1424. continue;
  1425. } else {
  1426. if (chr == '[') seenBracket = true;
  1427. else if (chr == ']') seenBracket = false;
  1428. buffer += chr;
  1429. } break;
  1430. case PORT:
  1431. if (DIGIT.test(chr)) {
  1432. buffer += chr;
  1433. } else if (
  1434. chr == EOF || chr == '/' || chr == '?' || chr == '#' ||
  1435. (chr == '\\' && isSpecial(url)) ||
  1436. stateOverride
  1437. ) {
  1438. if (buffer != '') {
  1439. var port = parseInt(buffer, 10);
  1440. if (port > 0xFFFF) return INVALID_PORT;
  1441. url.port = (isSpecial(url) && port === specialSchemes[url.scheme]) ? null : port;
  1442. buffer = '';
  1443. }
  1444. if (stateOverride) return;
  1445. state = PATH_START;
  1446. continue;
  1447. } else return INVALID_PORT;
  1448. break;
  1449. case FILE:
  1450. url.scheme = 'file';
  1451. if (chr == '/' || chr == '\\') state = FILE_SLASH;
  1452. else if (base && base.scheme == 'file') {
  1453. if (chr == EOF) {
  1454. url.host = base.host;
  1455. url.path = base.path.slice();
  1456. url.query = base.query;
  1457. } else if (chr == '?') {
  1458. url.host = base.host;
  1459. url.path = base.path.slice();
  1460. url.query = '';
  1461. state = QUERY;
  1462. } else if (chr == '#') {
  1463. url.host = base.host;
  1464. url.path = base.path.slice();
  1465. url.query = base.query;
  1466. url.fragment = '';
  1467. state = FRAGMENT;
  1468. } else {
  1469. if (!startsWithWindowsDriveLetter(codePoints.slice(pointer).join(''))) {
  1470. url.host = base.host;
  1471. url.path = base.path.slice();
  1472. shortenURLsPath(url);
  1473. }
  1474. state = PATH;
  1475. continue;
  1476. }
  1477. } else {
  1478. state = PATH;
  1479. continue;
  1480. } break;
  1481. case FILE_SLASH:
  1482. if (chr == '/' || chr == '\\') {
  1483. state = FILE_HOST;
  1484. break;
  1485. }
  1486. if (base && base.scheme == 'file' && !startsWithWindowsDriveLetter(codePoints.slice(pointer).join(''))) {
  1487. if (isWindowsDriveLetter(base.path[0], true)) url.path.push(base.path[0]);
  1488. else url.host = base.host;
  1489. }
  1490. state = PATH;
  1491. continue;
  1492. case FILE_HOST:
  1493. if (chr == EOF || chr == '/' || chr == '\\' || chr == '?' || chr == '#') {
  1494. if (!stateOverride && isWindowsDriveLetter(buffer)) {
  1495. state = PATH;
  1496. } else if (buffer == '') {
  1497. url.host = '';
  1498. if (stateOverride) return;
  1499. state = PATH_START;
  1500. } else {
  1501. failure = parseHost(url, buffer);
  1502. if (failure) return failure;
  1503. if (url.host == 'localhost') url.host = '';
  1504. if (stateOverride) return;
  1505. buffer = '';
  1506. state = PATH_START;
  1507. } continue;
  1508. } else buffer += chr;
  1509. break;
  1510. case PATH_START:
  1511. if (isSpecial(url)) {
  1512. state = PATH;
  1513. if (chr != '/' && chr != '\\') continue;
  1514. } else if (!stateOverride && chr == '?') {
  1515. url.query = '';
  1516. state = QUERY;
  1517. } else if (!stateOverride && chr == '#') {
  1518. url.fragment = '';
  1519. state = FRAGMENT;
  1520. } else if (chr != EOF) {
  1521. state = PATH;
  1522. if (chr != '/') continue;
  1523. } break;
  1524. case PATH:
  1525. if (
  1526. chr == EOF || chr == '/' ||
  1527. (chr == '\\' && isSpecial(url)) ||
  1528. (!stateOverride && (chr == '?' || chr == '#'))
  1529. ) {
  1530. if (isDoubleDot(buffer)) {
  1531. shortenURLsPath(url);
  1532. if (chr != '/' && !(chr == '\\' && isSpecial(url))) {
  1533. url.path.push('');
  1534. }
  1535. } else if (isSingleDot(buffer)) {
  1536. if (chr != '/' && !(chr == '\\' && isSpecial(url))) {
  1537. url.path.push('');
  1538. }
  1539. } else {
  1540. if (url.scheme == 'file' && !url.path.length && isWindowsDriveLetter(buffer)) {
  1541. if (url.host) url.host = '';
  1542. buffer = buffer.charAt(0) + ':'; // normalize windows drive letter
  1543. }
  1544. url.path.push(buffer);
  1545. }
  1546. buffer = '';
  1547. if (url.scheme == 'file' && (chr == EOF || chr == '?' || chr == '#')) {
  1548. while (url.path.length > 1 && url.path[0] === '') {
  1549. url.path.shift();
  1550. }
  1551. }
  1552. if (chr == '?') {
  1553. url.query = '';
  1554. state = QUERY;
  1555. } else if (chr == '#') {
  1556. url.fragment = '';
  1557. state = FRAGMENT;
  1558. }
  1559. } else {
  1560. buffer += percentEncode(chr, pathPercentEncodeSet);
  1561. } break;
  1562. case CANNOT_BE_A_BASE_URL_PATH:
  1563. if (chr == '?') {
  1564. url.query = '';
  1565. state = QUERY;
  1566. } else if (chr == '#') {
  1567. url.fragment = '';
  1568. state = FRAGMENT;
  1569. } else if (chr != EOF) {
  1570. url.path[0] += percentEncode(chr, C0ControlPercentEncodeSet);
  1571. } break;
  1572. case QUERY:
  1573. if (!stateOverride && chr == '#') {
  1574. url.fragment = '';
  1575. state = FRAGMENT;
  1576. } else if (chr != EOF) {
  1577. if (chr == "'" && isSpecial(url)) url.query += '%27';
  1578. else if (chr == '#') url.query += '%23';
  1579. else url.query += percentEncode(chr, C0ControlPercentEncodeSet);
  1580. } break;
  1581. case FRAGMENT:
  1582. if (chr != EOF) url.fragment += percentEncode(chr, fragmentPercentEncodeSet);
  1583. break;
  1584. }
  1585. pointer++;
  1586. }
  1587. };
  1588. // `URL` constructor
  1589. // https://url.spec.whatwg.org/#url-class
  1590. var URLConstructor = function URL(url /* , base */) {
  1591. var that = anInstance(this, URLConstructor, 'URL');
  1592. var base = arguments.length > 1 ? arguments[1] : undefined;
  1593. var urlString = $toString(url);
  1594. var state = setInternalState(that, { type: 'URL' });
  1595. var baseState, failure;
  1596. if (base !== undefined) {
  1597. if (base instanceof URLConstructor) baseState = getInternalURLState(base);
  1598. else {
  1599. failure = parseURL(baseState = {}, $toString(base));
  1600. if (failure) throw TypeError(failure);
  1601. }
  1602. }
  1603. failure = parseURL(state, urlString, null, baseState);
  1604. if (failure) throw TypeError(failure);
  1605. var searchParams = state.searchParams = new URLSearchParams();
  1606. var searchParamsState = getInternalSearchParamsState(searchParams);
  1607. searchParamsState.updateSearchParams(state.query);
  1608. searchParamsState.updateURL = function () {
  1609. state.query = String(searchParams) || null;
  1610. };
  1611. if (!DESCRIPTORS) {
  1612. that.href = serializeURL.call(that);
  1613. that.origin = getOrigin.call(that);
  1614. that.protocol = getProtocol.call(that);
  1615. that.username = getUsername.call(that);
  1616. that.password = getPassword.call(that);
  1617. that.host = getHost.call(that);
  1618. that.hostname = getHostname.call(that);
  1619. that.port = getPort.call(that);
  1620. that.pathname = getPathname.call(that);
  1621. that.search = getSearch.call(that);
  1622. that.searchParams = getSearchParams.call(that);
  1623. that.hash = getHash.call(that);
  1624. }
  1625. };
  1626. var URLPrototype = URLConstructor.prototype;
  1627. var serializeURL = function () {
  1628. var url = getInternalURLState(this);
  1629. var scheme = url.scheme;
  1630. var username = url.username;
  1631. var password = url.password;
  1632. var host = url.host;
  1633. var port = url.port;
  1634. var path = url.path;
  1635. var query = url.query;
  1636. var fragment = url.fragment;
  1637. var output = scheme + ':';
  1638. if (host !== null) {
  1639. output += '//';
  1640. if (includesCredentials(url)) {
  1641. output += username + (password ? ':' + password : '') + '@';
  1642. }
  1643. output += serializeHost(host);
  1644. if (port !== null) output += ':' + port;
  1645. } else if (scheme == 'file') output += '//';
  1646. output += url.cannotBeABaseURL ? path[0] : path.length ? '/' + path.join('/') : '';
  1647. if (query !== null) output += '?' + query;
  1648. if (fragment !== null) output += '#' + fragment;
  1649. return output;
  1650. };
  1651. var getOrigin = function () {
  1652. var url = getInternalURLState(this);
  1653. var scheme = url.scheme;
  1654. var port = url.port;
  1655. if (scheme == 'blob') try {
  1656. return new URLConstructor(scheme.path[0]).origin;
  1657. } catch (error) {
  1658. return 'null';
  1659. }
  1660. if (scheme == 'file' || !isSpecial(url)) return 'null';
  1661. return scheme + '://' + serializeHost(url.host) + (port !== null ? ':' + port : '');
  1662. };
  1663. var getProtocol = function () {
  1664. return getInternalURLState(this).scheme + ':';
  1665. };
  1666. var getUsername = function () {
  1667. return getInternalURLState(this).username;
  1668. };
  1669. var getPassword = function () {
  1670. return getInternalURLState(this).password;
  1671. };
  1672. var getHost = function () {
  1673. var url = getInternalURLState(this);
  1674. var host = url.host;
  1675. var port = url.port;
  1676. return host === null ? ''
  1677. : port === null ? serializeHost(host)
  1678. : serializeHost(host) + ':' + port;
  1679. };
  1680. var getHostname = function () {
  1681. var host = getInternalURLState(this).host;
  1682. return host === null ? '' : serializeHost(host);
  1683. };
  1684. var getPort = function () {
  1685. var port = getInternalURLState(this).port;
  1686. return port === null ? '' : String(port);
  1687. };
  1688. var getPathname = function () {
  1689. var url = getInternalURLState(this);
  1690. var path = url.path;
  1691. return url.cannotBeABaseURL ? path[0] : path.length ? '/' + path.join('/') : '';
  1692. };
  1693. var getSearch = function () {
  1694. var query = getInternalURLState(this).query;
  1695. return query ? '?' + query : '';
  1696. };
  1697. var getSearchParams = function () {
  1698. return getInternalURLState(this).searchParams;
  1699. };
  1700. var getHash = function () {
  1701. var fragment = getInternalURLState(this).fragment;
  1702. return fragment ? '#' + fragment : '';
  1703. };
  1704. var accessorDescriptor = function (getter, setter) {
  1705. return { get: getter, set: setter, configurable: true, enumerable: true };
  1706. };
  1707. if (DESCRIPTORS) {
  1708. defineProperties(URLPrototype, {
  1709. // `URL.prototype.href` accessors pair
  1710. // https://url.spec.whatwg.org/#dom-url-href
  1711. href: accessorDescriptor(serializeURL, function (href) {
  1712. var url = getInternalURLState(this);
  1713. var urlString = $toString(href);
  1714. var failure = parseURL(url, urlString);
  1715. if (failure) throw TypeError(failure);
  1716. getInternalSearchParamsState(url.searchParams).updateSearchParams(url.query);
  1717. }),
  1718. // `URL.prototype.origin` getter
  1719. // https://url.spec.whatwg.org/#dom-url-origin
  1720. origin: accessorDescriptor(getOrigin),
  1721. // `URL.prototype.protocol` accessors pair
  1722. // https://url.spec.whatwg.org/#dom-url-protocol
  1723. protocol: accessorDescriptor(getProtocol, function (protocol) {
  1724. var url = getInternalURLState(this);
  1725. parseURL(url, $toString(protocol) + ':', SCHEME_START);
  1726. }),
  1727. // `URL.prototype.username` accessors pair
  1728. // https://url.spec.whatwg.org/#dom-url-username
  1729. username: accessorDescriptor(getUsername, function (username) {
  1730. var url = getInternalURLState(this);
  1731. var codePoints = arrayFrom($toString(username));
  1732. if (cannotHaveUsernamePasswordPort(url)) return;
  1733. url.username = '';
  1734. for (var i = 0; i < codePoints.length; i++) {
  1735. url.username += percentEncode(codePoints[i], userinfoPercentEncodeSet);
  1736. }
  1737. }),
  1738. // `URL.prototype.password` accessors pair
  1739. // https://url.spec.whatwg.org/#dom-url-password
  1740. password: accessorDescriptor(getPassword, function (password) {
  1741. var url = getInternalURLState(this);
  1742. var codePoints = arrayFrom($toString(password));
  1743. if (cannotHaveUsernamePasswordPort(url)) return;
  1744. url.password = '';
  1745. for (var i = 0; i < codePoints.length; i++) {
  1746. url.password += percentEncode(codePoints[i], userinfoPercentEncodeSet);
  1747. }
  1748. }),
  1749. // `URL.prototype.host` accessors pair
  1750. // https://url.spec.whatwg.org/#dom-url-host
  1751. host: accessorDescriptor(getHost, function (host) {
  1752. var url = getInternalURLState(this);
  1753. if (url.cannotBeABaseURL) return;
  1754. parseURL(url, $toString(host), HOST);
  1755. }),
  1756. // `URL.prototype.hostname` accessors pair
  1757. // https://url.spec.whatwg.org/#dom-url-hostname
  1758. hostname: accessorDescriptor(getHostname, function (hostname) {
  1759. var url = getInternalURLState(this);
  1760. if (url.cannotBeABaseURL) return;
  1761. parseURL(url, $toString(hostname), HOSTNAME);
  1762. }),
  1763. // `URL.prototype.port` accessors pair
  1764. // https://url.spec.whatwg.org/#dom-url-port
  1765. port: accessorDescriptor(getPort, function (port) {
  1766. var url = getInternalURLState(this);
  1767. if (cannotHaveUsernamePasswordPort(url)) return;
  1768. port = $toString(port);
  1769. if (port == '') url.port = null;
  1770. else parseURL(url, port, PORT);
  1771. }),
  1772. // `URL.prototype.pathname` accessors pair
  1773. // https://url.spec.whatwg.org/#dom-url-pathname
  1774. pathname: accessorDescriptor(getPathname, function (pathname) {
  1775. var url = getInternalURLState(this);
  1776. if (url.cannotBeABaseURL) return;
  1777. url.path = [];
  1778. parseURL(url, $toString(pathname), PATH_START);
  1779. }),
  1780. // `URL.prototype.search` accessors pair
  1781. // https://url.spec.whatwg.org/#dom-url-search
  1782. search: accessorDescriptor(getSearch, function (search) {
  1783. var url = getInternalURLState(this);
  1784. search = $toString(search);
  1785. if (search == '') {
  1786. url.query = null;
  1787. } else {
  1788. if ('?' == search.charAt(0)) search = search.slice(1);
  1789. url.query = '';
  1790. parseURL(url, search, QUERY);
  1791. }
  1792. getInternalSearchParamsState(url.searchParams).updateSearchParams(url.query);
  1793. }),
  1794. // `URL.prototype.searchParams` getter
  1795. // https://url.spec.whatwg.org/#dom-url-searchparams
  1796. searchParams: accessorDescriptor(getSearchParams),
  1797. // `URL.prototype.hash` accessors pair
  1798. // https://url.spec.whatwg.org/#dom-url-hash
  1799. hash: accessorDescriptor(getHash, function (hash) {
  1800. var url = getInternalURLState(this);
  1801. hash = $toString(hash);
  1802. if (hash == '') {
  1803. url.fragment = null;
  1804. return;
  1805. }
  1806. if ('#' == hash.charAt(0)) hash = hash.slice(1);
  1807. url.fragment = '';
  1808. parseURL(url, hash, FRAGMENT);
  1809. })
  1810. });
  1811. }
  1812. // `URL.prototype.toJSON` method
  1813. // https://url.spec.whatwg.org/#dom-url-tojson
  1814. redefine(URLPrototype, 'toJSON', function toJSON() {
  1815. return serializeURL.call(this);
  1816. }, { enumerable: true });
  1817. // `URL.prototype.toString` method
  1818. // https://url.spec.whatwg.org/#URL-stringification-behavior
  1819. redefine(URLPrototype, 'toString', function toString() {
  1820. return serializeURL.call(this);
  1821. }, { enumerable: true });
  1822. if (NativeURL) {
  1823. var nativeCreateObjectURL = NativeURL.createObjectURL;
  1824. var nativeRevokeObjectURL = NativeURL.revokeObjectURL;
  1825. // `URL.createObjectURL` method
  1826. // https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL
  1827. // eslint-disable-next-line no-unused-vars -- required for `.length`
  1828. if (nativeCreateObjectURL) redefine(URLConstructor, 'createObjectURL', function createObjectURL(blob) {
  1829. return nativeCreateObjectURL.apply(NativeURL, arguments);
  1830. });
  1831. // `URL.revokeObjectURL` method
  1832. // https://developer.mozilla.org/en-US/docs/Web/API/URL/revokeObjectURL
  1833. // eslint-disable-next-line no-unused-vars -- required for `.length`
  1834. if (nativeRevokeObjectURL) redefine(URLConstructor, 'revokeObjectURL', function revokeObjectURL(url) {
  1835. return nativeRevokeObjectURL.apply(NativeURL, arguments);
  1836. });
  1837. }
  1838. setToStringTag(URLConstructor, 'URL');
  1839. $({ global: true, forced: !USE_NATIVE_URL, sham: !DESCRIPTORS }, {
  1840. URL: URLConstructor
  1841. });
  1842. /***/ }),
  1843. /***/ "2cf4":
  1844. /***/ (function(module, exports, __webpack_require__) {
  1845. var global = __webpack_require__("da84");
  1846. var isCallable = __webpack_require__("1626");
  1847. var fails = __webpack_require__("d039");
  1848. var bind = __webpack_require__("0366");
  1849. var html = __webpack_require__("1be4");
  1850. var createElement = __webpack_require__("cc12");
  1851. var IS_IOS = __webpack_require__("1cdc");
  1852. var IS_NODE = __webpack_require__("605d");
  1853. var set = global.setImmediate;
  1854. var clear = global.clearImmediate;
  1855. var process = global.process;
  1856. var MessageChannel = global.MessageChannel;
  1857. var Dispatch = global.Dispatch;
  1858. var counter = 0;
  1859. var queue = {};
  1860. var ONREADYSTATECHANGE = 'onreadystatechange';
  1861. var location, defer, channel, port;
  1862. try {
  1863. // Deno throws a ReferenceError on `location` access without `--location` flag
  1864. location = global.location;
  1865. } catch (error) { /* empty */ }
  1866. var run = function (id) {
  1867. // eslint-disable-next-line no-prototype-builtins -- safe
  1868. if (queue.hasOwnProperty(id)) {
  1869. var fn = queue[id];
  1870. delete queue[id];
  1871. fn();
  1872. }
  1873. };
  1874. var runner = function (id) {
  1875. return function () {
  1876. run(id);
  1877. };
  1878. };
  1879. var listener = function (event) {
  1880. run(event.data);
  1881. };
  1882. var post = function (id) {
  1883. // old engines have not location.origin
  1884. global.postMessage(String(id), location.protocol + '//' + location.host);
  1885. };
  1886. // Node.js 0.9+ & IE10+ has setImmediate, otherwise:
  1887. if (!set || !clear) {
  1888. set = function setImmediate(fn) {
  1889. var args = [];
  1890. var argumentsLength = arguments.length;
  1891. var i = 1;
  1892. while (argumentsLength > i) args.push(arguments[i++]);
  1893. queue[++counter] = function () {
  1894. // eslint-disable-next-line no-new-func -- spec requirement
  1895. (isCallable(fn) ? fn : Function(fn)).apply(undefined, args);
  1896. };
  1897. defer(counter);
  1898. return counter;
  1899. };
  1900. clear = function clearImmediate(id) {
  1901. delete queue[id];
  1902. };
  1903. // Node.js 0.8-
  1904. if (IS_NODE) {
  1905. defer = function (id) {
  1906. process.nextTick(runner(id));
  1907. };
  1908. // Sphere (JS game engine) Dispatch API
  1909. } else if (Dispatch && Dispatch.now) {
  1910. defer = function (id) {
  1911. Dispatch.now(runner(id));
  1912. };
  1913. // Browsers with MessageChannel, includes WebWorkers
  1914. // except iOS - https://github.com/zloirock/core-js/issues/624
  1915. } else if (MessageChannel && !IS_IOS) {
  1916. channel = new MessageChannel();
  1917. port = channel.port2;
  1918. channel.port1.onmessage = listener;
  1919. defer = bind(port.postMessage, port, 1);
  1920. // Browsers with postMessage, skip WebWorkers
  1921. // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
  1922. } else if (
  1923. global.addEventListener &&
  1924. isCallable(global.postMessage) &&
  1925. !global.importScripts &&
  1926. location && location.protocol !== 'file:' &&
  1927. !fails(post)
  1928. ) {
  1929. defer = post;
  1930. global.addEventListener('message', listener, false);
  1931. // IE8-
  1932. } else if (ONREADYSTATECHANGE in createElement('script')) {
  1933. defer = function (id) {
  1934. html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () {
  1935. html.removeChild(this);
  1936. run(id);
  1937. };
  1938. };
  1939. // Rest old browsers
  1940. } else {
  1941. defer = function (id) {
  1942. setTimeout(runner(id), 0);
  1943. };
  1944. }
  1945. }
  1946. module.exports = {
  1947. set: set,
  1948. clear: clear
  1949. };
  1950. /***/ }),
  1951. /***/ "2d00":
  1952. /***/ (function(module, exports, __webpack_require__) {
  1953. var global = __webpack_require__("da84");
  1954. var userAgent = __webpack_require__("342f");
  1955. var process = global.process;
  1956. var Deno = global.Deno;
  1957. var versions = process && process.versions || Deno && Deno.version;
  1958. var v8 = versions && versions.v8;
  1959. var match, version;
  1960. if (v8) {
  1961. match = v8.split('.');
  1962. version = match[0] < 4 ? 1 : match[0] + match[1];
  1963. } else if (userAgent) {
  1964. match = userAgent.match(/Edge\/(\d+)/);
  1965. if (!match || match[1] >= 74) {
  1966. match = userAgent.match(/Chrome\/(\d+)/);
  1967. if (match) version = match[1];
  1968. }
  1969. }
  1970. module.exports = version && +version;
  1971. /***/ }),
  1972. /***/ "342f":
  1973. /***/ (function(module, exports, __webpack_require__) {
  1974. var getBuiltIn = __webpack_require__("d066");
  1975. module.exports = getBuiltIn('navigator', 'userAgent') || '';
  1976. /***/ }),
  1977. /***/ "35a1":
  1978. /***/ (function(module, exports, __webpack_require__) {
  1979. var classof = __webpack_require__("f5df");
  1980. var getMethod = __webpack_require__("dc4a");
  1981. var Iterators = __webpack_require__("3f8c");
  1982. var wellKnownSymbol = __webpack_require__("b622");
  1983. var ITERATOR = wellKnownSymbol('iterator');
  1984. module.exports = function (it) {
  1985. if (it != undefined) return getMethod(it, ITERATOR)
  1986. || getMethod(it, '@@iterator')
  1987. || Iterators[classof(it)];
  1988. };
  1989. /***/ }),
  1990. /***/ "37e8":
  1991. /***/ (function(module, exports, __webpack_require__) {
  1992. var DESCRIPTORS = __webpack_require__("83ab");
  1993. var definePropertyModule = __webpack_require__("9bf2");
  1994. var anObject = __webpack_require__("825a");
  1995. var objectKeys = __webpack_require__("df75");
  1996. // `Object.defineProperties` method
  1997. // https://tc39.es/ecma262/#sec-object.defineproperties
  1998. // eslint-disable-next-line es/no-object-defineproperties -- safe
  1999. module.exports = DESCRIPTORS ? Object.defineProperties : function defineProperties(O, Properties) {
  2000. anObject(O);
  2001. var keys = objectKeys(Properties);
  2002. var length = keys.length;
  2003. var index = 0;
  2004. var key;
  2005. while (length > index) definePropertyModule.f(O, key = keys[index++], Properties[key]);
  2006. return O;
  2007. };
  2008. /***/ }),
  2009. /***/ "38cf":
  2010. /***/ (function(module, exports, __webpack_require__) {
  2011. var $ = __webpack_require__("23e7");
  2012. var repeat = __webpack_require__("1148");
  2013. // `String.prototype.repeat` method
  2014. // https://tc39.es/ecma262/#sec-string.prototype.repeat
  2015. $({ target: 'String', proto: true }, {
  2016. repeat: repeat
  2017. });
  2018. /***/ }),
  2019. /***/ "3bbe":
  2020. /***/ (function(module, exports, __webpack_require__) {
  2021. var isCallable = __webpack_require__("1626");
  2022. module.exports = function (argument) {
  2023. if (typeof argument === 'object' || isCallable(argument)) return argument;
  2024. throw TypeError("Can't set " + String(argument) + ' as a prototype');
  2025. };
  2026. /***/ }),
  2027. /***/ "3ca3":
  2028. /***/ (function(module, exports, __webpack_require__) {
  2029. "use strict";
  2030. var charAt = __webpack_require__("6547").charAt;
  2031. var toString = __webpack_require__("577e");
  2032. var InternalStateModule = __webpack_require__("69f3");
  2033. var defineIterator = __webpack_require__("7dd0");
  2034. var STRING_ITERATOR = 'String Iterator';
  2035. var setInternalState = InternalStateModule.set;
  2036. var getInternalState = InternalStateModule.getterFor(STRING_ITERATOR);
  2037. // `String.prototype[@@iterator]` method
  2038. // https://tc39.es/ecma262/#sec-string.prototype-@@iterator
  2039. defineIterator(String, 'String', function (iterated) {
  2040. setInternalState(this, {
  2041. type: STRING_ITERATOR,
  2042. string: toString(iterated),
  2043. index: 0
  2044. });
  2045. // `%StringIteratorPrototype%.next` method
  2046. // https://tc39.es/ecma262/#sec-%stringiteratorprototype%.next
  2047. }, function next() {
  2048. var state = getInternalState(this);
  2049. var string = state.string;
  2050. var index = state.index;
  2051. var point;
  2052. if (index >= string.length) return { value: undefined, done: true };
  2053. point = charAt(string, index);
  2054. state.index += point.length;
  2055. return { value: point, done: false };
  2056. });
  2057. /***/ }),
  2058. /***/ "3f8c":
  2059. /***/ (function(module, exports) {
  2060. module.exports = {};
  2061. /***/ }),
  2062. /***/ "408a":
  2063. /***/ (function(module, exports) {
  2064. var valueOf = 1.0.valueOf;
  2065. // `thisNumberValue` abstract operation
  2066. // https://tc39.es/ecma262/#sec-thisnumbervalue
  2067. module.exports = function (value) {
  2068. return valueOf.call(value);
  2069. };
  2070. /***/ }),
  2071. /***/ "428f":
  2072. /***/ (function(module, exports, __webpack_require__) {
  2073. var global = __webpack_require__("da84");
  2074. module.exports = global;
  2075. /***/ }),
  2076. /***/ "44ad":
  2077. /***/ (function(module, exports, __webpack_require__) {
  2078. var fails = __webpack_require__("d039");
  2079. var classof = __webpack_require__("c6b6");
  2080. var split = ''.split;
  2081. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  2082. module.exports = fails(function () {
  2083. // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
  2084. // eslint-disable-next-line no-prototype-builtins -- safe
  2085. return !Object('z').propertyIsEnumerable(0);
  2086. }) ? function (it) {
  2087. return classof(it) == 'String' ? split.call(it, '') : Object(it);
  2088. } : Object;
  2089. /***/ }),
  2090. /***/ "44d2":
  2091. /***/ (function(module, exports, __webpack_require__) {
  2092. var wellKnownSymbol = __webpack_require__("b622");
  2093. var create = __webpack_require__("7c73");
  2094. var definePropertyModule = __webpack_require__("9bf2");
  2095. var UNSCOPABLES = wellKnownSymbol('unscopables');
  2096. var ArrayPrototype = Array.prototype;
  2097. // Array.prototype[@@unscopables]
  2098. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  2099. if (ArrayPrototype[UNSCOPABLES] == undefined) {
  2100. definePropertyModule.f(ArrayPrototype, UNSCOPABLES, {
  2101. configurable: true,
  2102. value: create(null)
  2103. });
  2104. }
  2105. // add a key to Array.prototype[@@unscopables]
  2106. module.exports = function (key) {
  2107. ArrayPrototype[UNSCOPABLES][key] = true;
  2108. };
  2109. /***/ }),
  2110. /***/ "44de":
  2111. /***/ (function(module, exports, __webpack_require__) {
  2112. var global = __webpack_require__("da84");
  2113. module.exports = function (a, b) {
  2114. var console = global.console;
  2115. if (console && console.error) {
  2116. arguments.length === 1 ? console.error(a) : console.error(a, b);
  2117. }
  2118. };
  2119. /***/ }),
  2120. /***/ "44e7":
  2121. /***/ (function(module, exports, __webpack_require__) {
  2122. var isObject = __webpack_require__("861d");
  2123. var classof = __webpack_require__("c6b6");
  2124. var wellKnownSymbol = __webpack_require__("b622");
  2125. var MATCH = wellKnownSymbol('match');
  2126. // `IsRegExp` abstract operation
  2127. // https://tc39.es/ecma262/#sec-isregexp
  2128. module.exports = function (it) {
  2129. var isRegExp;
  2130. return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classof(it) == 'RegExp');
  2131. };
  2132. /***/ }),
  2133. /***/ "466d":
  2134. /***/ (function(module, exports, __webpack_require__) {
  2135. "use strict";
  2136. var fixRegExpWellKnownSymbolLogic = __webpack_require__("d784");
  2137. var anObject = __webpack_require__("825a");
  2138. var toLength = __webpack_require__("50c4");
  2139. var toString = __webpack_require__("577e");
  2140. var requireObjectCoercible = __webpack_require__("1d80");
  2141. var getMethod = __webpack_require__("dc4a");
  2142. var advanceStringIndex = __webpack_require__("8aa5");
  2143. var regExpExec = __webpack_require__("14c3");
  2144. // @@match logic
  2145. fixRegExpWellKnownSymbolLogic('match', function (MATCH, nativeMatch, maybeCallNative) {
  2146. return [
  2147. // `String.prototype.match` method
  2148. // https://tc39.es/ecma262/#sec-string.prototype.match
  2149. function match(regexp) {
  2150. var O = requireObjectCoercible(this);
  2151. var matcher = regexp == undefined ? undefined : getMethod(regexp, MATCH);
  2152. return matcher ? matcher.call(regexp, O) : new RegExp(regexp)[MATCH](toString(O));
  2153. },
  2154. // `RegExp.prototype[@@match]` method
  2155. // https://tc39.es/ecma262/#sec-regexp.prototype-@@match
  2156. function (string) {
  2157. var rx = anObject(this);
  2158. var S = toString(string);
  2159. var res = maybeCallNative(nativeMatch, rx, S);
  2160. if (res.done) return res.value;
  2161. if (!rx.global) return regExpExec(rx, S);
  2162. var fullUnicode = rx.unicode;
  2163. rx.lastIndex = 0;
  2164. var A = [];
  2165. var n = 0;
  2166. var result;
  2167. while ((result = regExpExec(rx, S)) !== null) {
  2168. var matchStr = toString(result[0]);
  2169. A[n] = matchStr;
  2170. if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
  2171. n++;
  2172. }
  2173. return n === 0 ? null : A;
  2174. }
  2175. ];
  2176. });
  2177. /***/ }),
  2178. /***/ "4840":
  2179. /***/ (function(module, exports, __webpack_require__) {
  2180. var anObject = __webpack_require__("825a");
  2181. var aConstructor = __webpack_require__("5087");
  2182. var wellKnownSymbol = __webpack_require__("b622");
  2183. var SPECIES = wellKnownSymbol('species');
  2184. // `SpeciesConstructor` abstract operation
  2185. // https://tc39.es/ecma262/#sec-speciesconstructor
  2186. module.exports = function (O, defaultConstructor) {
  2187. var C = anObject(O).constructor;
  2188. var S;
  2189. return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? defaultConstructor : aConstructor(S);
  2190. };
  2191. /***/ }),
  2192. /***/ "485a":
  2193. /***/ (function(module, exports, __webpack_require__) {
  2194. var isCallable = __webpack_require__("1626");
  2195. var isObject = __webpack_require__("861d");
  2196. // `OrdinaryToPrimitive` abstract operation
  2197. // https://tc39.es/ecma262/#sec-ordinarytoprimitive
  2198. module.exports = function (input, pref) {
  2199. var fn, val;
  2200. if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = fn.call(input))) return val;
  2201. if (isCallable(fn = input.valueOf) && !isObject(val = fn.call(input))) return val;
  2202. if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = fn.call(input))) return val;
  2203. throw TypeError("Can't convert object to primitive value");
  2204. };
  2205. /***/ }),
  2206. /***/ "4930":
  2207. /***/ (function(module, exports, __webpack_require__) {
  2208. /* eslint-disable es/no-symbol -- required for testing */
  2209. var V8_VERSION = __webpack_require__("2d00");
  2210. var fails = __webpack_require__("d039");
  2211. // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
  2212. module.exports = !!Object.getOwnPropertySymbols && !fails(function () {
  2213. var symbol = Symbol();
  2214. // Chrome 38 Symbol has incorrect toString conversion
  2215. // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
  2216. return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
  2217. // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
  2218. !Symbol.sham && V8_VERSION && V8_VERSION < 41;
  2219. });
  2220. /***/ }),
  2221. /***/ "498a":
  2222. /***/ (function(module, exports, __webpack_require__) {
  2223. "use strict";
  2224. var $ = __webpack_require__("23e7");
  2225. var $trim = __webpack_require__("58a8").trim;
  2226. var forcedStringTrimMethod = __webpack_require__("c8d2");
  2227. // `String.prototype.trim` method
  2228. // https://tc39.es/ecma262/#sec-string.prototype.trim
  2229. $({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
  2230. trim: function trim() {
  2231. return $trim(this);
  2232. }
  2233. });
  2234. /***/ }),
  2235. /***/ "4d63":
  2236. /***/ (function(module, exports, __webpack_require__) {
  2237. var DESCRIPTORS = __webpack_require__("83ab");
  2238. var global = __webpack_require__("da84");
  2239. var isForced = __webpack_require__("94ca");
  2240. var inheritIfRequired = __webpack_require__("7156");
  2241. var createNonEnumerableProperty = __webpack_require__("9112");
  2242. var defineProperty = __webpack_require__("9bf2").f;
  2243. var getOwnPropertyNames = __webpack_require__("241c").f;
  2244. var isRegExp = __webpack_require__("44e7");
  2245. var toString = __webpack_require__("577e");
  2246. var getFlags = __webpack_require__("ad6d");
  2247. var stickyHelpers = __webpack_require__("9f7f");
  2248. var redefine = __webpack_require__("6eeb");
  2249. var fails = __webpack_require__("d039");
  2250. var hasOwn = __webpack_require__("1a2d");
  2251. var enforceInternalState = __webpack_require__("69f3").enforce;
  2252. var setSpecies = __webpack_require__("2626");
  2253. var wellKnownSymbol = __webpack_require__("b622");
  2254. var UNSUPPORTED_DOT_ALL = __webpack_require__("fce3");
  2255. var UNSUPPORTED_NCG = __webpack_require__("107c");
  2256. var MATCH = wellKnownSymbol('match');
  2257. var NativeRegExp = global.RegExp;
  2258. var RegExpPrototype = NativeRegExp.prototype;
  2259. // TODO: Use only propper RegExpIdentifierName
  2260. var IS_NCG = /^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/;
  2261. var re1 = /a/g;
  2262. var re2 = /a/g;
  2263. // "new" should create a new object, old webkit bug
  2264. var CORRECT_NEW = new NativeRegExp(re1) !== re1;
  2265. var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y;
  2266. var BASE_FORCED = DESCRIPTORS &&
  2267. (!CORRECT_NEW || UNSUPPORTED_Y || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG || fails(function () {
  2268. re2[MATCH] = false;
  2269. // RegExp constructor can alter flags and IsRegExp works correct with @@match
  2270. return NativeRegExp(re1) != re1 || NativeRegExp(re2) == re2 || NativeRegExp(re1, 'i') != '/a/i';
  2271. }));
  2272. var handleDotAll = function (string) {
  2273. var length = string.length;
  2274. var index = 0;
  2275. var result = '';
  2276. var brackets = false;
  2277. var chr;
  2278. for (; index <= length; index++) {
  2279. chr = string.charAt(index);
  2280. if (chr === '\\') {
  2281. result += chr + string.charAt(++index);
  2282. continue;
  2283. }
  2284. if (!brackets && chr === '.') {
  2285. result += '[\\s\\S]';
  2286. } else {
  2287. if (chr === '[') {
  2288. brackets = true;
  2289. } else if (chr === ']') {
  2290. brackets = false;
  2291. } result += chr;
  2292. }
  2293. } return result;
  2294. };
  2295. var handleNCG = function (string) {
  2296. var length = string.length;
  2297. var index = 0;
  2298. var result = '';
  2299. var named = [];
  2300. var names = {};
  2301. var brackets = false;
  2302. var ncg = false;
  2303. var groupid = 0;
  2304. var groupname = '';
  2305. var chr;
  2306. for (; index <= length; index++) {
  2307. chr = string.charAt(index);
  2308. if (chr === '\\') {
  2309. chr = chr + string.charAt(++index);
  2310. } else if (chr === ']') {
  2311. brackets = false;
  2312. } else if (!brackets) switch (true) {
  2313. case chr === '[':
  2314. brackets = true;
  2315. break;
  2316. case chr === '(':
  2317. if (IS_NCG.test(string.slice(index + 1))) {
  2318. index += 2;
  2319. ncg = true;
  2320. }
  2321. result += chr;
  2322. groupid++;
  2323. continue;
  2324. case chr === '>' && ncg:
  2325. if (groupname === '' || hasOwn(names, groupname)) {
  2326. throw new SyntaxError('Invalid capture group name');
  2327. }
  2328. names[groupname] = true;
  2329. named.push([groupname, groupid]);
  2330. ncg = false;
  2331. groupname = '';
  2332. continue;
  2333. }
  2334. if (ncg) groupname += chr;
  2335. else result += chr;
  2336. } return [result, named];
  2337. };
  2338. // `RegExp` constructor
  2339. // https://tc39.es/ecma262/#sec-regexp-constructor
  2340. if (isForced('RegExp', BASE_FORCED)) {
  2341. var RegExpWrapper = function RegExp(pattern, flags) {
  2342. var thisIsRegExp = this instanceof RegExpWrapper;
  2343. var patternIsRegExp = isRegExp(pattern);
  2344. var flagsAreUndefined = flags === undefined;
  2345. var groups = [];
  2346. var rawPattern = pattern;
  2347. var rawFlags, dotAll, sticky, handled, result, state;
  2348. if (!thisIsRegExp && patternIsRegExp && flagsAreUndefined && pattern.constructor === RegExpWrapper) {
  2349. return pattern;
  2350. }
  2351. if (patternIsRegExp || pattern instanceof RegExpWrapper) {
  2352. pattern = pattern.source;
  2353. if (flagsAreUndefined) flags = 'flags' in rawPattern ? rawPattern.flags : getFlags.call(rawPattern);
  2354. }
  2355. pattern = pattern === undefined ? '' : toString(pattern);
  2356. flags = flags === undefined ? '' : toString(flags);
  2357. rawPattern = pattern;
  2358. if (UNSUPPORTED_DOT_ALL && 'dotAll' in re1) {
  2359. dotAll = !!flags && flags.indexOf('s') > -1;
  2360. if (dotAll) flags = flags.replace(/s/g, '');
  2361. }
  2362. rawFlags = flags;
  2363. if (UNSUPPORTED_Y && 'sticky' in re1) {
  2364. sticky = !!flags && flags.indexOf('y') > -1;
  2365. if (sticky) flags = flags.replace(/y/g, '');
  2366. }
  2367. if (UNSUPPORTED_NCG) {
  2368. handled = handleNCG(pattern);
  2369. pattern = handled[0];
  2370. groups = handled[1];
  2371. }
  2372. result = inheritIfRequired(NativeRegExp(pattern, flags), thisIsRegExp ? this : RegExpPrototype, RegExpWrapper);
  2373. if (dotAll || sticky || groups.length) {
  2374. state = enforceInternalState(result);
  2375. if (dotAll) {
  2376. state.dotAll = true;
  2377. state.raw = RegExpWrapper(handleDotAll(pattern), rawFlags);
  2378. }
  2379. if (sticky) state.sticky = true;
  2380. if (groups.length) state.groups = groups;
  2381. }
  2382. if (pattern !== rawPattern) try {
  2383. // fails in old engines, but we have no alternatives for unsupported regex syntax
  2384. createNonEnumerableProperty(result, 'source', rawPattern === '' ? '(?:)' : rawPattern);
  2385. } catch (error) { /* empty */ }
  2386. return result;
  2387. };
  2388. var proxy = function (key) {
  2389. key in RegExpWrapper || defineProperty(RegExpWrapper, key, {
  2390. configurable: true,
  2391. get: function () { return NativeRegExp[key]; },
  2392. set: function (it) { NativeRegExp[key] = it; }
  2393. });
  2394. };
  2395. for (var keys = getOwnPropertyNames(NativeRegExp), index = 0; keys.length > index;) {
  2396. proxy(keys[index++]);
  2397. }
  2398. RegExpPrototype.constructor = RegExpWrapper;
  2399. RegExpWrapper.prototype = RegExpPrototype;
  2400. redefine(global, 'RegExp', RegExpWrapper);
  2401. }
  2402. // https://tc39.es/ecma262/#sec-get-regexp-@@species
  2403. setSpecies('RegExp');
  2404. /***/ }),
  2405. /***/ "4d64":
  2406. /***/ (function(module, exports, __webpack_require__) {
  2407. var toIndexedObject = __webpack_require__("fc6a");
  2408. var toAbsoluteIndex = __webpack_require__("23cb");
  2409. var lengthOfArrayLike = __webpack_require__("07fa");
  2410. // `Array.prototype.{ indexOf, includes }` methods implementation
  2411. var createMethod = function (IS_INCLUDES) {
  2412. return function ($this, el, fromIndex) {
  2413. var O = toIndexedObject($this);
  2414. var length = lengthOfArrayLike(O);
  2415. var index = toAbsoluteIndex(fromIndex, length);
  2416. var value;
  2417. // Array#includes uses SameValueZero equality algorithm
  2418. // eslint-disable-next-line no-self-compare -- NaN check
  2419. if (IS_INCLUDES && el != el) while (length > index) {
  2420. value = O[index++];
  2421. // eslint-disable-next-line no-self-compare -- NaN check
  2422. if (value != value) return true;
  2423. // Array#indexOf ignores holes, Array#includes - not
  2424. } else for (;length > index; index++) {
  2425. if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
  2426. } return !IS_INCLUDES && -1;
  2427. };
  2428. };
  2429. module.exports = {
  2430. // `Array.prototype.includes` method
  2431. // https://tc39.es/ecma262/#sec-array.prototype.includes
  2432. includes: createMethod(true),
  2433. // `Array.prototype.indexOf` method
  2434. // https://tc39.es/ecma262/#sec-array.prototype.indexof
  2435. indexOf: createMethod(false)
  2436. };
  2437. /***/ }),
  2438. /***/ "4d90":
  2439. /***/ (function(module, exports, __webpack_require__) {
  2440. "use strict";
  2441. var $ = __webpack_require__("23e7");
  2442. var $padStart = __webpack_require__("0ccb").start;
  2443. var WEBKIT_BUG = __webpack_require__("9a0c");
  2444. // `String.prototype.padStart` method
  2445. // https://tc39.es/ecma262/#sec-string.prototype.padstart
  2446. $({ target: 'String', proto: true, forced: WEBKIT_BUG }, {
  2447. padStart: function padStart(maxLength /* , fillString = ' ' */) {
  2448. return $padStart(this, maxLength, arguments.length > 1 ? arguments[1] : undefined);
  2449. }
  2450. });
  2451. /***/ }),
  2452. /***/ "4de4":
  2453. /***/ (function(module, exports, __webpack_require__) {
  2454. "use strict";
  2455. var $ = __webpack_require__("23e7");
  2456. var $filter = __webpack_require__("b727").filter;
  2457. var arrayMethodHasSpeciesSupport = __webpack_require__("1dde");
  2458. var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');
  2459. // `Array.prototype.filter` method
  2460. // https://tc39.es/ecma262/#sec-array.prototype.filter
  2461. // with adding support of @@species
  2462. $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
  2463. filter: function filter(callbackfn /* , thisArg */) {
  2464. return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  2465. }
  2466. });
  2467. /***/ }),
  2468. /***/ "4df4":
  2469. /***/ (function(module, exports, __webpack_require__) {
  2470. "use strict";
  2471. var bind = __webpack_require__("0366");
  2472. var toObject = __webpack_require__("7b0b");
  2473. var callWithSafeIterationClosing = __webpack_require__("9bdd");
  2474. var isArrayIteratorMethod = __webpack_require__("e95a");
  2475. var isConstructor = __webpack_require__("68ee");
  2476. var lengthOfArrayLike = __webpack_require__("07fa");
  2477. var createProperty = __webpack_require__("8418");
  2478. var getIterator = __webpack_require__("9a1f");
  2479. var getIteratorMethod = __webpack_require__("35a1");
  2480. // `Array.from` method implementation
  2481. // https://tc39.es/ecma262/#sec-array.from
  2482. module.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
  2483. var O = toObject(arrayLike);
  2484. var IS_CONSTRUCTOR = isConstructor(this);
  2485. var argumentsLength = arguments.length;
  2486. var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
  2487. var mapping = mapfn !== undefined;
  2488. if (mapping) mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : undefined, 2);
  2489. var iteratorMethod = getIteratorMethod(O);
  2490. var index = 0;
  2491. var length, result, step, iterator, next, value;
  2492. // if the target is not iterable or it's an array with the default iterator - use a simple case
  2493. if (iteratorMethod && !(this == Array && isArrayIteratorMethod(iteratorMethod))) {
  2494. iterator = getIterator(O, iteratorMethod);
  2495. next = iterator.next;
  2496. result = IS_CONSTRUCTOR ? new this() : [];
  2497. for (;!(step = next.call(iterator)).done; index++) {
  2498. value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value;
  2499. createProperty(result, index, value);
  2500. }
  2501. } else {
  2502. length = lengthOfArrayLike(O);
  2503. result = IS_CONSTRUCTOR ? new this(length) : Array(length);
  2504. for (;length > index; index++) {
  2505. value = mapping ? mapfn(O[index], index) : O[index];
  2506. createProperty(result, index, value);
  2507. }
  2508. }
  2509. result.length = index;
  2510. return result;
  2511. };
  2512. /***/ }),
  2513. /***/ "4e82":
  2514. /***/ (function(module, exports, __webpack_require__) {
  2515. "use strict";
  2516. var $ = __webpack_require__("23e7");
  2517. var aCallable = __webpack_require__("59ed");
  2518. var toObject = __webpack_require__("7b0b");
  2519. var lengthOfArrayLike = __webpack_require__("07fa");
  2520. var toString = __webpack_require__("577e");
  2521. var fails = __webpack_require__("d039");
  2522. var internalSort = __webpack_require__("addb");
  2523. var arrayMethodIsStrict = __webpack_require__("a640");
  2524. var FF = __webpack_require__("04d1");
  2525. var IE_OR_EDGE = __webpack_require__("d998");
  2526. var V8 = __webpack_require__("2d00");
  2527. var WEBKIT = __webpack_require__("512c");
  2528. var test = [];
  2529. var nativeSort = test.sort;
  2530. // IE8-
  2531. var FAILS_ON_UNDEFINED = fails(function () {
  2532. test.sort(undefined);
  2533. });
  2534. // V8 bug
  2535. var FAILS_ON_NULL = fails(function () {
  2536. test.sort(null);
  2537. });
  2538. // Old WebKit
  2539. var STRICT_METHOD = arrayMethodIsStrict('sort');
  2540. var STABLE_SORT = !fails(function () {
  2541. // feature detection can be too slow, so check engines versions
  2542. if (V8) return V8 < 70;
  2543. if (FF && FF > 3) return;
  2544. if (IE_OR_EDGE) return true;
  2545. if (WEBKIT) return WEBKIT < 603;
  2546. var result = '';
  2547. var code, chr, value, index;
  2548. // generate an array with more 512 elements (Chakra and old V8 fails only in this case)
  2549. for (code = 65; code < 76; code++) {
  2550. chr = String.fromCharCode(code);
  2551. switch (code) {
  2552. case 66: case 69: case 70: case 72: value = 3; break;
  2553. case 68: case 71: value = 4; break;
  2554. default: value = 2;
  2555. }
  2556. for (index = 0; index < 47; index++) {
  2557. test.push({ k: chr + index, v: value });
  2558. }
  2559. }
  2560. test.sort(function (a, b) { return b.v - a.v; });
  2561. for (index = 0; index < test.length; index++) {
  2562. chr = test[index].k.charAt(0);
  2563. if (result.charAt(result.length - 1) !== chr) result += chr;
  2564. }
  2565. return result !== 'DGBEFHACIJK';
  2566. });
  2567. var FORCED = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD || !STABLE_SORT;
  2568. var getSortCompare = function (comparefn) {
  2569. return function (x, y) {
  2570. if (y === undefined) return -1;
  2571. if (x === undefined) return 1;
  2572. if (comparefn !== undefined) return +comparefn(x, y) || 0;
  2573. return toString(x) > toString(y) ? 1 : -1;
  2574. };
  2575. };
  2576. // `Array.prototype.sort` method
  2577. // https://tc39.es/ecma262/#sec-array.prototype.sort
  2578. $({ target: 'Array', proto: true, forced: FORCED }, {
  2579. sort: function sort(comparefn) {
  2580. if (comparefn !== undefined) aCallable(comparefn);
  2581. var array = toObject(this);
  2582. if (STABLE_SORT) return comparefn === undefined ? nativeSort.call(array) : nativeSort.call(array, comparefn);
  2583. var items = [];
  2584. var arrayLength = lengthOfArrayLike(array);
  2585. var itemsLength, index;
  2586. for (index = 0; index < arrayLength; index++) {
  2587. if (index in array) items.push(array[index]);
  2588. }
  2589. items = internalSort(items, getSortCompare(comparefn));
  2590. itemsLength = items.length;
  2591. index = 0;
  2592. while (index < itemsLength) array[index] = items[index++];
  2593. while (index < arrayLength) delete array[index++];
  2594. return array;
  2595. }
  2596. });
  2597. /***/ }),
  2598. /***/ "4ec9":
  2599. /***/ (function(module, exports, __webpack_require__) {
  2600. "use strict";
  2601. var collection = __webpack_require__("6d61");
  2602. var collectionStrong = __webpack_require__("6566");
  2603. // `Map` constructor
  2604. // https://tc39.es/ecma262/#sec-map-objects
  2605. module.exports = collection('Map', function (init) {
  2606. return function Map() { return init(this, arguments.length ? arguments[0] : undefined); };
  2607. }, collectionStrong);
  2608. /***/ }),
  2609. /***/ "5087":
  2610. /***/ (function(module, exports, __webpack_require__) {
  2611. var isConstructor = __webpack_require__("68ee");
  2612. var tryToString = __webpack_require__("0d51");
  2613. // `Assert: IsConstructor(argument) is true`
  2614. module.exports = function (argument) {
  2615. if (isConstructor(argument)) return argument;
  2616. throw TypeError(tryToString(argument) + ' is not a constructor');
  2617. };
  2618. /***/ }),
  2619. /***/ "50c4":
  2620. /***/ (function(module, exports, __webpack_require__) {
  2621. var toIntegerOrInfinity = __webpack_require__("5926");
  2622. var min = Math.min;
  2623. // `ToLength` abstract operation
  2624. // https://tc39.es/ecma262/#sec-tolength
  2625. module.exports = function (argument) {
  2626. return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
  2627. };
  2628. /***/ }),
  2629. /***/ "512c":
  2630. /***/ (function(module, exports, __webpack_require__) {
  2631. var userAgent = __webpack_require__("342f");
  2632. var webkit = userAgent.match(/AppleWebKit\/(\d+)\./);
  2633. module.exports = !!webkit && +webkit[1];
  2634. /***/ }),
  2635. /***/ "5319":
  2636. /***/ (function(module, exports, __webpack_require__) {
  2637. "use strict";
  2638. var fixRegExpWellKnownSymbolLogic = __webpack_require__("d784");
  2639. var fails = __webpack_require__("d039");
  2640. var anObject = __webpack_require__("825a");
  2641. var isCallable = __webpack_require__("1626");
  2642. var toIntegerOrInfinity = __webpack_require__("5926");
  2643. var toLength = __webpack_require__("50c4");
  2644. var toString = __webpack_require__("577e");
  2645. var requireObjectCoercible = __webpack_require__("1d80");
  2646. var advanceStringIndex = __webpack_require__("8aa5");
  2647. var getMethod = __webpack_require__("dc4a");
  2648. var getSubstitution = __webpack_require__("0cb2");
  2649. var regExpExec = __webpack_require__("14c3");
  2650. var wellKnownSymbol = __webpack_require__("b622");
  2651. var REPLACE = wellKnownSymbol('replace');
  2652. var max = Math.max;
  2653. var min = Math.min;
  2654. var maybeToString = function (it) {
  2655. return it === undefined ? it : String(it);
  2656. };
  2657. // IE <= 11 replaces $0 with the whole match, as if it was $&
  2658. // https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
  2659. var REPLACE_KEEPS_$0 = (function () {
  2660. // eslint-disable-next-line regexp/prefer-escape-replacement-dollar-char -- required for testing
  2661. return 'a'.replace(/./, '$0') === '$0';
  2662. })();
  2663. // Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string
  2664. var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
  2665. if (/./[REPLACE]) {
  2666. return /./[REPLACE]('a', '$0') === '';
  2667. }
  2668. return false;
  2669. })();
  2670. var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
  2671. var re = /./;
  2672. re.exec = function () {
  2673. var result = [];
  2674. result.groups = { a: '7' };
  2675. return result;
  2676. };
  2677. // eslint-disable-next-line regexp/no-useless-dollar-replacements -- false positive
  2678. return ''.replace(re, '$<a>') !== '7';
  2679. });
  2680. // @@replace logic
  2681. fixRegExpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNative) {
  2682. var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0';
  2683. return [
  2684. // `String.prototype.replace` method
  2685. // https://tc39.es/ecma262/#sec-string.prototype.replace
  2686. function replace(searchValue, replaceValue) {
  2687. var O = requireObjectCoercible(this);
  2688. var replacer = searchValue == undefined ? undefined : getMethod(searchValue, REPLACE);
  2689. return replacer
  2690. ? replacer.call(searchValue, O, replaceValue)
  2691. : nativeReplace.call(toString(O), searchValue, replaceValue);
  2692. },
  2693. // `RegExp.prototype[@@replace]` method
  2694. // https://tc39.es/ecma262/#sec-regexp.prototype-@@replace
  2695. function (string, replaceValue) {
  2696. var rx = anObject(this);
  2697. var S = toString(string);
  2698. if (
  2699. typeof replaceValue === 'string' &&
  2700. replaceValue.indexOf(UNSAFE_SUBSTITUTE) === -1 &&
  2701. replaceValue.indexOf('$<') === -1
  2702. ) {
  2703. var res = maybeCallNative(nativeReplace, rx, S, replaceValue);
  2704. if (res.done) return res.value;
  2705. }
  2706. var functionalReplace = isCallable(replaceValue);
  2707. if (!functionalReplace) replaceValue = toString(replaceValue);
  2708. var global = rx.global;
  2709. if (global) {
  2710. var fullUnicode = rx.unicode;
  2711. rx.lastIndex = 0;
  2712. }
  2713. var results = [];
  2714. while (true) {
  2715. var result = regExpExec(rx, S);
  2716. if (result === null) break;
  2717. results.push(result);
  2718. if (!global) break;
  2719. var matchStr = toString(result[0]);
  2720. if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
  2721. }
  2722. var accumulatedResult = '';
  2723. var nextSourcePosition = 0;
  2724. for (var i = 0; i < results.length; i++) {
  2725. result = results[i];
  2726. var matched = toString(result[0]);
  2727. var position = max(min(toIntegerOrInfinity(result.index), S.length), 0);
  2728. var captures = [];
  2729. // NOTE: This is equivalent to
  2730. // captures = result.slice(1).map(maybeToString)
  2731. // but for some reason `nativeSlice.call(result, 1, result.length)` (called in
  2732. // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
  2733. // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
  2734. for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j]));
  2735. var namedCaptures = result.groups;
  2736. if (functionalReplace) {
  2737. var replacerArgs = [matched].concat(captures, position, S);
  2738. if (namedCaptures !== undefined) replacerArgs.push(namedCaptures);
  2739. var replacement = toString(replaceValue.apply(undefined, replacerArgs));
  2740. } else {
  2741. replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
  2742. }
  2743. if (position >= nextSourcePosition) {
  2744. accumulatedResult += S.slice(nextSourcePosition, position) + replacement;
  2745. nextSourcePosition = position + matched.length;
  2746. }
  2747. }
  2748. return accumulatedResult + S.slice(nextSourcePosition);
  2749. }
  2750. ];
  2751. }, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);
  2752. /***/ }),
  2753. /***/ "5692":
  2754. /***/ (function(module, exports, __webpack_require__) {
  2755. var IS_PURE = __webpack_require__("c430");
  2756. var store = __webpack_require__("c6cd");
  2757. (module.exports = function (key, value) {
  2758. return store[key] || (store[key] = value !== undefined ? value : {});
  2759. })('versions', []).push({
  2760. version: '3.18.2',
  2761. mode: IS_PURE ? 'pure' : 'global',
  2762. copyright: '© 2021 Denis Pushkarev (zloirock.ru)'
  2763. });
  2764. /***/ }),
  2765. /***/ "56ef":
  2766. /***/ (function(module, exports, __webpack_require__) {
  2767. var getBuiltIn = __webpack_require__("d066");
  2768. var getOwnPropertyNamesModule = __webpack_require__("241c");
  2769. var getOwnPropertySymbolsModule = __webpack_require__("7418");
  2770. var anObject = __webpack_require__("825a");
  2771. // all object keys, includes non-enumerable and symbols
  2772. module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
  2773. var keys = getOwnPropertyNamesModule.f(anObject(it));
  2774. var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
  2775. return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
  2776. };
  2777. /***/ }),
  2778. /***/ "577e":
  2779. /***/ (function(module, exports, __webpack_require__) {
  2780. var classof = __webpack_require__("f5df");
  2781. module.exports = function (argument) {
  2782. if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
  2783. return String(argument);
  2784. };
  2785. /***/ }),
  2786. /***/ "5899":
  2787. /***/ (function(module, exports) {
  2788. // a string of all valid unicode whitespaces
  2789. module.exports = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
  2790. '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
  2791. /***/ }),
  2792. /***/ "58a8":
  2793. /***/ (function(module, exports, __webpack_require__) {
  2794. var requireObjectCoercible = __webpack_require__("1d80");
  2795. var toString = __webpack_require__("577e");
  2796. var whitespaces = __webpack_require__("5899");
  2797. var whitespace = '[' + whitespaces + ']';
  2798. var ltrim = RegExp('^' + whitespace + whitespace + '*');
  2799. var rtrim = RegExp(whitespace + whitespace + '*$');
  2800. // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
  2801. var createMethod = function (TYPE) {
  2802. return function ($this) {
  2803. var string = toString(requireObjectCoercible($this));
  2804. if (TYPE & 1) string = string.replace(ltrim, '');
  2805. if (TYPE & 2) string = string.replace(rtrim, '');
  2806. return string;
  2807. };
  2808. };
  2809. module.exports = {
  2810. // `String.prototype.{ trimLeft, trimStart }` methods
  2811. // https://tc39.es/ecma262/#sec-string.prototype.trimstart
  2812. start: createMethod(1),
  2813. // `String.prototype.{ trimRight, trimEnd }` methods
  2814. // https://tc39.es/ecma262/#sec-string.prototype.trimend
  2815. end: createMethod(2),
  2816. // `String.prototype.trim` method
  2817. // https://tc39.es/ecma262/#sec-string.prototype.trim
  2818. trim: createMethod(3)
  2819. };
  2820. /***/ }),
  2821. /***/ "5926":
  2822. /***/ (function(module, exports) {
  2823. var ceil = Math.ceil;
  2824. var floor = Math.floor;
  2825. // `ToIntegerOrInfinity` abstract operation
  2826. // https://tc39.es/ecma262/#sec-tointegerorinfinity
  2827. module.exports = function (argument) {
  2828. var number = +argument;
  2829. // eslint-disable-next-line no-self-compare -- safe
  2830. return number !== number || number === 0 ? 0 : (number > 0 ? floor : ceil)(number);
  2831. };
  2832. /***/ }),
  2833. /***/ "59ed":
  2834. /***/ (function(module, exports, __webpack_require__) {
  2835. var isCallable = __webpack_require__("1626");
  2836. var tryToString = __webpack_require__("0d51");
  2837. // `Assert: IsCallable(argument) is true`
  2838. module.exports = function (argument) {
  2839. if (isCallable(argument)) return argument;
  2840. throw TypeError(tryToString(argument) + ' is not a function');
  2841. };
  2842. /***/ }),
  2843. /***/ "5a34":
  2844. /***/ (function(module, exports, __webpack_require__) {
  2845. var isRegExp = __webpack_require__("44e7");
  2846. module.exports = function (it) {
  2847. if (isRegExp(it)) {
  2848. throw TypeError("The method doesn't accept regular expressions");
  2849. } return it;
  2850. };
  2851. /***/ }),
  2852. /***/ "5c6c":
  2853. /***/ (function(module, exports) {
  2854. module.exports = function (bitmap, value) {
  2855. return {
  2856. enumerable: !(bitmap & 1),
  2857. configurable: !(bitmap & 2),
  2858. writable: !(bitmap & 4),
  2859. value: value
  2860. };
  2861. };
  2862. /***/ }),
  2863. /***/ "5e77":
  2864. /***/ (function(module, exports, __webpack_require__) {
  2865. var DESCRIPTORS = __webpack_require__("83ab");
  2866. var hasOwn = __webpack_require__("1a2d");
  2867. var FunctionPrototype = Function.prototype;
  2868. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  2869. var getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor;
  2870. var EXISTS = hasOwn(FunctionPrototype, 'name');
  2871. // additional protection from minified / mangled / dropped function names
  2872. var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
  2873. var CONFIGURABLE = EXISTS && (!DESCRIPTORS || (DESCRIPTORS && getDescriptor(FunctionPrototype, 'name').configurable));
  2874. module.exports = {
  2875. EXISTS: EXISTS,
  2876. PROPER: PROPER,
  2877. CONFIGURABLE: CONFIGURABLE
  2878. };
  2879. /***/ }),
  2880. /***/ "5fb2":
  2881. /***/ (function(module, exports, __webpack_require__) {
  2882. "use strict";
  2883. // based on https://github.com/bestiejs/punycode.js/blob/master/punycode.js
  2884. var maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1
  2885. var base = 36;
  2886. var tMin = 1;
  2887. var tMax = 26;
  2888. var skew = 38;
  2889. var damp = 700;
  2890. var initialBias = 72;
  2891. var initialN = 128; // 0x80
  2892. var delimiter = '-'; // '\x2D'
  2893. var regexNonASCII = /[^\0-\u007E]/; // non-ASCII chars
  2894. var regexSeparators = /[.\u3002\uFF0E\uFF61]/g; // RFC 3490 separators
  2895. var OVERFLOW_ERROR = 'Overflow: input needs wider integers to process';
  2896. var baseMinusTMin = base - tMin;
  2897. var floor = Math.floor;
  2898. var stringFromCharCode = String.fromCharCode;
  2899. /**
  2900. * Creates an array containing the numeric code points of each Unicode
  2901. * character in the string. While JavaScript uses UCS-2 internally,
  2902. * this function will convert a pair of surrogate halves (each of which
  2903. * UCS-2 exposes as separate characters) into a single code point,
  2904. * matching UTF-16.
  2905. */
  2906. var ucs2decode = function (string) {
  2907. var output = [];
  2908. var counter = 0;
  2909. var length = string.length;
  2910. while (counter < length) {
  2911. var value = string.charCodeAt(counter++);
  2912. if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
  2913. // It's a high surrogate, and there is a next character.
  2914. var extra = string.charCodeAt(counter++);
  2915. if ((extra & 0xFC00) == 0xDC00) { // Low surrogate.
  2916. output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
  2917. } else {
  2918. // It's an unmatched surrogate; only append this code unit, in case the
  2919. // next code unit is the high surrogate of a surrogate pair.
  2920. output.push(value);
  2921. counter--;
  2922. }
  2923. } else {
  2924. output.push(value);
  2925. }
  2926. }
  2927. return output;
  2928. };
  2929. /**
  2930. * Converts a digit/integer into a basic code point.
  2931. */
  2932. var digitToBasic = function (digit) {
  2933. // 0..25 map to ASCII a..z or A..Z
  2934. // 26..35 map to ASCII 0..9
  2935. return digit + 22 + 75 * (digit < 26);
  2936. };
  2937. /**
  2938. * Bias adaptation function as per section 3.4 of RFC 3492.
  2939. * https://tools.ietf.org/html/rfc3492#section-3.4
  2940. */
  2941. var adapt = function (delta, numPoints, firstTime) {
  2942. var k = 0;
  2943. delta = firstTime ? floor(delta / damp) : delta >> 1;
  2944. delta += floor(delta / numPoints);
  2945. for (; delta > baseMinusTMin * tMax >> 1; k += base) {
  2946. delta = floor(delta / baseMinusTMin);
  2947. }
  2948. return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
  2949. };
  2950. /**
  2951. * Converts a string of Unicode symbols (e.g. a domain name label) to a
  2952. * Punycode string of ASCII-only symbols.
  2953. */
  2954. // eslint-disable-next-line max-statements -- TODO
  2955. var encode = function (input) {
  2956. var output = [];
  2957. // Convert the input in UCS-2 to an array of Unicode code points.
  2958. input = ucs2decode(input);
  2959. // Cache the length.
  2960. var inputLength = input.length;
  2961. // Initialize the state.
  2962. var n = initialN;
  2963. var delta = 0;
  2964. var bias = initialBias;
  2965. var i, currentValue;
  2966. // Handle the basic code points.
  2967. for (i = 0; i < input.length; i++) {
  2968. currentValue = input[i];
  2969. if (currentValue < 0x80) {
  2970. output.push(stringFromCharCode(currentValue));
  2971. }
  2972. }
  2973. var basicLength = output.length; // number of basic code points.
  2974. var handledCPCount = basicLength; // number of code points that have been handled;
  2975. // Finish the basic string with a delimiter unless it's empty.
  2976. if (basicLength) {
  2977. output.push(delimiter);
  2978. }
  2979. // Main encoding loop:
  2980. while (handledCPCount < inputLength) {
  2981. // All non-basic code points < n have been handled already. Find the next larger one:
  2982. var m = maxInt;
  2983. for (i = 0; i < input.length; i++) {
  2984. currentValue = input[i];
  2985. if (currentValue >= n && currentValue < m) {
  2986. m = currentValue;
  2987. }
  2988. }
  2989. // Increase `delta` enough to advance the decoder's <n,i> state to <m,0>, but guard against overflow.
  2990. var handledCPCountPlusOne = handledCPCount + 1;
  2991. if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
  2992. throw RangeError(OVERFLOW_ERROR);
  2993. }
  2994. delta += (m - n) * handledCPCountPlusOne;
  2995. n = m;
  2996. for (i = 0; i < input.length; i++) {
  2997. currentValue = input[i];
  2998. if (currentValue < n && ++delta > maxInt) {
  2999. throw RangeError(OVERFLOW_ERROR);
  3000. }
  3001. if (currentValue == n) {
  3002. // Represent delta as a generalized variable-length integer.
  3003. var q = delta;
  3004. for (var k = base; /* no condition */; k += base) {
  3005. var t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
  3006. if (q < t) break;
  3007. var qMinusT = q - t;
  3008. var baseMinusT = base - t;
  3009. output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT)));
  3010. q = floor(qMinusT / baseMinusT);
  3011. }
  3012. output.push(stringFromCharCode(digitToBasic(q)));
  3013. bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);
  3014. delta = 0;
  3015. ++handledCPCount;
  3016. }
  3017. }
  3018. ++delta;
  3019. ++n;
  3020. }
  3021. return output.join('');
  3022. };
  3023. module.exports = function (input) {
  3024. var encoded = [];
  3025. var labels = input.toLowerCase().replace(regexSeparators, '\u002E').split('.');
  3026. var i, label;
  3027. for (i = 0; i < labels.length; i++) {
  3028. label = labels[i];
  3029. encoded.push(regexNonASCII.test(label) ? 'xn--' + encode(label) : label);
  3030. }
  3031. return encoded.join('.');
  3032. };
  3033. /***/ }),
  3034. /***/ "605d":
  3035. /***/ (function(module, exports, __webpack_require__) {
  3036. var classof = __webpack_require__("c6b6");
  3037. var global = __webpack_require__("da84");
  3038. module.exports = classof(global.process) == 'process';
  3039. /***/ }),
  3040. /***/ "6069":
  3041. /***/ (function(module, exports) {
  3042. module.exports = typeof window == 'object';
  3043. /***/ }),
  3044. /***/ "60da":
  3045. /***/ (function(module, exports, __webpack_require__) {
  3046. "use strict";
  3047. var DESCRIPTORS = __webpack_require__("83ab");
  3048. var fails = __webpack_require__("d039");
  3049. var objectKeys = __webpack_require__("df75");
  3050. var getOwnPropertySymbolsModule = __webpack_require__("7418");
  3051. var propertyIsEnumerableModule = __webpack_require__("d1e7");
  3052. var toObject = __webpack_require__("7b0b");
  3053. var IndexedObject = __webpack_require__("44ad");
  3054. // eslint-disable-next-line es/no-object-assign -- safe
  3055. var $assign = Object.assign;
  3056. // eslint-disable-next-line es/no-object-defineproperty -- required for testing
  3057. var defineProperty = Object.defineProperty;
  3058. // `Object.assign` method
  3059. // https://tc39.es/ecma262/#sec-object.assign
  3060. module.exports = !$assign || fails(function () {
  3061. // should have correct order of operations (Edge bug)
  3062. if (DESCRIPTORS && $assign({ b: 1 }, $assign(defineProperty({}, 'a', {
  3063. enumerable: true,
  3064. get: function () {
  3065. defineProperty(this, 'b', {
  3066. value: 3,
  3067. enumerable: false
  3068. });
  3069. }
  3070. }), { b: 2 })).b !== 1) return true;
  3071. // should work with symbols and should have deterministic property order (V8 bug)
  3072. var A = {};
  3073. var B = {};
  3074. // eslint-disable-next-line es/no-symbol -- safe
  3075. var symbol = Symbol();
  3076. var alphabet = 'abcdefghijklmnopqrst';
  3077. A[symbol] = 7;
  3078. alphabet.split('').forEach(function (chr) { B[chr] = chr; });
  3079. return $assign({}, A)[symbol] != 7 || objectKeys($assign({}, B)).join('') != alphabet;
  3080. }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
  3081. var T = toObject(target);
  3082. var argumentsLength = arguments.length;
  3083. var index = 1;
  3084. var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
  3085. var propertyIsEnumerable = propertyIsEnumerableModule.f;
  3086. while (argumentsLength > index) {
  3087. var S = IndexedObject(arguments[index++]);
  3088. var keys = getOwnPropertySymbols ? objectKeys(S).concat(getOwnPropertySymbols(S)) : objectKeys(S);
  3089. var length = keys.length;
  3090. var j = 0;
  3091. var key;
  3092. while (length > j) {
  3093. key = keys[j++];
  3094. if (!DESCRIPTORS || propertyIsEnumerable.call(S, key)) T[key] = S[key];
  3095. }
  3096. } return T;
  3097. } : $assign;
  3098. /***/ }),
  3099. /***/ "6547":
  3100. /***/ (function(module, exports, __webpack_require__) {
  3101. var toIntegerOrInfinity = __webpack_require__("5926");
  3102. var toString = __webpack_require__("577e");
  3103. var requireObjectCoercible = __webpack_require__("1d80");
  3104. var createMethod = function (CONVERT_TO_STRING) {
  3105. return function ($this, pos) {
  3106. var S = toString(requireObjectCoercible($this));
  3107. var position = toIntegerOrInfinity(pos);
  3108. var size = S.length;
  3109. var first, second;
  3110. if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
  3111. first = S.charCodeAt(position);
  3112. return first < 0xD800 || first > 0xDBFF || position + 1 === size
  3113. || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF
  3114. ? CONVERT_TO_STRING ? S.charAt(position) : first
  3115. : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
  3116. };
  3117. };
  3118. module.exports = {
  3119. // `String.prototype.codePointAt` method
  3120. // https://tc39.es/ecma262/#sec-string.prototype.codepointat
  3121. codeAt: createMethod(false),
  3122. // `String.prototype.at` method
  3123. // https://github.com/mathiasbynens/String.prototype.at
  3124. charAt: createMethod(true)
  3125. };
  3126. /***/ }),
  3127. /***/ "6566":
  3128. /***/ (function(module, exports, __webpack_require__) {
  3129. "use strict";
  3130. var defineProperty = __webpack_require__("9bf2").f;
  3131. var create = __webpack_require__("7c73");
  3132. var redefineAll = __webpack_require__("e2cc");
  3133. var bind = __webpack_require__("0366");
  3134. var anInstance = __webpack_require__("19aa");
  3135. var iterate = __webpack_require__("2266");
  3136. var defineIterator = __webpack_require__("7dd0");
  3137. var setSpecies = __webpack_require__("2626");
  3138. var DESCRIPTORS = __webpack_require__("83ab");
  3139. var fastKey = __webpack_require__("f183").fastKey;
  3140. var InternalStateModule = __webpack_require__("69f3");
  3141. var setInternalState = InternalStateModule.set;
  3142. var internalStateGetterFor = InternalStateModule.getterFor;
  3143. module.exports = {
  3144. getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) {
  3145. var C = wrapper(function (that, iterable) {
  3146. anInstance(that, C, CONSTRUCTOR_NAME);
  3147. setInternalState(that, {
  3148. type: CONSTRUCTOR_NAME,
  3149. index: create(null),
  3150. first: undefined,
  3151. last: undefined,
  3152. size: 0
  3153. });
  3154. if (!DESCRIPTORS) that.size = 0;
  3155. if (iterable != undefined) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
  3156. });
  3157. var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);
  3158. var define = function (that, key, value) {
  3159. var state = getInternalState(that);
  3160. var entry = getEntry(that, key);
  3161. var previous, index;
  3162. // change existing entry
  3163. if (entry) {
  3164. entry.value = value;
  3165. // create new entry
  3166. } else {
  3167. state.last = entry = {
  3168. index: index = fastKey(key, true),
  3169. key: key,
  3170. value: value,
  3171. previous: previous = state.last,
  3172. next: undefined,
  3173. removed: false
  3174. };
  3175. if (!state.first) state.first = entry;
  3176. if (previous) previous.next = entry;
  3177. if (DESCRIPTORS) state.size++;
  3178. else that.size++;
  3179. // add to index
  3180. if (index !== 'F') state.index[index] = entry;
  3181. } return that;
  3182. };
  3183. var getEntry = function (that, key) {
  3184. var state = getInternalState(that);
  3185. // fast case
  3186. var index = fastKey(key);
  3187. var entry;
  3188. if (index !== 'F') return state.index[index];
  3189. // frozen object case
  3190. for (entry = state.first; entry; entry = entry.next) {
  3191. if (entry.key == key) return entry;
  3192. }
  3193. };
  3194. redefineAll(C.prototype, {
  3195. // `{ Map, Set }.prototype.clear()` methods
  3196. // https://tc39.es/ecma262/#sec-map.prototype.clear
  3197. // https://tc39.es/ecma262/#sec-set.prototype.clear
  3198. clear: function clear() {
  3199. var that = this;
  3200. var state = getInternalState(that);
  3201. var data = state.index;
  3202. var entry = state.first;
  3203. while (entry) {
  3204. entry.removed = true;
  3205. if (entry.previous) entry.previous = entry.previous.next = undefined;
  3206. delete data[entry.index];
  3207. entry = entry.next;
  3208. }
  3209. state.first = state.last = undefined;
  3210. if (DESCRIPTORS) state.size = 0;
  3211. else that.size = 0;
  3212. },
  3213. // `{ Map, Set }.prototype.delete(key)` methods
  3214. // https://tc39.es/ecma262/#sec-map.prototype.delete
  3215. // https://tc39.es/ecma262/#sec-set.prototype.delete
  3216. 'delete': function (key) {
  3217. var that = this;
  3218. var state = getInternalState(that);
  3219. var entry = getEntry(that, key);
  3220. if (entry) {
  3221. var next = entry.next;
  3222. var prev = entry.previous;
  3223. delete state.index[entry.index];
  3224. entry.removed = true;
  3225. if (prev) prev.next = next;
  3226. if (next) next.previous = prev;
  3227. if (state.first == entry) state.first = next;
  3228. if (state.last == entry) state.last = prev;
  3229. if (DESCRIPTORS) state.size--;
  3230. else that.size--;
  3231. } return !!entry;
  3232. },
  3233. // `{ Map, Set }.prototype.forEach(callbackfn, thisArg = undefined)` methods
  3234. // https://tc39.es/ecma262/#sec-map.prototype.foreach
  3235. // https://tc39.es/ecma262/#sec-set.prototype.foreach
  3236. forEach: function forEach(callbackfn /* , that = undefined */) {
  3237. var state = getInternalState(this);
  3238. var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);
  3239. var entry;
  3240. while (entry = entry ? entry.next : state.first) {
  3241. boundFunction(entry.value, entry.key, this);
  3242. // revert to the last existing entry
  3243. while (entry && entry.removed) entry = entry.previous;
  3244. }
  3245. },
  3246. // `{ Map, Set}.prototype.has(key)` methods
  3247. // https://tc39.es/ecma262/#sec-map.prototype.has
  3248. // https://tc39.es/ecma262/#sec-set.prototype.has
  3249. has: function has(key) {
  3250. return !!getEntry(this, key);
  3251. }
  3252. });
  3253. redefineAll(C.prototype, IS_MAP ? {
  3254. // `Map.prototype.get(key)` method
  3255. // https://tc39.es/ecma262/#sec-map.prototype.get
  3256. get: function get(key) {
  3257. var entry = getEntry(this, key);
  3258. return entry && entry.value;
  3259. },
  3260. // `Map.prototype.set(key, value)` method
  3261. // https://tc39.es/ecma262/#sec-map.prototype.set
  3262. set: function set(key, value) {
  3263. return define(this, key === 0 ? 0 : key, value);
  3264. }
  3265. } : {
  3266. // `Set.prototype.add(value)` method
  3267. // https://tc39.es/ecma262/#sec-set.prototype.add
  3268. add: function add(value) {
  3269. return define(this, value = value === 0 ? 0 : value, value);
  3270. }
  3271. });
  3272. if (DESCRIPTORS) defineProperty(C.prototype, 'size', {
  3273. get: function () {
  3274. return getInternalState(this).size;
  3275. }
  3276. });
  3277. return C;
  3278. },
  3279. setStrong: function (C, CONSTRUCTOR_NAME, IS_MAP) {
  3280. var ITERATOR_NAME = CONSTRUCTOR_NAME + ' Iterator';
  3281. var getInternalCollectionState = internalStateGetterFor(CONSTRUCTOR_NAME);
  3282. var getInternalIteratorState = internalStateGetterFor(ITERATOR_NAME);
  3283. // `{ Map, Set }.prototype.{ keys, values, entries, @@iterator }()` methods
  3284. // https://tc39.es/ecma262/#sec-map.prototype.entries
  3285. // https://tc39.es/ecma262/#sec-map.prototype.keys
  3286. // https://tc39.es/ecma262/#sec-map.prototype.values
  3287. // https://tc39.es/ecma262/#sec-map.prototype-@@iterator
  3288. // https://tc39.es/ecma262/#sec-set.prototype.entries
  3289. // https://tc39.es/ecma262/#sec-set.prototype.keys
  3290. // https://tc39.es/ecma262/#sec-set.prototype.values
  3291. // https://tc39.es/ecma262/#sec-set.prototype-@@iterator
  3292. defineIterator(C, CONSTRUCTOR_NAME, function (iterated, kind) {
  3293. setInternalState(this, {
  3294. type: ITERATOR_NAME,
  3295. target: iterated,
  3296. state: getInternalCollectionState(iterated),
  3297. kind: kind,
  3298. last: undefined
  3299. });
  3300. }, function () {
  3301. var state = getInternalIteratorState(this);
  3302. var kind = state.kind;
  3303. var entry = state.last;
  3304. // revert to the last existing entry
  3305. while (entry && entry.removed) entry = entry.previous;
  3306. // get next entry
  3307. if (!state.target || !(state.last = entry = entry ? entry.next : state.state.first)) {
  3308. // or finish the iteration
  3309. state.target = undefined;
  3310. return { value: undefined, done: true };
  3311. }
  3312. // return step by kind
  3313. if (kind == 'keys') return { value: entry.key, done: false };
  3314. if (kind == 'values') return { value: entry.value, done: false };
  3315. return { value: [entry.key, entry.value], done: false };
  3316. }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);
  3317. // `{ Map, Set }.prototype[@@species]` accessors
  3318. // https://tc39.es/ecma262/#sec-get-map-@@species
  3319. // https://tc39.es/ecma262/#sec-get-set-@@species
  3320. setSpecies(CONSTRUCTOR_NAME);
  3321. }
  3322. };
  3323. /***/ }),
  3324. /***/ "65f0":
  3325. /***/ (function(module, exports, __webpack_require__) {
  3326. var arraySpeciesConstructor = __webpack_require__("0b42");
  3327. // `ArraySpeciesCreate` abstract operation
  3328. // https://tc39.es/ecma262/#sec-arrayspeciescreate
  3329. module.exports = function (originalArray, length) {
  3330. return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
  3331. };
  3332. /***/ }),
  3333. /***/ "68ee":
  3334. /***/ (function(module, exports, __webpack_require__) {
  3335. var fails = __webpack_require__("d039");
  3336. var isCallable = __webpack_require__("1626");
  3337. var classof = __webpack_require__("f5df");
  3338. var getBuiltIn = __webpack_require__("d066");
  3339. var inspectSource = __webpack_require__("8925");
  3340. var empty = [];
  3341. var construct = getBuiltIn('Reflect', 'construct');
  3342. var constructorRegExp = /^\s*(?:class|function)\b/;
  3343. var exec = constructorRegExp.exec;
  3344. var INCORRECT_TO_STRING = !constructorRegExp.exec(function () { /* empty */ });
  3345. var isConstructorModern = function (argument) {
  3346. if (!isCallable(argument)) return false;
  3347. try {
  3348. construct(Object, empty, argument);
  3349. return true;
  3350. } catch (error) {
  3351. return false;
  3352. }
  3353. };
  3354. var isConstructorLegacy = function (argument) {
  3355. if (!isCallable(argument)) return false;
  3356. switch (classof(argument)) {
  3357. case 'AsyncFunction':
  3358. case 'GeneratorFunction':
  3359. case 'AsyncGeneratorFunction': return false;
  3360. // we can't check .prototype since constructors produced by .bind haven't it
  3361. } return INCORRECT_TO_STRING || !!exec.call(constructorRegExp, inspectSource(argument));
  3362. };
  3363. // `IsConstructor` abstract operation
  3364. // https://tc39.es/ecma262/#sec-isconstructor
  3365. module.exports = !construct || fails(function () {
  3366. var called;
  3367. return isConstructorModern(isConstructorModern.call)
  3368. || !isConstructorModern(Object)
  3369. || !isConstructorModern(function () { called = true; })
  3370. || called;
  3371. }) ? isConstructorLegacy : isConstructorModern;
  3372. /***/ }),
  3373. /***/ "69f3":
  3374. /***/ (function(module, exports, __webpack_require__) {
  3375. var NATIVE_WEAK_MAP = __webpack_require__("7f9a");
  3376. var global = __webpack_require__("da84");
  3377. var isObject = __webpack_require__("861d");
  3378. var createNonEnumerableProperty = __webpack_require__("9112");
  3379. var hasOwn = __webpack_require__("1a2d");
  3380. var shared = __webpack_require__("c6cd");
  3381. var sharedKey = __webpack_require__("f772");
  3382. var hiddenKeys = __webpack_require__("d012");
  3383. var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
  3384. var WeakMap = global.WeakMap;
  3385. var set, get, has;
  3386. var enforce = function (it) {
  3387. return has(it) ? get(it) : set(it, {});
  3388. };
  3389. var getterFor = function (TYPE) {
  3390. return function (it) {
  3391. var state;
  3392. if (!isObject(it) || (state = get(it)).type !== TYPE) {
  3393. throw TypeError('Incompatible receiver, ' + TYPE + ' required');
  3394. } return state;
  3395. };
  3396. };
  3397. if (NATIVE_WEAK_MAP || shared.state) {
  3398. var store = shared.state || (shared.state = new WeakMap());
  3399. var wmget = store.get;
  3400. var wmhas = store.has;
  3401. var wmset = store.set;
  3402. set = function (it, metadata) {
  3403. if (wmhas.call(store, it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
  3404. metadata.facade = it;
  3405. wmset.call(store, it, metadata);
  3406. return metadata;
  3407. };
  3408. get = function (it) {
  3409. return wmget.call(store, it) || {};
  3410. };
  3411. has = function (it) {
  3412. return wmhas.call(store, it);
  3413. };
  3414. } else {
  3415. var STATE = sharedKey('state');
  3416. hiddenKeys[STATE] = true;
  3417. set = function (it, metadata) {
  3418. if (hasOwn(it, STATE)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
  3419. metadata.facade = it;
  3420. createNonEnumerableProperty(it, STATE, metadata);
  3421. return metadata;
  3422. };
  3423. get = function (it) {
  3424. return hasOwn(it, STATE) ? it[STATE] : {};
  3425. };
  3426. has = function (it) {
  3427. return hasOwn(it, STATE);
  3428. };
  3429. }
  3430. module.exports = {
  3431. set: set,
  3432. get: get,
  3433. has: has,
  3434. enforce: enforce,
  3435. getterFor: getterFor
  3436. };
  3437. /***/ }),
  3438. /***/ "6d61":
  3439. /***/ (function(module, exports, __webpack_require__) {
  3440. "use strict";
  3441. var $ = __webpack_require__("23e7");
  3442. var global = __webpack_require__("da84");
  3443. var isForced = __webpack_require__("94ca");
  3444. var redefine = __webpack_require__("6eeb");
  3445. var InternalMetadataModule = __webpack_require__("f183");
  3446. var iterate = __webpack_require__("2266");
  3447. var anInstance = __webpack_require__("19aa");
  3448. var isCallable = __webpack_require__("1626");
  3449. var isObject = __webpack_require__("861d");
  3450. var fails = __webpack_require__("d039");
  3451. var checkCorrectnessOfIteration = __webpack_require__("1c7e");
  3452. var setToStringTag = __webpack_require__("d44e");
  3453. var inheritIfRequired = __webpack_require__("7156");
  3454. module.exports = function (CONSTRUCTOR_NAME, wrapper, common) {
  3455. var IS_MAP = CONSTRUCTOR_NAME.indexOf('Map') !== -1;
  3456. var IS_WEAK = CONSTRUCTOR_NAME.indexOf('Weak') !== -1;
  3457. var ADDER = IS_MAP ? 'set' : 'add';
  3458. var NativeConstructor = global[CONSTRUCTOR_NAME];
  3459. var NativePrototype = NativeConstructor && NativeConstructor.prototype;
  3460. var Constructor = NativeConstructor;
  3461. var exported = {};
  3462. var fixMethod = function (KEY) {
  3463. var nativeMethod = NativePrototype[KEY];
  3464. redefine(NativePrototype, KEY,
  3465. KEY == 'add' ? function add(value) {
  3466. nativeMethod.call(this, value === 0 ? 0 : value);
  3467. return this;
  3468. } : KEY == 'delete' ? function (key) {
  3469. return IS_WEAK && !isObject(key) ? false : nativeMethod.call(this, key === 0 ? 0 : key);
  3470. } : KEY == 'get' ? function get(key) {
  3471. return IS_WEAK && !isObject(key) ? undefined : nativeMethod.call(this, key === 0 ? 0 : key);
  3472. } : KEY == 'has' ? function has(key) {
  3473. return IS_WEAK && !isObject(key) ? false : nativeMethod.call(this, key === 0 ? 0 : key);
  3474. } : function set(key, value) {
  3475. nativeMethod.call(this, key === 0 ? 0 : key, value);
  3476. return this;
  3477. }
  3478. );
  3479. };
  3480. var REPLACE = isForced(
  3481. CONSTRUCTOR_NAME,
  3482. !isCallable(NativeConstructor) || !(IS_WEAK || NativePrototype.forEach && !fails(function () {
  3483. new NativeConstructor().entries().next();
  3484. }))
  3485. );
  3486. if (REPLACE) {
  3487. // create collection constructor
  3488. Constructor = common.getConstructor(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER);
  3489. InternalMetadataModule.enable();
  3490. } else if (isForced(CONSTRUCTOR_NAME, true)) {
  3491. var instance = new Constructor();
  3492. // early implementations not supports chaining
  3493. var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance;
  3494. // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false
  3495. var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); });
  3496. // most early implementations doesn't supports iterables, most modern - not close it correctly
  3497. // eslint-disable-next-line no-new -- required for testing
  3498. var ACCEPT_ITERABLES = checkCorrectnessOfIteration(function (iterable) { new NativeConstructor(iterable); });
  3499. // for early implementations -0 and +0 not the same
  3500. var BUGGY_ZERO = !IS_WEAK && fails(function () {
  3501. // V8 ~ Chromium 42- fails only with 5+ elements
  3502. var $instance = new NativeConstructor();
  3503. var index = 5;
  3504. while (index--) $instance[ADDER](index, index);
  3505. return !$instance.has(-0);
  3506. });
  3507. if (!ACCEPT_ITERABLES) {
  3508. Constructor = wrapper(function (dummy, iterable) {
  3509. anInstance(dummy, Constructor, CONSTRUCTOR_NAME);
  3510. var that = inheritIfRequired(new NativeConstructor(), dummy, Constructor);
  3511. if (iterable != undefined) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
  3512. return that;
  3513. });
  3514. Constructor.prototype = NativePrototype;
  3515. NativePrototype.constructor = Constructor;
  3516. }
  3517. if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) {
  3518. fixMethod('delete');
  3519. fixMethod('has');
  3520. IS_MAP && fixMethod('get');
  3521. }
  3522. if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER);
  3523. // weak collections should not contains .clear method
  3524. if (IS_WEAK && NativePrototype.clear) delete NativePrototype.clear;
  3525. }
  3526. exported[CONSTRUCTOR_NAME] = Constructor;
  3527. $({ global: true, forced: Constructor != NativeConstructor }, exported);
  3528. setToStringTag(Constructor, CONSTRUCTOR_NAME);
  3529. if (!IS_WEAK) common.setStrong(Constructor, CONSTRUCTOR_NAME, IS_MAP);
  3530. return Constructor;
  3531. };
  3532. /***/ }),
  3533. /***/ "6eeb":
  3534. /***/ (function(module, exports, __webpack_require__) {
  3535. var global = __webpack_require__("da84");
  3536. var isCallable = __webpack_require__("1626");
  3537. var hasOwn = __webpack_require__("1a2d");
  3538. var createNonEnumerableProperty = __webpack_require__("9112");
  3539. var setGlobal = __webpack_require__("ce4e");
  3540. var inspectSource = __webpack_require__("8925");
  3541. var InternalStateModule = __webpack_require__("69f3");
  3542. var CONFIGURABLE_FUNCTION_NAME = __webpack_require__("5e77").CONFIGURABLE;
  3543. var getInternalState = InternalStateModule.get;
  3544. var enforceInternalState = InternalStateModule.enforce;
  3545. var TEMPLATE = String(String).split('String');
  3546. (module.exports = function (O, key, value, options) {
  3547. var unsafe = options ? !!options.unsafe : false;
  3548. var simple = options ? !!options.enumerable : false;
  3549. var noTargetGet = options ? !!options.noTargetGet : false;
  3550. var name = options && options.name !== undefined ? options.name : key;
  3551. var state;
  3552. if (isCallable(value)) {
  3553. if (String(name).slice(0, 7) === 'Symbol(') {
  3554. name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
  3555. }
  3556. if (!hasOwn(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
  3557. createNonEnumerableProperty(value, 'name', name);
  3558. }
  3559. state = enforceInternalState(value);
  3560. if (!state.source) {
  3561. state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
  3562. }
  3563. }
  3564. if (O === global) {
  3565. if (simple) O[key] = value;
  3566. else setGlobal(key, value);
  3567. return;
  3568. } else if (!unsafe) {
  3569. delete O[key];
  3570. } else if (!noTargetGet && O[key]) {
  3571. simple = true;
  3572. }
  3573. if (simple) O[key] = value;
  3574. else createNonEnumerableProperty(O, key, value);
  3575. // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
  3576. })(Function.prototype, 'toString', function toString() {
  3577. return isCallable(this) && getInternalState(this).source || inspectSource(this);
  3578. });
  3579. /***/ }),
  3580. /***/ "7156":
  3581. /***/ (function(module, exports, __webpack_require__) {
  3582. var isCallable = __webpack_require__("1626");
  3583. var isObject = __webpack_require__("861d");
  3584. var setPrototypeOf = __webpack_require__("d2bb");
  3585. // makes subclassing work correct for wrapped built-ins
  3586. module.exports = function ($this, dummy, Wrapper) {
  3587. var NewTarget, NewTargetPrototype;
  3588. if (
  3589. // it can work only with native `setPrototypeOf`
  3590. setPrototypeOf &&
  3591. // we haven't completely correct pre-ES6 way for getting `new.target`, so use this
  3592. isCallable(NewTarget = dummy.constructor) &&
  3593. NewTarget !== Wrapper &&
  3594. isObject(NewTargetPrototype = NewTarget.prototype) &&
  3595. NewTargetPrototype !== Wrapper.prototype
  3596. ) setPrototypeOf($this, NewTargetPrototype);
  3597. return $this;
  3598. };
  3599. /***/ }),
  3600. /***/ "7418":
  3601. /***/ (function(module, exports) {
  3602. // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
  3603. exports.f = Object.getOwnPropertySymbols;
  3604. /***/ }),
  3605. /***/ "746f":
  3606. /***/ (function(module, exports, __webpack_require__) {
  3607. var path = __webpack_require__("428f");
  3608. var hasOwn = __webpack_require__("1a2d");
  3609. var wrappedWellKnownSymbolModule = __webpack_require__("e538");
  3610. var defineProperty = __webpack_require__("9bf2").f;
  3611. module.exports = function (NAME) {
  3612. var Symbol = path.Symbol || (path.Symbol = {});
  3613. if (!hasOwn(Symbol, NAME)) defineProperty(Symbol, NAME, {
  3614. value: wrappedWellKnownSymbolModule.f(NAME)
  3615. });
  3616. };
  3617. /***/ }),
  3618. /***/ "7839":
  3619. /***/ (function(module, exports) {
  3620. // IE8- don't enum bug keys
  3621. module.exports = [
  3622. 'constructor',
  3623. 'hasOwnProperty',
  3624. 'isPrototypeOf',
  3625. 'propertyIsEnumerable',
  3626. 'toLocaleString',
  3627. 'toString',
  3628. 'valueOf'
  3629. ];
  3630. /***/ }),
  3631. /***/ "785a":
  3632. /***/ (function(module, exports, __webpack_require__) {
  3633. // in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList`
  3634. var documentCreateElement = __webpack_require__("cc12");
  3635. var classList = documentCreateElement('span').classList;
  3636. var DOMTokenListPrototype = classList && classList.constructor && classList.constructor.prototype;
  3637. module.exports = DOMTokenListPrototype === Object.prototype ? undefined : DOMTokenListPrototype;
  3638. /***/ }),
  3639. /***/ "7b0b":
  3640. /***/ (function(module, exports, __webpack_require__) {
  3641. var requireObjectCoercible = __webpack_require__("1d80");
  3642. // `ToObject` abstract operation
  3643. // https://tc39.es/ecma262/#sec-toobject
  3644. module.exports = function (argument) {
  3645. return Object(requireObjectCoercible(argument));
  3646. };
  3647. /***/ }),
  3648. /***/ "7c73":
  3649. /***/ (function(module, exports, __webpack_require__) {
  3650. /* global ActiveXObject -- old IE, WSH */
  3651. var anObject = __webpack_require__("825a");
  3652. var defineProperties = __webpack_require__("37e8");
  3653. var enumBugKeys = __webpack_require__("7839");
  3654. var hiddenKeys = __webpack_require__("d012");
  3655. var html = __webpack_require__("1be4");
  3656. var documentCreateElement = __webpack_require__("cc12");
  3657. var sharedKey = __webpack_require__("f772");
  3658. var GT = '>';
  3659. var LT = '<';
  3660. var PROTOTYPE = 'prototype';
  3661. var SCRIPT = 'script';
  3662. var IE_PROTO = sharedKey('IE_PROTO');
  3663. var EmptyConstructor = function () { /* empty */ };
  3664. var scriptTag = function (content) {
  3665. return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
  3666. };
  3667. // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
  3668. var NullProtoObjectViaActiveX = function (activeXDocument) {
  3669. activeXDocument.write(scriptTag(''));
  3670. activeXDocument.close();
  3671. var temp = activeXDocument.parentWindow.Object;
  3672. activeXDocument = null; // avoid memory leak
  3673. return temp;
  3674. };
  3675. // Create object with fake `null` prototype: use iframe Object with cleared prototype
  3676. var NullProtoObjectViaIFrame = function () {
  3677. // Thrash, waste and sodomy: IE GC bug
  3678. var iframe = documentCreateElement('iframe');
  3679. var JS = 'java' + SCRIPT + ':';
  3680. var iframeDocument;
  3681. iframe.style.display = 'none';
  3682. html.appendChild(iframe);
  3683. // https://github.com/zloirock/core-js/issues/475
  3684. iframe.src = String(JS);
  3685. iframeDocument = iframe.contentWindow.document;
  3686. iframeDocument.open();
  3687. iframeDocument.write(scriptTag('document.F=Object'));
  3688. iframeDocument.close();
  3689. return iframeDocument.F;
  3690. };
  3691. // Check for document.domain and active x support
  3692. // No need to use active x approach when document.domain is not set
  3693. // see https://github.com/es-shims/es5-shim/issues/150
  3694. // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
  3695. // avoid IE GC bug
  3696. var activeXDocument;
  3697. var NullProtoObject = function () {
  3698. try {
  3699. activeXDocument = new ActiveXObject('htmlfile');
  3700. } catch (error) { /* ignore */ }
  3701. NullProtoObject = typeof document != 'undefined'
  3702. ? document.domain && activeXDocument
  3703. ? NullProtoObjectViaActiveX(activeXDocument) // old IE
  3704. : NullProtoObjectViaIFrame()
  3705. : NullProtoObjectViaActiveX(activeXDocument); // WSH
  3706. var length = enumBugKeys.length;
  3707. while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
  3708. return NullProtoObject();
  3709. };
  3710. hiddenKeys[IE_PROTO] = true;
  3711. // `Object.create` method
  3712. // https://tc39.es/ecma262/#sec-object.create
  3713. module.exports = Object.create || function create(O, Properties) {
  3714. var result;
  3715. if (O !== null) {
  3716. EmptyConstructor[PROTOTYPE] = anObject(O);
  3717. result = new EmptyConstructor();
  3718. EmptyConstructor[PROTOTYPE] = null;
  3719. // add "__proto__" for Object.getPrototypeOf polyfill
  3720. result[IE_PROTO] = O;
  3721. } else result = NullProtoObject();
  3722. return Properties === undefined ? result : defineProperties(result, Properties);
  3723. };
  3724. /***/ }),
  3725. /***/ "7db0":
  3726. /***/ (function(module, exports, __webpack_require__) {
  3727. "use strict";
  3728. var $ = __webpack_require__("23e7");
  3729. var $find = __webpack_require__("b727").find;
  3730. var addToUnscopables = __webpack_require__("44d2");
  3731. var FIND = 'find';
  3732. var SKIPS_HOLES = true;
  3733. // Shouldn't skip holes
  3734. if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
  3735. // `Array.prototype.find` method
  3736. // https://tc39.es/ecma262/#sec-array.prototype.find
  3737. $({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
  3738. find: function find(callbackfn /* , that = undefined */) {
  3739. return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  3740. }
  3741. });
  3742. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  3743. addToUnscopables(FIND);
  3744. /***/ }),
  3745. /***/ "7dd0":
  3746. /***/ (function(module, exports, __webpack_require__) {
  3747. "use strict";
  3748. var $ = __webpack_require__("23e7");
  3749. var IS_PURE = __webpack_require__("c430");
  3750. var FunctionName = __webpack_require__("5e77");
  3751. var isCallable = __webpack_require__("1626");
  3752. var createIteratorConstructor = __webpack_require__("9ed3");
  3753. var getPrototypeOf = __webpack_require__("e163");
  3754. var setPrototypeOf = __webpack_require__("d2bb");
  3755. var setToStringTag = __webpack_require__("d44e");
  3756. var createNonEnumerableProperty = __webpack_require__("9112");
  3757. var redefine = __webpack_require__("6eeb");
  3758. var wellKnownSymbol = __webpack_require__("b622");
  3759. var Iterators = __webpack_require__("3f8c");
  3760. var IteratorsCore = __webpack_require__("ae93");
  3761. var PROPER_FUNCTION_NAME = FunctionName.PROPER;
  3762. var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
  3763. var IteratorPrototype = IteratorsCore.IteratorPrototype;
  3764. var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
  3765. var ITERATOR = wellKnownSymbol('iterator');
  3766. var KEYS = 'keys';
  3767. var VALUES = 'values';
  3768. var ENTRIES = 'entries';
  3769. var returnThis = function () { return this; };
  3770. module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
  3771. createIteratorConstructor(IteratorConstructor, NAME, next);
  3772. var getIterationMethod = function (KIND) {
  3773. if (KIND === DEFAULT && defaultIterator) return defaultIterator;
  3774. if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];
  3775. switch (KIND) {
  3776. case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
  3777. case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
  3778. case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
  3779. } return function () { return new IteratorConstructor(this); };
  3780. };
  3781. var TO_STRING_TAG = NAME + ' Iterator';
  3782. var INCORRECT_VALUES_NAME = false;
  3783. var IterablePrototype = Iterable.prototype;
  3784. var nativeIterator = IterablePrototype[ITERATOR]
  3785. || IterablePrototype['@@iterator']
  3786. || DEFAULT && IterablePrototype[DEFAULT];
  3787. var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
  3788. var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
  3789. var CurrentIteratorPrototype, methods, KEY;
  3790. // fix native
  3791. if (anyNativeIterator) {
  3792. CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
  3793. if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
  3794. if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
  3795. if (setPrototypeOf) {
  3796. setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
  3797. } else if (!isCallable(CurrentIteratorPrototype[ITERATOR])) {
  3798. redefine(CurrentIteratorPrototype, ITERATOR, returnThis);
  3799. }
  3800. }
  3801. // Set @@toStringTag to native iterators
  3802. setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true);
  3803. if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis;
  3804. }
  3805. }
  3806. // fix Array.prototype.{ values, @@iterator }.name in V8 / FF
  3807. if (PROPER_FUNCTION_NAME && DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
  3808. if (!IS_PURE && CONFIGURABLE_FUNCTION_NAME) {
  3809. createNonEnumerableProperty(IterablePrototype, 'name', VALUES);
  3810. } else {
  3811. INCORRECT_VALUES_NAME = true;
  3812. defaultIterator = function values() { return nativeIterator.call(this); };
  3813. }
  3814. }
  3815. // export additional methods
  3816. if (DEFAULT) {
  3817. methods = {
  3818. values: getIterationMethod(VALUES),
  3819. keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
  3820. entries: getIterationMethod(ENTRIES)
  3821. };
  3822. if (FORCED) for (KEY in methods) {
  3823. if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
  3824. redefine(IterablePrototype, KEY, methods[KEY]);
  3825. }
  3826. } else $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
  3827. }
  3828. // define iterator
  3829. if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) {
  3830. redefine(IterablePrototype, ITERATOR, defaultIterator, { name: DEFAULT });
  3831. }
  3832. Iterators[NAME] = defaultIterator;
  3833. return methods;
  3834. };
  3835. /***/ }),
  3836. /***/ "7f9a":
  3837. /***/ (function(module, exports, __webpack_require__) {
  3838. var global = __webpack_require__("da84");
  3839. var isCallable = __webpack_require__("1626");
  3840. var inspectSource = __webpack_require__("8925");
  3841. var WeakMap = global.WeakMap;
  3842. module.exports = isCallable(WeakMap) && /native code/.test(inspectSource(WeakMap));
  3843. /***/ }),
  3844. /***/ "825a":
  3845. /***/ (function(module, exports, __webpack_require__) {
  3846. var isObject = __webpack_require__("861d");
  3847. // `Assert: Type(argument) is Object`
  3848. module.exports = function (argument) {
  3849. if (isObject(argument)) return argument;
  3850. throw TypeError(String(argument) + ' is not an object');
  3851. };
  3852. /***/ }),
  3853. /***/ "83ab":
  3854. /***/ (function(module, exports, __webpack_require__) {
  3855. var fails = __webpack_require__("d039");
  3856. // Detect IE8's incomplete defineProperty implementation
  3857. module.exports = !fails(function () {
  3858. // eslint-disable-next-line es/no-object-defineproperty -- required for testing
  3859. return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
  3860. });
  3861. /***/ }),
  3862. /***/ "8418":
  3863. /***/ (function(module, exports, __webpack_require__) {
  3864. "use strict";
  3865. var toPropertyKey = __webpack_require__("a04b");
  3866. var definePropertyModule = __webpack_require__("9bf2");
  3867. var createPropertyDescriptor = __webpack_require__("5c6c");
  3868. module.exports = function (object, key, value) {
  3869. var propertyKey = toPropertyKey(key);
  3870. if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));
  3871. else object[propertyKey] = value;
  3872. };
  3873. /***/ }),
  3874. /***/ "857a":
  3875. /***/ (function(module, exports, __webpack_require__) {
  3876. var requireObjectCoercible = __webpack_require__("1d80");
  3877. var toString = __webpack_require__("577e");
  3878. var quot = /"/g;
  3879. // `CreateHTML` abstract operation
  3880. // https://tc39.es/ecma262/#sec-createhtml
  3881. module.exports = function (string, tag, attribute, value) {
  3882. var S = toString(requireObjectCoercible(string));
  3883. var p1 = '<' + tag;
  3884. if (attribute !== '') p1 += ' ' + attribute + '="' + toString(value).replace(quot, '&quot;') + '"';
  3885. return p1 + '>' + S + '</' + tag + '>';
  3886. };
  3887. /***/ }),
  3888. /***/ "861d":
  3889. /***/ (function(module, exports, __webpack_require__) {
  3890. var isCallable = __webpack_require__("1626");
  3891. module.exports = function (it) {
  3892. return typeof it === 'object' ? it !== null : isCallable(it);
  3893. };
  3894. /***/ }),
  3895. /***/ "8875":
  3896. /***/ (function(module, exports, __webpack_require__) {
  3897. var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// addapted from the document.currentScript polyfill by Adam Miller
  3898. // MIT license
  3899. // source: https://github.com/amiller-gh/currentScript-polyfill
  3900. // added support for Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1620505
  3901. (function (root, factory) {
  3902. if (true) {
  3903. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
  3904. __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
  3905. (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
  3906. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  3907. } else {}
  3908. }(typeof self !== 'undefined' ? self : this, function () {
  3909. function getCurrentScript () {
  3910. var descriptor = Object.getOwnPropertyDescriptor(document, 'currentScript')
  3911. // for chrome
  3912. if (!descriptor && 'currentScript' in document && document.currentScript) {
  3913. return document.currentScript
  3914. }
  3915. // for other browsers with native support for currentScript
  3916. if (descriptor && descriptor.get !== getCurrentScript && document.currentScript) {
  3917. return document.currentScript
  3918. }
  3919. // IE 8-10 support script readyState
  3920. // IE 11+ & Firefox support stack trace
  3921. try {
  3922. throw new Error();
  3923. }
  3924. catch (err) {
  3925. // Find the second match for the "at" string to get file src url from stack.
  3926. var ieStackRegExp = /.*at [^(]*\((.*):(.+):(.+)\)$/ig,
  3927. ffStackRegExp = /@([^@]*):(\d+):(\d+)\s*$/ig,
  3928. stackDetails = ieStackRegExp.exec(err.stack) || ffStackRegExp.exec(err.stack),
  3929. scriptLocation = (stackDetails && stackDetails[1]) || false,
  3930. line = (stackDetails && stackDetails[2]) || false,
  3931. currentLocation = document.location.href.replace(document.location.hash, ''),
  3932. pageSource,
  3933. inlineScriptSourceRegExp,
  3934. inlineScriptSource,
  3935. scripts = document.getElementsByTagName('script'); // Live NodeList collection
  3936. if (scriptLocation === currentLocation) {
  3937. pageSource = document.documentElement.outerHTML;
  3938. inlineScriptSourceRegExp = new RegExp('(?:[^\\n]+?\\n){0,' + (line - 2) + '}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*', 'i');
  3939. inlineScriptSource = pageSource.replace(inlineScriptSourceRegExp, '$1').trim();
  3940. }
  3941. for (var i = 0; i < scripts.length; i++) {
  3942. // If ready state is interactive, return the script tag
  3943. if (scripts[i].readyState === 'interactive') {
  3944. return scripts[i];
  3945. }
  3946. // If src matches, return the script tag
  3947. if (scripts[i].src === scriptLocation) {
  3948. return scripts[i];
  3949. }
  3950. // If inline source matches, return the script tag
  3951. if (
  3952. scriptLocation === currentLocation &&
  3953. scripts[i].innerHTML &&
  3954. scripts[i].innerHTML.trim() === inlineScriptSource
  3955. ) {
  3956. return scripts[i];
  3957. }
  3958. }
  3959. // If no match, return null
  3960. return null;
  3961. }
  3962. };
  3963. return getCurrentScript
  3964. }));
  3965. /***/ }),
  3966. /***/ "8925":
  3967. /***/ (function(module, exports, __webpack_require__) {
  3968. var isCallable = __webpack_require__("1626");
  3969. var store = __webpack_require__("c6cd");
  3970. var functionToString = Function.toString;
  3971. // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
  3972. if (!isCallable(store.inspectSource)) {
  3973. store.inspectSource = function (it) {
  3974. return functionToString.call(it);
  3975. };
  3976. }
  3977. module.exports = store.inspectSource;
  3978. /***/ }),
  3979. /***/ "8aa5":
  3980. /***/ (function(module, exports, __webpack_require__) {
  3981. "use strict";
  3982. var charAt = __webpack_require__("6547").charAt;
  3983. // `AdvanceStringIndex` abstract operation
  3984. // https://tc39.es/ecma262/#sec-advancestringindex
  3985. module.exports = function (S, index, unicode) {
  3986. return index + (unicode ? charAt(S, index).length : 1);
  3987. };
  3988. /***/ }),
  3989. /***/ "90e3":
  3990. /***/ (function(module, exports) {
  3991. var id = 0;
  3992. var postfix = Math.random();
  3993. module.exports = function (key) {
  3994. return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);
  3995. };
  3996. /***/ }),
  3997. /***/ "9112":
  3998. /***/ (function(module, exports, __webpack_require__) {
  3999. var DESCRIPTORS = __webpack_require__("83ab");
  4000. var definePropertyModule = __webpack_require__("9bf2");
  4001. var createPropertyDescriptor = __webpack_require__("5c6c");
  4002. module.exports = DESCRIPTORS ? function (object, key, value) {
  4003. return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));
  4004. } : function (object, key, value) {
  4005. object[key] = value;
  4006. return object;
  4007. };
  4008. /***/ }),
  4009. /***/ "9263":
  4010. /***/ (function(module, exports, __webpack_require__) {
  4011. "use strict";
  4012. /* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */
  4013. /* eslint-disable regexp/no-useless-quantifier -- testing */
  4014. var toString = __webpack_require__("577e");
  4015. var regexpFlags = __webpack_require__("ad6d");
  4016. var stickyHelpers = __webpack_require__("9f7f");
  4017. var shared = __webpack_require__("5692");
  4018. var create = __webpack_require__("7c73");
  4019. var getInternalState = __webpack_require__("69f3").get;
  4020. var UNSUPPORTED_DOT_ALL = __webpack_require__("fce3");
  4021. var UNSUPPORTED_NCG = __webpack_require__("107c");
  4022. var nativeExec = RegExp.prototype.exec;
  4023. var nativeReplace = shared('native-string-replace', String.prototype.replace);
  4024. var patchedExec = nativeExec;
  4025. var UPDATES_LAST_INDEX_WRONG = (function () {
  4026. var re1 = /a/;
  4027. var re2 = /b*/g;
  4028. nativeExec.call(re1, 'a');
  4029. nativeExec.call(re2, 'a');
  4030. return re1.lastIndex !== 0 || re2.lastIndex !== 0;
  4031. })();
  4032. var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y || stickyHelpers.BROKEN_CARET;
  4033. // nonparticipating capturing group, copied from es5-shim's String#split patch.
  4034. var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
  4035. var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG;
  4036. if (PATCH) {
  4037. // eslint-disable-next-line max-statements -- TODO
  4038. patchedExec = function exec(string) {
  4039. var re = this;
  4040. var state = getInternalState(re);
  4041. var str = toString(string);
  4042. var raw = state.raw;
  4043. var result, reCopy, lastIndex, match, i, object, group;
  4044. if (raw) {
  4045. raw.lastIndex = re.lastIndex;
  4046. result = patchedExec.call(raw, str);
  4047. re.lastIndex = raw.lastIndex;
  4048. return result;
  4049. }
  4050. var groups = state.groups;
  4051. var sticky = UNSUPPORTED_Y && re.sticky;
  4052. var flags = regexpFlags.call(re);
  4053. var source = re.source;
  4054. var charsAdded = 0;
  4055. var strCopy = str;
  4056. if (sticky) {
  4057. flags = flags.replace('y', '');
  4058. if (flags.indexOf('g') === -1) {
  4059. flags += 'g';
  4060. }
  4061. strCopy = str.slice(re.lastIndex);
  4062. // Support anchored sticky behavior.
  4063. if (re.lastIndex > 0 && (!re.multiline || re.multiline && str.charAt(re.lastIndex - 1) !== '\n')) {
  4064. source = '(?: ' + source + ')';
  4065. strCopy = ' ' + strCopy;
  4066. charsAdded++;
  4067. }
  4068. // ^(? + rx + ) is needed, in combination with some str slicing, to
  4069. // simulate the 'y' flag.
  4070. reCopy = new RegExp('^(?:' + source + ')', flags);
  4071. }
  4072. if (NPCG_INCLUDED) {
  4073. reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
  4074. }
  4075. if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
  4076. match = nativeExec.call(sticky ? reCopy : re, strCopy);
  4077. if (sticky) {
  4078. if (match) {
  4079. match.input = match.input.slice(charsAdded);
  4080. match[0] = match[0].slice(charsAdded);
  4081. match.index = re.lastIndex;
  4082. re.lastIndex += match[0].length;
  4083. } else re.lastIndex = 0;
  4084. } else if (UPDATES_LAST_INDEX_WRONG && match) {
  4085. re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
  4086. }
  4087. if (NPCG_INCLUDED && match && match.length > 1) {
  4088. // Fix browsers whose `exec` methods don't consistently return `undefined`
  4089. // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
  4090. nativeReplace.call(match[0], reCopy, function () {
  4091. for (i = 1; i < arguments.length - 2; i++) {
  4092. if (arguments[i] === undefined) match[i] = undefined;
  4093. }
  4094. });
  4095. }
  4096. if (match && groups) {
  4097. match.groups = object = create(null);
  4098. for (i = 0; i < groups.length; i++) {
  4099. group = groups[i];
  4100. object[group[0]] = match[group[1]];
  4101. }
  4102. }
  4103. return match;
  4104. };
  4105. }
  4106. module.exports = patchedExec;
  4107. /***/ }),
  4108. /***/ "94ca":
  4109. /***/ (function(module, exports, __webpack_require__) {
  4110. var fails = __webpack_require__("d039");
  4111. var isCallable = __webpack_require__("1626");
  4112. var replacement = /#|\.prototype\./;
  4113. var isForced = function (feature, detection) {
  4114. var value = data[normalize(feature)];
  4115. return value == POLYFILL ? true
  4116. : value == NATIVE ? false
  4117. : isCallable(detection) ? fails(detection)
  4118. : !!detection;
  4119. };
  4120. var normalize = isForced.normalize = function (string) {
  4121. return String(string).replace(replacement, '.').toLowerCase();
  4122. };
  4123. var data = isForced.data = {};
  4124. var NATIVE = isForced.NATIVE = 'N';
  4125. var POLYFILL = isForced.POLYFILL = 'P';
  4126. module.exports = isForced;
  4127. /***/ }),
  4128. /***/ "9861":
  4129. /***/ (function(module, exports, __webpack_require__) {
  4130. "use strict";
  4131. // TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env`
  4132. __webpack_require__("e260");
  4133. var $ = __webpack_require__("23e7");
  4134. var getBuiltIn = __webpack_require__("d066");
  4135. var USE_NATIVE_URL = __webpack_require__("0d3b");
  4136. var redefine = __webpack_require__("6eeb");
  4137. var redefineAll = __webpack_require__("e2cc");
  4138. var setToStringTag = __webpack_require__("d44e");
  4139. var createIteratorConstructor = __webpack_require__("9ed3");
  4140. var InternalStateModule = __webpack_require__("69f3");
  4141. var anInstance = __webpack_require__("19aa");
  4142. var isCallable = __webpack_require__("1626");
  4143. var hasOwn = __webpack_require__("1a2d");
  4144. var bind = __webpack_require__("0366");
  4145. var classof = __webpack_require__("f5df");
  4146. var anObject = __webpack_require__("825a");
  4147. var isObject = __webpack_require__("861d");
  4148. var $toString = __webpack_require__("577e");
  4149. var create = __webpack_require__("7c73");
  4150. var createPropertyDescriptor = __webpack_require__("5c6c");
  4151. var getIterator = __webpack_require__("9a1f");
  4152. var getIteratorMethod = __webpack_require__("35a1");
  4153. var wellKnownSymbol = __webpack_require__("b622");
  4154. var nativeFetch = getBuiltIn('fetch');
  4155. var NativeRequest = getBuiltIn('Request');
  4156. var RequestPrototype = NativeRequest && NativeRequest.prototype;
  4157. var Headers = getBuiltIn('Headers');
  4158. var ITERATOR = wellKnownSymbol('iterator');
  4159. var URL_SEARCH_PARAMS = 'URLSearchParams';
  4160. var URL_SEARCH_PARAMS_ITERATOR = URL_SEARCH_PARAMS + 'Iterator';
  4161. var setInternalState = InternalStateModule.set;
  4162. var getInternalParamsState = InternalStateModule.getterFor(URL_SEARCH_PARAMS);
  4163. var getInternalIteratorState = InternalStateModule.getterFor(URL_SEARCH_PARAMS_ITERATOR);
  4164. var plus = /\+/g;
  4165. var sequences = Array(4);
  4166. var percentSequence = function (bytes) {
  4167. return sequences[bytes - 1] || (sequences[bytes - 1] = RegExp('((?:%[\\da-f]{2}){' + bytes + '})', 'gi'));
  4168. };
  4169. var percentDecode = function (sequence) {
  4170. try {
  4171. return decodeURIComponent(sequence);
  4172. } catch (error) {
  4173. return sequence;
  4174. }
  4175. };
  4176. var deserialize = function (it) {
  4177. var result = it.replace(plus, ' ');
  4178. var bytes = 4;
  4179. try {
  4180. return decodeURIComponent(result);
  4181. } catch (error) {
  4182. while (bytes) {
  4183. result = result.replace(percentSequence(bytes--), percentDecode);
  4184. }
  4185. return result;
  4186. }
  4187. };
  4188. var find = /[!'()~]|%20/g;
  4189. var replace = {
  4190. '!': '%21',
  4191. "'": '%27',
  4192. '(': '%28',
  4193. ')': '%29',
  4194. '~': '%7E',
  4195. '%20': '+'
  4196. };
  4197. var replacer = function (match) {
  4198. return replace[match];
  4199. };
  4200. var serialize = function (it) {
  4201. return encodeURIComponent(it).replace(find, replacer);
  4202. };
  4203. var parseSearchParams = function (result, query) {
  4204. if (query) {
  4205. var attributes = query.split('&');
  4206. var index = 0;
  4207. var attribute, entry;
  4208. while (index < attributes.length) {
  4209. attribute = attributes[index++];
  4210. if (attribute.length) {
  4211. entry = attribute.split('=');
  4212. result.push({
  4213. key: deserialize(entry.shift()),
  4214. value: deserialize(entry.join('='))
  4215. });
  4216. }
  4217. }
  4218. }
  4219. };
  4220. var updateSearchParams = function (query) {
  4221. this.entries.length = 0;
  4222. parseSearchParams(this.entries, query);
  4223. };
  4224. var validateArgumentsLength = function (passed, required) {
  4225. if (passed < required) throw TypeError('Not enough arguments');
  4226. };
  4227. var URLSearchParamsIterator = createIteratorConstructor(function Iterator(params, kind) {
  4228. setInternalState(this, {
  4229. type: URL_SEARCH_PARAMS_ITERATOR,
  4230. iterator: getIterator(getInternalParamsState(params).entries),
  4231. kind: kind
  4232. });
  4233. }, 'Iterator', function next() {
  4234. var state = getInternalIteratorState(this);
  4235. var kind = state.kind;
  4236. var step = state.iterator.next();
  4237. var entry = step.value;
  4238. if (!step.done) {
  4239. step.value = kind === 'keys' ? entry.key : kind === 'values' ? entry.value : [entry.key, entry.value];
  4240. } return step;
  4241. });
  4242. // `URLSearchParams` constructor
  4243. // https://url.spec.whatwg.org/#interface-urlsearchparams
  4244. var URLSearchParamsConstructor = function URLSearchParams(/* init */) {
  4245. anInstance(this, URLSearchParamsConstructor, URL_SEARCH_PARAMS);
  4246. var init = arguments.length > 0 ? arguments[0] : undefined;
  4247. var that = this;
  4248. var entries = [];
  4249. var iteratorMethod, iterator, next, step, entryIterator, entryNext, first, second, key;
  4250. setInternalState(that, {
  4251. type: URL_SEARCH_PARAMS,
  4252. entries: entries,
  4253. updateURL: function () { /* empty */ },
  4254. updateSearchParams: updateSearchParams
  4255. });
  4256. if (init !== undefined) {
  4257. if (isObject(init)) {
  4258. iteratorMethod = getIteratorMethod(init);
  4259. if (iteratorMethod) {
  4260. iterator = getIterator(init, iteratorMethod);
  4261. next = iterator.next;
  4262. while (!(step = next.call(iterator)).done) {
  4263. entryIterator = getIterator(anObject(step.value));
  4264. entryNext = entryIterator.next;
  4265. if (
  4266. (first = entryNext.call(entryIterator)).done ||
  4267. (second = entryNext.call(entryIterator)).done ||
  4268. !entryNext.call(entryIterator).done
  4269. ) throw TypeError('Expected sequence with length 2');
  4270. entries.push({ key: $toString(first.value), value: $toString(second.value) });
  4271. }
  4272. } else for (key in init) if (hasOwn(init, key)) entries.push({ key: key, value: $toString(init[key]) });
  4273. } else {
  4274. parseSearchParams(
  4275. entries,
  4276. typeof init === 'string' ? init.charAt(0) === '?' ? init.slice(1) : init : $toString(init)
  4277. );
  4278. }
  4279. }
  4280. };
  4281. var URLSearchParamsPrototype = URLSearchParamsConstructor.prototype;
  4282. redefineAll(URLSearchParamsPrototype, {
  4283. // `URLSearchParams.prototype.append` method
  4284. // https://url.spec.whatwg.org/#dom-urlsearchparams-append
  4285. append: function append(name, value) {
  4286. validateArgumentsLength(arguments.length, 2);
  4287. var state = getInternalParamsState(this);
  4288. state.entries.push({ key: $toString(name), value: $toString(value) });
  4289. state.updateURL();
  4290. },
  4291. // `URLSearchParams.prototype.delete` method
  4292. // https://url.spec.whatwg.org/#dom-urlsearchparams-delete
  4293. 'delete': function (name) {
  4294. validateArgumentsLength(arguments.length, 1);
  4295. var state = getInternalParamsState(this);
  4296. var entries = state.entries;
  4297. var key = $toString(name);
  4298. var index = 0;
  4299. while (index < entries.length) {
  4300. if (entries[index].key === key) entries.splice(index, 1);
  4301. else index++;
  4302. }
  4303. state.updateURL();
  4304. },
  4305. // `URLSearchParams.prototype.get` method
  4306. // https://url.spec.whatwg.org/#dom-urlsearchparams-get
  4307. get: function get(name) {
  4308. validateArgumentsLength(arguments.length, 1);
  4309. var entries = getInternalParamsState(this).entries;
  4310. var key = $toString(name);
  4311. var index = 0;
  4312. for (; index < entries.length; index++) {
  4313. if (entries[index].key === key) return entries[index].value;
  4314. }
  4315. return null;
  4316. },
  4317. // `URLSearchParams.prototype.getAll` method
  4318. // https://url.spec.whatwg.org/#dom-urlsearchparams-getall
  4319. getAll: function getAll(name) {
  4320. validateArgumentsLength(arguments.length, 1);
  4321. var entries = getInternalParamsState(this).entries;
  4322. var key = $toString(name);
  4323. var result = [];
  4324. var index = 0;
  4325. for (; index < entries.length; index++) {
  4326. if (entries[index].key === key) result.push(entries[index].value);
  4327. }
  4328. return result;
  4329. },
  4330. // `URLSearchParams.prototype.has` method
  4331. // https://url.spec.whatwg.org/#dom-urlsearchparams-has
  4332. has: function has(name) {
  4333. validateArgumentsLength(arguments.length, 1);
  4334. var entries = getInternalParamsState(this).entries;
  4335. var key = $toString(name);
  4336. var index = 0;
  4337. while (index < entries.length) {
  4338. if (entries[index++].key === key) return true;
  4339. }
  4340. return false;
  4341. },
  4342. // `URLSearchParams.prototype.set` method
  4343. // https://url.spec.whatwg.org/#dom-urlsearchparams-set
  4344. set: function set(name, value) {
  4345. validateArgumentsLength(arguments.length, 1);
  4346. var state = getInternalParamsState(this);
  4347. var entries = state.entries;
  4348. var found = false;
  4349. var key = $toString(name);
  4350. var val = $toString(value);
  4351. var index = 0;
  4352. var entry;
  4353. for (; index < entries.length; index++) {
  4354. entry = entries[index];
  4355. if (entry.key === key) {
  4356. if (found) entries.splice(index--, 1);
  4357. else {
  4358. found = true;
  4359. entry.value = val;
  4360. }
  4361. }
  4362. }
  4363. if (!found) entries.push({ key: key, value: val });
  4364. state.updateURL();
  4365. },
  4366. // `URLSearchParams.prototype.sort` method
  4367. // https://url.spec.whatwg.org/#dom-urlsearchparams-sort
  4368. sort: function sort() {
  4369. var state = getInternalParamsState(this);
  4370. var entries = state.entries;
  4371. // Array#sort is not stable in some engines
  4372. var slice = entries.slice();
  4373. var entry, entriesIndex, sliceIndex;
  4374. entries.length = 0;
  4375. for (sliceIndex = 0; sliceIndex < slice.length; sliceIndex++) {
  4376. entry = slice[sliceIndex];
  4377. for (entriesIndex = 0; entriesIndex < sliceIndex; entriesIndex++) {
  4378. if (entries[entriesIndex].key > entry.key) {
  4379. entries.splice(entriesIndex, 0, entry);
  4380. break;
  4381. }
  4382. }
  4383. if (entriesIndex === sliceIndex) entries.push(entry);
  4384. }
  4385. state.updateURL();
  4386. },
  4387. // `URLSearchParams.prototype.forEach` method
  4388. forEach: function forEach(callback /* , thisArg */) {
  4389. var entries = getInternalParamsState(this).entries;
  4390. var boundFunction = bind(callback, arguments.length > 1 ? arguments[1] : undefined, 3);
  4391. var index = 0;
  4392. var entry;
  4393. while (index < entries.length) {
  4394. entry = entries[index++];
  4395. boundFunction(entry.value, entry.key, this);
  4396. }
  4397. },
  4398. // `URLSearchParams.prototype.keys` method
  4399. keys: function keys() {
  4400. return new URLSearchParamsIterator(this, 'keys');
  4401. },
  4402. // `URLSearchParams.prototype.values` method
  4403. values: function values() {
  4404. return new URLSearchParamsIterator(this, 'values');
  4405. },
  4406. // `URLSearchParams.prototype.entries` method
  4407. entries: function entries() {
  4408. return new URLSearchParamsIterator(this, 'entries');
  4409. }
  4410. }, { enumerable: true });
  4411. // `URLSearchParams.prototype[@@iterator]` method
  4412. redefine(URLSearchParamsPrototype, ITERATOR, URLSearchParamsPrototype.entries, { name: 'entries' });
  4413. // `URLSearchParams.prototype.toString` method
  4414. // https://url.spec.whatwg.org/#urlsearchparams-stringification-behavior
  4415. redefine(URLSearchParamsPrototype, 'toString', function toString() {
  4416. var entries = getInternalParamsState(this).entries;
  4417. var result = [];
  4418. var index = 0;
  4419. var entry;
  4420. while (index < entries.length) {
  4421. entry = entries[index++];
  4422. result.push(serialize(entry.key) + '=' + serialize(entry.value));
  4423. } return result.join('&');
  4424. }, { enumerable: true });
  4425. setToStringTag(URLSearchParamsConstructor, URL_SEARCH_PARAMS);
  4426. $({ global: true, forced: !USE_NATIVE_URL }, {
  4427. URLSearchParams: URLSearchParamsConstructor
  4428. });
  4429. // Wrap `fetch` and `Request` for correct work with polyfilled `URLSearchParams`
  4430. if (!USE_NATIVE_URL && isCallable(Headers)) {
  4431. var wrapRequestOptions = function (init) {
  4432. if (isObject(init)) {
  4433. var body = init.body;
  4434. var headers;
  4435. if (classof(body) === URL_SEARCH_PARAMS) {
  4436. headers = init.headers ? new Headers(init.headers) : new Headers();
  4437. if (!headers.has('content-type')) {
  4438. headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8');
  4439. }
  4440. return create(init, {
  4441. body: createPropertyDescriptor(0, String(body)),
  4442. headers: createPropertyDescriptor(0, headers)
  4443. });
  4444. }
  4445. } return init;
  4446. };
  4447. if (isCallable(nativeFetch)) {
  4448. $({ global: true, enumerable: true, forced: true }, {
  4449. fetch: function fetch(input /* , init */) {
  4450. return nativeFetch(input, arguments.length > 1 ? wrapRequestOptions(arguments[1]) : {});
  4451. }
  4452. });
  4453. }
  4454. if (isCallable(NativeRequest)) {
  4455. var RequestConstructor = function Request(input /* , init */) {
  4456. anInstance(this, RequestConstructor, 'Request');
  4457. return new NativeRequest(input, arguments.length > 1 ? wrapRequestOptions(arguments[1]) : {});
  4458. };
  4459. RequestPrototype.constructor = RequestConstructor;
  4460. RequestConstructor.prototype = RequestPrototype;
  4461. $({ global: true, forced: true }, {
  4462. Request: RequestConstructor
  4463. });
  4464. }
  4465. }
  4466. module.exports = {
  4467. URLSearchParams: URLSearchParamsConstructor,
  4468. getState: getInternalParamsState
  4469. };
  4470. /***/ }),
  4471. /***/ "99af":
  4472. /***/ (function(module, exports, __webpack_require__) {
  4473. "use strict";
  4474. var $ = __webpack_require__("23e7");
  4475. var fails = __webpack_require__("d039");
  4476. var isArray = __webpack_require__("e8b5");
  4477. var isObject = __webpack_require__("861d");
  4478. var toObject = __webpack_require__("7b0b");
  4479. var lengthOfArrayLike = __webpack_require__("07fa");
  4480. var createProperty = __webpack_require__("8418");
  4481. var arraySpeciesCreate = __webpack_require__("65f0");
  4482. var arrayMethodHasSpeciesSupport = __webpack_require__("1dde");
  4483. var wellKnownSymbol = __webpack_require__("b622");
  4484. var V8_VERSION = __webpack_require__("2d00");
  4485. var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
  4486. var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
  4487. var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
  4488. // We can't use this feature detection in V8 since it causes
  4489. // deoptimization and serious performance degradation
  4490. // https://github.com/zloirock/core-js/issues/679
  4491. var IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails(function () {
  4492. var array = [];
  4493. array[IS_CONCAT_SPREADABLE] = false;
  4494. return array.concat()[0] !== array;
  4495. });
  4496. var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
  4497. var isConcatSpreadable = function (O) {
  4498. if (!isObject(O)) return false;
  4499. var spreadable = O[IS_CONCAT_SPREADABLE];
  4500. return spreadable !== undefined ? !!spreadable : isArray(O);
  4501. };
  4502. var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
  4503. // `Array.prototype.concat` method
  4504. // https://tc39.es/ecma262/#sec-array.prototype.concat
  4505. // with adding support of @@isConcatSpreadable and @@species
  4506. $({ target: 'Array', proto: true, forced: FORCED }, {
  4507. // eslint-disable-next-line no-unused-vars -- required for `.length`
  4508. concat: function concat(arg) {
  4509. var O = toObject(this);
  4510. var A = arraySpeciesCreate(O, 0);
  4511. var n = 0;
  4512. var i, k, length, len, E;
  4513. for (i = -1, length = arguments.length; i < length; i++) {
  4514. E = i === -1 ? O : arguments[i];
  4515. if (isConcatSpreadable(E)) {
  4516. len = lengthOfArrayLike(E);
  4517. if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  4518. for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
  4519. } else {
  4520. if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  4521. createProperty(A, n++, E);
  4522. }
  4523. }
  4524. A.length = n;
  4525. return A;
  4526. }
  4527. });
  4528. /***/ }),
  4529. /***/ "9a0c":
  4530. /***/ (function(module, exports, __webpack_require__) {
  4531. // https://github.com/zloirock/core-js/issues/280
  4532. var userAgent = __webpack_require__("342f");
  4533. module.exports = /Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(userAgent);
  4534. /***/ }),
  4535. /***/ "9a1f":
  4536. /***/ (function(module, exports, __webpack_require__) {
  4537. var aCallable = __webpack_require__("59ed");
  4538. var anObject = __webpack_require__("825a");
  4539. var getIteratorMethod = __webpack_require__("35a1");
  4540. module.exports = function (argument, usingIterator) {
  4541. var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;
  4542. if (aCallable(iteratorMethod)) return anObject(iteratorMethod.call(argument));
  4543. throw TypeError(String(argument) + ' is not iterable');
  4544. };
  4545. /***/ }),
  4546. /***/ "9bdd":
  4547. /***/ (function(module, exports, __webpack_require__) {
  4548. var anObject = __webpack_require__("825a");
  4549. var iteratorClose = __webpack_require__("2a62");
  4550. // call something on iterator step with safe closing on error
  4551. module.exports = function (iterator, fn, value, ENTRIES) {
  4552. try {
  4553. return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);
  4554. } catch (error) {
  4555. iteratorClose(iterator, 'throw', error);
  4556. }
  4557. };
  4558. /***/ }),
  4559. /***/ "9bf2":
  4560. /***/ (function(module, exports, __webpack_require__) {
  4561. var DESCRIPTORS = __webpack_require__("83ab");
  4562. var IE8_DOM_DEFINE = __webpack_require__("0cfb");
  4563. var anObject = __webpack_require__("825a");
  4564. var toPropertyKey = __webpack_require__("a04b");
  4565. // eslint-disable-next-line es/no-object-defineproperty -- safe
  4566. var $defineProperty = Object.defineProperty;
  4567. // `Object.defineProperty` method
  4568. // https://tc39.es/ecma262/#sec-object.defineproperty
  4569. exports.f = DESCRIPTORS ? $defineProperty : function defineProperty(O, P, Attributes) {
  4570. anObject(O);
  4571. P = toPropertyKey(P);
  4572. anObject(Attributes);
  4573. if (IE8_DOM_DEFINE) try {
  4574. return $defineProperty(O, P, Attributes);
  4575. } catch (error) { /* empty */ }
  4576. if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
  4577. if ('value' in Attributes) O[P] = Attributes.value;
  4578. return O;
  4579. };
  4580. /***/ }),
  4581. /***/ "9ed3":
  4582. /***/ (function(module, exports, __webpack_require__) {
  4583. "use strict";
  4584. var IteratorPrototype = __webpack_require__("ae93").IteratorPrototype;
  4585. var create = __webpack_require__("7c73");
  4586. var createPropertyDescriptor = __webpack_require__("5c6c");
  4587. var setToStringTag = __webpack_require__("d44e");
  4588. var Iterators = __webpack_require__("3f8c");
  4589. var returnThis = function () { return this; };
  4590. module.exports = function (IteratorConstructor, NAME, next) {
  4591. var TO_STRING_TAG = NAME + ' Iterator';
  4592. IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(1, next) });
  4593. setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true);
  4594. Iterators[TO_STRING_TAG] = returnThis;
  4595. return IteratorConstructor;
  4596. };
  4597. /***/ }),
  4598. /***/ "9f7f":
  4599. /***/ (function(module, exports, __webpack_require__) {
  4600. var fails = __webpack_require__("d039");
  4601. var global = __webpack_require__("da84");
  4602. // babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
  4603. var $RegExp = global.RegExp;
  4604. exports.UNSUPPORTED_Y = fails(function () {
  4605. var re = $RegExp('a', 'y');
  4606. re.lastIndex = 2;
  4607. return re.exec('abcd') != null;
  4608. });
  4609. exports.BROKEN_CARET = fails(function () {
  4610. // https://bugzilla.mozilla.org/show_bug.cgi?id=773687
  4611. var re = $RegExp('^r', 'gy');
  4612. re.lastIndex = 2;
  4613. return re.exec('str') != null;
  4614. });
  4615. /***/ }),
  4616. /***/ "a04b":
  4617. /***/ (function(module, exports, __webpack_require__) {
  4618. var toPrimitive = __webpack_require__("c04e");
  4619. var isSymbol = __webpack_require__("d9b5");
  4620. // `ToPropertyKey` abstract operation
  4621. // https://tc39.es/ecma262/#sec-topropertykey
  4622. module.exports = function (argument) {
  4623. var key = toPrimitive(argument, 'string');
  4624. return isSymbol(key) ? key : String(key);
  4625. };
  4626. /***/ }),
  4627. /***/ "a15b":
  4628. /***/ (function(module, exports, __webpack_require__) {
  4629. "use strict";
  4630. var $ = __webpack_require__("23e7");
  4631. var IndexedObject = __webpack_require__("44ad");
  4632. var toIndexedObject = __webpack_require__("fc6a");
  4633. var arrayMethodIsStrict = __webpack_require__("a640");
  4634. var nativeJoin = [].join;
  4635. var ES3_STRINGS = IndexedObject != Object;
  4636. var STRICT_METHOD = arrayMethodIsStrict('join', ',');
  4637. // `Array.prototype.join` method
  4638. // https://tc39.es/ecma262/#sec-array.prototype.join
  4639. $({ target: 'Array', proto: true, forced: ES3_STRINGS || !STRICT_METHOD }, {
  4640. join: function join(separator) {
  4641. return nativeJoin.call(toIndexedObject(this), separator === undefined ? ',' : separator);
  4642. }
  4643. });
  4644. /***/ }),
  4645. /***/ "a434":
  4646. /***/ (function(module, exports, __webpack_require__) {
  4647. "use strict";
  4648. var $ = __webpack_require__("23e7");
  4649. var toAbsoluteIndex = __webpack_require__("23cb");
  4650. var toIntegerOrInfinity = __webpack_require__("5926");
  4651. var lengthOfArrayLike = __webpack_require__("07fa");
  4652. var toObject = __webpack_require__("7b0b");
  4653. var arraySpeciesCreate = __webpack_require__("65f0");
  4654. var createProperty = __webpack_require__("8418");
  4655. var arrayMethodHasSpeciesSupport = __webpack_require__("1dde");
  4656. var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('splice');
  4657. var max = Math.max;
  4658. var min = Math.min;
  4659. var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
  4660. var MAXIMUM_ALLOWED_LENGTH_EXCEEDED = 'Maximum allowed length exceeded';
  4661. // `Array.prototype.splice` method
  4662. // https://tc39.es/ecma262/#sec-array.prototype.splice
  4663. // with adding support of @@species
  4664. $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
  4665. splice: function splice(start, deleteCount /* , ...items */) {
  4666. var O = toObject(this);
  4667. var len = lengthOfArrayLike(O);
  4668. var actualStart = toAbsoluteIndex(start, len);
  4669. var argumentsLength = arguments.length;
  4670. var insertCount, actualDeleteCount, A, k, from, to;
  4671. if (argumentsLength === 0) {
  4672. insertCount = actualDeleteCount = 0;
  4673. } else if (argumentsLength === 1) {
  4674. insertCount = 0;
  4675. actualDeleteCount = len - actualStart;
  4676. } else {
  4677. insertCount = argumentsLength - 2;
  4678. actualDeleteCount = min(max(toIntegerOrInfinity(deleteCount), 0), len - actualStart);
  4679. }
  4680. if (len + insertCount - actualDeleteCount > MAX_SAFE_INTEGER) {
  4681. throw TypeError(MAXIMUM_ALLOWED_LENGTH_EXCEEDED);
  4682. }
  4683. A = arraySpeciesCreate(O, actualDeleteCount);
  4684. for (k = 0; k < actualDeleteCount; k++) {
  4685. from = actualStart + k;
  4686. if (from in O) createProperty(A, k, O[from]);
  4687. }
  4688. A.length = actualDeleteCount;
  4689. if (insertCount < actualDeleteCount) {
  4690. for (k = actualStart; k < len - actualDeleteCount; k++) {
  4691. from = k + actualDeleteCount;
  4692. to = k + insertCount;
  4693. if (from in O) O[to] = O[from];
  4694. else delete O[to];
  4695. }
  4696. for (k = len; k > len - actualDeleteCount + insertCount; k--) delete O[k - 1];
  4697. } else if (insertCount > actualDeleteCount) {
  4698. for (k = len - actualDeleteCount; k > actualStart; k--) {
  4699. from = k + actualDeleteCount - 1;
  4700. to = k + insertCount - 1;
  4701. if (from in O) O[to] = O[from];
  4702. else delete O[to];
  4703. }
  4704. }
  4705. for (k = 0; k < insertCount; k++) {
  4706. O[k + actualStart] = arguments[k + 2];
  4707. }
  4708. O.length = len - actualDeleteCount + insertCount;
  4709. return A;
  4710. }
  4711. });
  4712. /***/ }),
  4713. /***/ "a4b4":
  4714. /***/ (function(module, exports, __webpack_require__) {
  4715. var userAgent = __webpack_require__("342f");
  4716. module.exports = /web0s(?!.*chrome)/i.test(userAgent);
  4717. /***/ }),
  4718. /***/ "a4d3":
  4719. /***/ (function(module, exports, __webpack_require__) {
  4720. "use strict";
  4721. var $ = __webpack_require__("23e7");
  4722. var global = __webpack_require__("da84");
  4723. var getBuiltIn = __webpack_require__("d066");
  4724. var IS_PURE = __webpack_require__("c430");
  4725. var DESCRIPTORS = __webpack_require__("83ab");
  4726. var NATIVE_SYMBOL = __webpack_require__("4930");
  4727. var fails = __webpack_require__("d039");
  4728. var hasOwn = __webpack_require__("1a2d");
  4729. var isArray = __webpack_require__("e8b5");
  4730. var isCallable = __webpack_require__("1626");
  4731. var isObject = __webpack_require__("861d");
  4732. var isSymbol = __webpack_require__("d9b5");
  4733. var anObject = __webpack_require__("825a");
  4734. var toObject = __webpack_require__("7b0b");
  4735. var toIndexedObject = __webpack_require__("fc6a");
  4736. var toPropertyKey = __webpack_require__("a04b");
  4737. var $toString = __webpack_require__("577e");
  4738. var createPropertyDescriptor = __webpack_require__("5c6c");
  4739. var nativeObjectCreate = __webpack_require__("7c73");
  4740. var objectKeys = __webpack_require__("df75");
  4741. var getOwnPropertyNamesModule = __webpack_require__("241c");
  4742. var getOwnPropertyNamesExternal = __webpack_require__("057f");
  4743. var getOwnPropertySymbolsModule = __webpack_require__("7418");
  4744. var getOwnPropertyDescriptorModule = __webpack_require__("06cf");
  4745. var definePropertyModule = __webpack_require__("9bf2");
  4746. var propertyIsEnumerableModule = __webpack_require__("d1e7");
  4747. var redefine = __webpack_require__("6eeb");
  4748. var shared = __webpack_require__("5692");
  4749. var sharedKey = __webpack_require__("f772");
  4750. var hiddenKeys = __webpack_require__("d012");
  4751. var uid = __webpack_require__("90e3");
  4752. var wellKnownSymbol = __webpack_require__("b622");
  4753. var wrappedWellKnownSymbolModule = __webpack_require__("e538");
  4754. var defineWellKnownSymbol = __webpack_require__("746f");
  4755. var setToStringTag = __webpack_require__("d44e");
  4756. var InternalStateModule = __webpack_require__("69f3");
  4757. var $forEach = __webpack_require__("b727").forEach;
  4758. var HIDDEN = sharedKey('hidden');
  4759. var SYMBOL = 'Symbol';
  4760. var PROTOTYPE = 'prototype';
  4761. var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
  4762. var setInternalState = InternalStateModule.set;
  4763. var getInternalState = InternalStateModule.getterFor(SYMBOL);
  4764. var ObjectPrototype = Object[PROTOTYPE];
  4765. var $Symbol = global.Symbol;
  4766. var $stringify = getBuiltIn('JSON', 'stringify');
  4767. var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
  4768. var nativeDefineProperty = definePropertyModule.f;
  4769. var nativeGetOwnPropertyNames = getOwnPropertyNamesExternal.f;
  4770. var nativePropertyIsEnumerable = propertyIsEnumerableModule.f;
  4771. var AllSymbols = shared('symbols');
  4772. var ObjectPrototypeSymbols = shared('op-symbols');
  4773. var StringToSymbolRegistry = shared('string-to-symbol-registry');
  4774. var SymbolToStringRegistry = shared('symbol-to-string-registry');
  4775. var WellKnownSymbolsStore = shared('wks');
  4776. var QObject = global.QObject;
  4777. // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
  4778. var USE_SETTER = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
  4779. // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
  4780. var setSymbolDescriptor = DESCRIPTORS && fails(function () {
  4781. return nativeObjectCreate(nativeDefineProperty({}, 'a', {
  4782. get: function () { return nativeDefineProperty(this, 'a', { value: 7 }).a; }
  4783. })).a != 7;
  4784. }) ? function (O, P, Attributes) {
  4785. var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor(ObjectPrototype, P);
  4786. if (ObjectPrototypeDescriptor) delete ObjectPrototype[P];
  4787. nativeDefineProperty(O, P, Attributes);
  4788. if (ObjectPrototypeDescriptor && O !== ObjectPrototype) {
  4789. nativeDefineProperty(ObjectPrototype, P, ObjectPrototypeDescriptor);
  4790. }
  4791. } : nativeDefineProperty;
  4792. var wrap = function (tag, description) {
  4793. var symbol = AllSymbols[tag] = nativeObjectCreate($Symbol[PROTOTYPE]);
  4794. setInternalState(symbol, {
  4795. type: SYMBOL,
  4796. tag: tag,
  4797. description: description
  4798. });
  4799. if (!DESCRIPTORS) symbol.description = description;
  4800. return symbol;
  4801. };
  4802. var $defineProperty = function defineProperty(O, P, Attributes) {
  4803. if (O === ObjectPrototype) $defineProperty(ObjectPrototypeSymbols, P, Attributes);
  4804. anObject(O);
  4805. var key = toPropertyKey(P);
  4806. anObject(Attributes);
  4807. if (hasOwn(AllSymbols, key)) {
  4808. if (!Attributes.enumerable) {
  4809. if (!hasOwn(O, HIDDEN)) nativeDefineProperty(O, HIDDEN, createPropertyDescriptor(1, {}));
  4810. O[HIDDEN][key] = true;
  4811. } else {
  4812. if (hasOwn(O, HIDDEN) && O[HIDDEN][key]) O[HIDDEN][key] = false;
  4813. Attributes = nativeObjectCreate(Attributes, { enumerable: createPropertyDescriptor(0, false) });
  4814. } return setSymbolDescriptor(O, key, Attributes);
  4815. } return nativeDefineProperty(O, key, Attributes);
  4816. };
  4817. var $defineProperties = function defineProperties(O, Properties) {
  4818. anObject(O);
  4819. var properties = toIndexedObject(Properties);
  4820. var keys = objectKeys(properties).concat($getOwnPropertySymbols(properties));
  4821. $forEach(keys, function (key) {
  4822. if (!DESCRIPTORS || $propertyIsEnumerable.call(properties, key)) $defineProperty(O, key, properties[key]);
  4823. });
  4824. return O;
  4825. };
  4826. var $create = function create(O, Properties) {
  4827. return Properties === undefined ? nativeObjectCreate(O) : $defineProperties(nativeObjectCreate(O), Properties);
  4828. };
  4829. var $propertyIsEnumerable = function propertyIsEnumerable(V) {
  4830. var P = toPropertyKey(V);
  4831. var enumerable = nativePropertyIsEnumerable.call(this, P);
  4832. if (this === ObjectPrototype && hasOwn(AllSymbols, P) && !hasOwn(ObjectPrototypeSymbols, P)) return false;
  4833. return enumerable || !hasOwn(this, P) || !hasOwn(AllSymbols, P) || hasOwn(this, HIDDEN) && this[HIDDEN][P]
  4834. ? enumerable : true;
  4835. };
  4836. var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(O, P) {
  4837. var it = toIndexedObject(O);
  4838. var key = toPropertyKey(P);
  4839. if (it === ObjectPrototype && hasOwn(AllSymbols, key) && !hasOwn(ObjectPrototypeSymbols, key)) return;
  4840. var descriptor = nativeGetOwnPropertyDescriptor(it, key);
  4841. if (descriptor && hasOwn(AllSymbols, key) && !(hasOwn(it, HIDDEN) && it[HIDDEN][key])) {
  4842. descriptor.enumerable = true;
  4843. }
  4844. return descriptor;
  4845. };
  4846. var $getOwnPropertyNames = function getOwnPropertyNames(O) {
  4847. var names = nativeGetOwnPropertyNames(toIndexedObject(O));
  4848. var result = [];
  4849. $forEach(names, function (key) {
  4850. if (!hasOwn(AllSymbols, key) && !hasOwn(hiddenKeys, key)) result.push(key);
  4851. });
  4852. return result;
  4853. };
  4854. var $getOwnPropertySymbols = function getOwnPropertySymbols(O) {
  4855. var IS_OBJECT_PROTOTYPE = O === ObjectPrototype;
  4856. var names = nativeGetOwnPropertyNames(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject(O));
  4857. var result = [];
  4858. $forEach(names, function (key) {
  4859. if (hasOwn(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || hasOwn(ObjectPrototype, key))) {
  4860. result.push(AllSymbols[key]);
  4861. }
  4862. });
  4863. return result;
  4864. };
  4865. // `Symbol` constructor
  4866. // https://tc39.es/ecma262/#sec-symbol-constructor
  4867. if (!NATIVE_SYMBOL) {
  4868. $Symbol = function Symbol() {
  4869. if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor');
  4870. var description = !arguments.length || arguments[0] === undefined ? undefined : $toString(arguments[0]);
  4871. var tag = uid(description);
  4872. var setter = function (value) {
  4873. if (this === ObjectPrototype) setter.call(ObjectPrototypeSymbols, value);
  4874. if (hasOwn(this, HIDDEN) && hasOwn(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
  4875. setSymbolDescriptor(this, tag, createPropertyDescriptor(1, value));
  4876. };
  4877. if (DESCRIPTORS && USE_SETTER) setSymbolDescriptor(ObjectPrototype, tag, { configurable: true, set: setter });
  4878. return wrap(tag, description);
  4879. };
  4880. redefine($Symbol[PROTOTYPE], 'toString', function toString() {
  4881. return getInternalState(this).tag;
  4882. });
  4883. redefine($Symbol, 'withoutSetter', function (description) {
  4884. return wrap(uid(description), description);
  4885. });
  4886. propertyIsEnumerableModule.f = $propertyIsEnumerable;
  4887. definePropertyModule.f = $defineProperty;
  4888. getOwnPropertyDescriptorModule.f = $getOwnPropertyDescriptor;
  4889. getOwnPropertyNamesModule.f = getOwnPropertyNamesExternal.f = $getOwnPropertyNames;
  4890. getOwnPropertySymbolsModule.f = $getOwnPropertySymbols;
  4891. wrappedWellKnownSymbolModule.f = function (name) {
  4892. return wrap(wellKnownSymbol(name), name);
  4893. };
  4894. if (DESCRIPTORS) {
  4895. // https://github.com/tc39/proposal-Symbol-description
  4896. nativeDefineProperty($Symbol[PROTOTYPE], 'description', {
  4897. configurable: true,
  4898. get: function description() {
  4899. return getInternalState(this).description;
  4900. }
  4901. });
  4902. if (!IS_PURE) {
  4903. redefine(ObjectPrototype, 'propertyIsEnumerable', $propertyIsEnumerable, { unsafe: true });
  4904. }
  4905. }
  4906. }
  4907. $({ global: true, wrap: true, forced: !NATIVE_SYMBOL, sham: !NATIVE_SYMBOL }, {
  4908. Symbol: $Symbol
  4909. });
  4910. $forEach(objectKeys(WellKnownSymbolsStore), function (name) {
  4911. defineWellKnownSymbol(name);
  4912. });
  4913. $({ target: SYMBOL, stat: true, forced: !NATIVE_SYMBOL }, {
  4914. // `Symbol.for` method
  4915. // https://tc39.es/ecma262/#sec-symbol.for
  4916. 'for': function (key) {
  4917. var string = $toString(key);
  4918. if (hasOwn(StringToSymbolRegistry, string)) return StringToSymbolRegistry[string];
  4919. var symbol = $Symbol(string);
  4920. StringToSymbolRegistry[string] = symbol;
  4921. SymbolToStringRegistry[symbol] = string;
  4922. return symbol;
  4923. },
  4924. // `Symbol.keyFor` method
  4925. // https://tc39.es/ecma262/#sec-symbol.keyfor
  4926. keyFor: function keyFor(sym) {
  4927. if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol');
  4928. if (hasOwn(SymbolToStringRegistry, sym)) return SymbolToStringRegistry[sym];
  4929. },
  4930. useSetter: function () { USE_SETTER = true; },
  4931. useSimple: function () { USE_SETTER = false; }
  4932. });
  4933. $({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL, sham: !DESCRIPTORS }, {
  4934. // `Object.create` method
  4935. // https://tc39.es/ecma262/#sec-object.create
  4936. create: $create,
  4937. // `Object.defineProperty` method
  4938. // https://tc39.es/ecma262/#sec-object.defineproperty
  4939. defineProperty: $defineProperty,
  4940. // `Object.defineProperties` method
  4941. // https://tc39.es/ecma262/#sec-object.defineproperties
  4942. defineProperties: $defineProperties,
  4943. // `Object.getOwnPropertyDescriptor` method
  4944. // https://tc39.es/ecma262/#sec-object.getownpropertydescriptors
  4945. getOwnPropertyDescriptor: $getOwnPropertyDescriptor
  4946. });
  4947. $({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL }, {
  4948. // `Object.getOwnPropertyNames` method
  4949. // https://tc39.es/ecma262/#sec-object.getownpropertynames
  4950. getOwnPropertyNames: $getOwnPropertyNames,
  4951. // `Object.getOwnPropertySymbols` method
  4952. // https://tc39.es/ecma262/#sec-object.getownpropertysymbols
  4953. getOwnPropertySymbols: $getOwnPropertySymbols
  4954. });
  4955. // Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives
  4956. // https://bugs.chromium.org/p/v8/issues/detail?id=3443
  4957. $({ target: 'Object', stat: true, forced: fails(function () { getOwnPropertySymbolsModule.f(1); }) }, {
  4958. getOwnPropertySymbols: function getOwnPropertySymbols(it) {
  4959. return getOwnPropertySymbolsModule.f(toObject(it));
  4960. }
  4961. });
  4962. // `JSON.stringify` method behavior with symbols
  4963. // https://tc39.es/ecma262/#sec-json.stringify
  4964. if ($stringify) {
  4965. var FORCED_JSON_STRINGIFY = !NATIVE_SYMBOL || fails(function () {
  4966. var symbol = $Symbol();
  4967. // MS Edge converts symbol values to JSON as {}
  4968. return $stringify([symbol]) != '[null]'
  4969. // WebKit converts symbol values to JSON as null
  4970. || $stringify({ a: symbol }) != '{}'
  4971. // V8 throws on boxed symbols
  4972. || $stringify(Object(symbol)) != '{}';
  4973. });
  4974. $({ target: 'JSON', stat: true, forced: FORCED_JSON_STRINGIFY }, {
  4975. // eslint-disable-next-line no-unused-vars -- required for `.length`
  4976. stringify: function stringify(it, replacer, space) {
  4977. var args = [it];
  4978. var index = 1;
  4979. var $replacer;
  4980. while (arguments.length > index) args.push(arguments[index++]);
  4981. $replacer = replacer;
  4982. if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined
  4983. if (!isArray(replacer)) replacer = function (key, value) {
  4984. if (isCallable($replacer)) value = $replacer.call(this, key, value);
  4985. if (!isSymbol(value)) return value;
  4986. };
  4987. args[1] = replacer;
  4988. return $stringify.apply(null, args);
  4989. }
  4990. });
  4991. }
  4992. // `Symbol.prototype[@@toPrimitive]` method
  4993. // https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive
  4994. if (!$Symbol[PROTOTYPE][TO_PRIMITIVE]) {
  4995. var valueOf = $Symbol[PROTOTYPE].valueOf;
  4996. redefine($Symbol[PROTOTYPE], TO_PRIMITIVE, function () {
  4997. return valueOf.apply(this, arguments);
  4998. });
  4999. }
  5000. // `Symbol.prototype[@@toStringTag]` property
  5001. // https://tc39.es/ecma262/#sec-symbol.prototype-@@tostringtag
  5002. setToStringTag($Symbol, SYMBOL);
  5003. hiddenKeys[HIDDEN] = true;
  5004. /***/ }),
  5005. /***/ "a630":
  5006. /***/ (function(module, exports, __webpack_require__) {
  5007. var $ = __webpack_require__("23e7");
  5008. var from = __webpack_require__("4df4");
  5009. var checkCorrectnessOfIteration = __webpack_require__("1c7e");
  5010. var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function (iterable) {
  5011. // eslint-disable-next-line es/no-array-from -- required for testing
  5012. Array.from(iterable);
  5013. });
  5014. // `Array.from` method
  5015. // https://tc39.es/ecma262/#sec-array.from
  5016. $({ target: 'Array', stat: true, forced: INCORRECT_ITERATION }, {
  5017. from: from
  5018. });
  5019. /***/ }),
  5020. /***/ "a640":
  5021. /***/ (function(module, exports, __webpack_require__) {
  5022. "use strict";
  5023. var fails = __webpack_require__("d039");
  5024. module.exports = function (METHOD_NAME, argument) {
  5025. var method = [][METHOD_NAME];
  5026. return !!method && fails(function () {
  5027. // eslint-disable-next-line no-useless-call,no-throw-literal -- required for testing
  5028. method.call(null, argument || function () { throw 1; }, 1);
  5029. });
  5030. };
  5031. /***/ }),
  5032. /***/ "a79d":
  5033. /***/ (function(module, exports, __webpack_require__) {
  5034. "use strict";
  5035. var $ = __webpack_require__("23e7");
  5036. var IS_PURE = __webpack_require__("c430");
  5037. var NativePromise = __webpack_require__("fea9");
  5038. var fails = __webpack_require__("d039");
  5039. var getBuiltIn = __webpack_require__("d066");
  5040. var isCallable = __webpack_require__("1626");
  5041. var speciesConstructor = __webpack_require__("4840");
  5042. var promiseResolve = __webpack_require__("cdf9");
  5043. var redefine = __webpack_require__("6eeb");
  5044. // Safari bug https://bugs.webkit.org/show_bug.cgi?id=200829
  5045. var NON_GENERIC = !!NativePromise && fails(function () {
  5046. NativePromise.prototype['finally'].call({ then: function () { /* empty */ } }, function () { /* empty */ });
  5047. });
  5048. // `Promise.prototype.finally` method
  5049. // https://tc39.es/ecma262/#sec-promise.prototype.finally
  5050. $({ target: 'Promise', proto: true, real: true, forced: NON_GENERIC }, {
  5051. 'finally': function (onFinally) {
  5052. var C = speciesConstructor(this, getBuiltIn('Promise'));
  5053. var isFunction = isCallable(onFinally);
  5054. return this.then(
  5055. isFunction ? function (x) {
  5056. return promiseResolve(C, onFinally()).then(function () { return x; });
  5057. } : onFinally,
  5058. isFunction ? function (e) {
  5059. return promiseResolve(C, onFinally()).then(function () { throw e; });
  5060. } : onFinally
  5061. );
  5062. }
  5063. });
  5064. // makes sure that native promise-based APIs `Promise#finally` properly works with patched `Promise#then`
  5065. if (!IS_PURE && isCallable(NativePromise)) {
  5066. var method = getBuiltIn('Promise').prototype['finally'];
  5067. if (NativePromise.prototype['finally'] !== method) {
  5068. redefine(NativePromise.prototype, 'finally', method, { unsafe: true });
  5069. }
  5070. }
  5071. /***/ }),
  5072. /***/ "a9e3":
  5073. /***/ (function(module, exports, __webpack_require__) {
  5074. "use strict";
  5075. var DESCRIPTORS = __webpack_require__("83ab");
  5076. var global = __webpack_require__("da84");
  5077. var isForced = __webpack_require__("94ca");
  5078. var redefine = __webpack_require__("6eeb");
  5079. var hasOwn = __webpack_require__("1a2d");
  5080. var inheritIfRequired = __webpack_require__("7156");
  5081. var isSymbol = __webpack_require__("d9b5");
  5082. var toPrimitive = __webpack_require__("c04e");
  5083. var fails = __webpack_require__("d039");
  5084. var getOwnPropertyNames = __webpack_require__("241c").f;
  5085. var getOwnPropertyDescriptor = __webpack_require__("06cf").f;
  5086. var defineProperty = __webpack_require__("9bf2").f;
  5087. var thisNumberValue = __webpack_require__("408a");
  5088. var trim = __webpack_require__("58a8").trim;
  5089. var NUMBER = 'Number';
  5090. var NativeNumber = global[NUMBER];
  5091. var NumberPrototype = NativeNumber.prototype;
  5092. // `ToNumeric` abstract operation
  5093. // https://tc39.es/ecma262/#sec-tonumeric
  5094. var toNumeric = function (value) {
  5095. var primValue = toPrimitive(value, 'number');
  5096. return typeof primValue === 'bigint' ? primValue : toNumber(primValue);
  5097. };
  5098. // `ToNumber` abstract operation
  5099. // https://tc39.es/ecma262/#sec-tonumber
  5100. var toNumber = function (argument) {
  5101. var it = toPrimitive(argument, 'number');
  5102. var first, third, radix, maxCode, digits, length, index, code;
  5103. if (isSymbol(it)) throw TypeError('Cannot convert a Symbol value to a number');
  5104. if (typeof it == 'string' && it.length > 2) {
  5105. it = trim(it);
  5106. first = it.charCodeAt(0);
  5107. if (first === 43 || first === 45) {
  5108. third = it.charCodeAt(2);
  5109. if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix
  5110. } else if (first === 48) {
  5111. switch (it.charCodeAt(1)) {
  5112. case 66: case 98: radix = 2; maxCode = 49; break; // fast equal of /^0b[01]+$/i
  5113. case 79: case 111: radix = 8; maxCode = 55; break; // fast equal of /^0o[0-7]+$/i
  5114. default: return +it;
  5115. }
  5116. digits = it.slice(2);
  5117. length = digits.length;
  5118. for (index = 0; index < length; index++) {
  5119. code = digits.charCodeAt(index);
  5120. // parseInt parses a string to a first unavailable symbol
  5121. // but ToNumber should return NaN if a string contains unavailable symbols
  5122. if (code < 48 || code > maxCode) return NaN;
  5123. } return parseInt(digits, radix);
  5124. }
  5125. } return +it;
  5126. };
  5127. // `Number` constructor
  5128. // https://tc39.es/ecma262/#sec-number-constructor
  5129. if (isForced(NUMBER, !NativeNumber(' 0o1') || !NativeNumber('0b1') || NativeNumber('+0x1'))) {
  5130. var NumberWrapper = function Number(value) {
  5131. var n = arguments.length < 1 ? 0 : NativeNumber(toNumeric(value));
  5132. var dummy = this;
  5133. // check on 1..constructor(foo) case
  5134. return dummy instanceof NumberWrapper && fails(function () { thisNumberValue(dummy); })
  5135. ? inheritIfRequired(Object(n), dummy, NumberWrapper) : n;
  5136. };
  5137. for (var keys = DESCRIPTORS ? getOwnPropertyNames(NativeNumber) : (
  5138. // ES3:
  5139. 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' +
  5140. // ES2015 (in case, if modules with ES2015 Number statics required before):
  5141. 'EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,' +
  5142. // ESNext
  5143. 'fromString,range'
  5144. ).split(','), j = 0, key; keys.length > j; j++) {
  5145. if (hasOwn(NativeNumber, key = keys[j]) && !hasOwn(NumberWrapper, key)) {
  5146. defineProperty(NumberWrapper, key, getOwnPropertyDescriptor(NativeNumber, key));
  5147. }
  5148. }
  5149. NumberWrapper.prototype = NumberPrototype;
  5150. NumberPrototype.constructor = NumberWrapper;
  5151. redefine(global, NUMBER, NumberWrapper);
  5152. }
  5153. /***/ }),
  5154. /***/ "ab13":
  5155. /***/ (function(module, exports, __webpack_require__) {
  5156. var wellKnownSymbol = __webpack_require__("b622");
  5157. var MATCH = wellKnownSymbol('match');
  5158. module.exports = function (METHOD_NAME) {
  5159. var regexp = /./;
  5160. try {
  5161. '/./'[METHOD_NAME](regexp);
  5162. } catch (error1) {
  5163. try {
  5164. regexp[MATCH] = false;
  5165. return '/./'[METHOD_NAME](regexp);
  5166. } catch (error2) { /* empty */ }
  5167. } return false;
  5168. };
  5169. /***/ }),
  5170. /***/ "ac1f":
  5171. /***/ (function(module, exports, __webpack_require__) {
  5172. "use strict";
  5173. var $ = __webpack_require__("23e7");
  5174. var exec = __webpack_require__("9263");
  5175. // `RegExp.prototype.exec` method
  5176. // https://tc39.es/ecma262/#sec-regexp.prototype.exec
  5177. $({ target: 'RegExp', proto: true, forced: /./.exec !== exec }, {
  5178. exec: exec
  5179. });
  5180. /***/ }),
  5181. /***/ "ad6d":
  5182. /***/ (function(module, exports, __webpack_require__) {
  5183. "use strict";
  5184. var anObject = __webpack_require__("825a");
  5185. // `RegExp.prototype.flags` getter implementation
  5186. // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
  5187. module.exports = function () {
  5188. var that = anObject(this);
  5189. var result = '';
  5190. if (that.global) result += 'g';
  5191. if (that.ignoreCase) result += 'i';
  5192. if (that.multiline) result += 'm';
  5193. if (that.dotAll) result += 's';
  5194. if (that.unicode) result += 'u';
  5195. if (that.sticky) result += 'y';
  5196. return result;
  5197. };
  5198. /***/ }),
  5199. /***/ "addb":
  5200. /***/ (function(module, exports) {
  5201. // TODO: use something more complex like timsort?
  5202. var floor = Math.floor;
  5203. var mergeSort = function (array, comparefn) {
  5204. var length = array.length;
  5205. var middle = floor(length / 2);
  5206. return length < 8 ? insertionSort(array, comparefn) : merge(
  5207. mergeSort(array.slice(0, middle), comparefn),
  5208. mergeSort(array.slice(middle), comparefn),
  5209. comparefn
  5210. );
  5211. };
  5212. var insertionSort = function (array, comparefn) {
  5213. var length = array.length;
  5214. var i = 1;
  5215. var element, j;
  5216. while (i < length) {
  5217. j = i;
  5218. element = array[i];
  5219. while (j && comparefn(array[j - 1], element) > 0) {
  5220. array[j] = array[--j];
  5221. }
  5222. if (j !== i++) array[j] = element;
  5223. } return array;
  5224. };
  5225. var merge = function (left, right, comparefn) {
  5226. var llength = left.length;
  5227. var rlength = right.length;
  5228. var lindex = 0;
  5229. var rindex = 0;
  5230. var result = [];
  5231. while (lindex < llength || rindex < rlength) {
  5232. if (lindex < llength && rindex < rlength) {
  5233. result.push(comparefn(left[lindex], right[rindex]) <= 0 ? left[lindex++] : right[rindex++]);
  5234. } else {
  5235. result.push(lindex < llength ? left[lindex++] : right[rindex++]);
  5236. }
  5237. } return result;
  5238. };
  5239. module.exports = mergeSort;
  5240. /***/ }),
  5241. /***/ "ae93":
  5242. /***/ (function(module, exports, __webpack_require__) {
  5243. "use strict";
  5244. var fails = __webpack_require__("d039");
  5245. var isCallable = __webpack_require__("1626");
  5246. var create = __webpack_require__("7c73");
  5247. var getPrototypeOf = __webpack_require__("e163");
  5248. var redefine = __webpack_require__("6eeb");
  5249. var wellKnownSymbol = __webpack_require__("b622");
  5250. var IS_PURE = __webpack_require__("c430");
  5251. var ITERATOR = wellKnownSymbol('iterator');
  5252. var BUGGY_SAFARI_ITERATORS = false;
  5253. // `%IteratorPrototype%` object
  5254. // https://tc39.es/ecma262/#sec-%iteratorprototype%-object
  5255. var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;
  5256. /* eslint-disable es/no-array-prototype-keys -- safe */
  5257. if ([].keys) {
  5258. arrayIterator = [].keys();
  5259. // Safari 8 has buggy iterators w/o `next`
  5260. if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;
  5261. else {
  5262. PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator));
  5263. if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;
  5264. }
  5265. }
  5266. var NEW_ITERATOR_PROTOTYPE = IteratorPrototype == undefined || fails(function () {
  5267. var test = {};
  5268. // FF44- legacy iterators case
  5269. return IteratorPrototype[ITERATOR].call(test) !== test;
  5270. });
  5271. if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype = {};
  5272. else if (IS_PURE) IteratorPrototype = create(IteratorPrototype);
  5273. // `%IteratorPrototype%[@@iterator]()` method
  5274. // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
  5275. if (!isCallable(IteratorPrototype[ITERATOR])) {
  5276. redefine(IteratorPrototype, ITERATOR, function () {
  5277. return this;
  5278. });
  5279. }
  5280. module.exports = {
  5281. IteratorPrototype: IteratorPrototype,
  5282. BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS
  5283. };
  5284. /***/ }),
  5285. /***/ "af03":
  5286. /***/ (function(module, exports, __webpack_require__) {
  5287. var fails = __webpack_require__("d039");
  5288. // check the existence of a method, lowercase
  5289. // of a tag and escaping quotes in arguments
  5290. module.exports = function (METHOD_NAME) {
  5291. return fails(function () {
  5292. var test = ''[METHOD_NAME]('"');
  5293. return test !== test.toLowerCase() || test.split('"').length > 3;
  5294. });
  5295. };
  5296. /***/ }),
  5297. /***/ "b041":
  5298. /***/ (function(module, exports, __webpack_require__) {
  5299. "use strict";
  5300. var TO_STRING_TAG_SUPPORT = __webpack_require__("00ee");
  5301. var classof = __webpack_require__("f5df");
  5302. // `Object.prototype.toString` method implementation
  5303. // https://tc39.es/ecma262/#sec-object.prototype.tostring
  5304. module.exports = TO_STRING_TAG_SUPPORT ? {}.toString : function toString() {
  5305. return '[object ' + classof(this) + ']';
  5306. };
  5307. /***/ }),
  5308. /***/ "b0c0":
  5309. /***/ (function(module, exports, __webpack_require__) {
  5310. var DESCRIPTORS = __webpack_require__("83ab");
  5311. var FUNCTION_NAME_EXISTS = __webpack_require__("5e77").EXISTS;
  5312. var defineProperty = __webpack_require__("9bf2").f;
  5313. var FunctionPrototype = Function.prototype;
  5314. var FunctionPrototypeToString = FunctionPrototype.toString;
  5315. var nameRE = /^\s*function ([^ (]*)/;
  5316. var NAME = 'name';
  5317. // Function instances `.name` property
  5318. // https://tc39.es/ecma262/#sec-function-instances-name
  5319. if (DESCRIPTORS && !FUNCTION_NAME_EXISTS) {
  5320. defineProperty(FunctionPrototype, NAME, {
  5321. configurable: true,
  5322. get: function () {
  5323. try {
  5324. return FunctionPrototypeToString.call(this).match(nameRE)[1];
  5325. } catch (error) {
  5326. return '';
  5327. }
  5328. }
  5329. });
  5330. }
  5331. /***/ }),
  5332. /***/ "b575":
  5333. /***/ (function(module, exports, __webpack_require__) {
  5334. var global = __webpack_require__("da84");
  5335. var getOwnPropertyDescriptor = __webpack_require__("06cf").f;
  5336. var macrotask = __webpack_require__("2cf4").set;
  5337. var IS_IOS = __webpack_require__("1cdc");
  5338. var IS_IOS_PEBBLE = __webpack_require__("d4c3");
  5339. var IS_WEBOS_WEBKIT = __webpack_require__("a4b4");
  5340. var IS_NODE = __webpack_require__("605d");
  5341. var MutationObserver = global.MutationObserver || global.WebKitMutationObserver;
  5342. var document = global.document;
  5343. var process = global.process;
  5344. var Promise = global.Promise;
  5345. // Node.js 11 shows ExperimentalWarning on getting `queueMicrotask`
  5346. var queueMicrotaskDescriptor = getOwnPropertyDescriptor(global, 'queueMicrotask');
  5347. var queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;
  5348. var flush, head, last, notify, toggle, node, promise, then;
  5349. // modern engines have queueMicrotask method
  5350. if (!queueMicrotask) {
  5351. flush = function () {
  5352. var parent, fn;
  5353. if (IS_NODE && (parent = process.domain)) parent.exit();
  5354. while (head) {
  5355. fn = head.fn;
  5356. head = head.next;
  5357. try {
  5358. fn();
  5359. } catch (error) {
  5360. if (head) notify();
  5361. else last = undefined;
  5362. throw error;
  5363. }
  5364. } last = undefined;
  5365. if (parent) parent.enter();
  5366. };
  5367. // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339
  5368. // also except WebOS Webkit https://github.com/zloirock/core-js/issues/898
  5369. if (!IS_IOS && !IS_NODE && !IS_WEBOS_WEBKIT && MutationObserver && document) {
  5370. toggle = true;
  5371. node = document.createTextNode('');
  5372. new MutationObserver(flush).observe(node, { characterData: true });
  5373. notify = function () {
  5374. node.data = toggle = !toggle;
  5375. };
  5376. // environments with maybe non-completely correct, but existent Promise
  5377. } else if (!IS_IOS_PEBBLE && Promise && Promise.resolve) {
  5378. // Promise.resolve without an argument throws an error in LG WebOS 2
  5379. promise = Promise.resolve(undefined);
  5380. // workaround of WebKit ~ iOS Safari 10.1 bug
  5381. promise.constructor = Promise;
  5382. then = promise.then;
  5383. notify = function () {
  5384. then.call(promise, flush);
  5385. };
  5386. // Node.js without promises
  5387. } else if (IS_NODE) {
  5388. notify = function () {
  5389. process.nextTick(flush);
  5390. };
  5391. // for other environments - macrotask based on:
  5392. // - setImmediate
  5393. // - MessageChannel
  5394. // - window.postMessag
  5395. // - onreadystatechange
  5396. // - setTimeout
  5397. } else {
  5398. notify = function () {
  5399. // strange IE + webpack dev server bug - use .call(global)
  5400. macrotask.call(global, flush);
  5401. };
  5402. }
  5403. }
  5404. module.exports = queueMicrotask || function (fn) {
  5405. var task = { fn: fn, next: undefined };
  5406. if (last) last.next = task;
  5407. if (!head) {
  5408. head = task;
  5409. notify();
  5410. } last = task;
  5411. };
  5412. /***/ }),
  5413. /***/ "b622":
  5414. /***/ (function(module, exports, __webpack_require__) {
  5415. var global = __webpack_require__("da84");
  5416. var shared = __webpack_require__("5692");
  5417. var hasOwn = __webpack_require__("1a2d");
  5418. var uid = __webpack_require__("90e3");
  5419. var NATIVE_SYMBOL = __webpack_require__("4930");
  5420. var USE_SYMBOL_AS_UID = __webpack_require__("fdbf");
  5421. var WellKnownSymbolsStore = shared('wks');
  5422. var Symbol = global.Symbol;
  5423. var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol : Symbol && Symbol.withoutSetter || uid;
  5424. module.exports = function (name) {
  5425. if (!hasOwn(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {
  5426. if (NATIVE_SYMBOL && hasOwn(Symbol, name)) {
  5427. WellKnownSymbolsStore[name] = Symbol[name];
  5428. } else {
  5429. WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);
  5430. }
  5431. } return WellKnownSymbolsStore[name];
  5432. };
  5433. /***/ }),
  5434. /***/ "b64b":
  5435. /***/ (function(module, exports, __webpack_require__) {
  5436. var $ = __webpack_require__("23e7");
  5437. var toObject = __webpack_require__("7b0b");
  5438. var nativeKeys = __webpack_require__("df75");
  5439. var fails = __webpack_require__("d039");
  5440. var FAILS_ON_PRIMITIVES = fails(function () { nativeKeys(1); });
  5441. // `Object.keys` method
  5442. // https://tc39.es/ecma262/#sec-object.keys
  5443. $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {
  5444. keys: function keys(it) {
  5445. return nativeKeys(toObject(it));
  5446. }
  5447. });
  5448. /***/ }),
  5449. /***/ "b680":
  5450. /***/ (function(module, exports, __webpack_require__) {
  5451. "use strict";
  5452. var $ = __webpack_require__("23e7");
  5453. var toIntegerOrInfinity = __webpack_require__("5926");
  5454. var thisNumberValue = __webpack_require__("408a");
  5455. var repeat = __webpack_require__("1148");
  5456. var fails = __webpack_require__("d039");
  5457. var nativeToFixed = 1.0.toFixed;
  5458. var floor = Math.floor;
  5459. var pow = function (x, n, acc) {
  5460. return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc);
  5461. };
  5462. var log = function (x) {
  5463. var n = 0;
  5464. var x2 = x;
  5465. while (x2 >= 4096) {
  5466. n += 12;
  5467. x2 /= 4096;
  5468. }
  5469. while (x2 >= 2) {
  5470. n += 1;
  5471. x2 /= 2;
  5472. } return n;
  5473. };
  5474. var multiply = function (data, n, c) {
  5475. var index = -1;
  5476. var c2 = c;
  5477. while (++index < 6) {
  5478. c2 += n * data[index];
  5479. data[index] = c2 % 1e7;
  5480. c2 = floor(c2 / 1e7);
  5481. }
  5482. };
  5483. var divide = function (data, n) {
  5484. var index = 6;
  5485. var c = 0;
  5486. while (--index >= 0) {
  5487. c += data[index];
  5488. data[index] = floor(c / n);
  5489. c = (c % n) * 1e7;
  5490. }
  5491. };
  5492. var dataToString = function (data) {
  5493. var index = 6;
  5494. var s = '';
  5495. while (--index >= 0) {
  5496. if (s !== '' || index === 0 || data[index] !== 0) {
  5497. var t = String(data[index]);
  5498. s = s === '' ? t : s + repeat.call('0', 7 - t.length) + t;
  5499. }
  5500. } return s;
  5501. };
  5502. var FORCED = nativeToFixed && (
  5503. 0.00008.toFixed(3) !== '0.000' ||
  5504. 0.9.toFixed(0) !== '1' ||
  5505. 1.255.toFixed(2) !== '1.25' ||
  5506. 1000000000000000128.0.toFixed(0) !== '1000000000000000128'
  5507. ) || !fails(function () {
  5508. // V8 ~ Android 4.3-
  5509. nativeToFixed.call({});
  5510. });
  5511. // `Number.prototype.toFixed` method
  5512. // https://tc39.es/ecma262/#sec-number.prototype.tofixed
  5513. $({ target: 'Number', proto: true, forced: FORCED }, {
  5514. toFixed: function toFixed(fractionDigits) {
  5515. var number = thisNumberValue(this);
  5516. var fractDigits = toIntegerOrInfinity(fractionDigits);
  5517. var data = [0, 0, 0, 0, 0, 0];
  5518. var sign = '';
  5519. var result = '0';
  5520. var e, z, j, k;
  5521. if (fractDigits < 0 || fractDigits > 20) throw RangeError('Incorrect fraction digits');
  5522. // eslint-disable-next-line no-self-compare -- NaN check
  5523. if (number != number) return 'NaN';
  5524. if (number <= -1e21 || number >= 1e21) return String(number);
  5525. if (number < 0) {
  5526. sign = '-';
  5527. number = -number;
  5528. }
  5529. if (number > 1e-21) {
  5530. e = log(number * pow(2, 69, 1)) - 69;
  5531. z = e < 0 ? number * pow(2, -e, 1) : number / pow(2, e, 1);
  5532. z *= 0x10000000000000;
  5533. e = 52 - e;
  5534. if (e > 0) {
  5535. multiply(data, 0, z);
  5536. j = fractDigits;
  5537. while (j >= 7) {
  5538. multiply(data, 1e7, 0);
  5539. j -= 7;
  5540. }
  5541. multiply(data, pow(10, j, 1), 0);
  5542. j = e - 1;
  5543. while (j >= 23) {
  5544. divide(data, 1 << 23);
  5545. j -= 23;
  5546. }
  5547. divide(data, 1 << j);
  5548. multiply(data, 1, 1);
  5549. divide(data, 2);
  5550. result = dataToString(data);
  5551. } else {
  5552. multiply(data, 0, z);
  5553. multiply(data, 1 << -e, 0);
  5554. result = dataToString(data) + repeat.call('0', fractDigits);
  5555. }
  5556. }
  5557. if (fractDigits > 0) {
  5558. k = result.length;
  5559. result = sign + (k <= fractDigits
  5560. ? '0.' + repeat.call('0', fractDigits - k) + result
  5561. : result.slice(0, k - fractDigits) + '.' + result.slice(k - fractDigits));
  5562. } else {
  5563. result = sign + result;
  5564. } return result;
  5565. }
  5566. });
  5567. /***/ }),
  5568. /***/ "b727":
  5569. /***/ (function(module, exports, __webpack_require__) {
  5570. var bind = __webpack_require__("0366");
  5571. var IndexedObject = __webpack_require__("44ad");
  5572. var toObject = __webpack_require__("7b0b");
  5573. var lengthOfArrayLike = __webpack_require__("07fa");
  5574. var arraySpeciesCreate = __webpack_require__("65f0");
  5575. var push = [].push;
  5576. // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation
  5577. var createMethod = function (TYPE) {
  5578. var IS_MAP = TYPE == 1;
  5579. var IS_FILTER = TYPE == 2;
  5580. var IS_SOME = TYPE == 3;
  5581. var IS_EVERY = TYPE == 4;
  5582. var IS_FIND_INDEX = TYPE == 6;
  5583. var IS_FILTER_REJECT = TYPE == 7;
  5584. var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
  5585. return function ($this, callbackfn, that, specificCreate) {
  5586. var O = toObject($this);
  5587. var self = IndexedObject(O);
  5588. var boundFunction = bind(callbackfn, that, 3);
  5589. var length = lengthOfArrayLike(self);
  5590. var index = 0;
  5591. var create = specificCreate || arraySpeciesCreate;
  5592. var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined;
  5593. var value, result;
  5594. for (;length > index; index++) if (NO_HOLES || index in self) {
  5595. value = self[index];
  5596. result = boundFunction(value, index, O);
  5597. if (TYPE) {
  5598. if (IS_MAP) target[index] = result; // map
  5599. else if (result) switch (TYPE) {
  5600. case 3: return true; // some
  5601. case 5: return value; // find
  5602. case 6: return index; // findIndex
  5603. case 2: push.call(target, value); // filter
  5604. } else switch (TYPE) {
  5605. case 4: return false; // every
  5606. case 7: push.call(target, value); // filterReject
  5607. }
  5608. }
  5609. }
  5610. return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
  5611. };
  5612. };
  5613. module.exports = {
  5614. // `Array.prototype.forEach` method
  5615. // https://tc39.es/ecma262/#sec-array.prototype.foreach
  5616. forEach: createMethod(0),
  5617. // `Array.prototype.map` method
  5618. // https://tc39.es/ecma262/#sec-array.prototype.map
  5619. map: createMethod(1),
  5620. // `Array.prototype.filter` method
  5621. // https://tc39.es/ecma262/#sec-array.prototype.filter
  5622. filter: createMethod(2),
  5623. // `Array.prototype.some` method
  5624. // https://tc39.es/ecma262/#sec-array.prototype.some
  5625. some: createMethod(3),
  5626. // `Array.prototype.every` method
  5627. // https://tc39.es/ecma262/#sec-array.prototype.every
  5628. every: createMethod(4),
  5629. // `Array.prototype.find` method
  5630. // https://tc39.es/ecma262/#sec-array.prototype.find
  5631. find: createMethod(5),
  5632. // `Array.prototype.findIndex` method
  5633. // https://tc39.es/ecma262/#sec-array.prototype.findIndex
  5634. findIndex: createMethod(6),
  5635. // `Array.prototype.filterReject` method
  5636. // https://github.com/tc39/proposal-array-filtering
  5637. filterReject: createMethod(7)
  5638. };
  5639. /***/ }),
  5640. /***/ "bb2f":
  5641. /***/ (function(module, exports, __webpack_require__) {
  5642. var fails = __webpack_require__("d039");
  5643. module.exports = !fails(function () {
  5644. // eslint-disable-next-line es/no-object-isextensible, es/no-object-preventextensions -- required for testing
  5645. return Object.isExtensible(Object.preventExtensions({}));
  5646. });
  5647. /***/ }),
  5648. /***/ "c04e":
  5649. /***/ (function(module, exports, __webpack_require__) {
  5650. var isObject = __webpack_require__("861d");
  5651. var isSymbol = __webpack_require__("d9b5");
  5652. var getMethod = __webpack_require__("dc4a");
  5653. var ordinaryToPrimitive = __webpack_require__("485a");
  5654. var wellKnownSymbol = __webpack_require__("b622");
  5655. var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
  5656. // `ToPrimitive` abstract operation
  5657. // https://tc39.es/ecma262/#sec-toprimitive
  5658. module.exports = function (input, pref) {
  5659. if (!isObject(input) || isSymbol(input)) return input;
  5660. var exoticToPrim = getMethod(input, TO_PRIMITIVE);
  5661. var result;
  5662. if (exoticToPrim) {
  5663. if (pref === undefined) pref = 'default';
  5664. result = exoticToPrim.call(input, pref);
  5665. if (!isObject(result) || isSymbol(result)) return result;
  5666. throw TypeError("Can't convert object to primitive value");
  5667. }
  5668. if (pref === undefined) pref = 'number';
  5669. return ordinaryToPrimitive(input, pref);
  5670. };
  5671. /***/ }),
  5672. /***/ "c430":
  5673. /***/ (function(module, exports) {
  5674. module.exports = false;
  5675. /***/ }),
  5676. /***/ "c6b6":
  5677. /***/ (function(module, exports) {
  5678. var toString = {}.toString;
  5679. module.exports = function (it) {
  5680. return toString.call(it).slice(8, -1);
  5681. };
  5682. /***/ }),
  5683. /***/ "c6cd":
  5684. /***/ (function(module, exports, __webpack_require__) {
  5685. var global = __webpack_require__("da84");
  5686. var setGlobal = __webpack_require__("ce4e");
  5687. var SHARED = '__core-js_shared__';
  5688. var store = global[SHARED] || setGlobal(SHARED, {});
  5689. module.exports = store;
  5690. /***/ }),
  5691. /***/ "c7cd":
  5692. /***/ (function(module, exports, __webpack_require__) {
  5693. "use strict";
  5694. var $ = __webpack_require__("23e7");
  5695. var createHTML = __webpack_require__("857a");
  5696. var forcedStringHTMLMethod = __webpack_require__("af03");
  5697. // `String.prototype.fixed` method
  5698. // https://tc39.es/ecma262/#sec-string.prototype.fixed
  5699. $({ target: 'String', proto: true, forced: forcedStringHTMLMethod('fixed') }, {
  5700. fixed: function fixed() {
  5701. return createHTML(this, 'tt', '', '');
  5702. }
  5703. });
  5704. /***/ }),
  5705. /***/ "c8ba":
  5706. /***/ (function(module, exports) {
  5707. var g;
  5708. // This works in non-strict mode
  5709. g = (function() {
  5710. return this;
  5711. })();
  5712. try {
  5713. // This works if eval is allowed (see CSP)
  5714. g = g || new Function("return this")();
  5715. } catch (e) {
  5716. // This works if the window reference is available
  5717. if (typeof window === "object") g = window;
  5718. }
  5719. // g can still be undefined, but nothing to do about it...
  5720. // We return undefined, instead of nothing here, so it's
  5721. // easier to handle this case. if(!global) { ...}
  5722. module.exports = g;
  5723. /***/ }),
  5724. /***/ "c8d2":
  5725. /***/ (function(module, exports, __webpack_require__) {
  5726. var PROPER_FUNCTION_NAME = __webpack_require__("5e77").PROPER;
  5727. var fails = __webpack_require__("d039");
  5728. var whitespaces = __webpack_require__("5899");
  5729. var non = '\u200B\u0085\u180E';
  5730. // check that a method works with the correct list
  5731. // of whitespaces and has a correct name
  5732. module.exports = function (METHOD_NAME) {
  5733. return fails(function () {
  5734. return !!whitespaces[METHOD_NAME]()
  5735. || non[METHOD_NAME]() !== non
  5736. || (PROPER_FUNCTION_NAME && whitespaces[METHOD_NAME].name !== METHOD_NAME);
  5737. });
  5738. };
  5739. /***/ }),
  5740. /***/ "ca84":
  5741. /***/ (function(module, exports, __webpack_require__) {
  5742. var hasOwn = __webpack_require__("1a2d");
  5743. var toIndexedObject = __webpack_require__("fc6a");
  5744. var indexOf = __webpack_require__("4d64").indexOf;
  5745. var hiddenKeys = __webpack_require__("d012");
  5746. module.exports = function (object, names) {
  5747. var O = toIndexedObject(object);
  5748. var i = 0;
  5749. var result = [];
  5750. var key;
  5751. for (key in O) !hasOwn(hiddenKeys, key) && hasOwn(O, key) && result.push(key);
  5752. // Don't enum bug & hidden keys
  5753. while (names.length > i) if (hasOwn(O, key = names[i++])) {
  5754. ~indexOf(result, key) || result.push(key);
  5755. }
  5756. return result;
  5757. };
  5758. /***/ }),
  5759. /***/ "caad":
  5760. /***/ (function(module, exports, __webpack_require__) {
  5761. "use strict";
  5762. var $ = __webpack_require__("23e7");
  5763. var $includes = __webpack_require__("4d64").includes;
  5764. var addToUnscopables = __webpack_require__("44d2");
  5765. // `Array.prototype.includes` method
  5766. // https://tc39.es/ecma262/#sec-array.prototype.includes
  5767. $({ target: 'Array', proto: true }, {
  5768. includes: function includes(el /* , fromIndex = 0 */) {
  5769. return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
  5770. }
  5771. });
  5772. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  5773. addToUnscopables('includes');
  5774. /***/ }),
  5775. /***/ "cc12":
  5776. /***/ (function(module, exports, __webpack_require__) {
  5777. var global = __webpack_require__("da84");
  5778. var isObject = __webpack_require__("861d");
  5779. var document = global.document;
  5780. // typeof document.createElement is 'object' in old IE
  5781. var EXISTS = isObject(document) && isObject(document.createElement);
  5782. module.exports = function (it) {
  5783. return EXISTS ? document.createElement(it) : {};
  5784. };
  5785. /***/ }),
  5786. /***/ "cca6":
  5787. /***/ (function(module, exports, __webpack_require__) {
  5788. var $ = __webpack_require__("23e7");
  5789. var assign = __webpack_require__("60da");
  5790. // `Object.assign` method
  5791. // https://tc39.es/ecma262/#sec-object.assign
  5792. // eslint-disable-next-line es/no-object-assign -- required for testing
  5793. $({ target: 'Object', stat: true, forced: Object.assign !== assign }, {
  5794. assign: assign
  5795. });
  5796. /***/ }),
  5797. /***/ "cdf9":
  5798. /***/ (function(module, exports, __webpack_require__) {
  5799. var anObject = __webpack_require__("825a");
  5800. var isObject = __webpack_require__("861d");
  5801. var newPromiseCapability = __webpack_require__("f069");
  5802. module.exports = function (C, x) {
  5803. anObject(C);
  5804. if (isObject(x) && x.constructor === C) return x;
  5805. var promiseCapability = newPromiseCapability.f(C);
  5806. var resolve = promiseCapability.resolve;
  5807. resolve(x);
  5808. return promiseCapability.promise;
  5809. };
  5810. /***/ }),
  5811. /***/ "ce4e":
  5812. /***/ (function(module, exports, __webpack_require__) {
  5813. var global = __webpack_require__("da84");
  5814. module.exports = function (key, value) {
  5815. try {
  5816. // eslint-disable-next-line es/no-object-defineproperty -- safe
  5817. Object.defineProperty(global, key, { value: value, configurable: true, writable: true });
  5818. } catch (error) {
  5819. global[key] = value;
  5820. } return value;
  5821. };
  5822. /***/ }),
  5823. /***/ "d012":
  5824. /***/ (function(module, exports) {
  5825. module.exports = {};
  5826. /***/ }),
  5827. /***/ "d039":
  5828. /***/ (function(module, exports) {
  5829. module.exports = function (exec) {
  5830. try {
  5831. return !!exec();
  5832. } catch (error) {
  5833. return true;
  5834. }
  5835. };
  5836. /***/ }),
  5837. /***/ "d066":
  5838. /***/ (function(module, exports, __webpack_require__) {
  5839. var global = __webpack_require__("da84");
  5840. var isCallable = __webpack_require__("1626");
  5841. var aFunction = function (argument) {
  5842. return isCallable(argument) ? argument : undefined;
  5843. };
  5844. module.exports = function (namespace, method) {
  5845. return arguments.length < 2 ? aFunction(global[namespace]) : global[namespace] && global[namespace][method];
  5846. };
  5847. /***/ }),
  5848. /***/ "d1e7":
  5849. /***/ (function(module, exports, __webpack_require__) {
  5850. "use strict";
  5851. var $propertyIsEnumerable = {}.propertyIsEnumerable;
  5852. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  5853. var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  5854. // Nashorn ~ JDK8 bug
  5855. var NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1);
  5856. // `Object.prototype.propertyIsEnumerable` method implementation
  5857. // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
  5858. exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
  5859. var descriptor = getOwnPropertyDescriptor(this, V);
  5860. return !!descriptor && descriptor.enumerable;
  5861. } : $propertyIsEnumerable;
  5862. /***/ }),
  5863. /***/ "d28b":
  5864. /***/ (function(module, exports, __webpack_require__) {
  5865. var defineWellKnownSymbol = __webpack_require__("746f");
  5866. // `Symbol.iterator` well-known symbol
  5867. // https://tc39.es/ecma262/#sec-symbol.iterator
  5868. defineWellKnownSymbol('iterator');
  5869. /***/ }),
  5870. /***/ "d2bb":
  5871. /***/ (function(module, exports, __webpack_require__) {
  5872. /* eslint-disable no-proto -- safe */
  5873. var anObject = __webpack_require__("825a");
  5874. var aPossiblePrototype = __webpack_require__("3bbe");
  5875. // `Object.setPrototypeOf` method
  5876. // https://tc39.es/ecma262/#sec-object.setprototypeof
  5877. // Works with __proto__ only. Old v8 can't work with null proto objects.
  5878. // eslint-disable-next-line es/no-object-setprototypeof -- safe
  5879. module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () {
  5880. var CORRECT_SETTER = false;
  5881. var test = {};
  5882. var setter;
  5883. try {
  5884. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  5885. setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set;
  5886. setter.call(test, []);
  5887. CORRECT_SETTER = test instanceof Array;
  5888. } catch (error) { /* empty */ }
  5889. return function setPrototypeOf(O, proto) {
  5890. anObject(O);
  5891. aPossiblePrototype(proto);
  5892. if (CORRECT_SETTER) setter.call(O, proto);
  5893. else O.__proto__ = proto;
  5894. return O;
  5895. };
  5896. }() : undefined);
  5897. /***/ }),
  5898. /***/ "d3b7":
  5899. /***/ (function(module, exports, __webpack_require__) {
  5900. var TO_STRING_TAG_SUPPORT = __webpack_require__("00ee");
  5901. var redefine = __webpack_require__("6eeb");
  5902. var toString = __webpack_require__("b041");
  5903. // `Object.prototype.toString` method
  5904. // https://tc39.es/ecma262/#sec-object.prototype.tostring
  5905. if (!TO_STRING_TAG_SUPPORT) {
  5906. redefine(Object.prototype, 'toString', toString, { unsafe: true });
  5907. }
  5908. /***/ }),
  5909. /***/ "d44e":
  5910. /***/ (function(module, exports, __webpack_require__) {
  5911. var defineProperty = __webpack_require__("9bf2").f;
  5912. var hasOwn = __webpack_require__("1a2d");
  5913. var wellKnownSymbol = __webpack_require__("b622");
  5914. var TO_STRING_TAG = wellKnownSymbol('toStringTag');
  5915. module.exports = function (it, TAG, STATIC) {
  5916. if (it && !hasOwn(it = STATIC ? it : it.prototype, TO_STRING_TAG)) {
  5917. defineProperty(it, TO_STRING_TAG, { configurable: true, value: TAG });
  5918. }
  5919. };
  5920. /***/ }),
  5921. /***/ "d4c3":
  5922. /***/ (function(module, exports, __webpack_require__) {
  5923. var userAgent = __webpack_require__("342f");
  5924. var global = __webpack_require__("da84");
  5925. module.exports = /ipad|iphone|ipod/i.test(userAgent) && global.Pebble !== undefined;
  5926. /***/ }),
  5927. /***/ "d784":
  5928. /***/ (function(module, exports, __webpack_require__) {
  5929. "use strict";
  5930. // TODO: Remove from `core-js@4` since it's moved to entry points
  5931. __webpack_require__("ac1f");
  5932. var redefine = __webpack_require__("6eeb");
  5933. var regexpExec = __webpack_require__("9263");
  5934. var fails = __webpack_require__("d039");
  5935. var wellKnownSymbol = __webpack_require__("b622");
  5936. var createNonEnumerableProperty = __webpack_require__("9112");
  5937. var SPECIES = wellKnownSymbol('species');
  5938. var RegExpPrototype = RegExp.prototype;
  5939. module.exports = function (KEY, exec, FORCED, SHAM) {
  5940. var SYMBOL = wellKnownSymbol(KEY);
  5941. var DELEGATES_TO_SYMBOL = !fails(function () {
  5942. // String methods call symbol-named RegEp methods
  5943. var O = {};
  5944. O[SYMBOL] = function () { return 7; };
  5945. return ''[KEY](O) != 7;
  5946. });
  5947. var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
  5948. // Symbol-named RegExp methods call .exec
  5949. var execCalled = false;
  5950. var re = /a/;
  5951. if (KEY === 'split') {
  5952. // We can't use real regex here since it causes deoptimization
  5953. // and serious performance degradation in V8
  5954. // https://github.com/zloirock/core-js/issues/306
  5955. re = {};
  5956. // RegExp[@@split] doesn't call the regex's exec method, but first creates
  5957. // a new one. We need to return the patched regex when creating the new one.
  5958. re.constructor = {};
  5959. re.constructor[SPECIES] = function () { return re; };
  5960. re.flags = '';
  5961. re[SYMBOL] = /./[SYMBOL];
  5962. }
  5963. re.exec = function () { execCalled = true; return null; };
  5964. re[SYMBOL]('');
  5965. return !execCalled;
  5966. });
  5967. if (
  5968. !DELEGATES_TO_SYMBOL ||
  5969. !DELEGATES_TO_EXEC ||
  5970. FORCED
  5971. ) {
  5972. var nativeRegExpMethod = /./[SYMBOL];
  5973. var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
  5974. var $exec = regexp.exec;
  5975. if ($exec === regexpExec || $exec === RegExpPrototype.exec) {
  5976. if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
  5977. // The native String method already delegates to @@method (this
  5978. // polyfilled function), leasing to infinite recursion.
  5979. // We avoid it by directly calling the native @@method method.
  5980. return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };
  5981. }
  5982. return { done: true, value: nativeMethod.call(str, regexp, arg2) };
  5983. }
  5984. return { done: false };
  5985. });
  5986. redefine(String.prototype, KEY, methods[0]);
  5987. redefine(RegExpPrototype, SYMBOL, methods[1]);
  5988. }
  5989. if (SHAM) createNonEnumerableProperty(RegExpPrototype[SYMBOL], 'sham', true);
  5990. };
  5991. /***/ }),
  5992. /***/ "d81d":
  5993. /***/ (function(module, exports, __webpack_require__) {
  5994. "use strict";
  5995. var $ = __webpack_require__("23e7");
  5996. var $map = __webpack_require__("b727").map;
  5997. var arrayMethodHasSpeciesSupport = __webpack_require__("1dde");
  5998. var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('map');
  5999. // `Array.prototype.map` method
  6000. // https://tc39.es/ecma262/#sec-array.prototype.map
  6001. // with adding support of @@species
  6002. $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
  6003. map: function map(callbackfn /* , thisArg */) {
  6004. return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  6005. }
  6006. });
  6007. /***/ }),
  6008. /***/ "d998":
  6009. /***/ (function(module, exports, __webpack_require__) {
  6010. var UA = __webpack_require__("342f");
  6011. module.exports = /MSIE|Trident/.test(UA);
  6012. /***/ }),
  6013. /***/ "d9b5":
  6014. /***/ (function(module, exports, __webpack_require__) {
  6015. var isCallable = __webpack_require__("1626");
  6016. var getBuiltIn = __webpack_require__("d066");
  6017. var USE_SYMBOL_AS_UID = __webpack_require__("fdbf");
  6018. module.exports = USE_SYMBOL_AS_UID ? function (it) {
  6019. return typeof it == 'symbol';
  6020. } : function (it) {
  6021. var $Symbol = getBuiltIn('Symbol');
  6022. return isCallable($Symbol) && Object(it) instanceof $Symbol;
  6023. };
  6024. /***/ }),
  6025. /***/ "da84":
  6026. /***/ (function(module, exports, __webpack_require__) {
  6027. /* WEBPACK VAR INJECTION */(function(global) {var check = function (it) {
  6028. return it && it.Math == Math && it;
  6029. };
  6030. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  6031. module.exports =
  6032. // eslint-disable-next-line es/no-global-this -- safe
  6033. check(typeof globalThis == 'object' && globalThis) ||
  6034. check(typeof window == 'object' && window) ||
  6035. // eslint-disable-next-line no-restricted-globals -- safe
  6036. check(typeof self == 'object' && self) ||
  6037. check(typeof global == 'object' && global) ||
  6038. // eslint-disable-next-line no-new-func -- fallback
  6039. (function () { return this; })() || Function('return this')();
  6040. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("c8ba")))
  6041. /***/ }),
  6042. /***/ "dbb4":
  6043. /***/ (function(module, exports, __webpack_require__) {
  6044. var $ = __webpack_require__("23e7");
  6045. var DESCRIPTORS = __webpack_require__("83ab");
  6046. var ownKeys = __webpack_require__("56ef");
  6047. var toIndexedObject = __webpack_require__("fc6a");
  6048. var getOwnPropertyDescriptorModule = __webpack_require__("06cf");
  6049. var createProperty = __webpack_require__("8418");
  6050. // `Object.getOwnPropertyDescriptors` method
  6051. // https://tc39.es/ecma262/#sec-object.getownpropertydescriptors
  6052. $({ target: 'Object', stat: true, sham: !DESCRIPTORS }, {
  6053. getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) {
  6054. var O = toIndexedObject(object);
  6055. var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
  6056. var keys = ownKeys(O);
  6057. var result = {};
  6058. var index = 0;
  6059. var key, descriptor;
  6060. while (keys.length > index) {
  6061. descriptor = getOwnPropertyDescriptor(O, key = keys[index++]);
  6062. if (descriptor !== undefined) createProperty(result, key, descriptor);
  6063. }
  6064. return result;
  6065. }
  6066. });
  6067. /***/ }),
  6068. /***/ "dc4a":
  6069. /***/ (function(module, exports, __webpack_require__) {
  6070. var aCallable = __webpack_require__("59ed");
  6071. // `GetMethod` abstract operation
  6072. // https://tc39.es/ecma262/#sec-getmethod
  6073. module.exports = function (V, P) {
  6074. var func = V[P];
  6075. return func == null ? undefined : aCallable(func);
  6076. };
  6077. /***/ }),
  6078. /***/ "ddb0":
  6079. /***/ (function(module, exports, __webpack_require__) {
  6080. var global = __webpack_require__("da84");
  6081. var DOMIterables = __webpack_require__("fdbc");
  6082. var DOMTokenListPrototype = __webpack_require__("785a");
  6083. var ArrayIteratorMethods = __webpack_require__("e260");
  6084. var createNonEnumerableProperty = __webpack_require__("9112");
  6085. var wellKnownSymbol = __webpack_require__("b622");
  6086. var ITERATOR = wellKnownSymbol('iterator');
  6087. var TO_STRING_TAG = wellKnownSymbol('toStringTag');
  6088. var ArrayValues = ArrayIteratorMethods.values;
  6089. var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
  6090. if (CollectionPrototype) {
  6091. // some Chrome versions have non-configurable methods on DOMTokenList
  6092. if (CollectionPrototype[ITERATOR] !== ArrayValues) try {
  6093. createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues);
  6094. } catch (error) {
  6095. CollectionPrototype[ITERATOR] = ArrayValues;
  6096. }
  6097. if (!CollectionPrototype[TO_STRING_TAG]) {
  6098. createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME);
  6099. }
  6100. if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {
  6101. // some Chrome versions have non-configurable methods on DOMTokenList
  6102. if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try {
  6103. createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);
  6104. } catch (error) {
  6105. CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];
  6106. }
  6107. }
  6108. }
  6109. };
  6110. for (var COLLECTION_NAME in DOMIterables) {
  6111. handlePrototype(global[COLLECTION_NAME] && global[COLLECTION_NAME].prototype, COLLECTION_NAME);
  6112. }
  6113. handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
  6114. /***/ }),
  6115. /***/ "df75":
  6116. /***/ (function(module, exports, __webpack_require__) {
  6117. var internalObjectKeys = __webpack_require__("ca84");
  6118. var enumBugKeys = __webpack_require__("7839");
  6119. // `Object.keys` method
  6120. // https://tc39.es/ecma262/#sec-object.keys
  6121. // eslint-disable-next-line es/no-object-keys -- safe
  6122. module.exports = Object.keys || function keys(O) {
  6123. return internalObjectKeys(O, enumBugKeys);
  6124. };
  6125. /***/ }),
  6126. /***/ "e01a":
  6127. /***/ (function(module, exports, __webpack_require__) {
  6128. "use strict";
  6129. // `Symbol.prototype.description` getter
  6130. // https://tc39.es/ecma262/#sec-symbol.prototype.description
  6131. var $ = __webpack_require__("23e7");
  6132. var DESCRIPTORS = __webpack_require__("83ab");
  6133. var global = __webpack_require__("da84");
  6134. var hasOwn = __webpack_require__("1a2d");
  6135. var isCallable = __webpack_require__("1626");
  6136. var isObject = __webpack_require__("861d");
  6137. var defineProperty = __webpack_require__("9bf2").f;
  6138. var copyConstructorProperties = __webpack_require__("e893");
  6139. var NativeSymbol = global.Symbol;
  6140. if (DESCRIPTORS && isCallable(NativeSymbol) && (!('description' in NativeSymbol.prototype) ||
  6141. // Safari 12 bug
  6142. NativeSymbol().description !== undefined
  6143. )) {
  6144. var EmptyStringDescriptionStore = {};
  6145. // wrap Symbol constructor for correct work with undefined description
  6146. var SymbolWrapper = function Symbol() {
  6147. var description = arguments.length < 1 || arguments[0] === undefined ? undefined : String(arguments[0]);
  6148. var result = this instanceof SymbolWrapper
  6149. ? new NativeSymbol(description)
  6150. // in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)'
  6151. : description === undefined ? NativeSymbol() : NativeSymbol(description);
  6152. if (description === '') EmptyStringDescriptionStore[result] = true;
  6153. return result;
  6154. };
  6155. copyConstructorProperties(SymbolWrapper, NativeSymbol);
  6156. var symbolPrototype = SymbolWrapper.prototype = NativeSymbol.prototype;
  6157. symbolPrototype.constructor = SymbolWrapper;
  6158. var symbolToString = symbolPrototype.toString;
  6159. var nativeSymbol = String(NativeSymbol('test')) == 'Symbol(test)';
  6160. var regexp = /^Symbol\((.*)\)[^)]+$/;
  6161. defineProperty(symbolPrototype, 'description', {
  6162. configurable: true,
  6163. get: function description() {
  6164. var symbol = isObject(this) ? this.valueOf() : this;
  6165. var string = symbolToString.call(symbol);
  6166. if (hasOwn(EmptyStringDescriptionStore, symbol)) return '';
  6167. var desc = nativeSymbol ? string.slice(7, -1) : string.replace(regexp, '$1');
  6168. return desc === '' ? undefined : desc;
  6169. }
  6170. });
  6171. $({ global: true, forced: true }, {
  6172. Symbol: SymbolWrapper
  6173. });
  6174. }
  6175. /***/ }),
  6176. /***/ "e163":
  6177. /***/ (function(module, exports, __webpack_require__) {
  6178. var hasOwn = __webpack_require__("1a2d");
  6179. var isCallable = __webpack_require__("1626");
  6180. var toObject = __webpack_require__("7b0b");
  6181. var sharedKey = __webpack_require__("f772");
  6182. var CORRECT_PROTOTYPE_GETTER = __webpack_require__("e177");
  6183. var IE_PROTO = sharedKey('IE_PROTO');
  6184. var ObjectPrototype = Object.prototype;
  6185. // `Object.getPrototypeOf` method
  6186. // https://tc39.es/ecma262/#sec-object.getprototypeof
  6187. // eslint-disable-next-line es/no-object-getprototypeof -- safe
  6188. module.exports = CORRECT_PROTOTYPE_GETTER ? Object.getPrototypeOf : function (O) {
  6189. var object = toObject(O);
  6190. if (hasOwn(object, IE_PROTO)) return object[IE_PROTO];
  6191. var constructor = object.constructor;
  6192. if (isCallable(constructor) && object instanceof constructor) {
  6193. return constructor.prototype;
  6194. } return object instanceof Object ? ObjectPrototype : null;
  6195. };
  6196. /***/ }),
  6197. /***/ "e177":
  6198. /***/ (function(module, exports, __webpack_require__) {
  6199. var fails = __webpack_require__("d039");
  6200. module.exports = !fails(function () {
  6201. function F() { /* empty */ }
  6202. F.prototype.constructor = null;
  6203. // eslint-disable-next-line es/no-object-getprototypeof -- required for testing
  6204. return Object.getPrototypeOf(new F()) !== F.prototype;
  6205. });
  6206. /***/ }),
  6207. /***/ "e260":
  6208. /***/ (function(module, exports, __webpack_require__) {
  6209. "use strict";
  6210. var toIndexedObject = __webpack_require__("fc6a");
  6211. var addToUnscopables = __webpack_require__("44d2");
  6212. var Iterators = __webpack_require__("3f8c");
  6213. var InternalStateModule = __webpack_require__("69f3");
  6214. var defineIterator = __webpack_require__("7dd0");
  6215. var ARRAY_ITERATOR = 'Array Iterator';
  6216. var setInternalState = InternalStateModule.set;
  6217. var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);
  6218. // `Array.prototype.entries` method
  6219. // https://tc39.es/ecma262/#sec-array.prototype.entries
  6220. // `Array.prototype.keys` method
  6221. // https://tc39.es/ecma262/#sec-array.prototype.keys
  6222. // `Array.prototype.values` method
  6223. // https://tc39.es/ecma262/#sec-array.prototype.values
  6224. // `Array.prototype[@@iterator]` method
  6225. // https://tc39.es/ecma262/#sec-array.prototype-@@iterator
  6226. // `CreateArrayIterator` internal method
  6227. // https://tc39.es/ecma262/#sec-createarrayiterator
  6228. module.exports = defineIterator(Array, 'Array', function (iterated, kind) {
  6229. setInternalState(this, {
  6230. type: ARRAY_ITERATOR,
  6231. target: toIndexedObject(iterated), // target
  6232. index: 0, // next index
  6233. kind: kind // kind
  6234. });
  6235. // `%ArrayIteratorPrototype%.next` method
  6236. // https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
  6237. }, function () {
  6238. var state = getInternalState(this);
  6239. var target = state.target;
  6240. var kind = state.kind;
  6241. var index = state.index++;
  6242. if (!target || index >= target.length) {
  6243. state.target = undefined;
  6244. return { value: undefined, done: true };
  6245. }
  6246. if (kind == 'keys') return { value: index, done: false };
  6247. if (kind == 'values') return { value: target[index], done: false };
  6248. return { value: [index, target[index]], done: false };
  6249. }, 'values');
  6250. // argumentsList[@@iterator] is %ArrayProto_values%
  6251. // https://tc39.es/ecma262/#sec-createunmappedargumentsobject
  6252. // https://tc39.es/ecma262/#sec-createmappedargumentsobject
  6253. Iterators.Arguments = Iterators.Array;
  6254. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  6255. addToUnscopables('keys');
  6256. addToUnscopables('values');
  6257. addToUnscopables('entries');
  6258. /***/ }),
  6259. /***/ "e2cc":
  6260. /***/ (function(module, exports, __webpack_require__) {
  6261. var redefine = __webpack_require__("6eeb");
  6262. module.exports = function (target, src, options) {
  6263. for (var key in src) redefine(target, key, src[key], options);
  6264. return target;
  6265. };
  6266. /***/ }),
  6267. /***/ "e439":
  6268. /***/ (function(module, exports, __webpack_require__) {
  6269. var $ = __webpack_require__("23e7");
  6270. var fails = __webpack_require__("d039");
  6271. var toIndexedObject = __webpack_require__("fc6a");
  6272. var nativeGetOwnPropertyDescriptor = __webpack_require__("06cf").f;
  6273. var DESCRIPTORS = __webpack_require__("83ab");
  6274. var FAILS_ON_PRIMITIVES = fails(function () { nativeGetOwnPropertyDescriptor(1); });
  6275. var FORCED = !DESCRIPTORS || FAILS_ON_PRIMITIVES;
  6276. // `Object.getOwnPropertyDescriptor` method
  6277. // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
  6278. $({ target: 'Object', stat: true, forced: FORCED, sham: !DESCRIPTORS }, {
  6279. getOwnPropertyDescriptor: function getOwnPropertyDescriptor(it, key) {
  6280. return nativeGetOwnPropertyDescriptor(toIndexedObject(it), key);
  6281. }
  6282. });
  6283. /***/ }),
  6284. /***/ "e538":
  6285. /***/ (function(module, exports, __webpack_require__) {
  6286. var wellKnownSymbol = __webpack_require__("b622");
  6287. exports.f = wellKnownSymbol;
  6288. /***/ }),
  6289. /***/ "e667":
  6290. /***/ (function(module, exports) {
  6291. module.exports = function (exec) {
  6292. try {
  6293. return { error: false, value: exec() };
  6294. } catch (error) {
  6295. return { error: true, value: error };
  6296. }
  6297. };
  6298. /***/ }),
  6299. /***/ "e6cf":
  6300. /***/ (function(module, exports, __webpack_require__) {
  6301. "use strict";
  6302. var $ = __webpack_require__("23e7");
  6303. var IS_PURE = __webpack_require__("c430");
  6304. var global = __webpack_require__("da84");
  6305. var getBuiltIn = __webpack_require__("d066");
  6306. var NativePromise = __webpack_require__("fea9");
  6307. var redefine = __webpack_require__("6eeb");
  6308. var redefineAll = __webpack_require__("e2cc");
  6309. var setPrototypeOf = __webpack_require__("d2bb");
  6310. var setToStringTag = __webpack_require__("d44e");
  6311. var setSpecies = __webpack_require__("2626");
  6312. var aCallable = __webpack_require__("59ed");
  6313. var isCallable = __webpack_require__("1626");
  6314. var isObject = __webpack_require__("861d");
  6315. var anInstance = __webpack_require__("19aa");
  6316. var inspectSource = __webpack_require__("8925");
  6317. var iterate = __webpack_require__("2266");
  6318. var checkCorrectnessOfIteration = __webpack_require__("1c7e");
  6319. var speciesConstructor = __webpack_require__("4840");
  6320. var task = __webpack_require__("2cf4").set;
  6321. var microtask = __webpack_require__("b575");
  6322. var promiseResolve = __webpack_require__("cdf9");
  6323. var hostReportErrors = __webpack_require__("44de");
  6324. var newPromiseCapabilityModule = __webpack_require__("f069");
  6325. var perform = __webpack_require__("e667");
  6326. var InternalStateModule = __webpack_require__("69f3");
  6327. var isForced = __webpack_require__("94ca");
  6328. var wellKnownSymbol = __webpack_require__("b622");
  6329. var IS_BROWSER = __webpack_require__("6069");
  6330. var IS_NODE = __webpack_require__("605d");
  6331. var V8_VERSION = __webpack_require__("2d00");
  6332. var SPECIES = wellKnownSymbol('species');
  6333. var PROMISE = 'Promise';
  6334. var getInternalState = InternalStateModule.get;
  6335. var setInternalState = InternalStateModule.set;
  6336. var getInternalPromiseState = InternalStateModule.getterFor(PROMISE);
  6337. var NativePromisePrototype = NativePromise && NativePromise.prototype;
  6338. var PromiseConstructor = NativePromise;
  6339. var PromiseConstructorPrototype = NativePromisePrototype;
  6340. var TypeError = global.TypeError;
  6341. var document = global.document;
  6342. var process = global.process;
  6343. var newPromiseCapability = newPromiseCapabilityModule.f;
  6344. var newGenericPromiseCapability = newPromiseCapability;
  6345. var DISPATCH_EVENT = !!(document && document.createEvent && global.dispatchEvent);
  6346. var NATIVE_REJECTION_EVENT = isCallable(global.PromiseRejectionEvent);
  6347. var UNHANDLED_REJECTION = 'unhandledrejection';
  6348. var REJECTION_HANDLED = 'rejectionhandled';
  6349. var PENDING = 0;
  6350. var FULFILLED = 1;
  6351. var REJECTED = 2;
  6352. var HANDLED = 1;
  6353. var UNHANDLED = 2;
  6354. var SUBCLASSING = false;
  6355. var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;
  6356. var FORCED = isForced(PROMISE, function () {
  6357. var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(PromiseConstructor);
  6358. var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(PromiseConstructor);
  6359. // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
  6360. // https://bugs.chromium.org/p/chromium/issues/detail?id=830565
  6361. // We can't detect it synchronously, so just check versions
  6362. if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION === 66) return true;
  6363. // We need Promise#finally in the pure version for preventing prototype pollution
  6364. if (IS_PURE && !PromiseConstructorPrototype['finally']) return true;
  6365. // We can't use @@species feature detection in V8 since it causes
  6366. // deoptimization and performance degradation
  6367. // https://github.com/zloirock/core-js/issues/679
  6368. if (V8_VERSION >= 51 && /native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) return false;
  6369. // Detect correctness of subclassing with @@species support
  6370. var promise = new PromiseConstructor(function (resolve) { resolve(1); });
  6371. var FakePromise = function (exec) {
  6372. exec(function () { /* empty */ }, function () { /* empty */ });
  6373. };
  6374. var constructor = promise.constructor = {};
  6375. constructor[SPECIES] = FakePromise;
  6376. SUBCLASSING = promise.then(function () { /* empty */ }) instanceof FakePromise;
  6377. if (!SUBCLASSING) return true;
  6378. // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test
  6379. return !GLOBAL_CORE_JS_PROMISE && IS_BROWSER && !NATIVE_REJECTION_EVENT;
  6380. });
  6381. var INCORRECT_ITERATION = FORCED || !checkCorrectnessOfIteration(function (iterable) {
  6382. PromiseConstructor.all(iterable)['catch'](function () { /* empty */ });
  6383. });
  6384. // helpers
  6385. var isThenable = function (it) {
  6386. var then;
  6387. return isObject(it) && isCallable(then = it.then) ? then : false;
  6388. };
  6389. var notify = function (state, isReject) {
  6390. if (state.notified) return;
  6391. state.notified = true;
  6392. var chain = state.reactions;
  6393. microtask(function () {
  6394. var value = state.value;
  6395. var ok = state.state == FULFILLED;
  6396. var index = 0;
  6397. // variable length - can't use forEach
  6398. while (chain.length > index) {
  6399. var reaction = chain[index++];
  6400. var handler = ok ? reaction.ok : reaction.fail;
  6401. var resolve = reaction.resolve;
  6402. var reject = reaction.reject;
  6403. var domain = reaction.domain;
  6404. var result, then, exited;
  6405. try {
  6406. if (handler) {
  6407. if (!ok) {
  6408. if (state.rejection === UNHANDLED) onHandleUnhandled(state);
  6409. state.rejection = HANDLED;
  6410. }
  6411. if (handler === true) result = value;
  6412. else {
  6413. if (domain) domain.enter();
  6414. result = handler(value); // can throw
  6415. if (domain) {
  6416. domain.exit();
  6417. exited = true;
  6418. }
  6419. }
  6420. if (result === reaction.promise) {
  6421. reject(TypeError('Promise-chain cycle'));
  6422. } else if (then = isThenable(result)) {
  6423. then.call(result, resolve, reject);
  6424. } else resolve(result);
  6425. } else reject(value);
  6426. } catch (error) {
  6427. if (domain && !exited) domain.exit();
  6428. reject(error);
  6429. }
  6430. }
  6431. state.reactions = [];
  6432. state.notified = false;
  6433. if (isReject && !state.rejection) onUnhandled(state);
  6434. });
  6435. };
  6436. var dispatchEvent = function (name, promise, reason) {
  6437. var event, handler;
  6438. if (DISPATCH_EVENT) {
  6439. event = document.createEvent('Event');
  6440. event.promise = promise;
  6441. event.reason = reason;
  6442. event.initEvent(name, false, true);
  6443. global.dispatchEvent(event);
  6444. } else event = { promise: promise, reason: reason };
  6445. if (!NATIVE_REJECTION_EVENT && (handler = global['on' + name])) handler(event);
  6446. else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);
  6447. };
  6448. var onUnhandled = function (state) {
  6449. task.call(global, function () {
  6450. var promise = state.facade;
  6451. var value = state.value;
  6452. var IS_UNHANDLED = isUnhandled(state);
  6453. var result;
  6454. if (IS_UNHANDLED) {
  6455. result = perform(function () {
  6456. if (IS_NODE) {
  6457. process.emit('unhandledRejection', value, promise);
  6458. } else dispatchEvent(UNHANDLED_REJECTION, promise, value);
  6459. });
  6460. // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
  6461. state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED;
  6462. if (result.error) throw result.value;
  6463. }
  6464. });
  6465. };
  6466. var isUnhandled = function (state) {
  6467. return state.rejection !== HANDLED && !state.parent;
  6468. };
  6469. var onHandleUnhandled = function (state) {
  6470. task.call(global, function () {
  6471. var promise = state.facade;
  6472. if (IS_NODE) {
  6473. process.emit('rejectionHandled', promise);
  6474. } else dispatchEvent(REJECTION_HANDLED, promise, state.value);
  6475. });
  6476. };
  6477. var bind = function (fn, state, unwrap) {
  6478. return function (value) {
  6479. fn(state, value, unwrap);
  6480. };
  6481. };
  6482. var internalReject = function (state, value, unwrap) {
  6483. if (state.done) return;
  6484. state.done = true;
  6485. if (unwrap) state = unwrap;
  6486. state.value = value;
  6487. state.state = REJECTED;
  6488. notify(state, true);
  6489. };
  6490. var internalResolve = function (state, value, unwrap) {
  6491. if (state.done) return;
  6492. state.done = true;
  6493. if (unwrap) state = unwrap;
  6494. try {
  6495. if (state.facade === value) throw TypeError("Promise can't be resolved itself");
  6496. var then = isThenable(value);
  6497. if (then) {
  6498. microtask(function () {
  6499. var wrapper = { done: false };
  6500. try {
  6501. then.call(value,
  6502. bind(internalResolve, wrapper, state),
  6503. bind(internalReject, wrapper, state)
  6504. );
  6505. } catch (error) {
  6506. internalReject(wrapper, error, state);
  6507. }
  6508. });
  6509. } else {
  6510. state.value = value;
  6511. state.state = FULFILLED;
  6512. notify(state, false);
  6513. }
  6514. } catch (error) {
  6515. internalReject({ done: false }, error, state);
  6516. }
  6517. };
  6518. // constructor polyfill
  6519. if (FORCED) {
  6520. // 25.4.3.1 Promise(executor)
  6521. PromiseConstructor = function Promise(executor) {
  6522. anInstance(this, PromiseConstructor, PROMISE);
  6523. aCallable(executor);
  6524. Internal.call(this);
  6525. var state = getInternalState(this);
  6526. try {
  6527. executor(bind(internalResolve, state), bind(internalReject, state));
  6528. } catch (error) {
  6529. internalReject(state, error);
  6530. }
  6531. };
  6532. PromiseConstructorPrototype = PromiseConstructor.prototype;
  6533. // eslint-disable-next-line no-unused-vars -- required for `.length`
  6534. Internal = function Promise(executor) {
  6535. setInternalState(this, {
  6536. type: PROMISE,
  6537. done: false,
  6538. notified: false,
  6539. parent: false,
  6540. reactions: [],
  6541. rejection: false,
  6542. state: PENDING,
  6543. value: undefined
  6544. });
  6545. };
  6546. Internal.prototype = redefineAll(PromiseConstructorPrototype, {
  6547. // `Promise.prototype.then` method
  6548. // https://tc39.es/ecma262/#sec-promise.prototype.then
  6549. then: function then(onFulfilled, onRejected) {
  6550. var state = getInternalPromiseState(this);
  6551. var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor));
  6552. reaction.ok = isCallable(onFulfilled) ? onFulfilled : true;
  6553. reaction.fail = isCallable(onRejected) && onRejected;
  6554. reaction.domain = IS_NODE ? process.domain : undefined;
  6555. state.parent = true;
  6556. state.reactions.push(reaction);
  6557. if (state.state != PENDING) notify(state, false);
  6558. return reaction.promise;
  6559. },
  6560. // `Promise.prototype.catch` method
  6561. // https://tc39.es/ecma262/#sec-promise.prototype.catch
  6562. 'catch': function (onRejected) {
  6563. return this.then(undefined, onRejected);
  6564. }
  6565. });
  6566. OwnPromiseCapability = function () {
  6567. var promise = new Internal();
  6568. var state = getInternalState(promise);
  6569. this.promise = promise;
  6570. this.resolve = bind(internalResolve, state);
  6571. this.reject = bind(internalReject, state);
  6572. };
  6573. newPromiseCapabilityModule.f = newPromiseCapability = function (C) {
  6574. return C === PromiseConstructor || C === PromiseWrapper
  6575. ? new OwnPromiseCapability(C)
  6576. : newGenericPromiseCapability(C);
  6577. };
  6578. if (!IS_PURE && isCallable(NativePromise) && NativePromisePrototype !== Object.prototype) {
  6579. nativeThen = NativePromisePrototype.then;
  6580. if (!SUBCLASSING) {
  6581. // make `Promise#then` return a polyfilled `Promise` for native promise-based APIs
  6582. redefine(NativePromisePrototype, 'then', function then(onFulfilled, onRejected) {
  6583. var that = this;
  6584. return new PromiseConstructor(function (resolve, reject) {
  6585. nativeThen.call(that, resolve, reject);
  6586. }).then(onFulfilled, onRejected);
  6587. // https://github.com/zloirock/core-js/issues/640
  6588. }, { unsafe: true });
  6589. // makes sure that native promise-based APIs `Promise#catch` properly works with patched `Promise#then`
  6590. redefine(NativePromisePrototype, 'catch', PromiseConstructorPrototype['catch'], { unsafe: true });
  6591. }
  6592. // make `.constructor === Promise` work for native promise-based APIs
  6593. try {
  6594. delete NativePromisePrototype.constructor;
  6595. } catch (error) { /* empty */ }
  6596. // make `instanceof Promise` work for native promise-based APIs
  6597. if (setPrototypeOf) {
  6598. setPrototypeOf(NativePromisePrototype, PromiseConstructorPrototype);
  6599. }
  6600. }
  6601. }
  6602. $({ global: true, wrap: true, forced: FORCED }, {
  6603. Promise: PromiseConstructor
  6604. });
  6605. setToStringTag(PromiseConstructor, PROMISE, false, true);
  6606. setSpecies(PROMISE);
  6607. PromiseWrapper = getBuiltIn(PROMISE);
  6608. // statics
  6609. $({ target: PROMISE, stat: true, forced: FORCED }, {
  6610. // `Promise.reject` method
  6611. // https://tc39.es/ecma262/#sec-promise.reject
  6612. reject: function reject(r) {
  6613. var capability = newPromiseCapability(this);
  6614. capability.reject.call(undefined, r);
  6615. return capability.promise;
  6616. }
  6617. });
  6618. $({ target: PROMISE, stat: true, forced: IS_PURE || FORCED }, {
  6619. // `Promise.resolve` method
  6620. // https://tc39.es/ecma262/#sec-promise.resolve
  6621. resolve: function resolve(x) {
  6622. return promiseResolve(IS_PURE && this === PromiseWrapper ? PromiseConstructor : this, x);
  6623. }
  6624. });
  6625. $({ target: PROMISE, stat: true, forced: INCORRECT_ITERATION }, {
  6626. // `Promise.all` method
  6627. // https://tc39.es/ecma262/#sec-promise.all
  6628. all: function all(iterable) {
  6629. var C = this;
  6630. var capability = newPromiseCapability(C);
  6631. var resolve = capability.resolve;
  6632. var reject = capability.reject;
  6633. var result = perform(function () {
  6634. var $promiseResolve = aCallable(C.resolve);
  6635. var values = [];
  6636. var counter = 0;
  6637. var remaining = 1;
  6638. iterate(iterable, function (promise) {
  6639. var index = counter++;
  6640. var alreadyCalled = false;
  6641. values.push(undefined);
  6642. remaining++;
  6643. $promiseResolve.call(C, promise).then(function (value) {
  6644. if (alreadyCalled) return;
  6645. alreadyCalled = true;
  6646. values[index] = value;
  6647. --remaining || resolve(values);
  6648. }, reject);
  6649. });
  6650. --remaining || resolve(values);
  6651. });
  6652. if (result.error) reject(result.value);
  6653. return capability.promise;
  6654. },
  6655. // `Promise.race` method
  6656. // https://tc39.es/ecma262/#sec-promise.race
  6657. race: function race(iterable) {
  6658. var C = this;
  6659. var capability = newPromiseCapability(C);
  6660. var reject = capability.reject;
  6661. var result = perform(function () {
  6662. var $promiseResolve = aCallable(C.resolve);
  6663. iterate(iterable, function (promise) {
  6664. $promiseResolve.call(C, promise).then(capability.resolve, reject);
  6665. });
  6666. });
  6667. if (result.error) reject(result.value);
  6668. return capability.promise;
  6669. }
  6670. });
  6671. /***/ }),
  6672. /***/ "e893":
  6673. /***/ (function(module, exports, __webpack_require__) {
  6674. var hasOwn = __webpack_require__("1a2d");
  6675. var ownKeys = __webpack_require__("56ef");
  6676. var getOwnPropertyDescriptorModule = __webpack_require__("06cf");
  6677. var definePropertyModule = __webpack_require__("9bf2");
  6678. module.exports = function (target, source) {
  6679. var keys = ownKeys(source);
  6680. var defineProperty = definePropertyModule.f;
  6681. var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
  6682. for (var i = 0; i < keys.length; i++) {
  6683. var key = keys[i];
  6684. if (!hasOwn(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
  6685. }
  6686. };
  6687. /***/ }),
  6688. /***/ "e8b5":
  6689. /***/ (function(module, exports, __webpack_require__) {
  6690. var classof = __webpack_require__("c6b6");
  6691. // `IsArray` abstract operation
  6692. // https://tc39.es/ecma262/#sec-isarray
  6693. // eslint-disable-next-line es/no-array-isarray -- safe
  6694. module.exports = Array.isArray || function isArray(argument) {
  6695. return classof(argument) == 'Array';
  6696. };
  6697. /***/ }),
  6698. /***/ "e95a":
  6699. /***/ (function(module, exports, __webpack_require__) {
  6700. var wellKnownSymbol = __webpack_require__("b622");
  6701. var Iterators = __webpack_require__("3f8c");
  6702. var ITERATOR = wellKnownSymbol('iterator');
  6703. var ArrayPrototype = Array.prototype;
  6704. // check on default Array iterator
  6705. module.exports = function (it) {
  6706. return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);
  6707. };
  6708. /***/ }),
  6709. /***/ "f069":
  6710. /***/ (function(module, exports, __webpack_require__) {
  6711. "use strict";
  6712. var aCallable = __webpack_require__("59ed");
  6713. var PromiseCapability = function (C) {
  6714. var resolve, reject;
  6715. this.promise = new C(function ($$resolve, $$reject) {
  6716. if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');
  6717. resolve = $$resolve;
  6718. reject = $$reject;
  6719. });
  6720. this.resolve = aCallable(resolve);
  6721. this.reject = aCallable(reject);
  6722. };
  6723. // `NewPromiseCapability` abstract operation
  6724. // https://tc39.es/ecma262/#sec-newpromisecapability
  6725. module.exports.f = function (C) {
  6726. return new PromiseCapability(C);
  6727. };
  6728. /***/ }),
  6729. /***/ "f0af":
  6730. /***/ (function(module, exports) {
  6731. module.exports = __WEBPACK_EXTERNAL_MODULE_f0af__;
  6732. /***/ }),
  6733. /***/ "f183":
  6734. /***/ (function(module, exports, __webpack_require__) {
  6735. var $ = __webpack_require__("23e7");
  6736. var hiddenKeys = __webpack_require__("d012");
  6737. var isObject = __webpack_require__("861d");
  6738. var hasOwn = __webpack_require__("1a2d");
  6739. var defineProperty = __webpack_require__("9bf2").f;
  6740. var getOwnPropertyNamesModule = __webpack_require__("241c");
  6741. var getOwnPropertyNamesExternalModule = __webpack_require__("057f");
  6742. var uid = __webpack_require__("90e3");
  6743. var FREEZING = __webpack_require__("bb2f");
  6744. var REQUIRED = false;
  6745. var METADATA = uid('meta');
  6746. var id = 0;
  6747. // eslint-disable-next-line es/no-object-isextensible -- safe
  6748. var isExtensible = Object.isExtensible || function () {
  6749. return true;
  6750. };
  6751. var setMetadata = function (it) {
  6752. defineProperty(it, METADATA, { value: {
  6753. objectID: 'O' + id++, // object ID
  6754. weakData: {} // weak collections IDs
  6755. } });
  6756. };
  6757. var fastKey = function (it, create) {
  6758. // return a primitive with prefix
  6759. if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
  6760. if (!hasOwn(it, METADATA)) {
  6761. // can't set metadata to uncaught frozen object
  6762. if (!isExtensible(it)) return 'F';
  6763. // not necessary to add metadata
  6764. if (!create) return 'E';
  6765. // add missing metadata
  6766. setMetadata(it);
  6767. // return object ID
  6768. } return it[METADATA].objectID;
  6769. };
  6770. var getWeakData = function (it, create) {
  6771. if (!hasOwn(it, METADATA)) {
  6772. // can't set metadata to uncaught frozen object
  6773. if (!isExtensible(it)) return true;
  6774. // not necessary to add metadata
  6775. if (!create) return false;
  6776. // add missing metadata
  6777. setMetadata(it);
  6778. // return the store of weak collections IDs
  6779. } return it[METADATA].weakData;
  6780. };
  6781. // add metadata on freeze-family methods calling
  6782. var onFreeze = function (it) {
  6783. if (FREEZING && REQUIRED && isExtensible(it) && !hasOwn(it, METADATA)) setMetadata(it);
  6784. return it;
  6785. };
  6786. var enable = function () {
  6787. meta.enable = function () { /* empty */ };
  6788. REQUIRED = true;
  6789. var getOwnPropertyNames = getOwnPropertyNamesModule.f;
  6790. var splice = [].splice;
  6791. var test = {};
  6792. test[METADATA] = 1;
  6793. // prevent exposing of metadata key
  6794. if (getOwnPropertyNames(test).length) {
  6795. getOwnPropertyNamesModule.f = function (it) {
  6796. var result = getOwnPropertyNames(it);
  6797. for (var i = 0, length = result.length; i < length; i++) {
  6798. if (result[i] === METADATA) {
  6799. splice.call(result, i, 1);
  6800. break;
  6801. }
  6802. } return result;
  6803. };
  6804. $({ target: 'Object', stat: true, forced: true }, {
  6805. getOwnPropertyNames: getOwnPropertyNamesExternalModule.f
  6806. });
  6807. }
  6808. };
  6809. var meta = module.exports = {
  6810. enable: enable,
  6811. fastKey: fastKey,
  6812. getWeakData: getWeakData,
  6813. onFreeze: onFreeze
  6814. };
  6815. hiddenKeys[METADATA] = true;
  6816. /***/ }),
  6817. /***/ "f5df":
  6818. /***/ (function(module, exports, __webpack_require__) {
  6819. var TO_STRING_TAG_SUPPORT = __webpack_require__("00ee");
  6820. var isCallable = __webpack_require__("1626");
  6821. var classofRaw = __webpack_require__("c6b6");
  6822. var wellKnownSymbol = __webpack_require__("b622");
  6823. var TO_STRING_TAG = wellKnownSymbol('toStringTag');
  6824. // ES3 wrong here
  6825. var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
  6826. // fallback for IE11 Script Access Denied error
  6827. var tryGet = function (it, key) {
  6828. try {
  6829. return it[key];
  6830. } catch (error) { /* empty */ }
  6831. };
  6832. // getting tag from ES6+ `Object.prototype.toString`
  6833. module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
  6834. var O, tag, result;
  6835. return it === undefined ? 'Undefined' : it === null ? 'Null'
  6836. // @@toStringTag case
  6837. : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG)) == 'string' ? tag
  6838. // builtinTag case
  6839. : CORRECT_ARGUMENTS ? classofRaw(O)
  6840. // ES3 arguments fallback
  6841. : (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result;
  6842. };
  6843. /***/ }),
  6844. /***/ "f772":
  6845. /***/ (function(module, exports, __webpack_require__) {
  6846. var shared = __webpack_require__("5692");
  6847. var uid = __webpack_require__("90e3");
  6848. var keys = shared('keys');
  6849. module.exports = function (key) {
  6850. return keys[key] || (keys[key] = uid(key));
  6851. };
  6852. /***/ }),
  6853. /***/ "fb15":
  6854. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6855. "use strict";
  6856. // ESM COMPAT FLAG
  6857. __webpack_require__.r(__webpack_exports__);
  6858. // EXPORTS
  6859. __webpack_require__.d(__webpack_exports__, "install", function() { return /* reexport */ all_install; });
  6860. __webpack_require__.d(__webpack_exports__, "use", function() { return /* reexport */ use; });
  6861. __webpack_require__.d(__webpack_exports__, "config", function() { return /* reexport */ v_x_e_table_config; });
  6862. __webpack_require__.d(__webpack_exports__, "t", function() { return /* reexport */ t; });
  6863. __webpack_require__.d(__webpack_exports__, "_t", function() { return /* reexport */ _t; });
  6864. __webpack_require__.d(__webpack_exports__, "v", function() { return /* reexport */ v; });
  6865. __webpack_require__.d(__webpack_exports__, "VXETable", function() { return /* reexport */ VXETable; });
  6866. __webpack_require__.d(__webpack_exports__, "interceptor", function() { return /* reexport */ interceptor; });
  6867. __webpack_require__.d(__webpack_exports__, "renderer", function() { return /* reexport */ renderer; });
  6868. __webpack_require__.d(__webpack_exports__, "commands", function() { return /* reexport */ commands; });
  6869. __webpack_require__.d(__webpack_exports__, "menus", function() { return /* reexport */ menus; });
  6870. __webpack_require__.d(__webpack_exports__, "formats", function() { return /* reexport */ formats; });
  6871. __webpack_require__.d(__webpack_exports__, "setup", function() { return /* reexport */ setup; });
  6872. __webpack_require__.d(__webpack_exports__, "Icon", function() { return /* reexport */ Icon; });
  6873. __webpack_require__.d(__webpack_exports__, "Filter", function() { return /* reexport */ Filter; });
  6874. __webpack_require__.d(__webpack_exports__, "Edit", function() { return /* reexport */ Edit; });
  6875. __webpack_require__.d(__webpack_exports__, "saveFile", function() { return /* reexport */ saveLocalFile; });
  6876. __webpack_require__.d(__webpack_exports__, "readFile", function() { return /* reexport */ readLocalFile; });
  6877. __webpack_require__.d(__webpack_exports__, "print", function() { return /* reexport */ print; });
  6878. __webpack_require__.d(__webpack_exports__, "Export", function() { return /* reexport */ Export; });
  6879. __webpack_require__.d(__webpack_exports__, "Keyboard", function() { return /* reexport */ Keyboard; });
  6880. __webpack_require__.d(__webpack_exports__, "Validator", function() { return /* reexport */ Validator; });
  6881. __webpack_require__.d(__webpack_exports__, "Header", function() { return /* reexport */ Header; });
  6882. __webpack_require__.d(__webpack_exports__, "Footer", function() { return /* reexport */ Footer; });
  6883. __webpack_require__.d(__webpack_exports__, "Column", function() { return /* reexport */ Column; });
  6884. __webpack_require__.d(__webpack_exports__, "Colgroup", function() { return /* reexport */ Colgroup; });
  6885. __webpack_require__.d(__webpack_exports__, "Grid", function() { return /* reexport */ Grid; });
  6886. __webpack_require__.d(__webpack_exports__, "Menu", function() { return /* reexport */ Menu; });
  6887. __webpack_require__.d(__webpack_exports__, "Toolbar", function() { return /* reexport */ Toolbar; });
  6888. __webpack_require__.d(__webpack_exports__, "Pager", function() { return /* reexport */ Pager; });
  6889. __webpack_require__.d(__webpack_exports__, "Checkbox", function() { return /* reexport */ Checkbox; });
  6890. __webpack_require__.d(__webpack_exports__, "CheckboxGroup", function() { return /* reexport */ CheckboxGroup; });
  6891. __webpack_require__.d(__webpack_exports__, "Radio", function() { return /* reexport */ Radio; });
  6892. __webpack_require__.d(__webpack_exports__, "RadioGroup", function() { return /* reexport */ RadioGroup; });
  6893. __webpack_require__.d(__webpack_exports__, "RadioButton", function() { return /* reexport */ RadioButton; });
  6894. __webpack_require__.d(__webpack_exports__, "Input", function() { return /* reexport */ Input; });
  6895. __webpack_require__.d(__webpack_exports__, "Textarea", function() { return /* reexport */ Textarea; });
  6896. __webpack_require__.d(__webpack_exports__, "Button", function() { return /* reexport */ Button; });
  6897. __webpack_require__.d(__webpack_exports__, "modal", function() { return /* reexport */ modal_modal; });
  6898. __webpack_require__.d(__webpack_exports__, "Modal", function() { return /* reexport */ Modal; });
  6899. __webpack_require__.d(__webpack_exports__, "Tooltip", function() { return /* reexport */ Tooltip; });
  6900. __webpack_require__.d(__webpack_exports__, "Form", function() { return /* reexport */ Form; });
  6901. __webpack_require__.d(__webpack_exports__, "FormItem", function() { return /* reexport */ FormItem; });
  6902. __webpack_require__.d(__webpack_exports__, "FormGather", function() { return /* reexport */ FormGather; });
  6903. __webpack_require__.d(__webpack_exports__, "Select", function() { return /* reexport */ Select; });
  6904. __webpack_require__.d(__webpack_exports__, "Optgroup", function() { return /* reexport */ Optgroup; });
  6905. __webpack_require__.d(__webpack_exports__, "Option", function() { return /* reexport */ Option; });
  6906. __webpack_require__.d(__webpack_exports__, "Switch", function() { return /* reexport */ Switch; });
  6907. __webpack_require__.d(__webpack_exports__, "List", function() { return /* reexport */ List; });
  6908. __webpack_require__.d(__webpack_exports__, "Pulldown", function() { return /* reexport */ Pulldown; });
  6909. __webpack_require__.d(__webpack_exports__, "Table", function() { return /* reexport */ Table; });
  6910. // NAMESPACE OBJECT: ./packages/all.js
  6911. var all_namespaceObject = {};
  6912. __webpack_require__.r(all_namespaceObject);
  6913. __webpack_require__.d(all_namespaceObject, "install", function() { return all_install; });
  6914. __webpack_require__.d(all_namespaceObject, "use", function() { return use; });
  6915. __webpack_require__.d(all_namespaceObject, "config", function() { return v_x_e_table_config; });
  6916. __webpack_require__.d(all_namespaceObject, "t", function() { return t; });
  6917. __webpack_require__.d(all_namespaceObject, "_t", function() { return _t; });
  6918. __webpack_require__.d(all_namespaceObject, "v", function() { return v; });
  6919. __webpack_require__.d(all_namespaceObject, "VXETable", function() { return VXETable; });
  6920. __webpack_require__.d(all_namespaceObject, "interceptor", function() { return interceptor; });
  6921. __webpack_require__.d(all_namespaceObject, "renderer", function() { return renderer; });
  6922. __webpack_require__.d(all_namespaceObject, "commands", function() { return commands; });
  6923. __webpack_require__.d(all_namespaceObject, "menus", function() { return menus; });
  6924. __webpack_require__.d(all_namespaceObject, "formats", function() { return formats; });
  6925. __webpack_require__.d(all_namespaceObject, "setup", function() { return setup; });
  6926. __webpack_require__.d(all_namespaceObject, "Icon", function() { return Icon; });
  6927. __webpack_require__.d(all_namespaceObject, "Filter", function() { return Filter; });
  6928. __webpack_require__.d(all_namespaceObject, "Edit", function() { return Edit; });
  6929. __webpack_require__.d(all_namespaceObject, "saveFile", function() { return saveLocalFile; });
  6930. __webpack_require__.d(all_namespaceObject, "readFile", function() { return readLocalFile; });
  6931. __webpack_require__.d(all_namespaceObject, "print", function() { return print; });
  6932. __webpack_require__.d(all_namespaceObject, "Export", function() { return Export; });
  6933. __webpack_require__.d(all_namespaceObject, "Keyboard", function() { return Keyboard; });
  6934. __webpack_require__.d(all_namespaceObject, "Validator", function() { return Validator; });
  6935. __webpack_require__.d(all_namespaceObject, "Header", function() { return Header; });
  6936. __webpack_require__.d(all_namespaceObject, "Footer", function() { return Footer; });
  6937. __webpack_require__.d(all_namespaceObject, "Column", function() { return Column; });
  6938. __webpack_require__.d(all_namespaceObject, "Colgroup", function() { return Colgroup; });
  6939. __webpack_require__.d(all_namespaceObject, "Grid", function() { return Grid; });
  6940. __webpack_require__.d(all_namespaceObject, "Menu", function() { return Menu; });
  6941. __webpack_require__.d(all_namespaceObject, "Toolbar", function() { return Toolbar; });
  6942. __webpack_require__.d(all_namespaceObject, "Pager", function() { return Pager; });
  6943. __webpack_require__.d(all_namespaceObject, "Checkbox", function() { return Checkbox; });
  6944. __webpack_require__.d(all_namespaceObject, "CheckboxGroup", function() { return CheckboxGroup; });
  6945. __webpack_require__.d(all_namespaceObject, "Radio", function() { return Radio; });
  6946. __webpack_require__.d(all_namespaceObject, "RadioGroup", function() { return RadioGroup; });
  6947. __webpack_require__.d(all_namespaceObject, "RadioButton", function() { return RadioButton; });
  6948. __webpack_require__.d(all_namespaceObject, "Input", function() { return Input; });
  6949. __webpack_require__.d(all_namespaceObject, "Textarea", function() { return Textarea; });
  6950. __webpack_require__.d(all_namespaceObject, "Button", function() { return Button; });
  6951. __webpack_require__.d(all_namespaceObject, "modal", function() { return modal_modal; });
  6952. __webpack_require__.d(all_namespaceObject, "Modal", function() { return Modal; });
  6953. __webpack_require__.d(all_namespaceObject, "Tooltip", function() { return Tooltip; });
  6954. __webpack_require__.d(all_namespaceObject, "Form", function() { return Form; });
  6955. __webpack_require__.d(all_namespaceObject, "FormItem", function() { return FormItem; });
  6956. __webpack_require__.d(all_namespaceObject, "FormGather", function() { return FormGather; });
  6957. __webpack_require__.d(all_namespaceObject, "Select", function() { return Select; });
  6958. __webpack_require__.d(all_namespaceObject, "Optgroup", function() { return Optgroup; });
  6959. __webpack_require__.d(all_namespaceObject, "Option", function() { return Option; });
  6960. __webpack_require__.d(all_namespaceObject, "Switch", function() { return Switch; });
  6961. __webpack_require__.d(all_namespaceObject, "List", function() { return List; });
  6962. __webpack_require__.d(all_namespaceObject, "Pulldown", function() { return Pulldown; });
  6963. __webpack_require__.d(all_namespaceObject, "Table", function() { return Table; });
  6964. // CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js
  6965. // This file is imported into lib/wc client bundles.
  6966. if (typeof window !== 'undefined') {
  6967. var currentScript = window.document.currentScript
  6968. if (true) {
  6969. var getCurrentScript = __webpack_require__("8875")
  6970. currentScript = getCurrentScript()
  6971. // for backward compatibility, because previously we directly included the polyfill
  6972. if (!('currentScript' in document)) {
  6973. Object.defineProperty(document, 'currentScript', { get: getCurrentScript })
  6974. }
  6975. }
  6976. var src = currentScript && currentScript.src.match(/(.+\/)[^/]+\.js(\?.*)?$/)
  6977. if (src) {
  6978. __webpack_require__.p = src[1] // eslint-disable-line
  6979. }
  6980. }
  6981. // Indicate to webpack that this file can be concatenated
  6982. /* harmony default export */ var setPublicPath = (null);
  6983. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.map.js
  6984. var es_array_map = __webpack_require__("d81d");
  6985. // EXTERNAL MODULE: external {"root":"XEUtils","commonjs":"xe-utils","commonjs2":"xe-utils","amd":"xe-utils"}
  6986. var external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_ = __webpack_require__("f0af");
  6987. 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_);
  6988. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js
  6989. function _classCallCheck(instance, Constructor) {
  6990. if (!(instance instanceof Constructor)) {
  6991. throw new TypeError("Cannot call a class as a function");
  6992. }
  6993. }
  6994. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js
  6995. function _defineProperties(target, props) {
  6996. for (var i = 0; i < props.length; i++) {
  6997. var descriptor = props[i];
  6998. descriptor.enumerable = descriptor.enumerable || false;
  6999. descriptor.configurable = true;
  7000. if ("value" in descriptor) descriptor.writable = true;
  7001. Object.defineProperty(target, descriptor.key, descriptor);
  7002. }
  7003. }
  7004. function _createClass(Constructor, protoProps, staticProps) {
  7005. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  7006. if (staticProps) _defineProperties(Constructor, staticProps);
  7007. return Constructor;
  7008. }
  7009. // CONCATENATED MODULE: ./packages/v-x-e-table/src/conf.js
  7010. var iconPrefix = 'vxe-icon-';
  7011. /* harmony default export */ var src_conf = ({
  7012. size: null,
  7013. // 全局尺寸
  7014. zIndex: 999,
  7015. // 全局 zIndex 起始值,如果项目的的 z-index 样式值过大时就需要跟随设置更大,避免被遮挡
  7016. version: 0,
  7017. // 版本号,对于某些带数据缓存的功能有用到,上升版本号可以用于重置数据
  7018. // resizeInterval: 500,
  7019. emptyCell: ' ',
  7020. // loadingText: null, // 自定义loading提示内容,如果为null则不显示文本
  7021. table: {
  7022. fit: true,
  7023. showHeader: true,
  7024. animat: true,
  7025. delayHover: 250,
  7026. autoResize: true,
  7027. // keepSource: false,
  7028. // showOverflow: null,
  7029. // showHeaderOverflow: null,
  7030. // showFooterOverflow: null,
  7031. // resizeInterval: 500,
  7032. // size: null,
  7033. // zIndex: null,
  7034. // stripe: false,
  7035. // border: false,
  7036. // round: false,
  7037. // emptyText: '暂无数据',
  7038. // emptyRender: {
  7039. // name: ''
  7040. // },
  7041. // rowConfig: {
  7042. // keyField: '_X_ROW_KEY' // 行数据的唯一主键字段名
  7043. // },
  7044. radioConfig: {
  7045. // trigger: 'default'
  7046. strict: true
  7047. },
  7048. checkboxConfig: {
  7049. // trigger: 'default',
  7050. strict: true
  7051. },
  7052. tooltipConfig: {
  7053. enterable: true
  7054. },
  7055. validConfig: {
  7056. showMessage: true,
  7057. message: 'default'
  7058. },
  7059. // menuConfig: {
  7060. // visibleMethod () {}
  7061. // },
  7062. // customConfig: {
  7063. // storage: false,
  7064. // checkMethod () {}
  7065. // },
  7066. sortConfig: {
  7067. // remote: false,
  7068. // trigger: 'default',
  7069. // orders: ['asc', 'desc', null],
  7070. // sortMethod: null,
  7071. showIcon: true
  7072. },
  7073. filterConfig: {
  7074. // remote: false,
  7075. // filterMethod: null,
  7076. showIcon: true
  7077. },
  7078. treeConfig: {
  7079. rowField: 'id',
  7080. parentField: 'parentId',
  7081. children: 'children',
  7082. hasChild: 'hasChild',
  7083. mapChildren: '_X_ROW_CHILD',
  7084. indent: 20,
  7085. showIcon: true
  7086. },
  7087. expandConfig: {
  7088. // trigger: 'default',
  7089. showIcon: true
  7090. },
  7091. editConfig: {
  7092. // mode: 'cell',
  7093. showIcon: true,
  7094. showAsterisk: true
  7095. },
  7096. importConfig: {
  7097. modes: ['insert', 'covering']
  7098. },
  7099. exportConfig: {
  7100. modes: ['current', 'selected']
  7101. },
  7102. printConfig: {
  7103. modes: ['current', 'selected']
  7104. },
  7105. mouseConfig: {
  7106. extension: true
  7107. },
  7108. keyboardConfig: {
  7109. isEsc: true
  7110. },
  7111. areaConfig: {
  7112. selectCellByHeader: true
  7113. },
  7114. clipConfig: {
  7115. isCopy: true,
  7116. isCut: true,
  7117. isPaste: true
  7118. },
  7119. fnrConfig: {
  7120. isFind: true,
  7121. isReplace: true
  7122. },
  7123. scrollX: {
  7124. enabled: true,
  7125. gt: 60 // oSize: 0
  7126. },
  7127. scrollY: {
  7128. enabled: true,
  7129. gt: 100 // oSize: 0
  7130. }
  7131. },
  7132. export: {
  7133. types: {}
  7134. },
  7135. icon: {
  7136. // loading
  7137. LOADING: iconPrefix + 'spinner roll vxe-loading--default-icon',
  7138. // table
  7139. TABLE_SORT_ASC: iconPrefix + 'caret-up',
  7140. TABLE_SORT_DESC: iconPrefix + 'caret-down',
  7141. TABLE_FILTER_NONE: iconPrefix + 'funnel',
  7142. TABLE_FILTER_MATCH: iconPrefix + 'funnel',
  7143. TABLE_EDIT: iconPrefix + 'edit',
  7144. TABLE_HELP: iconPrefix + 'question-circle-fill',
  7145. TABLE_TREE_LOADED: iconPrefix + 'spinner roll',
  7146. TABLE_TREE_OPEN: iconPrefix + 'caret-right rotate90',
  7147. TABLE_TREE_CLOSE: iconPrefix + 'caret-right',
  7148. TABLE_EXPAND_LOADED: iconPrefix + 'spinner roll',
  7149. TABLE_EXPAND_OPEN: iconPrefix + 'arrow-right rotate90',
  7150. TABLE_EXPAND_CLOSE: iconPrefix + 'arrow-right',
  7151. TABLE_CHECKBOX_CHECKED: iconPrefix + 'checkbox-checked',
  7152. TABLE_CHECKBOX_UNCHECKED: iconPrefix + 'checkbox-unchecked',
  7153. TABLE_CHECKBOX_INDETERMINATE: iconPrefix + 'checkbox-indeterminate',
  7154. TABLE_RADIO_CHECKED: iconPrefix + 'radio-checked',
  7155. TABLE_RADIO_UNCHECKED: iconPrefix + 'radio-unchecked',
  7156. // button
  7157. BUTTON_DROPDOWN: iconPrefix + 'arrow-down',
  7158. BUTTON_LOADING: iconPrefix + 'spinner roll',
  7159. // select
  7160. SELECT_LOADED: iconPrefix + 'spinner roll',
  7161. SELECT_OPEN: iconPrefix + 'caret-down rotate180',
  7162. SELECT_CLOSE: iconPrefix + 'caret-down',
  7163. // pager
  7164. PAGER_JUMP_PREV: iconPrefix + 'arrow-double-left',
  7165. PAGER_JUMP_NEXT: iconPrefix + 'arrow-double-right',
  7166. PAGER_PREV_PAGE: iconPrefix + 'arrow-left',
  7167. PAGER_NEXT_PAGE: iconPrefix + 'arrow-right',
  7168. PAGER_JUMP_MORE: iconPrefix + 'ellipsis-h',
  7169. // input
  7170. INPUT_CLEAR: iconPrefix + 'error-circle-fill',
  7171. INPUT_PWD: iconPrefix + 'eye-fill',
  7172. INPUT_SHOW_PWD: iconPrefix + 'eye-fill-close',
  7173. INPUT_PREV_NUM: iconPrefix + 'caret-up',
  7174. INPUT_NEXT_NUM: iconPrefix + 'caret-down',
  7175. INPUT_DATE: iconPrefix + 'calendar',
  7176. INPUT_SEARCH: iconPrefix + 'search',
  7177. // modal
  7178. MODAL_ZOOM_IN: iconPrefix + 'square',
  7179. MODAL_ZOOM_OUT: iconPrefix + 'maximize',
  7180. MODAL_CLOSE: iconPrefix + 'close',
  7181. MODAL_INFO: iconPrefix + 'info-circle-fill',
  7182. MODAL_SUCCESS: iconPrefix + 'success-circle-fill',
  7183. MODAL_WARNING: iconPrefix + 'warnion-circle-fill',
  7184. MODAL_ERROR: iconPrefix + 'error-circle-fill',
  7185. MODAL_QUESTION: iconPrefix + 'question-circle-fill',
  7186. MODAL_LOADING: iconPrefix + 'spinner roll',
  7187. // toolbar
  7188. TOOLBAR_TOOLS_REFRESH: iconPrefix + 'repeat',
  7189. TOOLBAR_TOOLS_REFRESH_LOADING: iconPrefix + 'repeat roll',
  7190. TOOLBAR_TOOLS_IMPORT: iconPrefix + 'upload',
  7191. TOOLBAR_TOOLS_EXPORT: iconPrefix + 'download',
  7192. TOOLBAR_TOOLS_PRINT: iconPrefix + 'print',
  7193. TOOLBAR_TOOLS_FULLSCREEN: iconPrefix + 'fullscreen',
  7194. TOOLBAR_TOOLS_MINIMIZE: iconPrefix + 'minimize',
  7195. TOOLBAR_TOOLS_CUSTOM: iconPrefix + 'custom-column',
  7196. // form
  7197. FORM_PREFIX: iconPrefix + 'question-circle-fill',
  7198. FORM_SUFFIX: iconPrefix + 'question-circle-fill',
  7199. FORM_FOLDING: iconPrefix + 'arrow-up rotate180',
  7200. FORM_UNFOLDING: iconPrefix + 'arrow-up'
  7201. },
  7202. grid: {
  7203. // size: null,
  7204. // zoomConfig: {
  7205. // escRestore: true
  7206. // },
  7207. formConfig: {
  7208. enabled: true
  7209. },
  7210. pagerConfig: {
  7211. enabled: true // perfect: false
  7212. },
  7213. toolbarConfig: {
  7214. enabled: true // perfect: false
  7215. },
  7216. proxyConfig: {
  7217. enabled: true,
  7218. autoLoad: true,
  7219. message: true,
  7220. props: {
  7221. list: null,
  7222. result: 'result',
  7223. total: 'page.total',
  7224. message: 'message'
  7225. } // beforeItem: null,
  7226. // beforeColumn: null,
  7227. // beforeQuery: null,
  7228. // afterQuery: null,
  7229. // beforeDelete: null,
  7230. // afterDelete: null,
  7231. // beforeSave: null,
  7232. // afterSave: null
  7233. }
  7234. },
  7235. tooltip: {
  7236. // size: null,
  7237. trigger: 'hover',
  7238. theme: 'dark',
  7239. enterDelay: 500,
  7240. leaveDelay: 300
  7241. },
  7242. pager: {// size: null,
  7243. // autoHidden: false,
  7244. // perfect: true,
  7245. // pageSize: 10,
  7246. // pagerCount: 7,
  7247. // pageSizes: [10, 15, 20, 50, 100],
  7248. // layouts: ['PrevJump', 'PrevPage', 'Jump', 'PageCount', 'NextPage', 'NextJump', 'Sizes', 'Total']
  7249. },
  7250. form: {
  7251. // preventSubmit: false,
  7252. // size: null,
  7253. // colon: false,
  7254. validConfig: {
  7255. showMessage: true,
  7256. autoPos: true
  7257. },
  7258. tooltipConfig: {
  7259. enterable: true
  7260. },
  7261. titleAsterisk: true
  7262. },
  7263. input: {
  7264. // size: null,
  7265. // transfer: false
  7266. // parseFormat: 'yyyy-MM-dd HH:mm:ss.SSS',
  7267. // labelFormat: '',
  7268. // valueFormat: '',
  7269. startDate: new Date(1900, 0, 1),
  7270. endDate: new Date(2100, 0, 1),
  7271. startDay: 1,
  7272. selectDay: 1,
  7273. digits: 2,
  7274. controls: true
  7275. },
  7276. textarea: {// size: null,
  7277. // autosize: {
  7278. // minRows: 1,
  7279. // maxRows: 10
  7280. // }
  7281. },
  7282. select: {
  7283. // size: null,
  7284. // transfer: false,
  7285. // optionConfig: {
  7286. // keyField: '_X_OPTION_KEY'
  7287. // },
  7288. multiCharOverflow: 8
  7289. },
  7290. toolbar: {// size: null,
  7291. // import: {
  7292. // mode: 'covering'
  7293. // },
  7294. // export: {
  7295. // types: ['csv', 'html', 'xml', 'txt']
  7296. // },
  7297. // custom: {
  7298. // isFooter: true
  7299. // },
  7300. // buttons: []
  7301. },
  7302. button: {// size: null,
  7303. // transfer: false
  7304. },
  7305. radio: {
  7306. // size: null,
  7307. strict: true
  7308. },
  7309. radioButton: {
  7310. // size: null,
  7311. strict: true
  7312. },
  7313. radioGroup: {
  7314. // size: null,
  7315. strict: true
  7316. },
  7317. checkbox: {// size: null
  7318. },
  7319. switch: {// size: null
  7320. },
  7321. modal: {
  7322. // size: null,
  7323. top: 15,
  7324. showHeader: true,
  7325. minWidth: 340,
  7326. minHeight: 140,
  7327. lockView: true,
  7328. mask: true,
  7329. duration: 3000,
  7330. marginSize: 0,
  7331. dblclickZoom: true,
  7332. showTitleOverflow: true,
  7333. animat: true,
  7334. showClose: true,
  7335. draggable: true,
  7336. // storage: false,
  7337. storageKey: 'VXE_MODAL_POSITION'
  7338. },
  7339. list: {
  7340. // size: null,
  7341. scrollY: {
  7342. enabled: true,
  7343. gt: 100 // oSize: 0
  7344. }
  7345. },
  7346. i18n: function i18n(key) {
  7347. return key;
  7348. }
  7349. });
  7350. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.regexp.exec.js
  7351. var es_regexp_exec = __webpack_require__("ac1f");
  7352. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.replace.js
  7353. var es_string_replace = __webpack_require__("5319");
  7354. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.split.js
  7355. var es_string_split = __webpack_require__("1276");
  7356. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.join.js
  7357. var es_array_join = __webpack_require__("a15b");
  7358. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.concat.js
  7359. var es_array_concat = __webpack_require__("99af");
  7360. // CONCATENATED MODULE: ./packages/tools/log.js
  7361. function getLog(message, params) {
  7362. return "[vxe-table v".concat("3.6.6-beta.1", "] ").concat(src_conf.i18n(message, params));
  7363. }
  7364. function outLog(type) {
  7365. return function (message, params) {
  7366. var msg = getLog(message, params);
  7367. console[type](msg);
  7368. return msg;
  7369. };
  7370. }
  7371. var warnLog = outLog('warn');
  7372. var errLog = outLog('error');
  7373. // CONCATENATED MODULE: ./packages/v-x-e-table/src/interceptor.js
  7374. function toType(type) {
  7375. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toValueString(type).replace('_', '').toLowerCase();
  7376. }
  7377. var eventTypes = 'created,mounted,activated,beforeDestroy,destroyed,event.clearActived,event.clearFilter,event.clearAreas,event.showMenu,event.keydown,event.export,event.import'.split(',').map(toType);
  7378. var storeMap = {};
  7379. var interceptor = {
  7380. mixin: function mixin(map) {
  7381. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.each(map, function (callback, type) {
  7382. return interceptor.add(type, callback);
  7383. });
  7384. return interceptor;
  7385. },
  7386. get: function get(type) {
  7387. return storeMap[toType(type)] || [];
  7388. },
  7389. add: function add(type, callback) {
  7390. type = toType(type); // 检测类型
  7391. if (false) {}
  7392. if (callback && eventTypes.indexOf(type) > -1) {
  7393. var eList = storeMap[type];
  7394. if (!eList) {
  7395. eList = storeMap[type] = [];
  7396. } // 检测重复
  7397. if (false) {}
  7398. eList.push(callback);
  7399. }
  7400. return interceptor;
  7401. },
  7402. delete: function _delete(type, callback) {
  7403. var eList = storeMap[toType(type)];
  7404. if (eList) {
  7405. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.remove(eList, function (fn) {
  7406. return fn === callback;
  7407. });
  7408. }
  7409. return interceptor;
  7410. }
  7411. };
  7412. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
  7413. function _defineProperty(obj, key, value) {
  7414. if (key in obj) {
  7415. Object.defineProperty(obj, key, {
  7416. value: value,
  7417. enumerable: true,
  7418. configurable: true,
  7419. writable: true
  7420. });
  7421. } else {
  7422. obj[key] = value;
  7423. }
  7424. return obj;
  7425. }
  7426. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.function.name.js
  7427. var es_function_name = __webpack_require__("b0c0");
  7428. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.object.assign.js
  7429. var es_object_assign = __webpack_require__("cca6");
  7430. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.find.js
  7431. var es_array_find = __webpack_require__("7db0");
  7432. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.number.to-fixed.js
  7433. var es_number_to_fixed = __webpack_require__("b680");
  7434. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
  7435. function _arrayLikeToArray(arr, len) {
  7436. if (len == null || len > arr.length) len = arr.length;
  7437. for (var i = 0, arr2 = new Array(len); i < len; i++) {
  7438. arr2[i] = arr[i];
  7439. }
  7440. return arr2;
  7441. }
  7442. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
  7443. function _arrayWithoutHoles(arr) {
  7444. if (Array.isArray(arr)) return _arrayLikeToArray(arr);
  7445. }
  7446. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.symbol.js
  7447. var es_symbol = __webpack_require__("a4d3");
  7448. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.symbol.description.js
  7449. var es_symbol_description = __webpack_require__("e01a");
  7450. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.object.to-string.js
  7451. var es_object_to_string = __webpack_require__("d3b7");
  7452. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.symbol.iterator.js
  7453. var es_symbol_iterator = __webpack_require__("d28b");
  7454. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.iterator.js
  7455. var es_array_iterator = __webpack_require__("e260");
  7456. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.iterator.js
  7457. var es_string_iterator = __webpack_require__("3ca3");
  7458. // EXTERNAL MODULE: ./node_modules/core-js/modules/web.dom-collections.iterator.js
  7459. var web_dom_collections_iterator = __webpack_require__("ddb0");
  7460. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.from.js
  7461. var es_array_from = __webpack_require__("a630");
  7462. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js
  7463. function _iterableToArray(iter) {
  7464. if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
  7465. }
  7466. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.slice.js
  7467. var es_array_slice = __webpack_require__("fb6a");
  7468. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
  7469. function _unsupportedIterableToArray(o, minLen) {
  7470. if (!o) return;
  7471. if (typeof o === "string") return _arrayLikeToArray(o, minLen);
  7472. var n = Object.prototype.toString.call(o).slice(8, -1);
  7473. if (n === "Object" && o.constructor) n = o.constructor.name;
  7474. if (n === "Map" || n === "Set") return Array.from(o);
  7475. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
  7476. }
  7477. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
  7478. function _nonIterableSpread() {
  7479. throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  7480. }
  7481. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
  7482. function _toConsumableArray(arr) {
  7483. return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
  7484. }
  7485. // EXTERNAL MODULE: ./node_modules/core-js/modules/web.dom-collections.for-each.js
  7486. var web_dom_collections_for_each = __webpack_require__("159b");
  7487. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.splice.js
  7488. var es_array_splice = __webpack_require__("a434");
  7489. // CONCATENATED MODULE: ./packages/tools/utils.js
  7490. var zindexIndex = 0;
  7491. var lastZindex = 1;
  7492. function isEnableConf(conf) {
  7493. return conf && conf.enabled !== false;
  7494. }
  7495. /**
  7496. * 判断值为:'' | null | undefined 时都属于空值
  7497. */
  7498. function eqEmptyValue(cellValue) {
  7499. return cellValue === '' || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eqNull(cellValue);
  7500. }
  7501. function getFuncText(content) {
  7502. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(content) ? content() : src_conf.translate ? src_conf.translate(content) : content;
  7503. } // 获取所有的列,排除分组
  7504. function getColumnList(columns) {
  7505. var result = [];
  7506. columns.forEach(function (column) {
  7507. result.push.apply(result, _toConsumableArray(column.children && column.children.length ? getColumnList(column.children) : [column]));
  7508. });
  7509. return result;
  7510. }
  7511. var UtilTools = {
  7512. nextZIndex: function nextZIndex() {
  7513. lastZindex = src_conf.zIndex + zindexIndex++;
  7514. return lastZindex;
  7515. },
  7516. getLastZIndex: function getLastZIndex() {
  7517. return lastZindex;
  7518. },
  7519. getColumnList: getColumnList,
  7520. getClass: function getClass(property, params) {
  7521. return property ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(property) ? property(params) : property : '';
  7522. },
  7523. formatText: function formatText(value, placeholder) {
  7524. return '' + (value === '' || value === null || value === undefined ? placeholder ? src_conf.emptyCell : '' : value);
  7525. },
  7526. getCellValue: function getCellValue(row, column) {
  7527. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, column.field);
  7528. },
  7529. setCellValue: function setCellValue(row, column, value) {
  7530. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.set(row, column.field, value);
  7531. },
  7532. // 组装列配置
  7533. assemColumn: function assemColumn(_vm) {
  7534. var $el = _vm.$el,
  7535. $xetable = _vm.$xetable,
  7536. $xecolumn = _vm.$xecolumn,
  7537. columnConfig = _vm.columnConfig;
  7538. var groupConfig = $xecolumn ? $xecolumn.columnConfig : null;
  7539. columnConfig.slots = _vm.$scopedSlots;
  7540. if (groupConfig) {
  7541. if (false) {}
  7542. if (!groupConfig.children) {
  7543. groupConfig.children = [];
  7544. }
  7545. groupConfig.children.splice([].indexOf.call($xecolumn.$el.children, $el), 0, columnConfig);
  7546. } else {
  7547. $xetable.staticColumns.splice([].indexOf.call($xetable.$refs.hideColumn.children, $el), 0, columnConfig);
  7548. }
  7549. },
  7550. // 销毁列
  7551. destroyColumn: function destroyColumn(_vm) {
  7552. var $xetable = _vm.$xetable,
  7553. columnConfig = _vm.columnConfig;
  7554. var matchObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.findTree($xetable.staticColumns, function (column) {
  7555. return column === columnConfig;
  7556. });
  7557. if (matchObj) {
  7558. matchObj.items.splice(matchObj.index, 1);
  7559. }
  7560. },
  7561. hasChildrenList: function hasChildrenList(item) {
  7562. return item && item.children && item.children.length > 0;
  7563. },
  7564. parseFile: function parseFile(file) {
  7565. var name = file.name;
  7566. var tIndex = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.lastIndexOf(name, '.');
  7567. var type = name.substring(tIndex + 1, name.length);
  7568. var filename = name.substring(0, tIndex);
  7569. return {
  7570. filename: filename,
  7571. type: type
  7572. };
  7573. },
  7574. isNumVal: function isNumVal(num) {
  7575. return !isNaN(parseFloat('' + num));
  7576. }
  7577. };
  7578. /* harmony default export */ var utils = (UtilTools);
  7579. // CONCATENATED MODULE: ./packages/v-x-e-table/src/renderer.js
  7580. var defaultCompProps = {
  7581. transfer: true
  7582. };
  7583. var componentDefaultModelProp = 'value';
  7584. function isEmptyValue(cellValue) {
  7585. return cellValue === null || cellValue === undefined || cellValue === '';
  7586. }
  7587. function getChangeEvent(renderOpts) {
  7588. switch (renderOpts.name) {
  7589. case 'input':
  7590. case 'textarea':
  7591. case '$input':
  7592. case '$textarea':
  7593. return 'input';
  7594. }
  7595. return 'change';
  7596. }
  7597. function renderer_parseDate(value, props) {
  7598. return value && props.valueFormat ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toStringDate(value, props.valueFormat) : value;
  7599. }
  7600. function getFormatDate(value, props, defaultFormat) {
  7601. var _props$dateConfig = props.dateConfig,
  7602. dateConfig = _props$dateConfig === void 0 ? {} : _props$dateConfig;
  7603. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toDateString(renderer_parseDate(value, props), dateConfig.labelFormat || defaultFormat);
  7604. }
  7605. function getLabelFormatDate(value, props) {
  7606. return getFormatDate(value, props, src_conf.i18n("vxe.input.date.labelFormat.".concat(props.type)));
  7607. }
  7608. function getDefaultComponentName(_ref) {
  7609. var name = _ref.name;
  7610. return "vxe-".concat(name.replace('$', ''));
  7611. }
  7612. function handleConfirmFilter(params, checked, option) {
  7613. var $panel = params.$panel;
  7614. $panel.changeOption({}, checked, option);
  7615. }
  7616. function getNativeAttrs(_ref2) {
  7617. var name = _ref2.name,
  7618. attrs = _ref2.attrs;
  7619. if (name === 'input') {
  7620. attrs = Object.assign({
  7621. type: 'text'
  7622. }, attrs);
  7623. }
  7624. return attrs;
  7625. }
  7626. function getInputImmediateModel(renderOpts) {
  7627. var name = renderOpts.name,
  7628. immediate = renderOpts.immediate,
  7629. props = renderOpts.props;
  7630. if (!immediate) {
  7631. if (name === '$input') {
  7632. var _ref3 = props || {},
  7633. type = _ref3.type;
  7634. return !(!type || type === 'text' || type === 'number' || type === 'integer' || type === 'float');
  7635. }
  7636. if (name === 'input' || name === 'textarea' || name === '$textarea') {
  7637. return false;
  7638. }
  7639. return true;
  7640. }
  7641. return immediate;
  7642. }
  7643. function isImmediateCell(renderOpts, params) {
  7644. return params.$type === 'cell' || getInputImmediateModel(renderOpts);
  7645. }
  7646. function getCellEditProps(renderOpts, params, value, defaultProps) {
  7647. var vSize = params.$table.vSize;
  7648. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.assign({
  7649. immediate: getInputImmediateModel(renderOpts)
  7650. }, vSize ? {
  7651. size: vSize
  7652. } : {}, defaultCompProps, defaultProps, renderOpts.props, _defineProperty({}, componentDefaultModelProp, value));
  7653. }
  7654. function getFilterProps(renderOpts, params, value, defaultProps) {
  7655. var vSize = params.$table.vSize;
  7656. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.assign(vSize ? {
  7657. size: vSize
  7658. } : {}, defaultCompProps, defaultProps, renderOpts.props, _defineProperty({}, componentDefaultModelProp, value));
  7659. }
  7660. function getItemProps(renderOpts, params, value, defaultProps) {
  7661. var vSize = params.$form.vSize;
  7662. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.assign(vSize ? {
  7663. size: vSize
  7664. } : {}, defaultCompProps, defaultProps, renderOpts.props, _defineProperty({}, componentDefaultModelProp, value));
  7665. }
  7666. function getCellLabelVNs(h, renderOpts, params, cellLabel) {
  7667. var placeholder = renderOpts.placeholder;
  7668. return [h('span', {
  7669. class: 'vxe-cell--label'
  7670. }, placeholder && isEmptyValue(cellLabel) ? [h('span', {
  7671. class: 'vxe-cell--placeholder'
  7672. }, utils.formatText(getFuncText(placeholder), 1))] : utils.formatText(cellLabel, 1))];
  7673. }
  7674. function getNativeOns(renderOpts, params) {
  7675. var nativeEvents = renderOpts.nativeEvents;
  7676. var nativeOns = {};
  7677. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.objectEach(nativeEvents, function (func, key) {
  7678. nativeOns[key] = function () {
  7679. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  7680. args[_key] = arguments[_key];
  7681. }
  7682. func.apply(void 0, [params].concat(args));
  7683. };
  7684. });
  7685. return nativeOns;
  7686. }
  7687. function getOns(renderOpts, params, inputFunc, changeFunc) {
  7688. var name = renderOpts.name,
  7689. events = renderOpts.events;
  7690. var modelEvent = 'input';
  7691. var changeEvent = getChangeEvent(renderOpts);
  7692. var isSameEvent = changeEvent === modelEvent;
  7693. var ons = {};
  7694. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.objectEach(events, function (func, key) {
  7695. ons[key] = function () {
  7696. for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  7697. args[_key2] = arguments[_key2];
  7698. }
  7699. func.apply(void 0, [params].concat(args));
  7700. };
  7701. });
  7702. if (inputFunc) {
  7703. ons[modelEvent] = function (targetEvnt) {
  7704. // 对输入框进行优化
  7705. inputFunc(name === '$input' || name === '$textarea' ? targetEvnt.value : targetEvnt);
  7706. if (events && events[modelEvent]) {
  7707. events[modelEvent](params, targetEvnt);
  7708. }
  7709. if (isSameEvent && changeFunc) {
  7710. changeFunc(targetEvnt);
  7711. }
  7712. };
  7713. }
  7714. if (!isSameEvent && changeFunc) {
  7715. ons[changeEvent] = function () {
  7716. for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
  7717. args[_key3] = arguments[_key3];
  7718. }
  7719. changeFunc.apply(void 0, args);
  7720. if (events && events[changeEvent]) {
  7721. events[changeEvent].apply(events, [params].concat(args));
  7722. }
  7723. };
  7724. }
  7725. return ons;
  7726. }
  7727. function getEditOns(renderOpts, params) {
  7728. var $table = params.$table,
  7729. row = params.row,
  7730. column = params.column;
  7731. var name = renderOpts.name;
  7732. var model = column.model;
  7733. var isImmediate = isImmediateCell(renderOpts, params);
  7734. return getOns(renderOpts, params, function (cellValue) {
  7735. // 处理 model 值双向绑定
  7736. if (isImmediate) {
  7737. utils.setCellValue(row, column, cellValue);
  7738. } else {
  7739. model.update = true;
  7740. model.value = cellValue;
  7741. }
  7742. }, function (eventParams) {
  7743. // 处理 change 事件相关逻辑
  7744. if (!isImmediate && (name === '$input' || name === '$textarea')) {
  7745. $table.updateStatus(params, eventParams.value);
  7746. } else {
  7747. $table.updateStatus(params);
  7748. }
  7749. });
  7750. }
  7751. function getFilterOns(renderOpts, params, option) {
  7752. return getOns(renderOpts, params, function (value) {
  7753. // 处理 model 值双向绑定
  7754. option.data = value;
  7755. }, function () {
  7756. handleConfirmFilter(params, !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eqNull(option.data), option);
  7757. });
  7758. }
  7759. function getItemOns(renderOpts, params) {
  7760. var $form = params.$form,
  7761. data = params.data,
  7762. property = params.property;
  7763. return getOns(renderOpts, params, function (value) {
  7764. // 处理 model 值双向绑定
  7765. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.set(data, property, value);
  7766. }, function () {
  7767. // 处理 change 事件相关逻辑
  7768. $form.updateStatus(params);
  7769. });
  7770. }
  7771. function getNativeEditOns(renderOpts, params) {
  7772. var $table = params.$table,
  7773. row = params.row,
  7774. column = params.column;
  7775. var model = column.model;
  7776. return getOns(renderOpts, params, function (evnt) {
  7777. // 处理 model 值双向绑定
  7778. var cellValue = evnt.target.value;
  7779. if (isImmediateCell(renderOpts, params)) {
  7780. utils.setCellValue(row, column, cellValue);
  7781. } else {
  7782. model.update = true;
  7783. model.value = cellValue;
  7784. }
  7785. }, function (evnt) {
  7786. // 处理 change 事件相关逻辑
  7787. var cellValue = evnt.target.value;
  7788. $table.updateStatus(params, cellValue);
  7789. });
  7790. }
  7791. function getNativeFilterOns(renderOpts, params, option) {
  7792. return getOns(renderOpts, params, function (evnt) {
  7793. // 处理 model 值双向绑定
  7794. option.data = evnt.target.value;
  7795. }, function () {
  7796. handleConfirmFilter(params, !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eqNull(option.data), option);
  7797. });
  7798. }
  7799. function getNativeItemOns(renderOpts, params) {
  7800. var $form = params.$form,
  7801. data = params.data,
  7802. property = params.property;
  7803. return getOns(renderOpts, params, function (evnt) {
  7804. // 处理 model 值双向绑定
  7805. var itemValue = evnt.target.value;
  7806. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.set(data, property, itemValue);
  7807. }, function () {
  7808. // 处理 change 事件相关逻辑
  7809. $form.updateStatus(params);
  7810. });
  7811. }
  7812. /**
  7813. * 单元格可编辑渲染-原生的标签
  7814. * input、textarea、select
  7815. */
  7816. function nativeEditRender(h, renderOpts, params) {
  7817. var row = params.row,
  7818. column = params.column;
  7819. var name = renderOpts.name;
  7820. var attrs = getNativeAttrs(renderOpts);
  7821. var cellValue = isImmediateCell(renderOpts, params) ? utils.getCellValue(row, column) : column.model.value;
  7822. return [h(name, {
  7823. class: "vxe-default-".concat(name),
  7824. attrs: attrs,
  7825. domProps: {
  7826. value: cellValue
  7827. },
  7828. on: getNativeEditOns(renderOpts, params)
  7829. })];
  7830. }
  7831. function defaultEditRender(h, renderOpts, params) {
  7832. var row = params.row,
  7833. column = params.column;
  7834. var cellValue = utils.getCellValue(row, column);
  7835. return [h(getDefaultComponentName(renderOpts), {
  7836. props: getCellEditProps(renderOpts, params, cellValue),
  7837. on: getEditOns(renderOpts, params),
  7838. nativeOn: getNativeOns(renderOpts, params)
  7839. })];
  7840. }
  7841. function defaultButtonEditRender(h, renderOpts, params) {
  7842. return [h('vxe-button', {
  7843. props: getCellEditProps(renderOpts, params),
  7844. on: getOns(renderOpts, params),
  7845. nativeOn: getNativeOns(renderOpts, params)
  7846. })];
  7847. }
  7848. function defaultButtonsEditRender(h, renderOpts, params) {
  7849. return renderOpts.children.map(function (childRenderOpts) {
  7850. return defaultButtonEditRender(h, childRenderOpts, params)[0];
  7851. });
  7852. }
  7853. function renderNativeOptgroups(h, renderOpts, params, renderOptionsMethods) {
  7854. var optionGroups = renderOpts.optionGroups,
  7855. _renderOpts$optionGro = renderOpts.optionGroupProps,
  7856. optionGroupProps = _renderOpts$optionGro === void 0 ? {} : _renderOpts$optionGro;
  7857. var groupOptions = optionGroupProps.options || 'options';
  7858. var groupLabel = optionGroupProps.label || 'label';
  7859. return optionGroups.map(function (group, gIndex) {
  7860. return h('optgroup', {
  7861. key: gIndex,
  7862. domProps: {
  7863. label: group[groupLabel]
  7864. }
  7865. }, renderOptionsMethods(h, group[groupOptions], renderOpts, params));
  7866. });
  7867. }
  7868. /**
  7869. * 渲染原生的 option 标签
  7870. */
  7871. function renderNativeOptions(h, options, renderOpts, params) {
  7872. var _renderOpts$optionPro = renderOpts.optionProps,
  7873. optionProps = _renderOpts$optionPro === void 0 ? {} : _renderOpts$optionPro;
  7874. var row = params.row,
  7875. column = params.column;
  7876. var labelProp = optionProps.label || 'label';
  7877. var valueProp = optionProps.value || 'value';
  7878. var disabledProp = optionProps.disabled || 'disabled';
  7879. var cellValue = isImmediateCell(renderOpts, params) ? utils.getCellValue(row, column) : column.model.value;
  7880. return options.map(function (option, oIndex) {
  7881. return h('option', {
  7882. key: oIndex,
  7883. attrs: {
  7884. value: option[valueProp],
  7885. disabled: option[disabledProp]
  7886. },
  7887. domProps: {
  7888. /* eslint-disable eqeqeq */
  7889. selected: option[valueProp] == cellValue
  7890. }
  7891. }, option[labelProp]);
  7892. });
  7893. }
  7894. function nativeFilterRender(h, renderOpts, params) {
  7895. var column = params.column;
  7896. var name = renderOpts.name;
  7897. var attrs = getNativeAttrs(renderOpts);
  7898. return column.filters.map(function (option, oIndex) {
  7899. return h(name, {
  7900. key: oIndex,
  7901. class: "vxe-default-".concat(name),
  7902. attrs: attrs,
  7903. domProps: {
  7904. value: option.data
  7905. },
  7906. on: getNativeFilterOns(renderOpts, params, option)
  7907. });
  7908. });
  7909. }
  7910. function defaultFilterRender(h, renderOpts, params) {
  7911. var column = params.column;
  7912. return column.filters.map(function (option, oIndex) {
  7913. var optionValue = option.data;
  7914. return h(getDefaultComponentName(renderOpts), {
  7915. key: oIndex,
  7916. props: getFilterProps(renderOpts, renderOpts, optionValue),
  7917. on: getFilterOns(renderOpts, params, option)
  7918. });
  7919. });
  7920. }
  7921. function handleFilterMethod(_ref4) {
  7922. var option = _ref4.option,
  7923. row = _ref4.row,
  7924. column = _ref4.column;
  7925. var data = option.data;
  7926. var cellValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, column.property);
  7927. /* eslint-disable eqeqeq */
  7928. return cellValue == data;
  7929. }
  7930. function nativeSelectEditRender(h, renderOpts, params) {
  7931. return [h('select', {
  7932. class: 'vxe-default-select',
  7933. attrs: getNativeAttrs(renderOpts),
  7934. on: getNativeEditOns(renderOpts, params)
  7935. }, renderOpts.optionGroups ? renderNativeOptgroups(h, renderOpts, params, renderNativeOptions) : renderNativeOptions(h, renderOpts.options, renderOpts, params))];
  7936. }
  7937. function defaultSelectEditRender(h, renderOpts, params) {
  7938. var row = params.row,
  7939. column = params.column;
  7940. var options = renderOpts.options,
  7941. optionProps = renderOpts.optionProps,
  7942. optionGroups = renderOpts.optionGroups,
  7943. optionGroupProps = renderOpts.optionGroupProps;
  7944. var cellValue = utils.getCellValue(row, column);
  7945. return [h(getDefaultComponentName(renderOpts), {
  7946. props: getCellEditProps(renderOpts, params, cellValue, {
  7947. options: options,
  7948. optionProps: optionProps,
  7949. optionGroups: optionGroups,
  7950. optionGroupProps: optionGroupProps
  7951. }),
  7952. on: getEditOns(renderOpts, params)
  7953. })];
  7954. }
  7955. function getSelectCellValue(renderOpts, _ref5) {
  7956. var row = _ref5.row,
  7957. column = _ref5.column;
  7958. var _renderOpts$props = renderOpts.props,
  7959. props = _renderOpts$props === void 0 ? {} : _renderOpts$props,
  7960. options = renderOpts.options,
  7961. optionGroups = renderOpts.optionGroups,
  7962. _renderOpts$optionPro2 = renderOpts.optionProps,
  7963. optionProps = _renderOpts$optionPro2 === void 0 ? {} : _renderOpts$optionPro2,
  7964. _renderOpts$optionGro2 = renderOpts.optionGroupProps,
  7965. optionGroupProps = _renderOpts$optionGro2 === void 0 ? {} : _renderOpts$optionGro2;
  7966. var cellValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, column.property);
  7967. var selectItem;
  7968. var labelProp = optionProps.label || 'label';
  7969. var valueProp = optionProps.value || 'value';
  7970. if (!isEmptyValue(cellValue)) {
  7971. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.map(props.multiple ? cellValue : [cellValue], optionGroups ? function (value) {
  7972. var groupOptions = optionGroupProps.options || 'options';
  7973. for (var index = 0; index < optionGroups.length; index++) {
  7974. /* eslint-disable eqeqeq */
  7975. selectItem = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.find(optionGroups[index][groupOptions], function (item) {
  7976. return item[valueProp] == value;
  7977. });
  7978. if (selectItem) {
  7979. break;
  7980. }
  7981. }
  7982. return selectItem ? selectItem[labelProp] : value;
  7983. } : function (value) {
  7984. /* eslint-disable eqeqeq */
  7985. selectItem = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.find(options, function (item) {
  7986. return item[valueProp] == value;
  7987. });
  7988. return selectItem ? selectItem[labelProp] : value;
  7989. }).join(', ');
  7990. }
  7991. return null;
  7992. }
  7993. /**
  7994. * 渲染表单-项
  7995. * 用于渲染原生的标签
  7996. */
  7997. function nativeItemRender(h, renderOpts, params) {
  7998. var data = params.data,
  7999. property = params.property;
  8000. var name = renderOpts.name;
  8001. var attrs = getNativeAttrs(renderOpts);
  8002. var itemValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(data, property);
  8003. return [h(name, {
  8004. class: "vxe-default-".concat(name),
  8005. attrs: attrs,
  8006. domProps: attrs && name === 'input' && (attrs.type === 'submit' || attrs.type === 'reset') ? null : {
  8007. value: itemValue
  8008. },
  8009. on: getNativeItemOns(renderOpts, params)
  8010. })];
  8011. }
  8012. function defaultItemRender(h, renderOpts, params) {
  8013. var data = params.data,
  8014. property = params.property;
  8015. var itemValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(data, property);
  8016. return [h(getDefaultComponentName(renderOpts), {
  8017. props: getItemProps(renderOpts, params, itemValue),
  8018. on: getItemOns(renderOpts, params),
  8019. nativeOn: getNativeOns(renderOpts, params)
  8020. })];
  8021. }
  8022. function defaultButtonItemRender(h, renderOpts, params) {
  8023. return [h('vxe-button', {
  8024. props: getItemProps(renderOpts, params),
  8025. on: getOns(renderOpts, params),
  8026. nativeOn: getNativeOns(renderOpts, params)
  8027. })];
  8028. }
  8029. function defaultButtonsItemRender(h, renderOpts, params) {
  8030. return renderOpts.children.map(function (childRenderOpts) {
  8031. return defaultButtonItemRender(h, childRenderOpts, params)[0];
  8032. });
  8033. }
  8034. /**
  8035. * 渲染原生的 select 标签
  8036. */
  8037. function renderNativeFormOptions(h, options, renderOpts, params) {
  8038. var data = params.data,
  8039. property = params.property;
  8040. var _renderOpts$optionPro3 = renderOpts.optionProps,
  8041. optionProps = _renderOpts$optionPro3 === void 0 ? {} : _renderOpts$optionPro3;
  8042. var labelProp = optionProps.label || 'label';
  8043. var valueProp = optionProps.value || 'value';
  8044. var disabledProp = optionProps.disabled || 'disabled';
  8045. var cellValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(data, property);
  8046. return options.map(function (item, oIndex) {
  8047. return h('option', {
  8048. key: oIndex,
  8049. attrs: {
  8050. value: item[valueProp],
  8051. disabled: item[disabledProp]
  8052. },
  8053. domProps: {
  8054. /* eslint-disable eqeqeq */
  8055. selected: item[valueProp] == cellValue
  8056. }
  8057. }, item[labelProp]);
  8058. });
  8059. }
  8060. function handleExportSelectMethod(params) {
  8061. var row = params.row,
  8062. column = params.column,
  8063. options = params.options;
  8064. return options.original ? utils.getCellValue(row, column) : getSelectCellValue(column.editRender || column.cellRender, params);
  8065. }
  8066. /**
  8067. * 渲染表单-项中
  8068. * 单选框和复选框
  8069. */
  8070. function defaultFormItemRadioAndCheckboxRender(h, renderOpts, params) {
  8071. var options = renderOpts.options,
  8072. _renderOpts$optionPro4 = renderOpts.optionProps,
  8073. optionProps = _renderOpts$optionPro4 === void 0 ? {} : _renderOpts$optionPro4;
  8074. var data = params.data,
  8075. property = params.property;
  8076. var labelProp = optionProps.label || 'label';
  8077. var valueProp = optionProps.value || 'value';
  8078. var disabledProp = optionProps.disabled || 'disabled';
  8079. var itemValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(data, property);
  8080. var name = getDefaultComponentName(renderOpts); // 如果是分组
  8081. if (options) {
  8082. return [h("".concat(name, "-group"), {
  8083. props: getItemProps(renderOpts, params, itemValue),
  8084. on: getItemOns(renderOpts, params),
  8085. nativeOn: getNativeOns(renderOpts, params)
  8086. }, options.map(function (item, index) {
  8087. return h(name, {
  8088. key: index,
  8089. props: {
  8090. label: item[valueProp],
  8091. content: item[labelProp],
  8092. disabled: item[disabledProp]
  8093. }
  8094. });
  8095. }))];
  8096. }
  8097. return [h(name, {
  8098. props: getItemProps(renderOpts, params, itemValue),
  8099. on: getItemOns(renderOpts, params),
  8100. nativeOn: getNativeOns(renderOpts, params)
  8101. })];
  8102. }
  8103. /**
  8104. * 内置的组件渲染
  8105. */
  8106. var renderMap = {
  8107. input: {
  8108. autofocus: 'input',
  8109. renderEdit: nativeEditRender,
  8110. renderDefault: nativeEditRender,
  8111. renderFilter: nativeFilterRender,
  8112. defaultFilterMethod: handleFilterMethod,
  8113. renderItemContent: nativeItemRender
  8114. },
  8115. textarea: {
  8116. autofocus: 'textarea',
  8117. renderEdit: nativeEditRender,
  8118. renderItemContent: nativeItemRender
  8119. },
  8120. select: {
  8121. renderEdit: nativeSelectEditRender,
  8122. renderDefault: nativeSelectEditRender,
  8123. renderCell: function renderCell(h, renderOpts, params) {
  8124. return getCellLabelVNs(h, renderOpts, params, getSelectCellValue(renderOpts, params));
  8125. },
  8126. renderFilter: function renderFilter(h, renderOpts, params) {
  8127. var column = params.column;
  8128. return column.filters.map(function (option, oIndex) {
  8129. return h('select', {
  8130. key: oIndex,
  8131. class: 'vxe-default-select',
  8132. attrs: getNativeAttrs(renderOpts),
  8133. on: getNativeFilterOns(renderOpts, params, option)
  8134. }, renderOpts.optionGroups ? renderNativeOptgroups(h, renderOpts, params, renderNativeOptions) : renderNativeOptions(h, renderOpts.options, renderOpts, params));
  8135. });
  8136. },
  8137. defaultFilterMethod: handleFilterMethod,
  8138. renderItemContent: function renderItemContent(h, renderOpts, params) {
  8139. return [h('select', {
  8140. class: 'vxe-default-select',
  8141. attrs: getNativeAttrs(renderOpts),
  8142. on: getNativeItemOns(renderOpts, params)
  8143. }, renderOpts.optionGroups ? renderNativeOptgroups(h, renderOpts, params, renderNativeFormOptions) : renderNativeFormOptions(h, renderOpts.options, renderOpts, params))];
  8144. },
  8145. cellExportMethod: handleExportSelectMethod
  8146. },
  8147. $input: {
  8148. autofocus: '.vxe-input--inner',
  8149. renderEdit: defaultEditRender,
  8150. renderCell: function renderCell(h, renderOpts, params) {
  8151. var _renderOpts$props2 = renderOpts.props,
  8152. props = _renderOpts$props2 === void 0 ? {} : _renderOpts$props2;
  8153. var row = params.row,
  8154. column = params.column;
  8155. var digits = props.digits || src_conf.input.digits;
  8156. var cellValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, column.property);
  8157. if (cellValue) {
  8158. switch (props.type) {
  8159. case 'date':
  8160. case 'week':
  8161. case 'month':
  8162. case 'year':
  8163. cellValue = getLabelFormatDate(cellValue, props);
  8164. break;
  8165. case 'float':
  8166. 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);
  8167. break;
  8168. }
  8169. }
  8170. return getCellLabelVNs(h, renderOpts, params, cellValue);
  8171. },
  8172. renderDefault: defaultEditRender,
  8173. renderFilter: defaultFilterRender,
  8174. defaultFilterMethod: handleFilterMethod,
  8175. renderItemContent: defaultItemRender
  8176. },
  8177. $textarea: {
  8178. autofocus: '.vxe-textarea--inner',
  8179. renderItemContent: defaultItemRender
  8180. },
  8181. $button: {
  8182. renderDefault: defaultButtonEditRender,
  8183. renderItemContent: defaultButtonItemRender
  8184. },
  8185. $buttons: {
  8186. renderDefault: defaultButtonsEditRender,
  8187. renderItemContent: defaultButtonsItemRender
  8188. },
  8189. $select: {
  8190. autofocus: '.vxe-input--inner',
  8191. renderEdit: defaultSelectEditRender,
  8192. renderDefault: defaultSelectEditRender,
  8193. renderCell: function renderCell(h, renderOpts, params) {
  8194. return getCellLabelVNs(h, renderOpts, params, getSelectCellValue(renderOpts, params));
  8195. },
  8196. renderFilter: function renderFilter(h, renderOpts, params) {
  8197. var column = params.column;
  8198. var options = renderOpts.options,
  8199. optionProps = renderOpts.optionProps,
  8200. optionGroups = renderOpts.optionGroups,
  8201. optionGroupProps = renderOpts.optionGroupProps;
  8202. var nativeOn = getNativeOns(renderOpts, params);
  8203. return column.filters.map(function (option, oIndex) {
  8204. var optionValue = option.data;
  8205. return h(getDefaultComponentName(renderOpts), {
  8206. key: oIndex,
  8207. props: getFilterProps(renderOpts, params, optionValue, {
  8208. options: options,
  8209. optionProps: optionProps,
  8210. optionGroups: optionGroups,
  8211. optionGroupProps: optionGroupProps
  8212. }),
  8213. on: getFilterOns(renderOpts, params, option),
  8214. nativeOn: nativeOn
  8215. });
  8216. });
  8217. },
  8218. defaultFilterMethod: handleFilterMethod,
  8219. renderItemContent: function renderItemContent(h, renderOpts, params) {
  8220. var data = params.data,
  8221. property = params.property;
  8222. var options = renderOpts.options,
  8223. optionProps = renderOpts.optionProps,
  8224. optionGroups = renderOpts.optionGroups,
  8225. optionGroupProps = renderOpts.optionGroupProps;
  8226. var itemValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(data, property);
  8227. return [h(getDefaultComponentName(renderOpts), {
  8228. props: getItemProps(renderOpts, params, itemValue, {
  8229. options: options,
  8230. optionProps: optionProps,
  8231. optionGroups: optionGroups,
  8232. optionGroupProps: optionGroupProps
  8233. }),
  8234. on: getItemOns(renderOpts, params),
  8235. nativeOn: getNativeOns(renderOpts, params)
  8236. })];
  8237. },
  8238. cellExportMethod: handleExportSelectMethod
  8239. },
  8240. $radio: {
  8241. autofocus: '.vxe-radio--input',
  8242. renderItemContent: defaultFormItemRadioAndCheckboxRender
  8243. },
  8244. $checkbox: {
  8245. autofocus: '.vxe-checkbox--input',
  8246. renderItemContent: defaultFormItemRadioAndCheckboxRender
  8247. },
  8248. $switch: {
  8249. autofocus: '.vxe-switch--button',
  8250. renderEdit: defaultEditRender,
  8251. renderDefault: defaultEditRender,
  8252. renderItemContent: defaultItemRender
  8253. }
  8254. };
  8255. /**
  8256. * 全局渲染器
  8257. */
  8258. var renderer = {
  8259. mixin: function mixin(map) {
  8260. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.each(map, function (options, name) {
  8261. return renderer.add(name, options);
  8262. });
  8263. return renderer;
  8264. },
  8265. get: function get(name) {
  8266. return renderMap[name] || null;
  8267. },
  8268. add: function add(name, options) {
  8269. if (name && options) {
  8270. var renders = renderMap[name];
  8271. if (renders) {
  8272. // 检测是否覆盖
  8273. if (false) {}
  8274. Object.assign(renders, options);
  8275. } else {
  8276. renderMap[name] = options;
  8277. }
  8278. }
  8279. return renderer;
  8280. },
  8281. delete: function _delete(name) {
  8282. delete renderMap[name];
  8283. return renderer;
  8284. }
  8285. };
  8286. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.includes.js
  8287. var es_array_includes = __webpack_require__("caad");
  8288. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.includes.js
  8289. var es_string_includes = __webpack_require__("2532");
  8290. // CONCATENATED MODULE: ./packages/v-x-e-table/src/store.js
  8291. /**
  8292. * 创建数据仓库
  8293. */
  8294. var store_Store = /*#__PURE__*/function () {
  8295. function Store() {
  8296. _classCallCheck(this, Store);
  8297. this.store = {};
  8298. }
  8299. _createClass(Store, [{
  8300. key: "mixin",
  8301. value: function mixin(map) {
  8302. Object.assign(this.store, map);
  8303. return Store;
  8304. }
  8305. }, {
  8306. key: "get",
  8307. value: function get(name) {
  8308. return this.store[name];
  8309. }
  8310. }, {
  8311. key: "add",
  8312. value: function add(name, render) {
  8313. var conf = this.store[name]; // 检测是否覆盖
  8314. if (false) { var confKeys; }
  8315. this.store[name] = conf ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.merge(conf, render) : render;
  8316. return Store;
  8317. }
  8318. }, {
  8319. key: "delete",
  8320. value: function _delete(name) {
  8321. delete this.store[name];
  8322. return Store;
  8323. }
  8324. }]);
  8325. return Store;
  8326. }();
  8327. /* harmony default export */ var store = (store_Store);
  8328. // CONCATENATED MODULE: ./packages/v-x-e-table/src/commands.js
  8329. var commands = new store();
  8330. if (false) {}
  8331. // CONCATENATED MODULE: ./packages/v-x-e-table/src/menus.js
  8332. var menus = new store();
  8333. if (false) {}
  8334. // CONCATENATED MODULE: ./packages/v-x-e-table/src/formats.js
  8335. var formats = new store();
  8336. if (false) {}
  8337. // CONCATENATED MODULE: ./packages/v-x-e-table/src/setup.js
  8338. /**
  8339. * 全局参数设置
  8340. */
  8341. function setup(options) {
  8342. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.merge(src_conf, options);
  8343. }
  8344. // CONCATENATED MODULE: ./packages/v-x-e-table/index.js
  8345. var installedPlugins = [];
  8346. function use(Plugin, options) {
  8347. /* eslint-disable @typescript-eslint/no-use-before-define */
  8348. if (Plugin && Plugin.install) {
  8349. if (installedPlugins.indexOf(Plugin) === -1) {
  8350. Plugin.install(VXETable, options);
  8351. installedPlugins.push(Plugin);
  8352. }
  8353. }
  8354. return VXETable;
  8355. }
  8356. /**
  8357. * 检测模块的安装顺序是否正确
  8358. */
  8359. function reg(key) {
  8360. /* eslint-disable @typescript-eslint/no-use-before-define */
  8361. // 检测安装顺序是否正确
  8362. if (false) {}
  8363. VXETable["_".concat(key)] = 1;
  8364. }
  8365. function getExportOrImpotType(types, flag) {
  8366. var rest = [];
  8367. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.objectEach(types, function (val, type) {
  8368. if (val === 0 || val === flag) {
  8369. rest.push(type);
  8370. }
  8371. });
  8372. return rest;
  8373. }
  8374. var v_x_e_table_VXETableConfig = /*#__PURE__*/function () {
  8375. function VXETableConfig() {
  8376. _classCallCheck(this, VXETableConfig);
  8377. }
  8378. _createClass(VXETableConfig, [{
  8379. key: "zIndex",
  8380. get:
  8381. /**
  8382. * 获取当前的 zIndex
  8383. */
  8384. function get() {
  8385. return UtilTools.getLastZIndex();
  8386. }
  8387. /**
  8388. * 获取下一个 zIndex
  8389. */
  8390. }, {
  8391. key: "nextZIndex",
  8392. get: function get() {
  8393. return UtilTools.nextZIndex();
  8394. }
  8395. /**
  8396. * 获取所有导出类型
  8397. */
  8398. }, {
  8399. key: "exportTypes",
  8400. get: function get() {
  8401. return getExportOrImpotType(src_conf.export.types, 1);
  8402. }
  8403. /**
  8404. * 获取所有导入类型
  8405. */
  8406. }, {
  8407. key: "importTypes",
  8408. get: function get() {
  8409. return getExportOrImpotType(src_conf.export.types, 2);
  8410. }
  8411. }]);
  8412. return VXETableConfig;
  8413. }();
  8414. var v_x_e_table_config = new v_x_e_table_VXETableConfig();
  8415. function t(key, args) {
  8416. return src_conf.i18n(key, args);
  8417. }
  8418. function _t(key, args) {
  8419. return key ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toValueString(src_conf.translate ? src_conf.translate(key, args) : key) : '';
  8420. }
  8421. var v = 'v3';
  8422. var VXETable = {
  8423. v: v,
  8424. version: "3.6.6-beta.1",
  8425. reg: reg,
  8426. use: use,
  8427. setup: setup,
  8428. interceptor: interceptor,
  8429. renderer: renderer,
  8430. commands: commands,
  8431. formats: formats,
  8432. menus: menus,
  8433. config: v_x_e_table_config,
  8434. t: t,
  8435. _t: _t
  8436. };
  8437. /* harmony default export */ var v_x_e_table = (VXETable);
  8438. // CONCATENATED MODULE: ./packages/icon/src/icon.js
  8439. /* harmony default export */ var src_icon = ({
  8440. name: 'VxeIcon',
  8441. props: {
  8442. name: String,
  8443. roll: Boolean
  8444. },
  8445. render: function render(h) {
  8446. return h('i', {
  8447. class: ["vxe-icon-".concat(this.name), this.roll ? 'roll' : ''],
  8448. on: {
  8449. click: this.clickEvent
  8450. }
  8451. });
  8452. },
  8453. methods: {
  8454. clickEvent: function clickEvent(evnt) {
  8455. this.$emit('click', {
  8456. $event: evnt
  8457. });
  8458. }
  8459. }
  8460. });
  8461. // CONCATENATED MODULE: ./packages/icon/index.js
  8462. var Icon = Object.assign(src_icon, {
  8463. install: function install(Vue) {
  8464. Vue.component(src_icon.name, src_icon);
  8465. }
  8466. });
  8467. /* harmony default export */ var packages_icon = (Icon);
  8468. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.object.keys.js
  8469. var es_object_keys = __webpack_require__("b64b");
  8470. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.filter.js
  8471. var es_array_filter = __webpack_require__("4de4");
  8472. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.object.get-own-property-descriptor.js
  8473. var es_object_get_own_property_descriptor = __webpack_require__("e439");
  8474. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.object.get-own-property-descriptors.js
  8475. var es_object_get_own_property_descriptors = __webpack_require__("dbb4");
  8476. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js
  8477. function ownKeys(object, enumerableOnly) {
  8478. var keys = Object.keys(object);
  8479. if (Object.getOwnPropertySymbols) {
  8480. var symbols = Object.getOwnPropertySymbols(object);
  8481. if (enumerableOnly) {
  8482. symbols = symbols.filter(function (sym) {
  8483. return Object.getOwnPropertyDescriptor(object, sym).enumerable;
  8484. });
  8485. }
  8486. keys.push.apply(keys, symbols);
  8487. }
  8488. return keys;
  8489. }
  8490. function _objectSpread2(target) {
  8491. for (var i = 1; i < arguments.length; i++) {
  8492. var source = arguments[i] != null ? arguments[i] : {};
  8493. if (i % 2) {
  8494. ownKeys(Object(source), true).forEach(function (key) {
  8495. _defineProperty(target, key, source[key]);
  8496. });
  8497. } else if (Object.getOwnPropertyDescriptors) {
  8498. Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
  8499. } else {
  8500. ownKeys(Object(source)).forEach(function (key) {
  8501. Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
  8502. });
  8503. }
  8504. }
  8505. return target;
  8506. }
  8507. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.number.constructor.js
  8508. var es_number_constructor = __webpack_require__("a9e3");
  8509. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.map.js
  8510. var es_map = __webpack_require__("4ec9");
  8511. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.fixed.js
  8512. var es_string_fixed = __webpack_require__("c7cd");
  8513. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.promise.js
  8514. var es_promise = __webpack_require__("e6cf");
  8515. // CONCATENATED MODULE: ./packages/table/src/columnInfo.js
  8516. var columnInfo_ColumnInfo = /*#__PURE__*/function () {
  8517. /* eslint-disable @typescript-eslint/no-use-before-define */
  8518. function ColumnInfo($xetable, _vm) {
  8519. var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
  8520. renderHeader = _ref.renderHeader,
  8521. renderCell = _ref.renderCell,
  8522. renderFooter = _ref.renderFooter,
  8523. renderData = _ref.renderData;
  8524. _classCallCheck(this, ColumnInfo);
  8525. var $xegrid = $xetable.$xegrid;
  8526. var proxyOpts = $xegrid ? $xegrid.proxyOpts : null;
  8527. var formatter = _vm.formatter;
  8528. var visible = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isBoolean(_vm.visible) ? _vm.visible : true;
  8529. if (false) { var _globalFunc, globalFunc, types; }
  8530. Object.assign(this, {
  8531. // 基本属性
  8532. type: _vm.type,
  8533. property: _vm.field,
  8534. field: _vm.field,
  8535. title: _vm.title,
  8536. width: _vm.width,
  8537. minWidth: _vm.minWidth,
  8538. resizable: _vm.resizable,
  8539. fixed: _vm.fixed,
  8540. align: _vm.align,
  8541. headerAlign: _vm.headerAlign,
  8542. footerAlign: _vm.footerAlign,
  8543. showOverflow: _vm.showOverflow,
  8544. showHeaderOverflow: _vm.showHeaderOverflow,
  8545. showFooterOverflow: _vm.showFooterOverflow,
  8546. className: _vm.className,
  8547. headerClassName: _vm.headerClassName,
  8548. footerClassName: _vm.footerClassName,
  8549. formatter: formatter,
  8550. sortable: _vm.sortable,
  8551. sortBy: _vm.sortBy,
  8552. sortType: _vm.sortType,
  8553. sortMethod: _vm.sortMethod,
  8554. remoteSort: _vm.remoteSort,
  8555. filters: toFilters(_vm.filters),
  8556. filterMultiple: external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isBoolean(_vm.filterMultiple) ? _vm.filterMultiple : true,
  8557. filterMethod: _vm.filterMethod,
  8558. filterResetMethod: _vm.filterResetMethod,
  8559. filterRecoverMethod: _vm.filterRecoverMethod,
  8560. filterRender: _vm.filterRender,
  8561. treeNode: _vm.treeNode,
  8562. cellType: _vm.cellType,
  8563. cellRender: _vm.cellRender,
  8564. editRender: _vm.editRender,
  8565. contentRender: _vm.contentRender,
  8566. exportMethod: _vm.exportMethod,
  8567. footerExportMethod: _vm.footerExportMethod,
  8568. titleHelp: _vm.titleHelp,
  8569. titlePrefix: _vm.titlePrefix,
  8570. // 自定义参数
  8571. params: _vm.params,
  8572. // 渲染属性
  8573. id: _vm.colId || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.uniqueId('col_'),
  8574. parentId: null,
  8575. visible: visible,
  8576. // 内部属性(一旦被使用,将导致不可升级版本)
  8577. halfVisible: false,
  8578. defaultVisible: visible,
  8579. checked: false,
  8580. halfChecked: false,
  8581. disabled: false,
  8582. level: 1,
  8583. rowSpan: 1,
  8584. colSpan: 1,
  8585. order: null,
  8586. sortTime: 0,
  8587. renderWidth: 0,
  8588. renderHeight: 0,
  8589. resizeWidth: 0,
  8590. renderLeft: 0,
  8591. renderArgs: [],
  8592. // 渲染参数可用于扩展
  8593. model: {},
  8594. renderHeader: renderHeader || _vm.renderHeader,
  8595. renderCell: renderCell || _vm.renderCell,
  8596. renderFooter: renderFooter || _vm.renderFooter,
  8597. renderData: renderData,
  8598. // 单元格插槽,只对 grid 有效
  8599. slots: _vm.slots
  8600. });
  8601. if (proxyOpts && proxyOpts.beforeColumn) {
  8602. proxyOpts.beforeColumn({
  8603. $grid: $xegrid,
  8604. column: this
  8605. });
  8606. }
  8607. }
  8608. _createClass(ColumnInfo, [{
  8609. key: "getTitle",
  8610. value: function getTitle() {
  8611. return getFuncText(this.title || (this.type === 'seq' ? src_conf.i18n('vxe.table.seqTitle') : ''));
  8612. }
  8613. }, {
  8614. key: "getKey",
  8615. value: function getKey() {
  8616. return this.field || (this.type ? "type=".concat(this.type) : null);
  8617. }
  8618. }, {
  8619. key: "update",
  8620. value: function update(name, value) {
  8621. // 不支持双向的属性
  8622. if (name !== 'filters') {
  8623. if (name === 'field') {
  8624. // 兼容旧属性
  8625. this.property = value;
  8626. }
  8627. this[name] = value;
  8628. }
  8629. }
  8630. }]);
  8631. return ColumnInfo;
  8632. }();
  8633. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.regexp.constructor.js
  8634. var es_regexp_constructor = __webpack_require__("4d63");
  8635. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.regexp.to-string.js
  8636. var es_regexp_to_string = __webpack_require__("25f0");
  8637. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.match.js
  8638. var es_string_match = __webpack_require__("466d");
  8639. // CONCATENATED MODULE: ./packages/tools/dom.js
  8640. var browse = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.browse();
  8641. var reClsMap = {};
  8642. function getClsRE(cls) {
  8643. if (!reClsMap[cls]) {
  8644. reClsMap[cls] = new RegExp("(?:^|\\s)".concat(cls, "(?!\\S)"), 'g');
  8645. }
  8646. return reClsMap[cls];
  8647. }
  8648. function getNodeOffset(elem, container, rest) {
  8649. if (elem) {
  8650. var parentElem = elem.parentNode;
  8651. rest.top += elem.offsetTop;
  8652. rest.left += elem.offsetLeft;
  8653. if (parentElem && parentElem !== document.documentElement && parentElem !== document.body) {
  8654. rest.top -= parentElem.scrollTop;
  8655. rest.left -= parentElem.scrollLeft;
  8656. }
  8657. if (container && (elem === container || elem.offsetParent === container) ? 0 : elem.offsetParent) {
  8658. return getNodeOffset(elem.offsetParent, container, rest);
  8659. }
  8660. }
  8661. return rest;
  8662. }
  8663. function isScale(val) {
  8664. return val && /^\d+%$/.test(val);
  8665. }
  8666. function hasClass(elem, cls) {
  8667. return elem && elem.className && elem.className.match && elem.className.match(getClsRE(cls));
  8668. }
  8669. function removeClass(elem, cls) {
  8670. if (elem && hasClass(elem, cls)) {
  8671. elem.className = elem.className.replace(getClsRE(cls), '');
  8672. }
  8673. }
  8674. function getDomNode() {
  8675. var documentElement = document.documentElement;
  8676. var bodyElem = document.body;
  8677. return {
  8678. scrollTop: documentElement.scrollTop || bodyElem.scrollTop,
  8679. scrollLeft: documentElement.scrollLeft || bodyElem.scrollLeft,
  8680. visibleHeight: documentElement.clientHeight || bodyElem.clientHeight,
  8681. visibleWidth: documentElement.clientWidth || bodyElem.clientWidth
  8682. };
  8683. }
  8684. function getOffsetHeight(elem) {
  8685. return elem ? elem.offsetHeight : 0;
  8686. }
  8687. function getPaddingTopBottomSize(elem) {
  8688. if (elem) {
  8689. var computedStyle = getComputedStyle(elem);
  8690. var paddingTop = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(computedStyle.paddingTop);
  8691. var paddingBottom = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(computedStyle.paddingBottom);
  8692. return paddingTop + paddingBottom;
  8693. }
  8694. return 0;
  8695. }
  8696. function setScrollTop(elem, scrollTop) {
  8697. if (elem) {
  8698. elem.scrollTop = scrollTop;
  8699. }
  8700. }
  8701. function setScrollLeft(elem, scrollLeft) {
  8702. if (elem) {
  8703. elem.scrollLeft = scrollLeft;
  8704. }
  8705. } // export function setScrollLeftAndTop (elem, scrollLeft, scrollTop) {
  8706. // if (elem) {
  8707. // elem.scrollLeft = scrollLeft
  8708. // elem.scrollTop = scrollTop
  8709. // }
  8710. // }
  8711. function isNodeElement(elem) {
  8712. return elem && elem.nodeType === 1;
  8713. }
  8714. var DomTools = {
  8715. browse: browse,
  8716. isPx: function isPx(val) {
  8717. return val && /^\d+(px)?$/.test(val);
  8718. },
  8719. isScale: isScale,
  8720. hasClass: hasClass,
  8721. removeClass: removeClass,
  8722. addClass: function addClass(elem, cls) {
  8723. if (elem && !hasClass(elem, cls)) {
  8724. removeClass(elem, cls);
  8725. elem.className = "".concat(elem.className, " ").concat(cls);
  8726. }
  8727. },
  8728. updateCellTitle: function updateCellTitle(overflowElem, column) {
  8729. var content = column.type === 'html' ? overflowElem.innerText : overflowElem.textContent;
  8730. if (overflowElem.getAttribute('title') !== content) {
  8731. overflowElem.setAttribute('title', content);
  8732. }
  8733. },
  8734. getDomNode: getDomNode,
  8735. /**
  8736. * 检查触发源是否属于目标节点
  8737. */
  8738. getEventTargetNode: function getEventTargetNode(evnt, container, queryCls, queryMethod) {
  8739. var targetElem;
  8740. var target = evnt.target;
  8741. while (target && target.nodeType && target !== document) {
  8742. if (queryCls && hasClass(target, queryCls) && (!queryMethod || queryMethod(target))) {
  8743. targetElem = target;
  8744. } else if (target === container) {
  8745. return {
  8746. flag: queryCls ? !!targetElem : true,
  8747. container: container,
  8748. targetElem: targetElem
  8749. };
  8750. }
  8751. target = target.parentNode;
  8752. }
  8753. return {
  8754. flag: false
  8755. };
  8756. },
  8757. /**
  8758. * 获取元素相对于 document 的位置
  8759. */
  8760. getOffsetPos: function getOffsetPos(elem, container) {
  8761. return getNodeOffset(elem, container, {
  8762. left: 0,
  8763. top: 0
  8764. });
  8765. },
  8766. getAbsolutePos: function getAbsolutePos(elem) {
  8767. var bounding = elem.getBoundingClientRect();
  8768. var boundingTop = bounding.top;
  8769. var boundingLeft = bounding.left;
  8770. var _getDomNode = getDomNode(),
  8771. scrollTop = _getDomNode.scrollTop,
  8772. scrollLeft = _getDomNode.scrollLeft,
  8773. visibleHeight = _getDomNode.visibleHeight,
  8774. visibleWidth = _getDomNode.visibleWidth;
  8775. return {
  8776. boundingTop: boundingTop,
  8777. top: scrollTop + boundingTop,
  8778. boundingLeft: boundingLeft,
  8779. left: scrollLeft + boundingLeft,
  8780. visibleHeight: visibleHeight,
  8781. visibleWidth: visibleWidth
  8782. };
  8783. },
  8784. scrollToView: function scrollToView(elem) {
  8785. var scrollIntoViewIfNeeded = 'scrollIntoViewIfNeeded';
  8786. var scrollIntoView = 'scrollIntoView';
  8787. if (elem) {
  8788. if (elem[scrollIntoViewIfNeeded]) {
  8789. elem[scrollIntoViewIfNeeded]();
  8790. } else if (elem[scrollIntoView]) {
  8791. elem[scrollIntoView]();
  8792. }
  8793. }
  8794. },
  8795. triggerEvent: function triggerEvent(targetElem, type) {
  8796. if (targetElem) {
  8797. targetElem.dispatchEvent(new Event(type));
  8798. }
  8799. },
  8800. calcHeight: function calcHeight($xetable, key) {
  8801. var val = $xetable[key];
  8802. var num = 0;
  8803. if (val) {
  8804. if (val === 'auto') {
  8805. num = $xetable.parentHeight;
  8806. } else {
  8807. var excludeHeight = $xetable.getExcludeHeight();
  8808. if (isScale(val)) {
  8809. num = Math.floor((external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toInteger(val) || 1) / 100 * $xetable.parentHeight);
  8810. } else {
  8811. num = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(val);
  8812. }
  8813. num = Math.max(40, num - excludeHeight);
  8814. }
  8815. }
  8816. return num;
  8817. },
  8818. isNodeElement: isNodeElement
  8819. };
  8820. /* harmony default export */ var dom = (DomTools);
  8821. // CONCATENATED MODULE: ./packages/table/src/util.js
  8822. var lineOffsetSizes = {
  8823. mini: 3,
  8824. small: 2,
  8825. medium: 1
  8826. };
  8827. function restoreScrollLocation(_vm, scrollLeft, scrollTop) {
  8828. return _vm.clearScroll().then(function () {
  8829. if (scrollLeft || scrollTop) {
  8830. // 重置最后滚动状态
  8831. _vm.lastScrollLeft = 0;
  8832. _vm.lastScrollTop = 0; // 还原滚动状态
  8833. return _vm.scrollTo(scrollLeft, scrollTop);
  8834. }
  8835. });
  8836. }
  8837. function toTreePathSeq(path) {
  8838. return path.map(function (num, i) {
  8839. return i % 2 === 0 ? Number(num) + 1 : '.';
  8840. }).join('');
  8841. }
  8842. function removeScrollListener(scrollElem) {
  8843. if (scrollElem && scrollElem._onscroll) {
  8844. scrollElem.onscroll = null;
  8845. }
  8846. }
  8847. function restoreScrollListener(scrollElem) {
  8848. if (scrollElem && scrollElem._onscroll) {
  8849. scrollElem.onscroll = scrollElem._onscroll;
  8850. }
  8851. } // 行主键 key
  8852. function getRowkey($xetable) {
  8853. return $xetable.rowOpts.keyField || $xetable.rowId || '_X_ROW_KEY';
  8854. } // 行主键 value
  8855. function getRowid($xetable, row) {
  8856. var rowid = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, getRowkey($xetable));
  8857. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eqNull(rowid) ? '' : encodeURIComponent(rowid);
  8858. }
  8859. function getPaddingLeftRightSize(elem) {
  8860. if (elem) {
  8861. var computedStyle = getComputedStyle(elem);
  8862. var paddingLeft = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(computedStyle.paddingLeft);
  8863. var paddingRight = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(computedStyle.paddingRight);
  8864. return paddingLeft + paddingRight;
  8865. }
  8866. return 0;
  8867. }
  8868. function getElemenMarginWidth(elem) {
  8869. if (elem) {
  8870. var computedStyle = getComputedStyle(elem);
  8871. var marginLeft = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(computedStyle.marginLeft);
  8872. var marginRight = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(computedStyle.marginRight);
  8873. return elem.offsetWidth + marginLeft + marginRight;
  8874. }
  8875. return 0;
  8876. }
  8877. function handleFieldOrColumn(_vm, fieldOrColumn) {
  8878. if (fieldOrColumn) {
  8879. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isString(fieldOrColumn) ? _vm.getColumnByField(fieldOrColumn) : fieldOrColumn;
  8880. }
  8881. return null;
  8882. }
  8883. function queryCellElement(cell, selector) {
  8884. return cell.querySelector('.vxe-cell' + selector);
  8885. }
  8886. function toFilters(filters) {
  8887. if (filters && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(filters)) {
  8888. return filters.map(function (_ref) {
  8889. var label = _ref.label,
  8890. value = _ref.value,
  8891. data = _ref.data,
  8892. resetValue = _ref.resetValue,
  8893. checked = _ref.checked;
  8894. return {
  8895. label: label,
  8896. value: value,
  8897. data: data,
  8898. resetValue: resetValue,
  8899. checked: !!checked,
  8900. _checked: !!checked
  8901. };
  8902. });
  8903. }
  8904. return filters;
  8905. }
  8906. function getColMinWidth(params) {
  8907. var $table = params.$table,
  8908. column = params.column,
  8909. cell = params.cell;
  8910. var allColumnHeaderOverflow = $table.showHeaderOverflow,
  8911. resizableOpts = $table.resizableOpts;
  8912. var minWidth = resizableOpts.minWidth; // 如果自定义调整宽度逻辑
  8913. if (minWidth) {
  8914. var customMinWidth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(minWidth) ? minWidth(params) : minWidth;
  8915. if (customMinWidth !== 'auto') {
  8916. return Math.max(1, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(customMinWidth));
  8917. }
  8918. }
  8919. var showHeaderOverflow = column.showHeaderOverflow,
  8920. colMinWidth = column.minWidth;
  8921. 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;
  8922. var showEllipsis = headOverflow === 'ellipsis';
  8923. var showTitle = headOverflow === 'title';
  8924. var showTooltip = headOverflow === true || headOverflow === 'tooltip';
  8925. var hasEllipsis = showTitle || showTooltip || showEllipsis;
  8926. 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);
  8927. var paddingLeftRight = getPaddingLeftRightSize(cell) + getPaddingLeftRightSize(queryCellElement(cell, ''));
  8928. var mWidth = minTitleWidth + paddingLeftRight; // 默认最小宽处理
  8929. if (hasEllipsis) {
  8930. var checkboxIconWidth = getPaddingLeftRightSize(queryCellElement(cell, '--title>.vxe-cell--checkbox'));
  8931. var requiredIconWidth = getElemenMarginWidth(queryCellElement(cell, '>.vxe-cell--required-icon'));
  8932. var editIconWidth = getElemenMarginWidth(queryCellElement(cell, '>.vxe-cell--edit-icon'));
  8933. var helpIconWidth = getElemenMarginWidth(queryCellElement(cell, '>.vxe-cell-help-icon'));
  8934. var sortIconWidth = getElemenMarginWidth(queryCellElement(cell, '>.vxe-cell--sort'));
  8935. var filterIconWidth = getElemenMarginWidth(queryCellElement(cell, '>.vxe-cell--filter'));
  8936. mWidth += checkboxIconWidth + requiredIconWidth + editIconWidth + helpIconWidth + filterIconWidth + sortIconWidth;
  8937. } // 如果设置最小宽
  8938. if (colMinWidth) {
  8939. var tableBody = $table.$refs.tableBody;
  8940. var bodyElem = tableBody ? tableBody.$el : null;
  8941. if (bodyElem) {
  8942. if (dom.isScale(colMinWidth)) {
  8943. var bodyWidth = bodyElem.clientWidth - 1;
  8944. var meanWidth = bodyWidth / 100;
  8945. return Math.max(mWidth, Math.floor(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toInteger(colMinWidth) * meanWidth));
  8946. } else if (dom.isPx(colMinWidth)) {
  8947. return Math.max(mWidth, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toInteger(colMinWidth));
  8948. }
  8949. }
  8950. }
  8951. return mWidth;
  8952. }
  8953. function countTreeExpand(prevRow, params) {
  8954. var count = 1;
  8955. if (!prevRow) {
  8956. return count;
  8957. }
  8958. var $table = params.$table;
  8959. var rowChildren = prevRow[$table.treeOpts.children];
  8960. if ($table.isTreeExpandByRow(prevRow)) {
  8961. for (var index = 0; index < rowChildren.length; index++) {
  8962. count += countTreeExpand(rowChildren[index], params);
  8963. }
  8964. }
  8965. return count;
  8966. }
  8967. function getOffsetSize($xetable) {
  8968. return lineOffsetSizes[$xetable.vSize] || 0;
  8969. }
  8970. function calcTreeLine(params, items, rIndex) {
  8971. var $table = params.$table;
  8972. var expandSize = 1;
  8973. if (rIndex) {
  8974. expandSize = countTreeExpand(items[rIndex - 1], params);
  8975. }
  8976. return $table.rowHeight * expandSize - (rIndex ? 1 : 12 - getOffsetSize($table));
  8977. }
  8978. function mergeBodyMethod(mergeList, _rowIndex, _columnIndex) {
  8979. for (var mIndex = 0; mIndex < mergeList.length; mIndex++) {
  8980. var _mergeList$mIndex = mergeList[mIndex],
  8981. mergeRowIndex = _mergeList$mIndex.row,
  8982. mergeColIndex = _mergeList$mIndex.col,
  8983. mergeRowspan = _mergeList$mIndex.rowspan,
  8984. mergeColspan = _mergeList$mIndex.colspan;
  8985. if (mergeColIndex > -1 && mergeRowIndex > -1 && mergeRowspan && mergeColspan) {
  8986. if (mergeRowIndex === _rowIndex && mergeColIndex === _columnIndex) {
  8987. return {
  8988. rowspan: mergeRowspan,
  8989. colspan: mergeColspan
  8990. };
  8991. }
  8992. if (_rowIndex >= mergeRowIndex && _rowIndex < mergeRowIndex + mergeRowspan && _columnIndex >= mergeColIndex && _columnIndex < mergeColIndex + mergeColspan) {
  8993. return {
  8994. rowspan: 0,
  8995. colspan: 0
  8996. };
  8997. }
  8998. }
  8999. }
  9000. }
  9001. function clearTableDefaultStatus(_vm) {
  9002. _vm.initStatus = false;
  9003. _vm.clearSort();
  9004. _vm.clearCurrentRow();
  9005. _vm.clearCurrentColumn();
  9006. _vm.clearRadioRow();
  9007. _vm.clearRadioReserve();
  9008. _vm.clearCheckboxRow();
  9009. _vm.clearCheckboxReserve();
  9010. _vm.clearRowExpand();
  9011. _vm.clearTreeExpand();
  9012. _vm.clearTreeExpandReserve();
  9013. if (_vm.clearActived && v_x_e_table._edit) {
  9014. _vm.clearActived();
  9015. }
  9016. if (_vm.clearSelected && (_vm.keyboardConfig || _vm.mouseConfig)) {
  9017. _vm.clearSelected();
  9018. }
  9019. if (_vm.clearCellAreas && _vm.mouseConfig) {
  9020. _vm.clearCellAreas();
  9021. _vm.clearCopyCellArea();
  9022. }
  9023. return _vm.clearScroll();
  9024. }
  9025. function clearTableAllStatus(_vm) {
  9026. if (_vm.clearFilter && v_x_e_table._filter) {
  9027. _vm.clearFilter();
  9028. }
  9029. return clearTableDefaultStatus(_vm);
  9030. }
  9031. function isColumnInfo(column) {
  9032. return column instanceof columnInfo_ColumnInfo;
  9033. }
  9034. function getColumnConfig($xetable, _vm, options) {
  9035. return isColumnInfo(_vm) ? _vm : new columnInfo_ColumnInfo($xetable, _vm, options);
  9036. }
  9037. function rowToVisible($xetable, row) {
  9038. var tableBody = $xetable.$refs.tableBody;
  9039. var bodyElem = tableBody ? tableBody.$el : null;
  9040. if (bodyElem) {
  9041. var trElem = bodyElem.querySelector("[rowid=\"".concat(getRowid($xetable, row), "\"]"));
  9042. if (trElem) {
  9043. var bodyHeight = bodyElem.clientHeight;
  9044. var bodySrcollTop = bodyElem.scrollTop;
  9045. var trOffsetTop = trElem.offsetTop + (trElem.offsetParent ? trElem.offsetParent.offsetTop : 0);
  9046. var trHeight = trElem.clientHeight; // 检测行是否在可视区中
  9047. if (trOffsetTop < bodySrcollTop || trOffsetTop > bodySrcollTop + bodyHeight) {
  9048. // 向上定位
  9049. return $xetable.scrollTo(null, trOffsetTop);
  9050. } else if (trOffsetTop + trHeight >= bodyHeight + bodySrcollTop) {
  9051. // 向下定位
  9052. return $xetable.scrollTo(null, bodySrcollTop + trHeight);
  9053. }
  9054. } else {
  9055. // 如果是虚拟渲染跨行滚动
  9056. if ($xetable.scrollYLoad) {
  9057. return $xetable.scrollTo(null, ($xetable.afterFullData.indexOf(row) - 1) * $xetable.scrollYStore.rowHeight);
  9058. }
  9059. }
  9060. }
  9061. return Promise.resolve();
  9062. }
  9063. function colToVisible($xetable, column) {
  9064. var tableBody = $xetable.$refs.tableBody;
  9065. var bodyElem = tableBody ? tableBody.$el : null;
  9066. if (bodyElem) {
  9067. var tdElem = bodyElem.querySelector(".".concat(column.id));
  9068. if (tdElem) {
  9069. var bodyWidth = bodyElem.clientWidth;
  9070. var bodySrcollLeft = bodyElem.scrollLeft;
  9071. var tdOffsetLeft = tdElem.offsetLeft + (tdElem.offsetParent ? tdElem.offsetParent.offsetLeft : 0);
  9072. var tdWidth = tdElem.clientWidth; // 检测行是否在可视区中
  9073. if (tdOffsetLeft < bodySrcollLeft || tdOffsetLeft > bodySrcollLeft + bodyWidth) {
  9074. // 向左定位
  9075. return $xetable.scrollTo(tdOffsetLeft);
  9076. } else if (tdOffsetLeft + tdWidth >= bodyWidth + bodySrcollLeft) {
  9077. // 向右定位
  9078. return $xetable.scrollTo(bodySrcollLeft + tdWidth);
  9079. }
  9080. } else {
  9081. // 如果是虚拟渲染跨行滚动
  9082. if ($xetable.scrollXLoad) {
  9083. var visibleColumn = $xetable.visibleColumn;
  9084. var scrollLeft = 0;
  9085. for (var index = 0; index < visibleColumn.length; index++) {
  9086. if (visibleColumn[index] === column) {
  9087. break;
  9088. }
  9089. scrollLeft += visibleColumn[index].renderWidth;
  9090. }
  9091. return $xetable.scrollTo(scrollLeft);
  9092. }
  9093. }
  9094. }
  9095. return Promise.resolve();
  9096. }
  9097. // CONCATENATED MODULE: ./packages/tools/vn.js
  9098. function getSlotVNs(vns) {
  9099. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(vns)) {
  9100. return vns;
  9101. }
  9102. return [vns];
  9103. }
  9104. // CONCATENATED MODULE: ./packages/table/src/body.js
  9105. var renderType = 'body'; // 滚动、拖动过程中不需要触发
  9106. function isOperateMouse($xetable) {
  9107. return $xetable._isResize || $xetable.lastScrollTime && Date.now() < $xetable.lastScrollTime + $xetable.delayHover;
  9108. }
  9109. function renderLine(h, _vm, $xetable, params) {
  9110. var row = params.row,
  9111. column = params.column;
  9112. var treeOpts = $xetable.treeOpts,
  9113. treeConfig = $xetable.treeConfig,
  9114. fullAllDataRowIdData = $xetable.fullAllDataRowIdData;
  9115. var slots = column.slots,
  9116. treeNode = column.treeNode;
  9117. var rowid = getRowid($xetable, row);
  9118. var rest = fullAllDataRowIdData[rowid];
  9119. var rLevel = 0;
  9120. var rIndex = 0;
  9121. var items = [];
  9122. if (rest) {
  9123. rLevel = rest.level;
  9124. rIndex = rest._index;
  9125. items = rest.items;
  9126. }
  9127. if (slots && slots.line) {
  9128. return $xetable.callSlot(slots.line, params, h);
  9129. }
  9130. if (treeConfig && treeNode && treeOpts.line) {
  9131. return [h('div', {
  9132. class: 'vxe-tree--line-wrapper'
  9133. }, [h('div', {
  9134. class: 'vxe-tree--line',
  9135. style: {
  9136. height: "".concat(calcTreeLine(params, items, rIndex), "px"),
  9137. left: "".concat(rLevel * treeOpts.indent + (rLevel ? 2 - getOffsetSize($xetable) : 0) + 16, "px")
  9138. }
  9139. })])];
  9140. }
  9141. return [];
  9142. }
  9143. /**
  9144. * 渲染列
  9145. */
  9146. function renderColumn(h, _vm, $xetable, seq, rowid, fixedType, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, columns, items) {
  9147. var _ref2;
  9148. var tableListeners = $xetable.$listeners,
  9149. afterFullData = $xetable.afterFullData,
  9150. tableData = $xetable.tableData,
  9151. height = $xetable.height,
  9152. columnKey = $xetable.columnKey,
  9153. overflowX = $xetable.overflowX,
  9154. sYOpts = $xetable.sYOpts,
  9155. scrollXLoad = $xetable.scrollXLoad,
  9156. scrollYLoad = $xetable.scrollYLoad,
  9157. highlightCurrentRow = $xetable.highlightCurrentRow,
  9158. allColumnOverflow = $xetable.showOverflow,
  9159. isAllOverflow = $xetable.isAllOverflow,
  9160. allAlign = $xetable.align,
  9161. currentColumn = $xetable.currentColumn,
  9162. allCellClassName = $xetable.cellClassName,
  9163. cellStyle = $xetable.cellStyle,
  9164. mergeList = $xetable.mergeList,
  9165. spanMethod = $xetable.spanMethod,
  9166. radioOpts = $xetable.radioOpts,
  9167. checkboxOpts = $xetable.checkboxOpts,
  9168. expandOpts = $xetable.expandOpts,
  9169. treeOpts = $xetable.treeOpts,
  9170. tooltipOpts = $xetable.tooltipOpts,
  9171. mouseConfig = $xetable.mouseConfig,
  9172. editConfig = $xetable.editConfig,
  9173. editOpts = $xetable.editOpts,
  9174. editRules = $xetable.editRules,
  9175. validOpts = $xetable.validOpts,
  9176. editStore = $xetable.editStore,
  9177. validStore = $xetable.validStore,
  9178. tooltipConfig = $xetable.tooltipConfig,
  9179. rowOpts = $xetable.rowOpts,
  9180. columnOpts = $xetable.columnOpts;
  9181. var type = column.type,
  9182. cellRender = column.cellRender,
  9183. editRender = column.editRender,
  9184. align = column.align,
  9185. showOverflow = column.showOverflow,
  9186. className = column.className,
  9187. treeNode = column.treeNode;
  9188. var actived = editStore.actived;
  9189. var scrollYRHeight = sYOpts.rHeight;
  9190. var rowHeight = rowOpts.height;
  9191. var renderOpts = editRender || cellRender;
  9192. var compConf = renderOpts ? v_x_e_table.renderer.get(renderOpts.name) : null;
  9193. var cellClassName = compConf ? compConf.cellClassName : '';
  9194. var showAllTip = tooltipOpts.showAll || tooltipOpts.enabled;
  9195. var columnIndex = $xetable.getColumnIndex(column);
  9196. var _columnIndex = $xetable.getVTColumnIndex(column);
  9197. var isEdit = isEnableConf(editRender);
  9198. var fixedHiddenColumn = fixedType ? column.fixed !== fixedType : column.fixed && overflowX;
  9199. 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;
  9200. var showEllipsis = cellOverflow === 'ellipsis';
  9201. var showTitle = cellOverflow === 'title';
  9202. var showTooltip = cellOverflow === true || cellOverflow === 'tooltip';
  9203. var hasEllipsis = showTitle || showTooltip || showEllipsis;
  9204. var isDirty;
  9205. var tdOns = {};
  9206. var cellAlign = align || allAlign;
  9207. var hasValidError = validStore.row === row && validStore.column === column;
  9208. var showValidTip = editRules && validOpts.showMessage && (validOpts.message === 'default' ? height || tableData.length > 1 : validOpts.message === 'inline');
  9209. var attrs = {
  9210. colid: column.id
  9211. };
  9212. var bindMouseenter = tableListeners['cell-mouseenter'];
  9213. var bindMouseleave = tableListeners['cell-mouseleave'];
  9214. var triggerDblclick = editRender && editConfig && editOpts.trigger === 'dblclick';
  9215. var params = {
  9216. $table: $xetable,
  9217. seq: seq,
  9218. rowid: rowid,
  9219. row: row,
  9220. rowIndex: rowIndex,
  9221. $rowIndex: $rowIndex,
  9222. _rowIndex: _rowIndex,
  9223. column: column,
  9224. columnIndex: columnIndex,
  9225. $columnIndex: $columnIndex,
  9226. _columnIndex: _columnIndex,
  9227. fixed: fixedType,
  9228. type: renderType,
  9229. isHidden: fixedHiddenColumn,
  9230. level: rowLevel,
  9231. visibleData: afterFullData,
  9232. data: tableData,
  9233. items: items
  9234. }; // 虚拟滚动不支持动态高度
  9235. if ((scrollXLoad || scrollYLoad) && !hasEllipsis) {
  9236. showEllipsis = hasEllipsis = true;
  9237. } // hover 进入事件
  9238. if (showTitle || showTooltip || showAllTip || bindMouseenter || tooltipConfig) {
  9239. tdOns.mouseenter = function (evnt) {
  9240. if (isOperateMouse($xetable)) {
  9241. return;
  9242. }
  9243. if (showTitle) {
  9244. dom.updateCellTitle(evnt.currentTarget, column);
  9245. } else if (showTooltip || showAllTip) {
  9246. // 如果配置了显示 tooltip
  9247. $xetable.triggerBodyTooltipEvent(evnt, params);
  9248. }
  9249. if (bindMouseenter) {
  9250. $xetable.emitEvent('cell-mouseenter', Object.assign({
  9251. cell: evnt.currentTarget
  9252. }, params), evnt);
  9253. }
  9254. };
  9255. } // hover 退出事件
  9256. if (showTooltip || showAllTip || bindMouseleave || tooltipConfig) {
  9257. tdOns.mouseleave = function (evnt) {
  9258. if (isOperateMouse($xetable)) {
  9259. return;
  9260. }
  9261. if (showTooltip || showAllTip) {
  9262. $xetable.handleTargetLeaveEvent(evnt);
  9263. }
  9264. if (bindMouseleave) {
  9265. $xetable.emitEvent('cell-mouseleave', Object.assign({
  9266. cell: evnt.currentTarget
  9267. }, params), evnt);
  9268. }
  9269. };
  9270. } // 按下事件处理
  9271. if (checkboxOpts.range || mouseConfig) {
  9272. tdOns.mousedown = function (evnt) {
  9273. $xetable.triggerCellMousedownEvent(evnt, params);
  9274. };
  9275. } // 点击事件处理
  9276. if (rowOpts.isCurrent || 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') {
  9277. tdOns.click = function (evnt) {
  9278. $xetable.triggerCellClickEvent(evnt, params);
  9279. };
  9280. } // 双击事件处理
  9281. if (triggerDblclick || tableListeners['cell-dblclick']) {
  9282. tdOns.dblclick = function (evnt) {
  9283. $xetable.triggerCellDblclickEvent(evnt, params);
  9284. };
  9285. } // 合并行或列
  9286. if (mergeList.length) {
  9287. var spanRest = mergeBodyMethod(mergeList, _rowIndex, _columnIndex);
  9288. if (spanRest) {
  9289. var rowspan = spanRest.rowspan,
  9290. colspan = spanRest.colspan;
  9291. if (!rowspan || !colspan) {
  9292. return null;
  9293. }
  9294. if (rowspan > 1) {
  9295. attrs.rowspan = rowspan;
  9296. }
  9297. if (colspan > 1) {
  9298. attrs.colspan = colspan;
  9299. }
  9300. }
  9301. } else if (spanMethod) {
  9302. // 自定义合并行或列的方法
  9303. var _ref = spanMethod(params) || {},
  9304. _ref$rowspan = _ref.rowspan,
  9305. _rowspan = _ref$rowspan === void 0 ? 1 : _ref$rowspan,
  9306. _ref$colspan = _ref.colspan,
  9307. _colspan = _ref$colspan === void 0 ? 1 : _ref$colspan;
  9308. if (!_rowspan || !_colspan) {
  9309. return null;
  9310. }
  9311. if (_rowspan > 1) {
  9312. attrs.rowspan = _rowspan;
  9313. }
  9314. if (_colspan > 1) {
  9315. attrs.colspan = _colspan;
  9316. }
  9317. } // 如果被合并不可隐藏
  9318. if (fixedHiddenColumn && mergeList) {
  9319. if (attrs.colspan > 1 || attrs.rowspan > 1) {
  9320. fixedHiddenColumn = false;
  9321. }
  9322. } // 如果编辑列开启显示状态
  9323. if (!fixedHiddenColumn && editConfig && (editRender || cellRender) && (editOpts.showStatus || editOpts.showUpdateStatus)) {
  9324. isDirty = $xetable.isUpdateByRow(row, column.field);
  9325. }
  9326. var tdVNs = [];
  9327. if (fixedHiddenColumn && (allColumnOverflow ? isAllOverflow : allColumnOverflow)) {
  9328. tdVNs.push(h('div', {
  9329. class: ['vxe-cell', {
  9330. 'c--title': showTitle,
  9331. 'c--tooltip': showTooltip,
  9332. 'c--ellipsis': showEllipsis
  9333. }],
  9334. style: {
  9335. maxHeight: hasEllipsis && (scrollYRHeight || rowHeight) ? "".concat(scrollYRHeight || rowHeight, "px") : ''
  9336. }
  9337. }));
  9338. } else {
  9339. // 渲染单元格
  9340. tdVNs.push.apply(tdVNs, _toConsumableArray(renderLine(h, _vm, $xetable, params)).concat([h('div', {
  9341. class: ['vxe-cell', {
  9342. 'c--title': showTitle,
  9343. 'c--tooltip': showTooltip,
  9344. 'c--ellipsis': showEllipsis
  9345. }],
  9346. style: {
  9347. maxHeight: hasEllipsis && (scrollYRHeight || rowHeight) ? "".concat(scrollYRHeight || rowHeight, "px") : ''
  9348. },
  9349. attrs: {
  9350. title: showTitle ? $xetable.getCellLabel(row, column) : null
  9351. }
  9352. }, column.renderCell(h, params))]));
  9353. if (showValidTip && hasValidError) {
  9354. tdVNs.push(h('div', {
  9355. class: 'vxe-cell--valid',
  9356. style: validStore.rule && validStore.rule.maxWidth ? {
  9357. width: "".concat(validStore.rule.maxWidth, "px")
  9358. } : null
  9359. }, [h('span', {
  9360. class: 'vxe-cell--valid-msg'
  9361. }, validStore.content)]));
  9362. }
  9363. }
  9364. return h('td', {
  9365. 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), utils.getClass(cellClassName, params), utils.getClass(className, params), utils.getClass(allCellClassName, params)],
  9366. key: columnKey || columnOpts.useKey ? column.id : $columnIndex,
  9367. attrs: attrs,
  9368. style: Object.assign({
  9369. height: hasEllipsis && (scrollYRHeight || rowHeight) ? "".concat(scrollYRHeight || rowHeight, "px") : ''
  9370. }, cellStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(cellStyle) ? cellStyle(params) : cellStyle : null),
  9371. on: tdOns
  9372. }, tdVNs);
  9373. }
  9374. function renderRows(h, _vm, $xetable, fixedType, tableData, tableColumn) {
  9375. var stripe = $xetable.stripe,
  9376. rowKey = $xetable.rowKey,
  9377. highlightHoverRow = $xetable.highlightHoverRow,
  9378. rowClassName = $xetable.rowClassName,
  9379. rowStyle = $xetable.rowStyle,
  9380. editConfig = $xetable.editConfig,
  9381. allColumnOverflow = $xetable.showOverflow,
  9382. treeConfig = $xetable.treeConfig,
  9383. treeOpts = $xetable.treeOpts,
  9384. expandOpts = $xetable.expandOpts,
  9385. editOpts = $xetable.editOpts,
  9386. treeExpandeds = $xetable.treeExpandeds,
  9387. scrollYLoad = $xetable.scrollYLoad,
  9388. editStore = $xetable.editStore,
  9389. rowExpandeds = $xetable.rowExpandeds,
  9390. radioOpts = $xetable.radioOpts,
  9391. checkboxOpts = $xetable.checkboxOpts,
  9392. expandColumn = $xetable.expandColumn,
  9393. hasFixedColumn = $xetable.hasFixedColumn,
  9394. fullAllDataRowIdData = $xetable.fullAllDataRowIdData,
  9395. rowOpts = $xetable.rowOpts;
  9396. var rows = [];
  9397. tableData.forEach(function (row, $rowIndex) {
  9398. var trOn = {};
  9399. var rowIndex = $rowIndex;
  9400. var _rowIndex = $xetable.getVTRowIndex(row); // 确保任何情况下 rowIndex 都精准指向真实 data 索引
  9401. rowIndex = $xetable.getRowIndex(row); // 事件绑定
  9402. if (rowOpts.isHover || highlightHoverRow) {
  9403. trOn.mouseenter = function (evnt) {
  9404. if (isOperateMouse($xetable)) {
  9405. return;
  9406. }
  9407. $xetable.triggerHoverEvent(evnt, {
  9408. row: row,
  9409. rowIndex: rowIndex
  9410. });
  9411. };
  9412. trOn.mouseleave = function () {
  9413. if (isOperateMouse($xetable)) {
  9414. return;
  9415. }
  9416. $xetable.clearHoverRow();
  9417. };
  9418. }
  9419. var rowid = getRowid($xetable, row);
  9420. var rest = fullAllDataRowIdData[rowid];
  9421. var rowLevel = rest ? rest.level : 0;
  9422. var seq = rest ? rest.seq : -1;
  9423. var params = {
  9424. $table: $xetable,
  9425. seq: seq,
  9426. rowid: rowid,
  9427. fixed: fixedType,
  9428. type: renderType,
  9429. level: rowLevel,
  9430. row: row,
  9431. rowIndex: rowIndex,
  9432. $rowIndex: $rowIndex
  9433. }; // 行是否被展开
  9434. var isExpandRow = expandColumn && rowExpandeds.length && rowExpandeds.indexOf(row) > -1; // 树节点是否被展开
  9435. var isExpandTree = false;
  9436. var rowChildren = []; // 是否新增行
  9437. var isNewRow = false;
  9438. if (editConfig) {
  9439. isNewRow = editStore.insertList.indexOf(row) > -1;
  9440. }
  9441. if (treeConfig && !scrollYLoad && !treeOpts.transform && treeExpandeds.length) {
  9442. rowChildren = row[treeOpts.children];
  9443. isExpandTree = rowChildren && rowChildren.length && treeExpandeds.indexOf(row) > -1;
  9444. }
  9445. rows.push(h('tr', {
  9446. class: ['vxe-body--row', treeConfig ? "row--level-".concat(rowLevel) : '', {
  9447. 'row--stripe': stripe && ($xetable.getVTRowIndex(row) + 1) % 2 === 0,
  9448. 'is--new': isNewRow,
  9449. 'is--expand-row': isExpandRow,
  9450. 'is--expand-tree': isExpandTree,
  9451. 'row--new': isNewRow && (editOpts.showStatus || editOpts.showInsertStatus),
  9452. 'row--radio': radioOpts.highlight && $xetable.selectRow === row,
  9453. 'row--checked': checkboxOpts.highlight && $xetable.isCheckedByCheckboxRow(row)
  9454. }, rowClassName ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(rowClassName) ? rowClassName(params) : rowClassName : ''],
  9455. attrs: {
  9456. rowid: rowid
  9457. },
  9458. style: rowStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(rowStyle) ? rowStyle(params) : rowStyle : null,
  9459. key: rowKey || rowOpts.useKey || treeConfig ? rowid : $rowIndex,
  9460. on: trOn
  9461. }, tableColumn.map(function (column, $columnIndex) {
  9462. return renderColumn(h, _vm, $xetable, seq, rowid, fixedType, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, tableColumn, tableData);
  9463. }))); // 如果行被展开了
  9464. if (isExpandRow) {
  9465. var expandHeight = expandOpts.height;
  9466. var cellStyle = {};
  9467. if (expandHeight) {
  9468. cellStyle.height = "".concat(expandHeight, "px");
  9469. }
  9470. if (treeConfig) {
  9471. cellStyle.paddingLeft = "".concat(rowLevel * treeOpts.indent + 30, "px");
  9472. }
  9473. var showOverflow = expandColumn.showOverflow;
  9474. 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;
  9475. var expandParams = {
  9476. $table: $xetable,
  9477. seq: seq,
  9478. column: expandColumn,
  9479. fixed: fixedType,
  9480. type: renderType,
  9481. level: rowLevel,
  9482. row: row,
  9483. rowIndex: rowIndex,
  9484. $rowIndex: $rowIndex
  9485. };
  9486. rows.push(h('tr', {
  9487. class: 'vxe-body--expanded-row',
  9488. key: "expand_".concat(rowid),
  9489. style: rowStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(rowStyle) ? rowStyle(expandParams) : rowStyle : null,
  9490. on: trOn
  9491. }, [h('td', {
  9492. class: {
  9493. 'vxe-body--expanded-column': 1,
  9494. 'fixed--hidden': fixedType && !hasFixedColumn,
  9495. 'col--ellipsis': hasEllipsis
  9496. },
  9497. attrs: {
  9498. colspan: tableColumn.length
  9499. }
  9500. }, [h('div', {
  9501. class: {
  9502. 'vxe-body--expanded-cell': 1,
  9503. 'is--ellipsis': expandHeight
  9504. },
  9505. style: cellStyle
  9506. }, [expandColumn.renderData(h, expandParams)])])]));
  9507. } // 如果是树形表格
  9508. if (isExpandTree) {
  9509. rows.push.apply(rows, _toConsumableArray(renderRows(h, _vm, $xetable, fixedType, rowChildren, tableColumn)));
  9510. }
  9511. });
  9512. return rows;
  9513. }
  9514. /**
  9515. * 同步滚动条
  9516. */
  9517. var scrollProcessTimeout;
  9518. function syncBodyScroll(_vm, fixedType, scrollTop, elem1, elem2) {
  9519. if (elem1 || elem2) {
  9520. if (elem1) {
  9521. removeScrollListener(elem1);
  9522. elem1.scrollTop = scrollTop;
  9523. }
  9524. if (elem2) {
  9525. removeScrollListener(elem2);
  9526. elem2.scrollTop = scrollTop;
  9527. }
  9528. clearTimeout(scrollProcessTimeout);
  9529. scrollProcessTimeout = setTimeout(function () {
  9530. // const { tableBody, leftBody, rightBody } = _vm.$refs
  9531. // const bodyElem = tableBody.$el
  9532. // const leftElem = leftBody ? leftBody.$el : null
  9533. // const rightElem = rightBody ? rightBody.$el : null
  9534. restoreScrollListener(elem1);
  9535. restoreScrollListener(elem2); // 检查滚动条是的同步
  9536. // let targetTop = bodyElem.scrollTop
  9537. // if (fixedType === 'left') {
  9538. // if (leftElem) {
  9539. // targetTop = leftElem.scrollTop
  9540. // }
  9541. // } else if (fixedType === 'right') {
  9542. // if (rightElem) {
  9543. // targetTop = rightElem.scrollTop
  9544. // }
  9545. // }
  9546. // setScrollTop(bodyElem, targetTop)
  9547. // setScrollTop(leftElem, targetTop)
  9548. // setScrollTop(rightElem, targetTop)
  9549. }, 300);
  9550. }
  9551. }
  9552. /* harmony default export */ var src_body = ({
  9553. name: 'VxeTableBody',
  9554. props: {
  9555. tableData: Array,
  9556. tableColumn: Array,
  9557. fixedColumn: Array,
  9558. size: String,
  9559. fixedType: String
  9560. },
  9561. data: function data() {
  9562. return {
  9563. wheelTime: null,
  9564. wheelYSize: 0,
  9565. wheelYInterval: 0,
  9566. wheelYTotal: 0
  9567. };
  9568. },
  9569. mounted: function mounted() {
  9570. var $xetable = this.$parent,
  9571. $el = this.$el,
  9572. $refs = this.$refs,
  9573. fixedType = this.fixedType;
  9574. var elemStore = $xetable.elemStore;
  9575. var prefix = "".concat(fixedType || 'main', "-body-");
  9576. elemStore["".concat(prefix, "wrapper")] = $el;
  9577. elemStore["".concat(prefix, "table")] = $refs.table;
  9578. elemStore["".concat(prefix, "colgroup")] = $refs.colgroup;
  9579. elemStore["".concat(prefix, "list")] = $refs.tbody;
  9580. elemStore["".concat(prefix, "xSpace")] = $refs.xSpace;
  9581. elemStore["".concat(prefix, "ySpace")] = $refs.ySpace;
  9582. elemStore["".concat(prefix, "emptyBlock")] = $refs.emptyBlock;
  9583. this.$el.onscroll = this.scrollEvent;
  9584. this.$el._onscroll = this.scrollEvent;
  9585. },
  9586. beforeDestroy: function beforeDestroy() {
  9587. clearTimeout(this.wheelTime);
  9588. this.$el._onscroll = null;
  9589. this.$el.onscroll = null;
  9590. },
  9591. destroyed: function destroyed() {
  9592. var $xetable = this.$parent,
  9593. fixedType = this.fixedType;
  9594. var elemStore = $xetable.elemStore;
  9595. var prefix = "".concat(fixedType || 'main', "-body-");
  9596. elemStore["".concat(prefix, "wrapper")] = null;
  9597. elemStore["".concat(prefix, "table")] = null;
  9598. elemStore["".concat(prefix, "colgroup")] = null;
  9599. elemStore["".concat(prefix, "list")] = null;
  9600. elemStore["".concat(prefix, "xSpace")] = null;
  9601. elemStore["".concat(prefix, "ySpace")] = null;
  9602. elemStore["".concat(prefix, "emptyBlock")] = null;
  9603. },
  9604. render: function render(h) {
  9605. var _e = this._e,
  9606. $xetable = this.$parent,
  9607. fixedColumn = this.fixedColumn,
  9608. fixedType = this.fixedType;
  9609. var $scopedSlots = $xetable.$scopedSlots,
  9610. tId = $xetable.tId,
  9611. tableData = $xetable.tableData,
  9612. tableColumn = $xetable.tableColumn,
  9613. visibleColumn = $xetable.visibleColumn,
  9614. allColumnOverflow = $xetable.showOverflow,
  9615. keyboardConfig = $xetable.keyboardConfig,
  9616. keyboardOpts = $xetable.keyboardOpts,
  9617. mergeList = $xetable.mergeList,
  9618. spanMethod = $xetable.spanMethod,
  9619. scrollXLoad = $xetable.scrollXLoad,
  9620. scrollYLoad = $xetable.scrollYLoad,
  9621. isAllOverflow = $xetable.isAllOverflow,
  9622. emptyOpts = $xetable.emptyOpts,
  9623. mouseConfig = $xetable.mouseConfig,
  9624. mouseOpts = $xetable.mouseOpts,
  9625. sYOpts = $xetable.sYOpts; // 如果是使用优化模式
  9626. if (fixedType) {
  9627. if (scrollXLoad || scrollYLoad || (allColumnOverflow ? isAllOverflow : allColumnOverflow)) {
  9628. if (!mergeList.length && !spanMethod && !(keyboardConfig && keyboardOpts.isMerge)) {
  9629. tableColumn = fixedColumn;
  9630. } else {
  9631. tableColumn = visibleColumn; // 检查固定列是否被合并,合并范围是否超出固定列
  9632. // if (mergeList.length && !isMergeLeftFixedExceeded && fixedType === 'left') {
  9633. // tableColumn = fixedColumn
  9634. // } else if (mergeList.length && !isMergeRightFixedExceeded && fixedType === 'right') {
  9635. // tableColumn = fixedColumn
  9636. // } else {
  9637. // tableColumn = visibleColumn
  9638. // }
  9639. }
  9640. } else {
  9641. tableColumn = visibleColumn;
  9642. }
  9643. }
  9644. var emptyContent;
  9645. if ($scopedSlots.empty) {
  9646. emptyContent = $scopedSlots.empty.call(this, {
  9647. $table: $xetable
  9648. }, h);
  9649. } else {
  9650. var compConf = emptyOpts.name ? v_x_e_table.renderer.get(emptyOpts.name) : null;
  9651. var renderEmpty = compConf ? compConf.renderEmpty : null;
  9652. if (renderEmpty) {
  9653. emptyContent = getSlotVNs(renderEmpty.call(this, h, emptyOpts, {
  9654. $table: $xetable
  9655. }));
  9656. } else {
  9657. emptyContent = $xetable.emptyText || src_conf.i18n('vxe.table.emptyText');
  9658. }
  9659. }
  9660. return h('div', {
  9661. class: ['vxe-table--body-wrapper', fixedType ? "fixed-".concat(fixedType, "--wrapper") : 'body--wrapper'],
  9662. attrs: {
  9663. xid: tId
  9664. },
  9665. on: scrollYLoad && sYOpts.mode === 'wheel' ? {
  9666. wheel: this.wheelEvent
  9667. } : {}
  9668. }, [fixedType ? _e() : h('div', {
  9669. class: 'vxe-body--x-space',
  9670. ref: 'xSpace'
  9671. }), h('div', {
  9672. class: 'vxe-body--y-space',
  9673. ref: 'ySpace'
  9674. }), h('table', {
  9675. class: 'vxe-table--body',
  9676. attrs: {
  9677. xid: tId,
  9678. cellspacing: 0,
  9679. cellpadding: 0,
  9680. border: 0
  9681. },
  9682. ref: 'table'
  9683. }, [
  9684. /**
  9685. * 列宽
  9686. */
  9687. h('colgroup', {
  9688. ref: 'colgroup'
  9689. }, tableColumn.map(function (column, $columnIndex) {
  9690. return h('col', {
  9691. attrs: {
  9692. name: column.id
  9693. },
  9694. key: $columnIndex
  9695. });
  9696. })),
  9697. /**
  9698. * 内容
  9699. */
  9700. h('tbody', {
  9701. ref: 'tbody'
  9702. }, renderRows(h, this, $xetable, fixedType, tableData, tableColumn))]), h('div', {
  9703. class: 'vxe-table--checkbox-range'
  9704. }), mouseConfig && mouseOpts.area ? h('div', {
  9705. class: 'vxe-table--cell-area'
  9706. }, [h('span', {
  9707. class: 'vxe-table--cell-main-area'
  9708. }, mouseOpts.extension ? [h('span', {
  9709. class: 'vxe-table--cell-main-area-btn',
  9710. on: {
  9711. mousedown: function mousedown(evnt) {
  9712. $xetable.triggerCellExtendMousedownEvent(evnt, {
  9713. $table: $xetable,
  9714. fixed: fixedType,
  9715. type: renderType
  9716. });
  9717. }
  9718. }
  9719. })] : null), h('span', {
  9720. class: 'vxe-table--cell-copy-area'
  9721. }), h('span', {
  9722. class: 'vxe-table--cell-extend-area'
  9723. }), h('span', {
  9724. class: 'vxe-table--cell-multi-area'
  9725. }), h('span', {
  9726. class: 'vxe-table--cell-active-area'
  9727. })]) : null, !fixedType ? h('div', {
  9728. class: 'vxe-table--empty-block',
  9729. ref: 'emptyBlock'
  9730. }, [h('div', {
  9731. class: 'vxe-table--empty-content'
  9732. }, emptyContent)]) : null]);
  9733. },
  9734. methods: {
  9735. /**
  9736. * 滚动处理
  9737. * 如果存在列固定左侧,同步更新滚动状态
  9738. * 如果存在列固定右侧,同步更新滚动状态
  9739. */
  9740. scrollEvent: function scrollEvent(evnt) {
  9741. var scrollBodyElem = this.$el,
  9742. $xetable = this.$parent,
  9743. fixedType = this.fixedType;
  9744. var $refs = $xetable.$refs,
  9745. elemStore = $xetable.elemStore,
  9746. highlightHoverRow = $xetable.highlightHoverRow,
  9747. scrollXLoad = $xetable.scrollXLoad,
  9748. scrollYLoad = $xetable.scrollYLoad,
  9749. lastScrollTop = $xetable.lastScrollTop,
  9750. lastScrollLeft = $xetable.lastScrollLeft,
  9751. rowOpts = $xetable.rowOpts;
  9752. var tableHeader = $refs.tableHeader,
  9753. tableBody = $refs.tableBody,
  9754. leftBody = $refs.leftBody,
  9755. rightBody = $refs.rightBody,
  9756. tableFooter = $refs.tableFooter,
  9757. validTip = $refs.validTip;
  9758. var headerElem = tableHeader ? tableHeader.$el : null;
  9759. var footerElem = tableFooter ? tableFooter.$el : null;
  9760. var bodyElem = tableBody.$el;
  9761. var leftElem = leftBody ? leftBody.$el : null;
  9762. var rightElem = rightBody ? rightBody.$el : null;
  9763. var bodyYElem = elemStore['main-body-ySpace'];
  9764. var bodyXElem = elemStore['main-body-xSpace'];
  9765. var bodyHeight = scrollYLoad && bodyYElem ? bodyYElem.clientHeight : bodyElem.clientHeight;
  9766. var bodyWidth = scrollXLoad && bodyXElem ? bodyXElem.clientWidth : bodyElem.clientWidth;
  9767. var scrollTop = scrollBodyElem.scrollTop;
  9768. var scrollLeft = bodyElem.scrollLeft;
  9769. var isRollX = scrollLeft !== lastScrollLeft;
  9770. var isRollY = scrollTop !== lastScrollTop;
  9771. $xetable.lastScrollTop = scrollTop;
  9772. $xetable.lastScrollLeft = scrollLeft;
  9773. $xetable.lastScrollTime = Date.now();
  9774. if (rowOpts.isHover || highlightHoverRow) {
  9775. $xetable.clearHoverRow();
  9776. }
  9777. if (leftElem && fixedType === 'left') {
  9778. scrollTop = leftElem.scrollTop;
  9779. syncBodyScroll($xetable, fixedType, scrollTop, bodyElem, rightElem);
  9780. } else if (rightElem && fixedType === 'right') {
  9781. scrollTop = rightElem.scrollTop;
  9782. syncBodyScroll($xetable, fixedType, scrollTop, bodyElem, leftElem);
  9783. } else {
  9784. if (isRollX) {
  9785. if (headerElem) {
  9786. headerElem.scrollLeft = bodyElem.scrollLeft;
  9787. }
  9788. if (footerElem) {
  9789. footerElem.scrollLeft = bodyElem.scrollLeft;
  9790. }
  9791. }
  9792. if (leftElem || rightElem) {
  9793. $xetable.checkScrolling();
  9794. if (isRollY) {
  9795. syncBodyScroll($xetable, fixedType, scrollTop, leftElem, rightElem);
  9796. }
  9797. }
  9798. }
  9799. if (scrollXLoad && isRollX) {
  9800. $xetable.triggerScrollXEvent(evnt);
  9801. }
  9802. if (scrollYLoad && isRollY) {
  9803. $xetable.triggerScrollYEvent(evnt);
  9804. }
  9805. if (isRollX && validTip && validTip.visible) {
  9806. validTip.updatePlacement();
  9807. }
  9808. $xetable.emitEvent('scroll', {
  9809. type: renderType,
  9810. fixed: fixedType,
  9811. scrollTop: scrollTop,
  9812. scrollLeft: scrollLeft,
  9813. scrollHeight: bodyElem.scrollHeight,
  9814. scrollWidth: bodyElem.scrollWidth,
  9815. bodyHeight: bodyHeight,
  9816. bodyWidth: bodyWidth,
  9817. isX: isRollX,
  9818. isY: isRollY
  9819. }, evnt);
  9820. },
  9821. handleWheel: function handleWheel(evnt, isTopWheel, deltaTop, isRollX, isRollY) {
  9822. var _this = this;
  9823. var $xetable = this.$parent;
  9824. var $refs = $xetable.$refs,
  9825. elemStore = $xetable.elemStore,
  9826. scrollYLoad = $xetable.scrollYLoad,
  9827. scrollXLoad = $xetable.scrollXLoad;
  9828. var tableBody = $refs.tableBody,
  9829. leftBody = $refs.leftBody,
  9830. rightBody = $refs.rightBody;
  9831. var bodyElem = tableBody.$el;
  9832. var leftElem = leftBody ? leftBody.$el : null;
  9833. var rightElem = rightBody ? rightBody.$el : null;
  9834. var remainSize = this.isPrevWheelTop === isTopWheel ? Math.max(0, this.wheelYSize - this.wheelYTotal) : 0;
  9835. var bodyYElem = elemStore['main-body-ySpace'];
  9836. var bodyXElem = elemStore['main-body-xSpace'];
  9837. var bodyHeight = scrollYLoad && bodyYElem ? bodyYElem.clientHeight : bodyElem.clientHeight;
  9838. var bodyWidth = scrollXLoad && bodyXElem ? bodyXElem.clientWidth : bodyElem.clientWidth;
  9839. this.isPrevWheelTop = isTopWheel;
  9840. this.wheelYSize = Math.abs(isTopWheel ? deltaTop - remainSize : deltaTop + remainSize);
  9841. this.wheelYInterval = 0;
  9842. this.wheelYTotal = 0;
  9843. clearTimeout(this.wheelTime);
  9844. var handleSmooth = function handleSmooth() {
  9845. var fixedType = _this.fixedType,
  9846. wheelYTotal = _this.wheelYTotal,
  9847. wheelYSize = _this.wheelYSize,
  9848. wheelYInterval = _this.wheelYInterval;
  9849. if (wheelYTotal < wheelYSize) {
  9850. wheelYInterval = Math.max(5, Math.floor(wheelYInterval * 1.5));
  9851. wheelYTotal = wheelYTotal + wheelYInterval;
  9852. if (wheelYTotal > wheelYSize) {
  9853. wheelYInterval = wheelYInterval - (wheelYTotal - wheelYSize);
  9854. }
  9855. var scrollTop = bodyElem.scrollTop,
  9856. clientHeight = bodyElem.clientHeight,
  9857. scrollHeight = bodyElem.scrollHeight;
  9858. var targetTop = scrollTop + wheelYInterval * (isTopWheel ? -1 : 1);
  9859. bodyElem.scrollTop = targetTop;
  9860. if (leftElem) {
  9861. leftElem.scrollTop = targetTop;
  9862. }
  9863. if (rightElem) {
  9864. rightElem.scrollTop = targetTop;
  9865. }
  9866. if (isTopWheel ? targetTop < scrollHeight - clientHeight : targetTop >= 0) {
  9867. _this.wheelTime = setTimeout(handleSmooth, 10);
  9868. }
  9869. _this.wheelYTotal = wheelYTotal;
  9870. _this.wheelYInterval = wheelYInterval;
  9871. $xetable.emitEvent('scroll', {
  9872. type: renderType,
  9873. fixed: fixedType,
  9874. scrollTop: bodyElem.scrollTop,
  9875. scrollLeft: bodyElem.scrollLeft,
  9876. scrollHeight: bodyElem.scrollHeight,
  9877. scrollWidth: bodyElem.scrollWidth,
  9878. bodyHeight: bodyHeight,
  9879. bodyWidth: bodyWidth,
  9880. isX: isRollX,
  9881. isY: isRollY
  9882. }, evnt);
  9883. }
  9884. };
  9885. handleSmooth();
  9886. },
  9887. /**
  9888. * 滚轮处理
  9889. */
  9890. wheelEvent: function wheelEvent(evnt) {
  9891. var deltaY = evnt.deltaY,
  9892. deltaX = evnt.deltaX;
  9893. var scrollBodyElem = this.$el,
  9894. $xetable = this.$parent;
  9895. var $refs = $xetable.$refs,
  9896. highlightHoverRow = $xetable.highlightHoverRow,
  9897. scrollYLoad = $xetable.scrollYLoad,
  9898. lastScrollTop = $xetable.lastScrollTop,
  9899. lastScrollLeft = $xetable.lastScrollLeft,
  9900. rowOpts = $xetable.rowOpts;
  9901. var tableBody = $refs.tableBody;
  9902. var bodyElem = tableBody.$el;
  9903. var deltaTop = deltaY;
  9904. var deltaLeft = deltaX;
  9905. var isTopWheel = deltaTop < 0; // 如果滚动位置已经是顶部或底部,则不需要触发
  9906. if (isTopWheel ? scrollBodyElem.scrollTop <= 0 : scrollBodyElem.scrollTop >= scrollBodyElem.scrollHeight - scrollBodyElem.clientHeight) {
  9907. return;
  9908. }
  9909. var scrollTop = scrollBodyElem.scrollTop + deltaTop;
  9910. var scrollLeft = bodyElem.scrollLeft + deltaLeft;
  9911. var isRollX = scrollLeft !== lastScrollLeft;
  9912. var isRollY = scrollTop !== lastScrollTop; // 用于鼠标纵向滚轮处理
  9913. if (isRollY) {
  9914. evnt.preventDefault();
  9915. $xetable.lastScrollTop = scrollTop;
  9916. $xetable.lastScrollLeft = scrollLeft;
  9917. $xetable.lastScrollTime = Date.now();
  9918. if (rowOpts.isHover || highlightHoverRow) {
  9919. $xetable.clearHoverRow();
  9920. }
  9921. this.handleWheel(evnt, isTopWheel, deltaTop, isRollX, isRollY);
  9922. if (scrollYLoad) {
  9923. $xetable.triggerScrollYEvent(evnt);
  9924. }
  9925. }
  9926. }
  9927. }
  9928. });
  9929. // CONCATENATED MODULE: ./packages/header/src/util.js
  9930. var util_getAllColumns = function getAllColumns(columns, parentColumn) {
  9931. var result = [];
  9932. columns.forEach(function (column) {
  9933. column.parentId = parentColumn ? parentColumn.id : null;
  9934. if (column.visible) {
  9935. if (column.children && column.children.length && column.children.some(function (column) {
  9936. return column.visible;
  9937. })) {
  9938. result.push(column);
  9939. result.push.apply(result, _toConsumableArray(getAllColumns(column.children, column)));
  9940. } else {
  9941. result.push(column);
  9942. }
  9943. }
  9944. });
  9945. return result;
  9946. };
  9947. var convertToRows = function convertToRows(originColumns) {
  9948. var maxLevel = 1;
  9949. var traverse = function traverse(column, parent) {
  9950. if (parent) {
  9951. column.level = parent.level + 1;
  9952. if (maxLevel < column.level) {
  9953. maxLevel = column.level;
  9954. }
  9955. }
  9956. if (column.children && column.children.length && column.children.some(function (column) {
  9957. return column.visible;
  9958. })) {
  9959. var colSpan = 0;
  9960. column.children.forEach(function (subColumn) {
  9961. if (subColumn.visible) {
  9962. traverse(subColumn, column);
  9963. colSpan += subColumn.colSpan;
  9964. }
  9965. });
  9966. column.colSpan = colSpan;
  9967. } else {
  9968. column.colSpan = 1;
  9969. }
  9970. };
  9971. originColumns.forEach(function (column) {
  9972. column.level = 1;
  9973. traverse(column);
  9974. });
  9975. var rows = [];
  9976. for (var i = 0; i < maxLevel; i++) {
  9977. rows.push([]);
  9978. }
  9979. var allColumns = util_getAllColumns(originColumns);
  9980. allColumns.forEach(function (column) {
  9981. if (column.children && column.children.length && column.children.some(function (column) {
  9982. return column.visible;
  9983. })) {
  9984. column.rowSpan = 1;
  9985. } else {
  9986. column.rowSpan = maxLevel - column.level + 1;
  9987. }
  9988. rows[column.level - 1].push(column);
  9989. });
  9990. return rows;
  9991. };
  9992. // CONCATENATED MODULE: ./packages/header/src/header.js
  9993. var cellType = 'header';
  9994. /* harmony default export */ var header = ({
  9995. name: 'VxeTableHeader',
  9996. props: {
  9997. tableData: Array,
  9998. tableColumn: Array,
  9999. tableGroupColumn: Array,
  10000. fixedColumn: Array,
  10001. size: String,
  10002. fixedType: String
  10003. },
  10004. data: function data() {
  10005. return {
  10006. headerColumn: []
  10007. };
  10008. },
  10009. watch: {
  10010. tableColumn: function tableColumn() {
  10011. this.uploadColumn();
  10012. }
  10013. },
  10014. created: function created() {
  10015. this.uploadColumn();
  10016. },
  10017. mounted: function mounted() {
  10018. var $xetable = this.$parent,
  10019. $el = this.$el,
  10020. $refs = this.$refs,
  10021. fixedType = this.fixedType;
  10022. var elemStore = $xetable.elemStore;
  10023. var prefix = "".concat(fixedType || 'main', "-header-");
  10024. elemStore["".concat(prefix, "wrapper")] = $el;
  10025. elemStore["".concat(prefix, "table")] = $refs.table;
  10026. elemStore["".concat(prefix, "colgroup")] = $refs.colgroup;
  10027. elemStore["".concat(prefix, "list")] = $refs.thead;
  10028. elemStore["".concat(prefix, "xSpace")] = $refs.xSpace;
  10029. elemStore["".concat(prefix, "repair")] = $refs.repair;
  10030. },
  10031. destroyed: function destroyed() {
  10032. var $xetable = this.$parent,
  10033. fixedType = this.fixedType;
  10034. var elemStore = $xetable.elemStore;
  10035. var prefix = "".concat(fixedType || 'main', "-header-");
  10036. elemStore["".concat(prefix, "wrapper")] = null;
  10037. elemStore["".concat(prefix, "table")] = null;
  10038. elemStore["".concat(prefix, "colgroup")] = null;
  10039. elemStore["".concat(prefix, "list")] = null;
  10040. elemStore["".concat(prefix, "xSpace")] = null;
  10041. elemStore["".concat(prefix, "repair")] = null;
  10042. },
  10043. render: function render(h) {
  10044. var _this = this;
  10045. var _e = this._e,
  10046. $xetable = this.$parent,
  10047. fixedType = this.fixedType,
  10048. headerColumn = this.headerColumn,
  10049. tableColumn = this.tableColumn,
  10050. fixedColumn = this.fixedColumn;
  10051. var tableListeners = $xetable.$listeners,
  10052. tId = $xetable.tId,
  10053. isGroup = $xetable.isGroup,
  10054. visibleColumn = $xetable.visibleColumn,
  10055. resizable = $xetable.resizable,
  10056. border = $xetable.border,
  10057. columnKey = $xetable.columnKey,
  10058. headerRowClassName = $xetable.headerRowClassName,
  10059. headerCellClassName = $xetable.headerCellClassName,
  10060. headerRowStyle = $xetable.headerRowStyle,
  10061. headerCellStyle = $xetable.headerCellStyle,
  10062. allColumnHeaderOverflow = $xetable.showHeaderOverflow,
  10063. allHeaderAlign = $xetable.headerAlign,
  10064. allAlign = $xetable.align,
  10065. highlightCurrentColumn = $xetable.highlightCurrentColumn,
  10066. currentColumn = $xetable.currentColumn,
  10067. scrollXLoad = $xetable.scrollXLoad,
  10068. overflowX = $xetable.overflowX,
  10069. scrollbarWidth = $xetable.scrollbarWidth,
  10070. sortOpts = $xetable.sortOpts,
  10071. mouseConfig = $xetable.mouseConfig,
  10072. columnOpts = $xetable.columnOpts;
  10073. var headerGroups = headerColumn;
  10074. var renderColumnList = tableColumn;
  10075. if (isGroup) {
  10076. renderColumnList = visibleColumn;
  10077. } else {
  10078. // 如果是使用优化模式
  10079. if (fixedType) {
  10080. if (scrollXLoad || allColumnHeaderOverflow) {
  10081. renderColumnList = fixedColumn;
  10082. }
  10083. }
  10084. headerGroups = [renderColumnList];
  10085. }
  10086. return h('div', {
  10087. class: ['vxe-table--header-wrapper', fixedType ? "fixed-".concat(fixedType, "--wrapper") : 'body--wrapper'],
  10088. attrs: {
  10089. xid: tId
  10090. }
  10091. }, [fixedType ? _e() : h('div', {
  10092. class: 'vxe-body--x-space',
  10093. ref: 'xSpace'
  10094. }), h('table', {
  10095. class: 'vxe-table--header',
  10096. attrs: {
  10097. xid: tId,
  10098. cellspacing: 0,
  10099. cellpadding: 0,
  10100. border: 0
  10101. },
  10102. ref: 'table'
  10103. }, [
  10104. /**
  10105. * 列宽
  10106. */
  10107. h('colgroup', {
  10108. ref: 'colgroup'
  10109. }, renderColumnList.map(function (column, $columnIndex) {
  10110. return h('col', {
  10111. attrs: {
  10112. name: column.id
  10113. },
  10114. key: $columnIndex
  10115. });
  10116. }).concat(scrollbarWidth ? [h('col', {
  10117. attrs: {
  10118. name: 'col_gutter'
  10119. }
  10120. })] : [])),
  10121. /**
  10122. * 头部
  10123. */
  10124. h('thead', {
  10125. ref: 'thead'
  10126. }, headerGroups.map(function (cols, $rowIndex) {
  10127. return h('tr', {
  10128. class: ['vxe-header--row', headerRowClassName ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(headerRowClassName) ? headerRowClassName({
  10129. $table: $xetable,
  10130. $rowIndex: $rowIndex,
  10131. fixed: fixedType,
  10132. type: cellType
  10133. }) : headerRowClassName : ''],
  10134. style: headerRowStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(headerRowStyle) ? headerRowStyle({
  10135. $table: $xetable,
  10136. $rowIndex: $rowIndex,
  10137. fixed: fixedType,
  10138. type: cellType
  10139. }) : headerRowStyle : null
  10140. }, cols.map(function (column, $columnIndex) {
  10141. var _ref;
  10142. var type = column.type,
  10143. showHeaderOverflow = column.showHeaderOverflow,
  10144. headerAlign = column.headerAlign,
  10145. align = column.align,
  10146. headerClassName = column.headerClassName; // const { enabled } = tooltipOpts
  10147. var isColGroup = column.children && column.children.length;
  10148. var fixedHiddenColumn = fixedType ? column.fixed !== fixedType && !isColGroup : column.fixed && overflowX;
  10149. 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;
  10150. var headAlign = headerAlign || align || allHeaderAlign || allAlign;
  10151. var showEllipsis = headOverflow === 'ellipsis';
  10152. var showTitle = headOverflow === 'title';
  10153. var showTooltip = headOverflow === true || headOverflow === 'tooltip';
  10154. var hasEllipsis = showTitle || showTooltip || showEllipsis;
  10155. var thOns = {};
  10156. var hasFilter = column.filters && column.filters.some(function (item) {
  10157. return item.checked;
  10158. });
  10159. var columnIndex = $xetable.getColumnIndex(column);
  10160. var _columnIndex = $xetable.getVTColumnIndex(column);
  10161. var params = {
  10162. $table: $xetable,
  10163. $rowIndex: $rowIndex,
  10164. column: column,
  10165. columnIndex: columnIndex,
  10166. $columnIndex: $columnIndex,
  10167. _columnIndex: _columnIndex,
  10168. fixed: fixedType,
  10169. type: cellType,
  10170. isHidden: fixedHiddenColumn,
  10171. hasFilter: hasFilter
  10172. }; // 虚拟滚动不支持动态高度
  10173. if (scrollXLoad && !hasEllipsis) {
  10174. showEllipsis = hasEllipsis = true;
  10175. }
  10176. if (columnOpts.isCurrent || highlightCurrentColumn || tableListeners['header-cell-click'] || sortOpts.trigger === 'cell') {
  10177. thOns.click = function (evnt) {
  10178. return $xetable.triggerHeaderCellClickEvent(evnt, params);
  10179. };
  10180. }
  10181. if (tableListeners['header-cell-dblclick']) {
  10182. thOns.dblclick = function (evnt) {
  10183. return $xetable.triggerHeaderCellDblclickEvent(evnt, params);
  10184. };
  10185. } // 按下事件处理
  10186. if (mouseConfig) {
  10187. thOns.mousedown = function (evnt) {
  10188. return $xetable.triggerHeaderCellMousedownEvent(evnt, params);
  10189. };
  10190. }
  10191. return h('th', {
  10192. 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, 'col--filter', !!column.filters), _defineProperty(_ref, 'is--filter-active', hasFilter), _defineProperty(_ref, 'col--current', currentColumn === column), _ref), utils.getClass(headerClassName, params), utils.getClass(headerCellClassName, params)],
  10193. attrs: {
  10194. colid: column.id,
  10195. colspan: column.colSpan > 1 ? column.colSpan : null,
  10196. rowspan: column.rowSpan > 1 ? column.rowSpan : null
  10197. },
  10198. style: headerCellStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(headerCellStyle) ? headerCellStyle(params) : headerCellStyle : null,
  10199. on: thOns,
  10200. key: columnKey || columnOpts.useKey || isColGroup ? column.id : $columnIndex
  10201. }, [h('div', {
  10202. class: ['vxe-cell', {
  10203. 'c--title': showTitle,
  10204. 'c--tooltip': showTooltip,
  10205. 'c--ellipsis': showEllipsis
  10206. }]
  10207. }, column.renderHeader(h, params)),
  10208. /**
  10209. * 列宽拖动
  10210. */
  10211. !fixedHiddenColumn && !isColGroup && (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isBoolean(column.resizable) ? column.resizable : columnOpts.resizable || resizable) ? h('div', {
  10212. class: ['vxe-resizable', {
  10213. 'is--line': !border || border === 'none'
  10214. }],
  10215. on: {
  10216. mousedown: function mousedown(evnt) {
  10217. return _this.resizeMousedown(evnt, params);
  10218. }
  10219. }
  10220. }) : null]);
  10221. }).concat(scrollbarWidth ? [h('th', {
  10222. class: 'vxe-header--gutter col--gutter'
  10223. })] : []));
  10224. }))]),
  10225. /**
  10226. * 其他
  10227. */
  10228. h('div', {
  10229. class: 'vxe-table--header-border-line',
  10230. ref: 'repair'
  10231. })]);
  10232. },
  10233. methods: {
  10234. uploadColumn: function uploadColumn() {
  10235. var $xetable = this.$parent;
  10236. this.headerColumn = $xetable.isGroup ? convertToRows(this.tableGroupColumn) : [];
  10237. },
  10238. resizeMousedown: function resizeMousedown(evnt, params) {
  10239. var column = params.column;
  10240. var $xetable = this.$parent,
  10241. $el = this.$el,
  10242. fixedType = this.fixedType;
  10243. var _$xetable$$refs = $xetable.$refs,
  10244. tableBody = _$xetable$$refs.tableBody,
  10245. leftContainer = _$xetable$$refs.leftContainer,
  10246. rightContainer = _$xetable$$refs.rightContainer,
  10247. resizeBarElem = _$xetable$$refs.resizeBar;
  10248. var dragBtnElem = evnt.target,
  10249. dragClientX = evnt.clientX;
  10250. var cell = params.cell = dragBtnElem.parentNode;
  10251. var dragLeft = 0;
  10252. var tableBodyElem = tableBody.$el;
  10253. var pos = dom.getOffsetPos(dragBtnElem, $el);
  10254. var dragBtnWidth = dragBtnElem.clientWidth;
  10255. var dragBtnOffsetWidth = Math.floor(dragBtnWidth / 2);
  10256. var minInterval = getColMinWidth(params) - dragBtnOffsetWidth; // 列之间的最小间距
  10257. var dragMinLeft = pos.left - cell.clientWidth + dragBtnWidth + minInterval;
  10258. var dragPosLeft = pos.left + dragBtnOffsetWidth;
  10259. var domMousemove = document.onmousemove;
  10260. var domMouseup = document.onmouseup;
  10261. var isLeftFixed = fixedType === 'left';
  10262. var isRightFixed = fixedType === 'right'; // 计算左右侧固定列偏移量
  10263. var fixedOffsetWidth = 0;
  10264. if (isLeftFixed || isRightFixed) {
  10265. var siblingProp = isLeftFixed ? 'nextElementSibling' : 'previousElementSibling';
  10266. var tempCellElem = cell[siblingProp];
  10267. while (tempCellElem) {
  10268. if (dom.hasClass(tempCellElem, 'fixed--hidden')) {
  10269. break;
  10270. } else if (!dom.hasClass(tempCellElem, 'col--group')) {
  10271. fixedOffsetWidth += tempCellElem.offsetWidth;
  10272. }
  10273. tempCellElem = tempCellElem[siblingProp];
  10274. }
  10275. if (isRightFixed && rightContainer) {
  10276. dragPosLeft = rightContainer.offsetLeft + fixedOffsetWidth;
  10277. }
  10278. } // 处理拖动事件
  10279. var updateEvent = function updateEvent(evnt) {
  10280. evnt.stopPropagation();
  10281. evnt.preventDefault();
  10282. var offsetX = evnt.clientX - dragClientX;
  10283. var left = dragPosLeft + offsetX;
  10284. var scrollLeft = fixedType ? 0 : tableBodyElem.scrollLeft;
  10285. if (isLeftFixed) {
  10286. // 左固定列(不允许超过右侧固定列、不允许超过右边距)
  10287. left = Math.min(left, (rightContainer ? rightContainer.offsetLeft : tableBodyElem.clientWidth) - fixedOffsetWidth - minInterval);
  10288. } else if (isRightFixed) {
  10289. // 右侧固定列(不允许超过左侧固定列、不允许超过左边距)
  10290. dragMinLeft = (leftContainer ? leftContainer.clientWidth : 0) + fixedOffsetWidth + minInterval;
  10291. left = Math.min(left, dragPosLeft + cell.clientWidth - minInterval);
  10292. } else {
  10293. dragMinLeft = Math.max(tableBodyElem.scrollLeft, dragMinLeft); // left = Math.min(left, tableBodyElem.clientWidth + tableBodyElem.scrollLeft - 40)
  10294. }
  10295. dragLeft = Math.max(left, dragMinLeft);
  10296. resizeBarElem.style.left = "".concat(dragLeft - scrollLeft, "px");
  10297. };
  10298. $xetable._isResize = true;
  10299. dom.addClass($xetable.$el, 'drag--resize');
  10300. resizeBarElem.style.display = 'block';
  10301. document.onmousemove = updateEvent;
  10302. document.onmouseup = function (evnt) {
  10303. document.onmousemove = domMousemove;
  10304. document.onmouseup = domMouseup;
  10305. var resizeWidth = column.renderWidth + (isRightFixed ? dragPosLeft - dragLeft : dragLeft - dragPosLeft);
  10306. column.resizeWidth = resizeWidth;
  10307. resizeBarElem.style.display = 'none';
  10308. $xetable._isResize = false;
  10309. $xetable._lastResizeTime = Date.now();
  10310. $xetable.analyColumnWidth();
  10311. $xetable.recalculate(true).then(function () {
  10312. $xetable.saveCustomResizable();
  10313. $xetable.updateCellAreas();
  10314. $xetable.emitEvent('resizable-change', _objectSpread2(_objectSpread2({}, params), {}, {
  10315. resizeWidth: resizeWidth
  10316. }), evnt);
  10317. });
  10318. dom.removeClass($xetable.$el, 'drag--resize');
  10319. };
  10320. updateEvent(evnt);
  10321. $xetable.closeMenu();
  10322. }
  10323. }
  10324. });
  10325. // CONCATENATED MODULE: ./packages/header/index.js
  10326. var Header = Object.assign(header, {
  10327. install: function install(Vue) {
  10328. Vue.component(header.name, header);
  10329. }
  10330. });
  10331. /* harmony default export */ var packages_header = (Header);
  10332. // CONCATENATED MODULE: ./packages/mixins/size.js
  10333. /* harmony default export */ var size = ({
  10334. computed: {
  10335. vSize: function vSize() {
  10336. var $parent = this.$parent,
  10337. size = this.size;
  10338. return size || $parent && ($parent.size || $parent.vSize);
  10339. }
  10340. }
  10341. });
  10342. // CONCATENATED MODULE: ./packages/tools/resize.js
  10343. /**
  10344. * 监听 resize 事件
  10345. * 如果项目中已使用了 resize-observer-polyfill,那么只需要将方法定义全局,该组件就会自动使用
  10346. */
  10347. var resizeTimeout;
  10348. var eventStore = [];
  10349. var defaultInterval = 500;
  10350. function eventHandle() {
  10351. if (eventStore.length) {
  10352. eventStore.forEach(function (item) {
  10353. item.tarList.forEach(function (observer) {
  10354. var target = observer.target,
  10355. width = observer.width,
  10356. heighe = observer.heighe;
  10357. var clientWidth = target.clientWidth;
  10358. var clientHeight = target.clientHeight;
  10359. var rWidth = clientWidth && width !== clientWidth;
  10360. var rHeight = clientHeight && heighe !== clientHeight;
  10361. if (rWidth || rHeight) {
  10362. observer.width = clientWidth;
  10363. observer.heighe = clientHeight;
  10364. setTimeout(item.callback);
  10365. }
  10366. });
  10367. });
  10368. /* eslint-disable @typescript-eslint/no-use-before-define */
  10369. eventListener();
  10370. }
  10371. }
  10372. function eventListener() {
  10373. clearTimeout(resizeTimeout);
  10374. resizeTimeout = setTimeout(eventHandle, src_conf.resizeInterval || defaultInterval);
  10375. }
  10376. var resize_ResizeObserverPolyfill = /*#__PURE__*/function () {
  10377. function ResizeObserverPolyfill(callback) {
  10378. _classCallCheck(this, ResizeObserverPolyfill);
  10379. this.tarList = [];
  10380. this.callback = callback;
  10381. }
  10382. _createClass(ResizeObserverPolyfill, [{
  10383. key: "observe",
  10384. value: function observe(target) {
  10385. var _this = this;
  10386. if (target) {
  10387. if (!this.tarList.some(function (observer) {
  10388. return observer.target === target;
  10389. })) {
  10390. this.tarList.push({
  10391. target: target,
  10392. width: target.clientWidth,
  10393. heighe: target.clientHeight
  10394. });
  10395. }
  10396. if (!eventStore.length) {
  10397. eventListener();
  10398. }
  10399. if (!eventStore.some(function (item) {
  10400. return item === _this;
  10401. })) {
  10402. eventStore.push(this);
  10403. }
  10404. }
  10405. }
  10406. }, {
  10407. key: "unobserve",
  10408. value: function unobserve(target) {
  10409. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.remove(eventStore, function (item) {
  10410. return item.tarList.some(function (observer) {
  10411. return observer.target === target;
  10412. });
  10413. });
  10414. }
  10415. }, {
  10416. key: "disconnect",
  10417. value: function disconnect() {
  10418. var _this2 = this;
  10419. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.remove(eventStore, function (item) {
  10420. return item === _this2;
  10421. });
  10422. }
  10423. }]);
  10424. return ResizeObserverPolyfill;
  10425. }();
  10426. function createResizeEvent(callback) {
  10427. if (window.ResizeObserver) {
  10428. return new window.ResizeObserver(callback);
  10429. }
  10430. return new resize_ResizeObserverPolyfill(callback);
  10431. }
  10432. // CONCATENATED MODULE: ./packages/tools/event.js
  10433. var EVENT_KEYS = {
  10434. F2: 'F2',
  10435. ESCAPE: 'Escape',
  10436. ENTER: 'Enter',
  10437. TAB: 'Tab',
  10438. DELETE: 'Delete',
  10439. BACKSPACE: 'Backspace',
  10440. SPACEBAR: ' ',
  10441. CONTEXT_MENU: 'ContextMenu',
  10442. ARROW_UP: 'ArrowUp',
  10443. ARROW_DOWN: 'ArrowDown',
  10444. ARROW_LEFT: 'ArrowLeft',
  10445. ARROW_RIGHT: 'ArrowRight',
  10446. PAGE_UP: 'PageUp',
  10447. PAGE_DOWN: 'PageDown'
  10448. };
  10449. var convertEventKeys = {
  10450. ' ': 'Spacebar',
  10451. Apps: EVENT_KEYS.CONTEXT_MENU,
  10452. Del: EVENT_KEYS.DELETE,
  10453. Up: EVENT_KEYS.ARROW_UP,
  10454. Down: EVENT_KEYS.ARROW_DOWN,
  10455. Left: EVENT_KEYS.ARROW_LEFT,
  10456. Right: EVENT_KEYS.ARROW_RIGHT
  10457. }; // 监听全局事件
  10458. var wheelName = browse.firefox ? 'DOMMouseScroll' : 'mousewheel';
  10459. var event_eventStore = [];
  10460. var hasEventKey = function hasEventKey(evnt, targetKey) {
  10461. var key = evnt.key;
  10462. targetKey = targetKey.toLowerCase();
  10463. return key ? targetKey === key.toLowerCase() || !!(convertEventKeys[key] && convertEventKeys[key].toLowerCase() === targetKey) : false;
  10464. };
  10465. var GlobalEvent = {
  10466. on: function on(comp, type, cb) {
  10467. if (cb) {
  10468. event_eventStore.push({
  10469. comp: comp,
  10470. type: type,
  10471. cb: cb
  10472. });
  10473. }
  10474. },
  10475. off: function off(comp, type) {
  10476. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.remove(event_eventStore, function (item) {
  10477. return item.comp === comp && item.type === type;
  10478. });
  10479. },
  10480. trigger: function trigger(evnt) {
  10481. var isWheel = evnt.type === wheelName;
  10482. event_eventStore.forEach(function (_ref) {
  10483. var comp = _ref.comp,
  10484. type = _ref.type,
  10485. cb = _ref.cb;
  10486. // 如果被取消冒泡,不再执行
  10487. if (!evnt.cancelBubble) {
  10488. if (type === evnt.type || isWheel && type === 'mousewheel') {
  10489. cb.call(comp, evnt);
  10490. }
  10491. }
  10492. });
  10493. },
  10494. eqKeypad: function eqKeypad(evnt, keyVal) {
  10495. var key = evnt.key;
  10496. if (keyVal.toLowerCase() === key.toLowerCase()) {
  10497. return true;
  10498. }
  10499. return false;
  10500. }
  10501. };
  10502. if (browse.isDoc) {
  10503. if (!browse.msie) {
  10504. document.addEventListener('copy', GlobalEvent.trigger, false);
  10505. document.addEventListener('cut', GlobalEvent.trigger, false);
  10506. document.addEventListener('paste', GlobalEvent.trigger, false);
  10507. }
  10508. document.addEventListener('keydown', GlobalEvent.trigger, false);
  10509. document.addEventListener('contextmenu', GlobalEvent.trigger, false);
  10510. window.addEventListener('mousedown', GlobalEvent.trigger, false);
  10511. window.addEventListener('blur', GlobalEvent.trigger, false);
  10512. window.addEventListener('resize', GlobalEvent.trigger, false);
  10513. window.addEventListener(wheelName, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.throttle(GlobalEvent.trigger, 100, {
  10514. leading: true,
  10515. trailing: false
  10516. }), false);
  10517. }
  10518. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.trim.js
  10519. var es_string_trim = __webpack_require__("498a");
  10520. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.sort.js
  10521. var es_array_sort = __webpack_require__("4e82");
  10522. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.promise.finally.js
  10523. var es_promise_finally = __webpack_require__("a79d");
  10524. // CONCATENATED MODULE: ./packages/table/src/cell.js
  10525. function renderHelpIcon(h, params) {
  10526. var $table = params.$table,
  10527. column = params.column;
  10528. var titlePrefix = column.titlePrefix || column.titleHelp;
  10529. return titlePrefix ? [h('i', {
  10530. class: ['vxe-cell-help-icon', titlePrefix.icon || src_conf.icon.TABLE_HELP],
  10531. on: {
  10532. mouseenter: function mouseenter(evnt) {
  10533. $table.triggerHeaderHelpEvent(evnt, params);
  10534. },
  10535. mouseleave: function mouseleave(evnt) {
  10536. $table.handleTargetLeaveEvent(evnt);
  10537. }
  10538. }
  10539. })] : [];
  10540. }
  10541. function renderTitleContent(h, params, content) {
  10542. var $table = params.$table,
  10543. column = params.column;
  10544. var type = column.type,
  10545. showHeaderOverflow = column.showHeaderOverflow;
  10546. var allColumnHeaderOverflow = $table.showHeaderOverflow,
  10547. tooltipOpts = $table.tooltipOpts;
  10548. var showAllTip = tooltipOpts.showAll || tooltipOpts.enabled;
  10549. 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;
  10550. var showTitle = headOverflow === 'title';
  10551. var showTooltip = headOverflow === true || headOverflow === 'tooltip';
  10552. var ons = {};
  10553. if (showTitle || showTooltip || showAllTip) {
  10554. ons.mouseenter = function (evnt) {
  10555. if ($table._isResize) {
  10556. return;
  10557. }
  10558. if (showTitle) {
  10559. dom.updateCellTitle(evnt.currentTarget, column);
  10560. } else if (showTooltip || showAllTip) {
  10561. $table.triggerHeaderTooltipEvent(evnt, params);
  10562. }
  10563. };
  10564. }
  10565. if (showTooltip || showAllTip) {
  10566. ons.mouseleave = function (evnt) {
  10567. if ($table._isResize) {
  10568. return;
  10569. }
  10570. if (showTooltip || showAllTip) {
  10571. $table.handleTargetLeaveEvent(evnt);
  10572. }
  10573. };
  10574. }
  10575. return [type === 'html' && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isString(content) ? h('span', {
  10576. class: 'vxe-cell--title',
  10577. domProps: {
  10578. innerHTML: content
  10579. },
  10580. on: ons
  10581. }) : h('span', {
  10582. class: 'vxe-cell--title',
  10583. on: ons
  10584. }, content)];
  10585. }
  10586. function getFooterContent(h, params) {
  10587. var $table = params.$table,
  10588. column = params.column,
  10589. _columnIndex = params._columnIndex,
  10590. items = params.items;
  10591. var slots = column.slots,
  10592. editRender = column.editRender,
  10593. cellRender = column.cellRender;
  10594. var renderOpts = editRender || cellRender;
  10595. if (slots && slots.footer) {
  10596. return $table.callSlot(slots.footer, params, h);
  10597. }
  10598. if (renderOpts) {
  10599. var compConf = v_x_e_table.renderer.get(renderOpts.name);
  10600. if (compConf && compConf.renderFooter) {
  10601. return getSlotVNs(compConf.renderFooter.call($table, h, renderOpts, params));
  10602. }
  10603. }
  10604. return [utils.formatText(items[_columnIndex], 1)];
  10605. }
  10606. function getDefaultCellLabel(params) {
  10607. var $table = params.$table,
  10608. row = params.row,
  10609. column = params.column;
  10610. return utils.formatText($table.getCellLabel(row, column), 1);
  10611. }
  10612. var Cell = {
  10613. createColumn: function createColumn($xetable, _vm) {
  10614. var type = _vm.type,
  10615. sortable = _vm.sortable,
  10616. remoteSort = _vm.remoteSort,
  10617. filters = _vm.filters,
  10618. editRender = _vm.editRender,
  10619. treeNode = _vm.treeNode;
  10620. var editConfig = $xetable.editConfig,
  10621. editOpts = $xetable.editOpts,
  10622. checkboxOpts = $xetable.checkboxOpts;
  10623. var renMaps = {
  10624. renderHeader: this.renderDefaultHeader,
  10625. renderCell: treeNode ? this.renderTreeCell : this.renderDefaultCell,
  10626. renderFooter: this.renderDefaultFooter
  10627. };
  10628. switch (type) {
  10629. case 'seq':
  10630. renMaps.renderHeader = this.renderSeqHeader;
  10631. renMaps.renderCell = treeNode ? this.renderTreeIndexCell : this.renderSeqCell;
  10632. break;
  10633. case 'radio':
  10634. renMaps.renderHeader = this.renderRadioHeader;
  10635. renMaps.renderCell = treeNode ? this.renderTreeRadioCell : this.renderRadioCell;
  10636. break;
  10637. case 'checkbox':
  10638. renMaps.renderHeader = this.renderCheckboxHeader;
  10639. renMaps.renderCell = checkboxOpts.checkField ? treeNode ? this.renderTreeSelectionCellByProp : this.renderCheckboxCellByProp : treeNode ? this.renderTreeSelectionCell : this.renderCheckboxCell;
  10640. break;
  10641. case 'expand':
  10642. renMaps.renderCell = this.renderExpandCell;
  10643. renMaps.renderData = this.renderExpandData;
  10644. break;
  10645. case 'html':
  10646. renMaps.renderCell = treeNode ? this.renderTreeHTMLCell : this.renderHTMLCell;
  10647. if (filters && (sortable || remoteSort)) {
  10648. renMaps.renderHeader = this.renderSortAndFilterHeader;
  10649. } else if (sortable || remoteSort) {
  10650. renMaps.renderHeader = this.renderSortHeader;
  10651. } else if (filters) {
  10652. renMaps.renderHeader = this.renderFilterHeader;
  10653. }
  10654. break;
  10655. default:
  10656. if (editConfig && editRender) {
  10657. renMaps.renderHeader = this.renderEditHeader;
  10658. renMaps.renderCell = editOpts.mode === 'cell' ? treeNode ? this.renderTreeCellEdit : this.renderCellEdit : treeNode ? this.renderTreeRowEdit : this.renderRowEdit;
  10659. } else if (filters && (sortable || remoteSort)) {
  10660. renMaps.renderHeader = this.renderSortAndFilterHeader;
  10661. } else if (sortable || remoteSort) {
  10662. renMaps.renderHeader = this.renderSortHeader;
  10663. } else if (filters) {
  10664. renMaps.renderHeader = this.renderFilterHeader;
  10665. }
  10666. }
  10667. return getColumnConfig($xetable, _vm, renMaps);
  10668. },
  10669. /**
  10670. * 单元格
  10671. */
  10672. renderHeaderTitle: function renderHeaderTitle(h, params) {
  10673. var $table = params.$table,
  10674. column = params.column;
  10675. var slots = column.slots,
  10676. editRender = column.editRender,
  10677. cellRender = column.cellRender;
  10678. var renderOpts = editRender || cellRender;
  10679. if (slots && slots.header) {
  10680. return renderTitleContent(h, params, $table.callSlot(slots.header, params, h));
  10681. }
  10682. if (renderOpts) {
  10683. var compConf = v_x_e_table.renderer.get(renderOpts.name);
  10684. if (compConf && compConf.renderHeader) {
  10685. return getSlotVNs(renderTitleContent(h, params, compConf.renderHeader.call($table, h, renderOpts, params)));
  10686. }
  10687. }
  10688. return renderTitleContent(h, params, utils.formatText(column.getTitle(), 1));
  10689. },
  10690. renderDefaultHeader: function renderDefaultHeader(h, params) {
  10691. return renderHelpIcon(h, params).concat(Cell.renderHeaderTitle(h, params));
  10692. },
  10693. renderDefaultCell: function renderDefaultCell(h, params) {
  10694. var $table = params.$table,
  10695. row = params.row,
  10696. column = params.column;
  10697. var slots = column.slots,
  10698. editRender = column.editRender,
  10699. cellRender = column.cellRender;
  10700. var renderOpts = editRender || cellRender;
  10701. if (slots && slots.default) {
  10702. return $table.callSlot(slots.default, params, h);
  10703. }
  10704. if (renderOpts) {
  10705. var funName = editRender ? 'renderCell' : 'renderDefault';
  10706. var compConf = v_x_e_table.renderer.get(renderOpts.name);
  10707. if (compConf && compConf[funName]) {
  10708. return getSlotVNs(compConf[funName].call($table, h, renderOpts, Object.assign({
  10709. $type: editRender ? 'edit' : 'cell'
  10710. }, params)));
  10711. }
  10712. }
  10713. var cellValue = $table.getCellLabel(row, column);
  10714. var cellPlaceholder = editRender ? editRender.placeholder : '';
  10715. return [h('span', {
  10716. class: 'vxe-cell--label'
  10717. }, editRender && eqEmptyValue(cellValue) ? [// 如果设置占位符
  10718. h('span', {
  10719. class: 'vxe-cell--placeholder'
  10720. }, utils.formatText(getFuncText(cellPlaceholder), 1))] : utils.formatText(cellValue, 1))];
  10721. },
  10722. renderTreeCell: function renderTreeCell(h, params) {
  10723. return Cell.renderTreeIcon(h, params, Cell.renderDefaultCell.call(this, h, params));
  10724. },
  10725. renderDefaultFooter: function renderDefaultFooter(h, params) {
  10726. return [h('span', {
  10727. class: 'vxe-cell--item'
  10728. }, getFooterContent(h, params))];
  10729. },
  10730. /**
  10731. * 树节点
  10732. */
  10733. renderTreeIcon: function renderTreeIcon(h, params, cellVNodes) {
  10734. var $table = params.$table,
  10735. isHidden = params.isHidden;
  10736. var treeOpts = $table.treeOpts,
  10737. treeExpandeds = $table.treeExpandeds,
  10738. treeLazyLoadeds = $table.treeLazyLoadeds;
  10739. var row = params.row,
  10740. column = params.column,
  10741. level = params.level;
  10742. var slots = column.slots;
  10743. var children = treeOpts.children,
  10744. hasChild = treeOpts.hasChild,
  10745. indent = treeOpts.indent,
  10746. lazy = treeOpts.lazy,
  10747. trigger = treeOpts.trigger,
  10748. iconLoaded = treeOpts.iconLoaded,
  10749. showIcon = treeOpts.showIcon,
  10750. iconOpen = treeOpts.iconOpen,
  10751. iconClose = treeOpts.iconClose;
  10752. var rowChilds = row[children];
  10753. var hasLazyChilds = false;
  10754. var isAceived = false;
  10755. var isLazyLoaded = false;
  10756. var on = {};
  10757. if (slots && slots.icon) {
  10758. return $table.callSlot(slots.icon, params, h, cellVNodes);
  10759. }
  10760. if (!isHidden) {
  10761. isAceived = $table.findRowIndexOf(treeExpandeds, row) > -1;
  10762. if (lazy) {
  10763. isLazyLoaded = $table.findRowIndexOf(treeLazyLoadeds, row) > -1;
  10764. hasLazyChilds = row[hasChild];
  10765. }
  10766. }
  10767. if (!trigger || trigger === 'default') {
  10768. on.click = function (evnt) {
  10769. return $table.triggerTreeExpandEvent(evnt, params);
  10770. };
  10771. }
  10772. return [h('div', {
  10773. class: ['vxe-cell--tree-node', {
  10774. 'is--active': isAceived
  10775. }],
  10776. style: {
  10777. paddingLeft: "".concat(level * indent, "px")
  10778. }
  10779. }, [showIcon && (rowChilds && rowChilds.length || hasLazyChilds) ? [h('div', {
  10780. class: 'vxe-tree--btn-wrapper',
  10781. on: on
  10782. }, [h('i', {
  10783. class: ['vxe-tree--node-btn', isLazyLoaded ? iconLoaded || src_conf.icon.TABLE_TREE_LOADED : isAceived ? iconOpen || src_conf.icon.TABLE_TREE_OPEN : iconClose || src_conf.icon.TABLE_TREE_CLOSE]
  10784. })])] : null, h('div', {
  10785. class: 'vxe-tree-cell'
  10786. }, cellVNodes)])];
  10787. },
  10788. /**
  10789. * 索引
  10790. */
  10791. renderSeqHeader: function renderSeqHeader(h, params) {
  10792. var $table = params.$table,
  10793. column = params.column;
  10794. var slots = column.slots;
  10795. return renderTitleContent(h, params, slots && slots.header ? $table.callSlot(slots.header, params, h) : utils.formatText(column.getTitle(), 1));
  10796. },
  10797. renderSeqCell: function renderSeqCell(h, params) {
  10798. var $table = params.$table,
  10799. column = params.column;
  10800. var treeConfig = $table.treeConfig,
  10801. seqOpts = $table.seqOpts;
  10802. var slots = column.slots;
  10803. if (slots && slots.default) {
  10804. return $table.callSlot(slots.default, params, h);
  10805. }
  10806. var seq = params.seq;
  10807. var seqMethod = seqOpts.seqMethod;
  10808. return [utils.formatText(seqMethod ? seqMethod(params) : treeConfig ? seq : (seqOpts.startIndex || 0) + seq, 1)];
  10809. },
  10810. renderTreeIndexCell: function renderTreeIndexCell(h, params) {
  10811. return Cell.renderTreeIcon(h, params, Cell.renderSeqCell(h, params));
  10812. },
  10813. /**
  10814. * 单选
  10815. */
  10816. renderRadioHeader: function renderRadioHeader(h, params) {
  10817. var $table = params.$table,
  10818. column = params.column;
  10819. var slots = column.slots;
  10820. var headerSlot = slots ? slots.header : null;
  10821. var titleSlot = slots ? slots.title : null;
  10822. return renderTitleContent(h, params, headerSlot ? $table.callSlot(headerSlot, params, h) : [h('span', {
  10823. class: 'vxe-radio--label'
  10824. }, titleSlot ? $table.callSlot(titleSlot, params, h) : utils.formatText(column.getTitle(), 1))]);
  10825. },
  10826. renderRadioCell: function renderRadioCell(h, params) {
  10827. var $table = params.$table,
  10828. column = params.column,
  10829. isHidden = params.isHidden;
  10830. var radioOpts = $table.radioOpts,
  10831. selectRow = $table.selectRow;
  10832. var slots = column.slots;
  10833. var labelField = radioOpts.labelField,
  10834. checkMethod = radioOpts.checkMethod,
  10835. visibleMethod = radioOpts.visibleMethod;
  10836. var row = params.row;
  10837. var defaultSlot = slots ? slots.default : null;
  10838. var radioSlot = slots ? slots.radio : null;
  10839. var isChecked = row === selectRow;
  10840. var isVisible = !visibleMethod || visibleMethod({
  10841. row: row
  10842. });
  10843. var isDisabled = !!checkMethod;
  10844. var on;
  10845. if (!isHidden) {
  10846. on = {
  10847. click: function click(evnt) {
  10848. if (!isDisabled && isVisible) {
  10849. $table.triggerRadioRowEvent(evnt, params);
  10850. }
  10851. }
  10852. };
  10853. if (checkMethod) {
  10854. isDisabled = !checkMethod({
  10855. row: row
  10856. });
  10857. }
  10858. }
  10859. var radioParams = _objectSpread2(_objectSpread2({}, params), {}, {
  10860. checked: isChecked,
  10861. disabled: isDisabled,
  10862. visible: isVisible
  10863. });
  10864. if (radioSlot) {
  10865. return $table.callSlot(radioSlot, radioParams, h);
  10866. }
  10867. var radioVNs = [];
  10868. if (isVisible) {
  10869. radioVNs.push(h('span', {
  10870. class: ['vxe-radio--icon', isChecked ? src_conf.icon.TABLE_RADIO_CHECKED : src_conf.icon.TABLE_RADIO_UNCHECKED]
  10871. }));
  10872. }
  10873. if (defaultSlot || labelField) {
  10874. radioVNs.push(h('span', {
  10875. class: 'vxe-radio--label'
  10876. }, defaultSlot ? $table.callSlot(defaultSlot, radioParams, h) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, labelField)));
  10877. }
  10878. return [h('span', {
  10879. class: ['vxe-cell--radio', {
  10880. 'is--checked': isChecked,
  10881. 'is--disabled': isDisabled
  10882. }],
  10883. on: on
  10884. }, radioVNs)];
  10885. },
  10886. renderTreeRadioCell: function renderTreeRadioCell(h, params) {
  10887. return Cell.renderTreeIcon(h, params, Cell.renderRadioCell(h, params));
  10888. },
  10889. /**
  10890. * 多选
  10891. */
  10892. renderCheckboxHeader: function renderCheckboxHeader(h, params) {
  10893. var $table = params.$table,
  10894. column = params.column,
  10895. isHidden = params.isHidden;
  10896. var isAllCheckboxSelected = $table.isAllSelected,
  10897. isAllCheckboxIndeterminate = $table.isIndeterminate,
  10898. isAllCheckboxDisabled = $table.isAllCheckboxDisabled;
  10899. var slots = column.slots;
  10900. var headerSlot = slots ? slots.header : null;
  10901. var titleSlot = slots ? slots.title : null;
  10902. var checkboxOpts = $table.checkboxOpts;
  10903. var headerTitle = column.getTitle();
  10904. var on;
  10905. if (!isHidden) {
  10906. on = {
  10907. click: function click(evnt) {
  10908. if (!isAllCheckboxDisabled) {
  10909. $table.triggerCheckAllEvent(evnt, !isAllCheckboxSelected);
  10910. }
  10911. }
  10912. };
  10913. }
  10914. var checkboxParams = _objectSpread2(_objectSpread2({}, params), {}, {
  10915. checked: isAllCheckboxSelected,
  10916. disabled: isAllCheckboxDisabled,
  10917. indeterminate: isAllCheckboxIndeterminate
  10918. });
  10919. if (headerSlot) {
  10920. return renderTitleContent(h, checkboxParams, $table.callSlot(headerSlot, checkboxParams, h));
  10921. }
  10922. if (checkboxOpts.checkStrictly ? !checkboxOpts.showHeader : checkboxOpts.showHeader === false) {
  10923. return renderTitleContent(h, checkboxParams, [h('span', {
  10924. class: 'vxe-checkbox--label'
  10925. }, titleSlot ? $table.callSlot(titleSlot, checkboxParams, h) : headerTitle)]);
  10926. }
  10927. return renderTitleContent(h, checkboxParams, [h('span', {
  10928. class: ['vxe-cell--checkbox', {
  10929. 'is--checked': isAllCheckboxSelected,
  10930. 'is--disabled': isAllCheckboxDisabled,
  10931. 'is--indeterminate': isAllCheckboxIndeterminate
  10932. }],
  10933. attrs: {
  10934. title: src_conf.i18n('vxe.table.allTitle')
  10935. },
  10936. on: on
  10937. }, [h('span', {
  10938. class: ['vxe-checkbox--icon', isAllCheckboxIndeterminate ? src_conf.icon.TABLE_CHECKBOX_INDETERMINATE : isAllCheckboxSelected ? src_conf.icon.TABLE_CHECKBOX_CHECKED : src_conf.icon.TABLE_CHECKBOX_UNCHECKED]
  10939. })].concat(titleSlot || headerTitle ? [h('span', {
  10940. class: 'vxe-checkbox--label'
  10941. }, titleSlot ? $table.callSlot(titleSlot, checkboxParams, h) : headerTitle)] : []))]);
  10942. },
  10943. renderCheckboxCell: function renderCheckboxCell(h, params) {
  10944. var $table = params.$table,
  10945. row = params.row,
  10946. column = params.column,
  10947. isHidden = params.isHidden;
  10948. var treeConfig = $table.treeConfig,
  10949. treeIndeterminates = $table.treeIndeterminates,
  10950. selection = $table.selection;
  10951. var _$table$checkboxOpts = $table.checkboxOpts,
  10952. labelField = _$table$checkboxOpts.labelField,
  10953. checkMethod = _$table$checkboxOpts.checkMethod,
  10954. visibleMethod = _$table$checkboxOpts.visibleMethod;
  10955. var slots = column.slots;
  10956. var defaultSlot = slots ? slots.default : null;
  10957. var checkboxSlot = slots ? slots.checkbox : null;
  10958. var indeterminate = false;
  10959. var isChecked = false;
  10960. var isVisible = !visibleMethod || visibleMethod({
  10961. row: row
  10962. });
  10963. var isDisabled = !!checkMethod;
  10964. var on;
  10965. if (!isHidden) {
  10966. isChecked = $table.findRowIndexOf(selection, row) > -1;
  10967. on = {
  10968. click: function click(evnt) {
  10969. if (!isDisabled && isVisible) {
  10970. $table.triggerCheckRowEvent(evnt, params, !isChecked);
  10971. }
  10972. }
  10973. };
  10974. if (checkMethod) {
  10975. isDisabled = !checkMethod({
  10976. row: row
  10977. });
  10978. }
  10979. if (treeConfig) {
  10980. indeterminate = $table.findRowIndexOf(treeIndeterminates, row) > -1;
  10981. }
  10982. }
  10983. var checkboxParams = _objectSpread2(_objectSpread2({}, params), {}, {
  10984. checked: isChecked,
  10985. disabled: isDisabled,
  10986. visible: isVisible,
  10987. indeterminate: indeterminate
  10988. });
  10989. if (checkboxSlot) {
  10990. return $table.callSlot(checkboxSlot, checkboxParams, h);
  10991. }
  10992. var checkVNs = [];
  10993. if (isVisible) {
  10994. checkVNs.push(h('span', {
  10995. class: ['vxe-checkbox--icon', indeterminate ? src_conf.icon.TABLE_CHECKBOX_INDETERMINATE : isChecked ? src_conf.icon.TABLE_CHECKBOX_CHECKED : src_conf.icon.TABLE_CHECKBOX_UNCHECKED]
  10996. }));
  10997. }
  10998. if (defaultSlot || labelField) {
  10999. checkVNs.push(h('span', {
  11000. class: 'vxe-checkbox--label'
  11001. }, defaultSlot ? $table.callSlot(defaultSlot, checkboxParams, h) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, labelField)));
  11002. }
  11003. return [h('span', {
  11004. class: ['vxe-cell--checkbox', {
  11005. 'is--checked': isChecked,
  11006. 'is--disabled': isDisabled,
  11007. 'is--indeterminate': indeterminate
  11008. }],
  11009. on: on
  11010. }, checkVNs)];
  11011. },
  11012. renderTreeSelectionCell: function renderTreeSelectionCell(h, params) {
  11013. return Cell.renderTreeIcon(h, params, Cell.renderCheckboxCell(h, params));
  11014. },
  11015. renderCheckboxCellByProp: function renderCheckboxCellByProp(h, params) {
  11016. var $table = params.$table,
  11017. row = params.row,
  11018. column = params.column,
  11019. isHidden = params.isHidden;
  11020. var treeConfig = $table.treeConfig,
  11021. treeIndeterminates = $table.treeIndeterminates;
  11022. var _$table$checkboxOpts2 = $table.checkboxOpts,
  11023. labelField = _$table$checkboxOpts2.labelField,
  11024. checkField = _$table$checkboxOpts2.checkField,
  11025. halfField = _$table$checkboxOpts2.halfField,
  11026. checkMethod = _$table$checkboxOpts2.checkMethod,
  11027. visibleMethod = _$table$checkboxOpts2.visibleMethod;
  11028. var slots = column.slots;
  11029. var defaultSlot = slots ? slots.default : null;
  11030. var checkboxSlot = slots ? slots.checkbox : null;
  11031. var indeterminate = false;
  11032. var isChecked = false;
  11033. var isVisible = !visibleMethod || visibleMethod({
  11034. row: row
  11035. });
  11036. var isDisabled = !!checkMethod;
  11037. var on;
  11038. if (!isHidden) {
  11039. isChecked = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, checkField);
  11040. on = {
  11041. click: function click(evnt) {
  11042. if (!isDisabled && isVisible) {
  11043. $table.triggerCheckRowEvent(evnt, params, !isChecked);
  11044. }
  11045. }
  11046. };
  11047. if (checkMethod) {
  11048. isDisabled = !checkMethod({
  11049. row: row
  11050. });
  11051. }
  11052. if (treeConfig) {
  11053. indeterminate = $table.findRowIndexOf(treeIndeterminates, row) > -1;
  11054. }
  11055. }
  11056. var checkboxParams = _objectSpread2(_objectSpread2({}, params), {}, {
  11057. checked: isChecked,
  11058. disabled: isDisabled,
  11059. visible: isVisible,
  11060. indeterminate: indeterminate
  11061. });
  11062. if (checkboxSlot) {
  11063. return $table.callSlot(checkboxSlot, checkboxParams, h);
  11064. }
  11065. var checkVNs = [];
  11066. if (isVisible) {
  11067. checkVNs.push(h('span', {
  11068. class: ['vxe-checkbox--icon', indeterminate ? src_conf.icon.TABLE_CHECKBOX_INDETERMINATE : isChecked ? src_conf.icon.TABLE_CHECKBOX_CHECKED : src_conf.icon.TABLE_CHECKBOX_UNCHECKED]
  11069. }));
  11070. }
  11071. if (defaultSlot || labelField) {
  11072. checkVNs.push(h('span', {
  11073. class: 'vxe-checkbox--label'
  11074. }, defaultSlot ? $table.callSlot(defaultSlot, checkboxParams, h) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, labelField)));
  11075. }
  11076. return [h('span', {
  11077. class: ['vxe-cell--checkbox', {
  11078. 'is--checked': isChecked,
  11079. 'is--disabled': isDisabled,
  11080. 'is--indeterminate': halfField && !isChecked ? row[halfField] : indeterminate
  11081. }],
  11082. on: on
  11083. }, checkVNs)];
  11084. },
  11085. renderTreeSelectionCellByProp: function renderTreeSelectionCellByProp(h, params) {
  11086. return Cell.renderTreeIcon(h, params, Cell.renderCheckboxCellByProp(h, params));
  11087. },
  11088. /**
  11089. * 展开行
  11090. */
  11091. renderExpandCell: function renderExpandCell(h, params) {
  11092. var $table = params.$table,
  11093. isHidden = params.isHidden,
  11094. row = params.row,
  11095. column = params.column;
  11096. var expandOpts = $table.expandOpts,
  11097. rowExpandeds = $table.rowExpandeds,
  11098. expandLazyLoadeds = $table.expandLazyLoadeds;
  11099. var lazy = expandOpts.lazy,
  11100. labelField = expandOpts.labelField,
  11101. iconLoaded = expandOpts.iconLoaded,
  11102. showIcon = expandOpts.showIcon,
  11103. iconOpen = expandOpts.iconOpen,
  11104. iconClose = expandOpts.iconClose,
  11105. visibleMethod = expandOpts.visibleMethod;
  11106. var slots = column.slots;
  11107. var defaultSlot = slots ? slots.default : null;
  11108. var isAceived = false;
  11109. var isLazyLoaded = false;
  11110. if (slots && slots.icon) {
  11111. return $table.callSlot(slots.icon, params, h);
  11112. }
  11113. if (!isHidden) {
  11114. isAceived = $table.findRowIndexOf(rowExpandeds, params.row) > -1;
  11115. if (lazy) {
  11116. isLazyLoaded = $table.findRowIndexOf(expandLazyLoadeds, row) > -1;
  11117. }
  11118. }
  11119. return [showIcon && (!visibleMethod || visibleMethod(params)) ? h('span', {
  11120. class: ['vxe-table--expanded', {
  11121. 'is--active': isAceived
  11122. }],
  11123. on: {
  11124. click: function click(evnt) {
  11125. $table.triggerRowExpandEvent(evnt, params);
  11126. }
  11127. }
  11128. }, [h('i', {
  11129. class: ['vxe-table--expand-btn', isLazyLoaded ? iconLoaded || src_conf.icon.TABLE_EXPAND_LOADED : isAceived ? iconOpen || src_conf.icon.TABLE_EXPAND_OPEN : iconClose || src_conf.icon.TABLE_EXPAND_CLOSE]
  11130. })]) : null, defaultSlot || labelField ? h('span', {
  11131. class: 'vxe-table--expand-label'
  11132. }, defaultSlot ? $table.callSlot(defaultSlot, params, h) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, labelField)) : null];
  11133. },
  11134. renderExpandData: function renderExpandData(h, params) {
  11135. var $table = params.$table,
  11136. column = params.column;
  11137. var slots = column.slots,
  11138. contentRender = column.contentRender;
  11139. if (slots && slots.content) {
  11140. return $table.callSlot(slots.content, params, h);
  11141. }
  11142. if (contentRender) {
  11143. var compConf = v_x_e_table.renderer.get(contentRender.name);
  11144. if (compConf && compConf.renderExpand) {
  11145. return getSlotVNs(compConf.renderExpand.call($table, h, contentRender, params));
  11146. }
  11147. }
  11148. return [];
  11149. },
  11150. /**
  11151. * HTML 标签
  11152. */
  11153. renderHTMLCell: function renderHTMLCell(h, params) {
  11154. var $table = params.$table,
  11155. column = params.column;
  11156. var slots = column.slots;
  11157. if (slots && slots.default) {
  11158. return $table.callSlot(slots.default, params, h);
  11159. }
  11160. return [h('span', {
  11161. class: 'vxe-cell--html',
  11162. domProps: {
  11163. innerHTML: getDefaultCellLabel(params)
  11164. }
  11165. })];
  11166. },
  11167. renderTreeHTMLCell: function renderTreeHTMLCell(h, params) {
  11168. return Cell.renderTreeIcon(h, params, Cell.renderHTMLCell(h, params));
  11169. },
  11170. /**
  11171. * 排序和筛选
  11172. */
  11173. renderSortAndFilterHeader: function renderSortAndFilterHeader(h, params) {
  11174. return Cell.renderDefaultHeader(h, params).concat(Cell.renderSortIcon(h, params)).concat(Cell.renderFilterIcon(h, params));
  11175. },
  11176. /**
  11177. * 排序
  11178. */
  11179. renderSortHeader: function renderSortHeader(h, params) {
  11180. return Cell.renderDefaultHeader(h, params).concat(Cell.renderSortIcon(h, params));
  11181. },
  11182. renderSortIcon: function renderSortIcon(h, params) {
  11183. var $table = params.$table,
  11184. column = params.column;
  11185. var _$table$sortOpts = $table.sortOpts,
  11186. showIcon = _$table$sortOpts.showIcon,
  11187. iconAsc = _$table$sortOpts.iconAsc,
  11188. iconDesc = _$table$sortOpts.iconDesc;
  11189. return showIcon ? [h('span', {
  11190. class: 'vxe-cell--sort'
  11191. }, [h('i', {
  11192. class: ['vxe-sort--asc-btn', iconAsc || src_conf.icon.TABLE_SORT_ASC, {
  11193. 'sort--active': column.order === 'asc'
  11194. }],
  11195. attrs: {
  11196. title: src_conf.i18n('vxe.table.sortAsc')
  11197. },
  11198. on: {
  11199. click: function click(evnt) {
  11200. $table.triggerSortEvent(evnt, column, 'asc');
  11201. }
  11202. }
  11203. }), h('i', {
  11204. class: ['vxe-sort--desc-btn', iconDesc || src_conf.icon.TABLE_SORT_DESC, {
  11205. 'sort--active': column.order === 'desc'
  11206. }],
  11207. attrs: {
  11208. title: src_conf.i18n('vxe.table.sortDesc')
  11209. },
  11210. on: {
  11211. click: function click(evnt) {
  11212. $table.triggerSortEvent(evnt, column, 'desc');
  11213. }
  11214. }
  11215. })])] : [];
  11216. },
  11217. /**
  11218. * 筛选
  11219. */
  11220. renderFilterHeader: function renderFilterHeader(h, params) {
  11221. return Cell.renderDefaultHeader(h, params).concat(Cell.renderFilterIcon(h, params));
  11222. },
  11223. renderFilterIcon: function renderFilterIcon(h, params) {
  11224. var $table = params.$table,
  11225. column = params.column,
  11226. hasFilter = params.hasFilter;
  11227. var filterStore = $table.filterStore,
  11228. filterOpts = $table.filterOpts;
  11229. var showIcon = filterOpts.showIcon,
  11230. iconNone = filterOpts.iconNone,
  11231. iconMatch = filterOpts.iconMatch;
  11232. return showIcon ? [h('span', {
  11233. class: ['vxe-cell--filter', {
  11234. 'is--active': filterStore.visible && filterStore.column === column
  11235. }]
  11236. }, [h('i', {
  11237. class: ['vxe-filter--btn', hasFilter ? iconMatch || src_conf.icon.TABLE_FILTER_MATCH : iconNone || src_conf.icon.TABLE_FILTER_NONE],
  11238. attrs: {
  11239. title: src_conf.i18n('vxe.table.filter')
  11240. },
  11241. on: {
  11242. click: function click(evnt) {
  11243. $table.triggerFilterEvent(evnt, params.column, params);
  11244. }
  11245. }
  11246. })])] : [];
  11247. },
  11248. /**
  11249. * 可编辑
  11250. */
  11251. renderEditHeader: function renderEditHeader(h, params) {
  11252. var $table = params.$table,
  11253. column = params.column;
  11254. var editConfig = $table.editConfig,
  11255. editRules = $table.editRules,
  11256. editOpts = $table.editOpts;
  11257. var sortable = column.sortable,
  11258. remoteSort = column.remoteSort,
  11259. filters = column.filters,
  11260. editRender = column.editRender;
  11261. var isRequired = false;
  11262. if (editRules) {
  11263. var columnRules = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(editRules, column.field);
  11264. if (columnRules) {
  11265. isRequired = columnRules.some(function (rule) {
  11266. return rule.required;
  11267. });
  11268. }
  11269. }
  11270. return (isEnableConf(editConfig) ? [isRequired && editOpts.showAsterisk ? h('i', {
  11271. class: 'vxe-cell--required-icon'
  11272. }) : null, isEnableConf(editRender) && editOpts.showIcon ? h('i', {
  11273. class: ['vxe-cell--edit-icon', editOpts.icon || src_conf.icon.TABLE_EDIT]
  11274. }) : null] : []).concat(Cell.renderDefaultHeader(h, params)).concat(sortable || remoteSort ? Cell.renderSortIcon(h, params) : []).concat(filters ? Cell.renderFilterIcon(h, params) : []);
  11275. },
  11276. // 行格编辑模式
  11277. renderRowEdit: function renderRowEdit(h, params) {
  11278. var $table = params.$table,
  11279. column = params.column;
  11280. var editRender = column.editRender;
  11281. var actived = $table.editStore.actived;
  11282. return Cell.runRenderer(h, params, this, isEnableConf(editRender) && actived && actived.row === params.row);
  11283. },
  11284. renderTreeRowEdit: function renderTreeRowEdit(h, params) {
  11285. return Cell.renderTreeIcon(h, params, Cell.renderRowEdit(h, params));
  11286. },
  11287. // 单元格编辑模式
  11288. renderCellEdit: function renderCellEdit(h, params) {
  11289. var $table = params.$table,
  11290. column = params.column;
  11291. var editRender = column.editRender;
  11292. var actived = $table.editStore.actived;
  11293. return Cell.runRenderer(h, params, this, isEnableConf(editRender) && actived && actived.row === params.row && actived.column === params.column);
  11294. },
  11295. renderTreeCellEdit: function renderTreeCellEdit(h, params) {
  11296. return Cell.renderTreeIcon(h, params, Cell.renderCellEdit(h, params));
  11297. },
  11298. runRenderer: function runRenderer(h, params, _vm, isEdit) {
  11299. var $table = params.$table,
  11300. column = params.column;
  11301. var slots = column.slots,
  11302. editRender = column.editRender,
  11303. formatter = column.formatter;
  11304. var compConf = v_x_e_table.renderer.get(editRender.name);
  11305. if (isEdit) {
  11306. if (slots && slots.edit) {
  11307. return $table.callSlot(slots.edit, params, h);
  11308. }
  11309. if (compConf && compConf.renderEdit) {
  11310. return getSlotVNs(compConf.renderEdit.call($table, h, editRender, Object.assign({
  11311. $type: 'edit'
  11312. }, params)));
  11313. }
  11314. return [];
  11315. }
  11316. if (slots && slots.default) {
  11317. return $table.callSlot(slots.default, params, h);
  11318. }
  11319. if (formatter) {
  11320. return [h('span', {
  11321. class: 'vxe-cell--label'
  11322. }, [getDefaultCellLabel(params)])];
  11323. }
  11324. return Cell.renderDefaultCell.call(_vm, h, params);
  11325. }
  11326. };
  11327. /* harmony default export */ var src_cell = (Cell);
  11328. // CONCATENATED MODULE: ./packages/table/src/methods.js
  11329. var methods_setCellValue = utils.setCellValue,
  11330. hasChildrenList = utils.hasChildrenList,
  11331. methods_getColumnList = utils.getColumnList;
  11332. var methods_calcHeight = dom.calcHeight,
  11333. methods_hasClass = dom.hasClass,
  11334. addClass = dom.addClass,
  11335. methods_removeClass = dom.removeClass,
  11336. getEventTargetNode = dom.getEventTargetNode,
  11337. methods_isNodeElement = dom.isNodeElement;
  11338. var isWebkit = browse['-webkit'] && !browse.edge;
  11339. var debounceScrollYDuration = browse.msie ? 80 : 20;
  11340. var resizableStorageKey = 'VXE_TABLE_CUSTOM_COLUMN_WIDTH';
  11341. var visibleStorageKey = 'VXE_TABLE_CUSTOM_COLUMN_VISIBLE';
  11342. /**
  11343. * 生成行的唯一主键
  11344. */
  11345. function getRowUniqueId() {
  11346. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.uniqueId('row_');
  11347. }
  11348. function eqCellValue(row1, row2, field) {
  11349. var val1 = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row1, field);
  11350. var val2 = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row2, field);
  11351. if (eqEmptyValue(val1) && eqEmptyValue(val2)) {
  11352. return true;
  11353. }
  11354. 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)) {
  11355. return '' + val1 === '' + val2;
  11356. }
  11357. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isEqual(val1, val2);
  11358. }
  11359. function getNextSortOrder(_vm, column) {
  11360. var orders = _vm.sortOpts.orders;
  11361. var currOrder = column.order || null;
  11362. var oIndex = orders.indexOf(currOrder) + 1;
  11363. return orders[oIndex < orders.length ? oIndex : 0];
  11364. }
  11365. function getCustomStorageMap(key) {
  11366. var version = src_conf.version;
  11367. var rest = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toStringJSON(localStorage.getItem(key));
  11368. return rest && rest._v === version ? rest : {
  11369. _v: version
  11370. };
  11371. }
  11372. function getRecoverRow(_vm, list) {
  11373. var fullAllDataRowMap = _vm.fullAllDataRowMap;
  11374. return list.filter(function (row) {
  11375. return fullAllDataRowMap.has(row);
  11376. });
  11377. }
  11378. function handleReserveRow(_vm, reserveRowMap) {
  11379. var fullDataRowIdData = _vm.fullDataRowIdData;
  11380. var reserveList = [];
  11381. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.each(reserveRowMap, function (item, rowid) {
  11382. if (fullDataRowIdData[rowid] && reserveList.indexOf(fullDataRowIdData[rowid].row) === -1) {
  11383. reserveList.push(fullDataRowIdData[rowid].row);
  11384. }
  11385. });
  11386. return reserveList;
  11387. }
  11388. function computeVirtualX(_vm) {
  11389. var $refs = _vm.$refs,
  11390. visibleColumn = _vm.visibleColumn;
  11391. var tableBody = $refs.tableBody;
  11392. var tableBodyElem = tableBody ? tableBody.$el : null;
  11393. if (tableBodyElem) {
  11394. var scrollLeft = tableBodyElem.scrollLeft,
  11395. clientWidth = tableBodyElem.clientWidth;
  11396. var endWidth = scrollLeft + clientWidth;
  11397. var toVisibleIndex = -1;
  11398. var cWidth = 0;
  11399. var visibleSize = 0;
  11400. for (var colIndex = 0, colLen = visibleColumn.length; colIndex < colLen; colIndex++) {
  11401. cWidth += visibleColumn[colIndex].renderWidth;
  11402. if (toVisibleIndex === -1 && scrollLeft < cWidth) {
  11403. toVisibleIndex = colIndex;
  11404. }
  11405. if (toVisibleIndex >= 0) {
  11406. visibleSize++;
  11407. if (cWidth > endWidth) {
  11408. break;
  11409. }
  11410. }
  11411. }
  11412. return {
  11413. toVisibleIndex: Math.max(0, toVisibleIndex),
  11414. visibleSize: Math.max(8, visibleSize)
  11415. };
  11416. }
  11417. return {
  11418. toVisibleIndex: 0,
  11419. visibleSize: 8
  11420. };
  11421. }
  11422. function computeVirtualY(_vm) {
  11423. var $refs = _vm.$refs,
  11424. vSize = _vm.vSize,
  11425. rowHeightMaps = _vm.rowHeightMaps;
  11426. var tableHeader = $refs.tableHeader,
  11427. tableBody = $refs.tableBody;
  11428. var tableBodyElem = tableBody ? tableBody.$el : null;
  11429. if (tableBodyElem) {
  11430. var tableHeaderElem = tableHeader ? tableHeader.$el : null;
  11431. var rowHeight = 0;
  11432. var firstTrElem;
  11433. firstTrElem = tableBodyElem.querySelector('tr');
  11434. if (!firstTrElem && tableHeaderElem) {
  11435. firstTrElem = tableHeaderElem.querySelector('tr');
  11436. }
  11437. if (firstTrElem) {
  11438. rowHeight = firstTrElem.clientHeight;
  11439. }
  11440. if (!rowHeight) {
  11441. rowHeight = rowHeightMaps[vSize || 'default'];
  11442. }
  11443. var visibleSize = Math.max(8, Math.ceil(tableBodyElem.clientHeight / rowHeight) + 2);
  11444. return {
  11445. rowHeight: rowHeight,
  11446. visibleSize: visibleSize
  11447. };
  11448. }
  11449. return {
  11450. rowHeight: 0,
  11451. visibleSize: 8
  11452. };
  11453. }
  11454. function calculateMergerOffserIndex(list, offsetItem, type) {
  11455. for (var mcIndex = 0, len = list.length; mcIndex < len; mcIndex++) {
  11456. var mergeItem = list[mcIndex];
  11457. var startIndex = offsetItem.startIndex,
  11458. endIndex = offsetItem.endIndex;
  11459. var mergeStartIndex = mergeItem[type];
  11460. var mergeSpanNumber = mergeItem[type + 'span'];
  11461. var mergeEndIndex = mergeStartIndex + mergeSpanNumber;
  11462. if (mergeStartIndex < startIndex && startIndex < mergeEndIndex) {
  11463. offsetItem.startIndex = mergeStartIndex;
  11464. }
  11465. if (mergeStartIndex < endIndex && endIndex < mergeEndIndex) {
  11466. offsetItem.endIndex = mergeEndIndex;
  11467. }
  11468. if (offsetItem.startIndex !== startIndex || offsetItem.endIndex !== endIndex) {
  11469. mcIndex = -1;
  11470. }
  11471. }
  11472. }
  11473. function setMerges(_vm, merges, mList, rowList) {
  11474. if (merges) {
  11475. var treeConfig = _vm.treeConfig,
  11476. visibleColumn = _vm.visibleColumn;
  11477. if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(merges)) {
  11478. merges = [merges];
  11479. }
  11480. if (treeConfig && merges.length) {
  11481. errLog('vxe.error.noTree', ['merge-cells | merge-footer-items']);
  11482. }
  11483. merges.forEach(function (item) {
  11484. var row = item.row,
  11485. col = item.col,
  11486. rowspan = item.rowspan,
  11487. colspan = item.colspan;
  11488. if (rowList && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNumber(row)) {
  11489. row = rowList[row];
  11490. }
  11491. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNumber(col)) {
  11492. col = visibleColumn[col];
  11493. }
  11494. if ((rowList ? row : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNumber(row)) && col && (rowspan || colspan)) {
  11495. rowspan = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(rowspan) || 1;
  11496. colspan = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(colspan) || 1;
  11497. if (rowspan > 1 || colspan > 1) {
  11498. var mcIndex = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.findIndexOf(mList, function (item) {
  11499. return item._row === row && item._col === col;
  11500. });
  11501. var mergeItem = mList[mcIndex];
  11502. if (mergeItem) {
  11503. mergeItem.rowspan = rowspan;
  11504. mergeItem.colspan = colspan;
  11505. mergeItem._rowspan = rowspan;
  11506. mergeItem._colspan = colspan;
  11507. } else {
  11508. var mergeRowIndex = rowList ? rowList.indexOf(row) : row;
  11509. var mergeColIndex = visibleColumn.indexOf(col);
  11510. mList.push({
  11511. row: mergeRowIndex,
  11512. col: mergeColIndex,
  11513. rowspan: rowspan,
  11514. colspan: colspan,
  11515. _row: row,
  11516. _col: col,
  11517. _rowspan: rowspan,
  11518. _colspan: colspan
  11519. });
  11520. }
  11521. }
  11522. }
  11523. });
  11524. }
  11525. }
  11526. function removeMerges(_vm, merges, mList, rowList) {
  11527. var rest = [];
  11528. if (merges) {
  11529. var treeConfig = _vm.treeConfig,
  11530. visibleColumn = _vm.visibleColumn;
  11531. if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(merges)) {
  11532. merges = [merges];
  11533. }
  11534. if (treeConfig && merges.length) {
  11535. errLog('vxe.error.noTree', ['merge-cells | merge-footer-items']);
  11536. }
  11537. merges.forEach(function (item) {
  11538. var row = item.row,
  11539. col = item.col;
  11540. if (rowList && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNumber(row)) {
  11541. row = rowList[row];
  11542. }
  11543. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNumber(col)) {
  11544. col = visibleColumn[col];
  11545. }
  11546. var mcIndex = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.findIndexOf(mList, function (item) {
  11547. return item._row === row && item._col === col;
  11548. });
  11549. if (mcIndex > -1) {
  11550. var rItems = mList.splice(mcIndex, 1);
  11551. rest.push(rItems[0]);
  11552. }
  11553. });
  11554. }
  11555. return rest;
  11556. }
  11557. function clearAllSort(_vm) {
  11558. _vm.tableFullColumn.forEach(function (column) {
  11559. column.order = null;
  11560. });
  11561. }
  11562. function getOrderField(_vm, column) {
  11563. var sortBy = column.sortBy,
  11564. sortType = column.sortType;
  11565. return function (row) {
  11566. var cellValue;
  11567. if (sortBy) {
  11568. cellValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(sortBy) ? sortBy({
  11569. row: row,
  11570. column: column
  11571. }) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, sortBy);
  11572. } else {
  11573. cellValue = _vm.getCellLabel(row, column);
  11574. }
  11575. if (!sortType || sortType === 'auto') {
  11576. return isNaN(cellValue) ? cellValue : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(cellValue);
  11577. } else if (sortType === 'number') {
  11578. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(cellValue);
  11579. } else if (sortType === 'string') {
  11580. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toValueString(cellValue);
  11581. }
  11582. return cellValue;
  11583. };
  11584. }
  11585. var Methods = {
  11586. callSlot: function callSlot(slotFunc, params, h, vNodes) {
  11587. if (slotFunc) {
  11588. var $xegrid = this.$xegrid;
  11589. if ($xegrid) {
  11590. return $xegrid.callSlot(slotFunc, params, h, vNodes);
  11591. }
  11592. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(slotFunc)) {
  11593. return getSlotVNs(slotFunc.call(this, params, h, vNodes));
  11594. }
  11595. }
  11596. return [];
  11597. },
  11598. /**
  11599. * 获取父容器元素
  11600. */
  11601. getParentElem: function getParentElem() {
  11602. var $el = this.$el,
  11603. $xegrid = this.$xegrid;
  11604. return $xegrid ? $xegrid.$el.parentNode : $el.parentNode;
  11605. },
  11606. /**
  11607. * 获取父容器的高度
  11608. */
  11609. getParentHeight: function getParentHeight() {
  11610. var $el = this.$el,
  11611. $xegrid = this.$xegrid,
  11612. height = this.height;
  11613. var parentElem = $el.parentNode;
  11614. var parentPaddingSize = height === 'auto' ? getPaddingTopBottomSize(parentElem) : 0;
  11615. return Math.floor($xegrid ? $xegrid.getParentHeight() : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(getComputedStyle(parentElem).height) - parentPaddingSize);
  11616. },
  11617. /**
  11618. * 获取需要排除的高度
  11619. * 但渲染表格高度时,需要排除工具栏或分页等相关组件的高度
  11620. * 如果存在表尾合计滚动条,则需要排除滚动条高度
  11621. */
  11622. getExcludeHeight: function getExcludeHeight() {
  11623. var $xegrid = this.$xegrid;
  11624. return $xegrid ? $xegrid.getExcludeHeight() : 0;
  11625. },
  11626. /**
  11627. * 重置表格的一切数据状态
  11628. */
  11629. clearAll: function clearAll() {
  11630. return clearTableAllStatus(this);
  11631. },
  11632. /**
  11633. * 同步 data 数据(即将废弃)
  11634. * 如果用了该方法,那么组件将不再记录增删改的状态,只能自行实现对应逻辑
  11635. * 对于某些特殊的场景,比如深层树节点元素发生变动时可能会用到
  11636. */
  11637. syncData: function syncData() {
  11638. var _this = this;
  11639. return this.$nextTick().then(function () {
  11640. _this.tableData = [];
  11641. return _this.$nextTick().then(function () {
  11642. return _this.loadTableData(_this.tableFullData);
  11643. });
  11644. });
  11645. },
  11646. /**
  11647. * 手动处理数据,用于手动排序与筛选
  11648. * 对于手动更改了排序、筛选...等条件后需要重新处理数据时可能会用到
  11649. */
  11650. updateData: function updateData() {
  11651. var _this2 = this;
  11652. var scrollXLoad = this.scrollXLoad,
  11653. scrollYLoad = this.scrollYLoad;
  11654. return this.handleTableData(true).then(function () {
  11655. _this2.updateFooter();
  11656. _this2.checkSelectionStatus();
  11657. if (scrollXLoad || scrollYLoad) {
  11658. if (scrollXLoad) {
  11659. _this2.updateScrollXSpace();
  11660. }
  11661. if (scrollYLoad) {
  11662. _this2.updateScrollYSpace();
  11663. }
  11664. return _this2.refreshScroll();
  11665. }
  11666. }).then(function () {
  11667. _this2.updateCellAreas();
  11668. return _this2.recalculate(true);
  11669. }).then(function () {
  11670. // 存在滚动行为未结束情况
  11671. setTimeout(function () {
  11672. return _this2.recalculate();
  11673. }, 50);
  11674. });
  11675. },
  11676. handleTableData: function handleTableData(force) {
  11677. var _this3 = this;
  11678. var scrollYLoad = this.scrollYLoad,
  11679. scrollYStore = this.scrollYStore,
  11680. fullDataRowIdData = this.fullDataRowIdData,
  11681. afterFullData = this.afterFullData;
  11682. var fullList = afterFullData; // 是否进行数据处理
  11683. if (force) {
  11684. // 更新数据,处理筛选和排序
  11685. this.updateAfterFullData(); // 如果为虚拟树,将树结构拍平
  11686. fullList = this.handleVirtualTreeToList();
  11687. }
  11688. var tableData = scrollYLoad ? fullList.slice(scrollYStore.startIndex, scrollYStore.endIndex) : fullList.slice(0);
  11689. tableData.forEach(function (row, $index) {
  11690. var rowid = getRowid(_this3, row);
  11691. var rest = fullDataRowIdData[rowid];
  11692. if (rest) {
  11693. rest.$index = $index;
  11694. }
  11695. });
  11696. this.tableData = tableData;
  11697. return this.$nextTick();
  11698. },
  11699. updateScrollYStatus: function updateScrollYStatus(fullData) {
  11700. var treeConfig = this.treeConfig,
  11701. treeOpts = this.treeOpts,
  11702. sYOpts = this.sYOpts;
  11703. var transform = treeOpts.transform;
  11704. var scrollYLoad = (transform || !treeConfig) && !!sYOpts.enabled && sYOpts.gt > -1 && sYOpts.gt < fullData.length;
  11705. this.scrollYLoad = scrollYLoad;
  11706. return scrollYLoad;
  11707. },
  11708. /**
  11709. * 加载表格数据
  11710. * @param {Array} datas 数据
  11711. */
  11712. loadTableData: function loadTableData(datas) {
  11713. var _this4 = this;
  11714. var keepSource = this.keepSource,
  11715. treeConfig = this.treeConfig,
  11716. treeOpts = this.treeOpts,
  11717. editStore = this.editStore,
  11718. scrollYStore = this.scrollYStore,
  11719. scrollXStore = this.scrollXStore,
  11720. lastScrollLeft = this.lastScrollLeft,
  11721. lastScrollTop = this.lastScrollTop,
  11722. oldScrollYLoad = this.scrollYLoad,
  11723. sXOpts = this.sXOpts,
  11724. sYOpts = this.sYOpts;
  11725. var treeData = [];
  11726. var fullData = datas ? datas.slice(0) : [];
  11727. if (treeConfig) {
  11728. // 树结构自动转换
  11729. if (treeOpts.transform) {
  11730. if (false) {}
  11731. treeData = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toArrayTree(fullData, {
  11732. key: treeOpts.rowField,
  11733. parentKey: treeOpts.parentField,
  11734. children: treeOpts.children,
  11735. mapChildren: treeOpts.mapChildren
  11736. });
  11737. fullData = treeData.slice(0);
  11738. } else {
  11739. treeData = fullData.slice(0);
  11740. }
  11741. }
  11742. scrollYStore.startIndex = 0;
  11743. scrollYStore.endIndex = 1;
  11744. scrollXStore.startIndex = 0;
  11745. scrollXStore.endIndex = 1;
  11746. editStore.insertList = [];
  11747. editStore.removeList = [];
  11748. var sYLoad = this.updateScrollYStatus(fullData);
  11749. this.scrollYLoad = sYLoad; // 全量数据
  11750. this.tableFullData = fullData;
  11751. this.tableFullTreeData = treeData; // 缓存数据
  11752. this.cacheRowMap(true); // 原始数据
  11753. this.tableSynchData = datas; // 克隆原数据,用于显示编辑状态,与编辑值做对比
  11754. if (keepSource) {
  11755. this.tableSourceData = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.clone(fullData, true);
  11756. }
  11757. if (false) {}
  11758. if (this.clearCellAreas && this.mouseConfig) {
  11759. this.clearCellAreas();
  11760. this.clearCopyCellArea();
  11761. }
  11762. this.clearMergeCells();
  11763. this.clearMergeFooterItems();
  11764. this.handleTableData(true);
  11765. this.updateFooter();
  11766. return this.$nextTick().then(function () {
  11767. _this4.updateHeight();
  11768. _this4.updateStyle();
  11769. }).then(function () {
  11770. _this4.computeScrollLoad();
  11771. }).then(function () {
  11772. // 是否启用了虚拟滚动
  11773. if (sYLoad) {
  11774. scrollYStore.endIndex = scrollYStore.visibleSize;
  11775. }
  11776. _this4.handleReserveStatus();
  11777. _this4.checkSelectionStatus();
  11778. return new Promise(function (resolve) {
  11779. _this4.$nextTick().then(function () {
  11780. return _this4.recalculate();
  11781. }).then(function () {
  11782. var targetScrollLeft = lastScrollLeft;
  11783. var targetScrollTop = lastScrollTop; // 是否在更新数据之后自动滚动重置滚动条
  11784. if (sXOpts.scrollToLeftOnChange) {
  11785. targetScrollLeft = 0;
  11786. }
  11787. if (sYOpts.scrollToTopOnChange) {
  11788. targetScrollTop = 0;
  11789. } // 是否变更虚拟滚动
  11790. if (oldScrollYLoad === sYLoad) {
  11791. restoreScrollLocation(_this4, targetScrollLeft, targetScrollTop).then(resolve);
  11792. } else {
  11793. setTimeout(function () {
  11794. return restoreScrollLocation(_this4, targetScrollLeft, targetScrollTop).then(resolve);
  11795. });
  11796. }
  11797. });
  11798. });
  11799. });
  11800. },
  11801. /**
  11802. * 重新加载数据,不会清空表格状态
  11803. * @param {Array} datas 数据
  11804. */
  11805. loadData: function loadData(datas) {
  11806. var _this5 = this;
  11807. var inited = this.inited,
  11808. initStatus = this.initStatus;
  11809. return this.loadTableData(datas).then(function () {
  11810. _this5.inited = true;
  11811. _this5.initStatus = true;
  11812. if (!initStatus) {
  11813. _this5.handleLoadDefaults();
  11814. }
  11815. if (!inited) {
  11816. _this5.handleInitDefaults();
  11817. }
  11818. return _this5.recalculate();
  11819. });
  11820. },
  11821. /**
  11822. * 重新加载数据,会清空表格状态
  11823. * @param {Array} datas 数据
  11824. */
  11825. reloadData: function reloadData(datas) {
  11826. var _this6 = this;
  11827. var inited = this.inited;
  11828. return this.clearAll().then(function () {
  11829. _this6.inited = true;
  11830. _this6.initStatus = true;
  11831. return _this6.loadTableData(datas);
  11832. }).then(function () {
  11833. _this6.handleLoadDefaults();
  11834. if (!inited) {
  11835. _this6.handleInitDefaults();
  11836. }
  11837. return _this6.recalculate();
  11838. });
  11839. },
  11840. /**
  11841. * 局部加载行数据并恢复到初始状态
  11842. * 对于行数据需要局部更改的场景中可能会用到
  11843. * @param {Row} row 行对象
  11844. * @param {Object} record 新数据
  11845. * @param {String} field 字段名
  11846. */
  11847. reloadRow: function reloadRow(row, record, field) {
  11848. var keepSource = this.keepSource,
  11849. tableSourceData = this.tableSourceData,
  11850. tableData = this.tableData;
  11851. if (keepSource) {
  11852. var rowIndex = this.getRowIndex(row);
  11853. var oRow = tableSourceData[rowIndex];
  11854. if (oRow && row) {
  11855. if (field) {
  11856. var newValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(record || row, field);
  11857. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.set(row, field, newValue);
  11858. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.set(oRow, field, newValue);
  11859. } else {
  11860. var newRecord = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.clone(_objectSpread2({}, record), true);
  11861. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.destructuring(oRow, Object.assign(row, newRecord));
  11862. }
  11863. }
  11864. this.tableData = tableData.slice(0);
  11865. } else {
  11866. if (false) {}
  11867. }
  11868. return this.$nextTick();
  11869. },
  11870. /**
  11871. * 加载列配置
  11872. * 对于表格列需要重载、局部递增场景下可能会用到
  11873. * @param {ColumnInfo} columns 列配置
  11874. */
  11875. loadColumn: function loadColumn(columns) {
  11876. var _this7 = this;
  11877. var collectColumn = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.mapTree(columns, function (column) {
  11878. return src_cell.createColumn(_this7, column);
  11879. }, {
  11880. children: 'children'
  11881. });
  11882. return this.handleColumn(collectColumn);
  11883. },
  11884. /**
  11885. * 加载列配置并恢复到初始状态
  11886. * 对于表格列需要重载、局部递增场景下可能会用到
  11887. * @param {ColumnInfo} columns 列配置
  11888. */
  11889. reloadColumn: function reloadColumn(columns) {
  11890. var _this8 = this;
  11891. return this.clearAll().then(function () {
  11892. return _this8.loadColumn(columns);
  11893. });
  11894. },
  11895. handleColumn: function handleColumn(collectColumn) {
  11896. var _this9 = this;
  11897. this.collectColumn = collectColumn;
  11898. var tableFullColumn = methods_getColumnList(collectColumn);
  11899. this.tableFullColumn = tableFullColumn;
  11900. this.cacheColumnMap();
  11901. this.restoreCustomStorage();
  11902. this.parseColumns().then(function () {
  11903. if (_this9.scrollXLoad) {
  11904. _this9.loadScrollXData(true);
  11905. }
  11906. });
  11907. this.clearMergeCells();
  11908. this.clearMergeFooterItems();
  11909. this.handleTableData(true);
  11910. if (false) {}
  11911. return this.$nextTick().then(function () {
  11912. if (_this9.$toolbar) {
  11913. _this9.$toolbar.syncUpdate({
  11914. collectColumn: collectColumn,
  11915. $table: _this9
  11916. });
  11917. }
  11918. return _this9.recalculate();
  11919. });
  11920. },
  11921. /**
  11922. * 更新数据行的 Map
  11923. * 牺牲数据组装的耗时,用来换取使用过程中的流畅
  11924. */
  11925. cacheRowMap: function cacheRowMap(source) {
  11926. var _this10 = this;
  11927. var treeConfig = this.treeConfig,
  11928. treeOpts = this.treeOpts,
  11929. tableFullData = this.tableFullData,
  11930. fullDataRowMap = this.fullDataRowMap,
  11931. fullAllDataRowMap = this.fullAllDataRowMap,
  11932. tableFullTreeData = this.tableFullTreeData;
  11933. var fullDataRowIdData = this.fullDataRowIdData,
  11934. fullAllDataRowIdData = this.fullAllDataRowIdData;
  11935. var rowkey = getRowkey(this);
  11936. var isLazy = treeConfig && treeOpts.lazy;
  11937. var handleCache = function handleCache(row, index, items, path, parent, nodes) {
  11938. var rowid = getRowid(_this10, row);
  11939. var seq = treeConfig && path ? toTreePathSeq(path) : index + 1;
  11940. var level = nodes ? nodes.length - 1 : 0;
  11941. if (eqEmptyValue(rowid)) {
  11942. rowid = getRowUniqueId();
  11943. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.set(row, rowkey, rowid);
  11944. }
  11945. if (isLazy && row[treeOpts.hasChild] && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isUndefined(row[treeOpts.children])) {
  11946. row[treeOpts.children] = null;
  11947. }
  11948. var rest = {
  11949. row: row,
  11950. rowid: rowid,
  11951. seq: seq,
  11952. index: treeConfig && parent ? -1 : index,
  11953. _index: -1,
  11954. $index: -1,
  11955. items: items,
  11956. parent: parent,
  11957. level: level
  11958. };
  11959. if (source) {
  11960. fullDataRowIdData[rowid] = rest;
  11961. fullDataRowMap.set(row, rest);
  11962. }
  11963. fullAllDataRowIdData[rowid] = rest;
  11964. fullAllDataRowMap.set(row, rest);
  11965. };
  11966. if (source) {
  11967. fullDataRowIdData = this.fullDataRowIdData = {};
  11968. fullDataRowMap.clear();
  11969. }
  11970. fullAllDataRowIdData = this.fullAllDataRowIdData = {};
  11971. fullAllDataRowMap.clear();
  11972. if (treeConfig) {
  11973. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(tableFullTreeData, handleCache, treeOpts);
  11974. } else {
  11975. tableFullData.forEach(handleCache);
  11976. }
  11977. },
  11978. loadTreeChildren: function loadTreeChildren(row, childRecords) {
  11979. var _this11 = this;
  11980. var keepSource = this.keepSource,
  11981. tableSourceData = this.tableSourceData,
  11982. treeOpts = this.treeOpts,
  11983. fullDataRowIdData = this.fullDataRowIdData,
  11984. fullDataRowMap = this.fullDataRowMap,
  11985. fullAllDataRowMap = this.fullAllDataRowMap,
  11986. fullAllDataRowIdData = this.fullAllDataRowIdData;
  11987. var transform = treeOpts.transform,
  11988. children = treeOpts.children,
  11989. mapChildren = treeOpts.mapChildren;
  11990. var rest = fullAllDataRowIdData[getRowid(this, row)];
  11991. var parentLevel = rest ? rest.level : 0;
  11992. return this.createData(childRecords).then(function (rows) {
  11993. if (keepSource) {
  11994. var rowid = getRowid(_this11, row);
  11995. var matchObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.findTree(tableSourceData, function (item) {
  11996. return rowid === getRowid(_this11, item);
  11997. }, treeOpts);
  11998. if (matchObj) {
  11999. matchObj.item[children] = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.clone(rows, true);
  12000. }
  12001. }
  12002. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(rows, function (childRow, index, items, path, parent, nodes) {
  12003. var rowid = getRowid(_this11, childRow);
  12004. var rest = {
  12005. row: childRow,
  12006. rowid: rowid,
  12007. seq: -1,
  12008. index: index,
  12009. _index: -1,
  12010. $index: -1,
  12011. items: items,
  12012. parent: parent,
  12013. level: parentLevel + nodes.length
  12014. };
  12015. fullDataRowIdData[rowid] = rest;
  12016. fullDataRowMap.set(childRow, rest);
  12017. fullAllDataRowIdData[rowid] = rest;
  12018. fullAllDataRowMap.set(childRow, rest);
  12019. }, treeOpts);
  12020. row[children] = rows;
  12021. if (transform) {
  12022. row[mapChildren] = rows;
  12023. }
  12024. _this11.updateAfterDataIndex();
  12025. return rows;
  12026. });
  12027. },
  12028. /**
  12029. * 更新数据列的 Map
  12030. * 牺牲数据组装的耗时,用来换取使用过程中的流畅
  12031. */
  12032. cacheColumnMap: function cacheColumnMap() {
  12033. var _this12 = this;
  12034. var tableFullColumn = this.tableFullColumn,
  12035. collectColumn = this.collectColumn,
  12036. fullColumnMap = this.fullColumnMap,
  12037. showOverflow = this.showOverflow;
  12038. var fullColumnIdData = this.fullColumnIdData = {};
  12039. var fullColumnFieldData = this.fullColumnFieldData = {};
  12040. var isGroup = collectColumn.some(hasChildrenList);
  12041. var isAllOverflow = !!showOverflow;
  12042. var expandColumn;
  12043. var treeNodeColumn;
  12044. var checkboxColumn;
  12045. var radioColumn;
  12046. var hasFixed;
  12047. var handleFunc = function handleFunc(column, index, items, path, parent) {
  12048. var colid = column.id,
  12049. field = column.field,
  12050. fixed = column.fixed,
  12051. type = column.type,
  12052. treeNode = column.treeNode;
  12053. var rest = {
  12054. column: column,
  12055. colid: colid,
  12056. index: index,
  12057. items: items,
  12058. parent: parent
  12059. };
  12060. if (field) {
  12061. if (false) {}
  12062. fullColumnFieldData[field] = rest;
  12063. }
  12064. if (!hasFixed && fixed) {
  12065. hasFixed = fixed;
  12066. }
  12067. if (treeNode) {
  12068. if (false) {}
  12069. if (!treeNodeColumn) {
  12070. treeNodeColumn = column;
  12071. }
  12072. } else if (type === 'expand') {
  12073. if (false) {}
  12074. if (!expandColumn) {
  12075. expandColumn = column;
  12076. }
  12077. }
  12078. if (false) {}
  12079. if (false) {}
  12080. if (isAllOverflow && column.showOverflow === false) {
  12081. isAllOverflow = false;
  12082. }
  12083. if (fullColumnIdData[colid]) {
  12084. errLog('vxe.error.colRepet', ['colId', colid]);
  12085. }
  12086. fullColumnIdData[colid] = rest;
  12087. fullColumnMap.set(column, rest);
  12088. };
  12089. fullColumnMap.clear();
  12090. if (isGroup) {
  12091. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(collectColumn, function (column, index, items, path, parent, nodes) {
  12092. column.level = nodes.length;
  12093. handleFunc(column, index, items, path, parent);
  12094. });
  12095. } else {
  12096. tableFullColumn.forEach(handleFunc);
  12097. }
  12098. if (false) {}
  12099. this.isGroup = isGroup;
  12100. this.treeNodeColumn = treeNodeColumn;
  12101. this.expandColumn = expandColumn;
  12102. this.isAllOverflow = isAllOverflow;
  12103. },
  12104. /**
  12105. * 根据 tr 元素获取对应的 row 信息
  12106. * @param {Element} tr 元素
  12107. */
  12108. getRowNode: function getRowNode(tr) {
  12109. if (tr) {
  12110. var fullAllDataRowIdData = this.fullAllDataRowIdData;
  12111. var rowid = tr.getAttribute('rowid');
  12112. var rest = fullAllDataRowIdData[rowid];
  12113. if (rest) {
  12114. return {
  12115. rowid: rest.rowid,
  12116. item: rest.row,
  12117. index: rest.index,
  12118. items: rest.items,
  12119. parent: rest.parent
  12120. };
  12121. }
  12122. }
  12123. return null;
  12124. },
  12125. /**
  12126. * 根据 th/td 元素获取对应的 column 信息
  12127. * @param {Element} cell 元素
  12128. */
  12129. getColumnNode: function getColumnNode(cell) {
  12130. if (cell) {
  12131. var fullColumnIdData = this.fullColumnIdData;
  12132. var colid = cell.getAttribute('colid');
  12133. var rest = fullColumnIdData[colid];
  12134. if (rest) {
  12135. return {
  12136. colid: rest.colid,
  12137. item: rest.column,
  12138. index: rest.index,
  12139. items: rest.items,
  12140. parent: rest.parent
  12141. };
  12142. }
  12143. }
  12144. return null;
  12145. },
  12146. /**
  12147. * 根据 row 获取序号
  12148. * @param {Row} row 行对象
  12149. */
  12150. getRowSeq: function getRowSeq(row) {
  12151. var fullDataRowIdData = this.fullDataRowIdData;
  12152. if (row) {
  12153. var rowid = getRowid(this, row);
  12154. var rest = fullDataRowIdData[rowid];
  12155. if (rest) {
  12156. return rest.seq;
  12157. }
  12158. }
  12159. return -1;
  12160. },
  12161. /**
  12162. * 根据 row 获取相对于 data 中的索引
  12163. * @param {Row} row 行对象
  12164. */
  12165. getRowIndex: function getRowIndex(row) {
  12166. return this.fullDataRowMap.has(row) ? this.fullDataRowMap.get(row).index : -1;
  12167. },
  12168. /**
  12169. * 根据 row 获取相对于当前数据中的索引
  12170. * @param {Row} row 行对象
  12171. */
  12172. getVTRowIndex: function getVTRowIndex(row) {
  12173. return this.afterFullData.indexOf(row);
  12174. },
  12175. // 在 v3 中废弃
  12176. _getRowIndex: function _getRowIndex(row) {
  12177. if (false) {}
  12178. return this.getVTRowIndex(row);
  12179. },
  12180. /**
  12181. * 根据 row 获取渲染中的虚拟索引
  12182. * @param {Row} row 行对象
  12183. */
  12184. getVMRowIndex: function getVMRowIndex(row) {
  12185. return this.tableData.indexOf(row);
  12186. },
  12187. // 在 v3 中废弃
  12188. $getRowIndex: function $getRowIndex(row) {
  12189. if (false) {}
  12190. return this.getVMRowIndex(row);
  12191. },
  12192. /**
  12193. * 根据 column 获取相对于 columns 中的索引
  12194. * @param {ColumnInfo} column 列配置
  12195. */
  12196. getColumnIndex: function getColumnIndex(column) {
  12197. return this.fullColumnMap.has(column) ? this.fullColumnMap.get(column).index : -1;
  12198. },
  12199. /**
  12200. * 根据 column 获取相对于当前表格列中的索引
  12201. * @param {ColumnInfo} column 列配置
  12202. */
  12203. getVTColumnIndex: function getVTColumnIndex(column) {
  12204. return this.visibleColumn.indexOf(column);
  12205. },
  12206. // 在 v3 中废弃
  12207. _getColumnIndex: function _getColumnIndex(column) {
  12208. if (false) {}
  12209. return this.getVTColumnIndex(column);
  12210. },
  12211. /**
  12212. * 根据 column 获取渲染中的虚拟索引
  12213. * @param {ColumnInfo} column 列配置
  12214. */
  12215. getVMColumnIndex: function getVMColumnIndex(column) {
  12216. return this.tableColumn.indexOf(column);
  12217. },
  12218. // 在 v3 中废弃
  12219. $getColumnIndex: function $getColumnIndex(column) {
  12220. if (false) {}
  12221. return this.getVMColumnIndex(column);
  12222. },
  12223. /**
  12224. * 判断是否为索引列
  12225. * @param {ColumnInfo} column 列配置
  12226. */
  12227. isSeqColumn: function isSeqColumn(column) {
  12228. return column && column.type === 'seq';
  12229. },
  12230. /**
  12231. * 定义行数据中的列属性,如果不存在则定义
  12232. * @param {Row} record 行数据
  12233. */
  12234. defineField: function defineField(record) {
  12235. var radioOpts = this.radioOpts,
  12236. checkboxOpts = this.checkboxOpts,
  12237. treeConfig = this.treeConfig,
  12238. treeOpts = this.treeOpts,
  12239. expandOpts = this.expandOpts;
  12240. var rowkey = getRowkey(this);
  12241. this.tableFullColumn.forEach(function (column) {
  12242. var field = column.field,
  12243. editRender = column.editRender;
  12244. if (field && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.has(record, field)) {
  12245. var cellValue = null;
  12246. if (editRender) {
  12247. var defaultValue = editRender.defaultValue;
  12248. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(defaultValue)) {
  12249. cellValue = defaultValue({
  12250. column: column
  12251. });
  12252. } else if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isUndefined(defaultValue)) {
  12253. cellValue = defaultValue;
  12254. }
  12255. }
  12256. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.set(record, field, cellValue);
  12257. }
  12258. });
  12259. var otherFields = [radioOpts.labelField, checkboxOpts.checkField, checkboxOpts.labelField, expandOpts.labelField];
  12260. otherFields.forEach(function (key) {
  12261. if (key && eqEmptyValue(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(record, key))) {
  12262. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.set(record, key, null);
  12263. }
  12264. });
  12265. if (treeConfig && treeOpts.lazy && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isUndefined(record[treeOpts.children])) {
  12266. record[treeOpts.children] = null;
  12267. } // 必须有行数据的唯一主键,可以自行设置;也可以默认生成一个随机数
  12268. if (eqEmptyValue(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(record, rowkey))) {
  12269. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.set(record, rowkey, getRowUniqueId());
  12270. }
  12271. return record;
  12272. },
  12273. /**
  12274. * 创建 data 对象
  12275. * 对于某些特殊场景可能会用到,会自动对数据的字段名进行检测,如果不存在就自动定义
  12276. * @param {Array} records 新数据
  12277. */
  12278. createData: function createData(records) {
  12279. var _this13 = this;
  12280. var treeConfig = this.treeConfig,
  12281. treeOpts = this.treeOpts;
  12282. var handleRrecord = function handleRrecord(record) {
  12283. return _this13.defineField(Object.assign({}, record));
  12284. };
  12285. var rows = treeConfig ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.mapTree(records, handleRrecord, treeOpts) : records.map(handleRrecord);
  12286. return this.$nextTick().then(function () {
  12287. return rows;
  12288. });
  12289. },
  12290. /**
  12291. * 创建 Row|Rows 对象
  12292. * 对于某些特殊场景需要对数据进行手动插入时可能会用到
  12293. * @param {Array/Object} records 新数据
  12294. */
  12295. createRow: function createRow(records) {
  12296. var _this14 = this;
  12297. var isArr = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(records);
  12298. if (!isArr) {
  12299. records = [records];
  12300. }
  12301. return this.$nextTick().then(function () {
  12302. return _this14.createData(records).then(function (rows) {
  12303. return isArr ? rows : rows[0];
  12304. });
  12305. });
  12306. },
  12307. /**
  12308. * 还原数据
  12309. * 如果不传任何参数,则还原整个表格
  12310. * 如果传 row 则还原一行
  12311. * 如果传 rows 则还原多行
  12312. * 如果还额外传了 field 则还原指定的单元格数据
  12313. */
  12314. revertData: function revertData(rows, field) {
  12315. var _this15 = this;
  12316. var keepSource = this.keepSource,
  12317. tableSourceData = this.tableSourceData,
  12318. treeConfig = this.treeConfig;
  12319. if (!keepSource) {
  12320. if (false) {}
  12321. return this.$nextTick();
  12322. }
  12323. var targetRows = rows;
  12324. if (rows) {
  12325. if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(rows)) {
  12326. targetRows = [rows];
  12327. }
  12328. } else {
  12329. targetRows = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toArray(this.getUpdateRecords());
  12330. }
  12331. if (targetRows.length) {
  12332. targetRows.forEach(function (row) {
  12333. if (!_this15.isInsertByRow(row)) {
  12334. var rowIndex = _this15.getRowIndex(row);
  12335. if (treeConfig && rowIndex === -1) {
  12336. errLog('vxe.error.noTree', ['revertData']);
  12337. }
  12338. var oRow = tableSourceData[rowIndex];
  12339. if (oRow && row) {
  12340. if (field) {
  12341. 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));
  12342. } else {
  12343. 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));
  12344. }
  12345. }
  12346. }
  12347. });
  12348. }
  12349. if (rows) {
  12350. return this.$nextTick();
  12351. }
  12352. return this.reloadData(tableSourceData);
  12353. },
  12354. /**
  12355. * 清空单元格内容
  12356. * 如果不创参数,则清空整个表格内容
  12357. * 如果传 row 则清空一行内容
  12358. * 如果传 rows 则清空多行内容
  12359. * 如果还额外传了 field 则清空指定单元格内容
  12360. * @param {Array/Row} rows 行数据
  12361. * @param {String} field 字段名
  12362. */
  12363. clearData: function clearData(rows, field) {
  12364. var tableFullData = this.tableFullData,
  12365. visibleColumn = this.visibleColumn;
  12366. if (!arguments.length) {
  12367. rows = tableFullData;
  12368. } else if (rows && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(rows)) {
  12369. rows = [rows];
  12370. }
  12371. if (field) {
  12372. rows.forEach(function (row) {
  12373. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.set(row, field, null);
  12374. });
  12375. } else {
  12376. rows.forEach(function (row) {
  12377. visibleColumn.forEach(function (column) {
  12378. if (column.field) {
  12379. methods_setCellValue(row, column, null);
  12380. }
  12381. });
  12382. });
  12383. }
  12384. return this.$nextTick();
  12385. },
  12386. /**
  12387. * 检查是否为临时行数据
  12388. * @param {Row} row 行对象
  12389. */
  12390. isInsertByRow: function isInsertByRow(row) {
  12391. return this.editStore.insertList.indexOf(row) > -1;
  12392. },
  12393. /**
  12394. * 删除所有新增的临时数据
  12395. * @returns
  12396. */
  12397. removeInsertRow: function removeInsertRow() {
  12398. return this.remove(this.editStore.insertList);
  12399. },
  12400. /**
  12401. * 检查行或列数据是否发生改变
  12402. * @param {Row} row 行对象
  12403. * @param {String} field 字段名
  12404. */
  12405. isUpdateByRow: function isUpdateByRow(row, field) {
  12406. var _this16 = this;
  12407. var visibleColumn = this.visibleColumn,
  12408. keepSource = this.keepSource,
  12409. treeConfig = this.treeConfig,
  12410. treeOpts = this.treeOpts,
  12411. tableSourceData = this.tableSourceData,
  12412. fullDataRowIdData = this.fullDataRowIdData;
  12413. if (keepSource) {
  12414. var oRow, property;
  12415. var rowid = getRowid(this, row); // 新增的数据不需要检测
  12416. if (!fullDataRowIdData[rowid]) {
  12417. return false;
  12418. }
  12419. if (treeConfig) {
  12420. var children = treeOpts.children;
  12421. var matchObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.findTree(tableSourceData, function (item) {
  12422. return rowid === getRowid(_this16, item);
  12423. }, treeOpts);
  12424. row = Object.assign({}, row, _defineProperty({}, children, null));
  12425. if (matchObj) {
  12426. oRow = Object.assign({}, matchObj.item, _defineProperty({}, children, null));
  12427. }
  12428. } else {
  12429. var oRowIndex = fullDataRowIdData[rowid].index;
  12430. oRow = tableSourceData[oRowIndex];
  12431. }
  12432. if (oRow) {
  12433. if (arguments.length > 1) {
  12434. return !eqCellValue(oRow, row, field);
  12435. }
  12436. for (var index = 0, len = visibleColumn.length; index < len; index++) {
  12437. property = visibleColumn[index].field;
  12438. if (property && !eqCellValue(oRow, row, property)) {
  12439. return true;
  12440. }
  12441. }
  12442. }
  12443. }
  12444. return false;
  12445. },
  12446. /**
  12447. * 获取表格的可视列,也可以指定索引获取列
  12448. * @param {Number} columnIndex 索引
  12449. */
  12450. getColumns: function getColumns(columnIndex) {
  12451. var columns = this.visibleColumn;
  12452. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isUndefined(columnIndex) ? columns.slice(0) : columns[columnIndex];
  12453. },
  12454. /**
  12455. * 根据列的唯一主键获取列
  12456. * @param {String} colid 列主键
  12457. */
  12458. getColumnById: function getColumnById(colid) {
  12459. var fullColumnIdData = this.fullColumnIdData;
  12460. return fullColumnIdData[colid] ? fullColumnIdData[colid].column : null;
  12461. },
  12462. /**
  12463. * 根据列的字段名获取列
  12464. * @param {String} field 字段名
  12465. */
  12466. getColumnByField: function getColumnByField(field) {
  12467. var fullColumnFieldData = this.fullColumnFieldData;
  12468. return fullColumnFieldData[field] ? fullColumnFieldData[field].column : null;
  12469. },
  12470. /**
  12471. * 获取当前表格的列
  12472. * 收集到的全量列、全量表头列、处理条件之后的全量表头列、当前渲染中的表头列
  12473. */
  12474. getTableColumn: function getTableColumn() {
  12475. return {
  12476. collectColumn: this.collectColumn.slice(0),
  12477. fullColumn: this.tableFullColumn.slice(0),
  12478. visibleColumn: this.visibleColumn.slice(0),
  12479. tableColumn: this.tableColumn.slice(0)
  12480. };
  12481. },
  12482. /**
  12483. * 获取数据,和 data 的行为一致,也可以指定索引获取数据
  12484. */
  12485. getData: function getData(rowIndex) {
  12486. var tableSynchData = this.data || this.tableSynchData;
  12487. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isUndefined(rowIndex) ? tableSynchData.slice(0) : tableSynchData[rowIndex];
  12488. },
  12489. /**
  12490. * 用于多选行,获取已选中的数据
  12491. */
  12492. getCheckboxRecords: function getCheckboxRecords(isFull) {
  12493. var _this17 = this;
  12494. var tableFullData = this.tableFullData,
  12495. afterFullData = this.afterFullData,
  12496. treeConfig = this.treeConfig,
  12497. treeOpts = this.treeOpts,
  12498. checkboxOpts = this.checkboxOpts,
  12499. tableFullTreeData = this.tableFullTreeData,
  12500. afterTreeFullData = this.afterTreeFullData;
  12501. var transform = treeOpts.transform,
  12502. children = treeOpts.children,
  12503. mapChildren = treeOpts.mapChildren;
  12504. var checkField = checkboxOpts.checkField;
  12505. var currTableData = isFull ? transform ? tableFullTreeData : tableFullData : transform ? afterTreeFullData : afterFullData;
  12506. var rowList = [];
  12507. if (checkField) {
  12508. if (treeConfig) {
  12509. rowList = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.filterTree(currTableData, function (row) {
  12510. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, checkField);
  12511. }, {
  12512. children: transform ? mapChildren : children
  12513. });
  12514. } else {
  12515. rowList = currTableData.filter(function (row) {
  12516. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, checkField);
  12517. });
  12518. }
  12519. } else {
  12520. var selection = this.selection;
  12521. if (treeConfig) {
  12522. rowList = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.filterTree(currTableData, function (row) {
  12523. return _this17.findRowIndexOf(selection, row) > -1;
  12524. }, {
  12525. children: transform ? mapChildren : children
  12526. });
  12527. } else {
  12528. rowList = currTableData.filter(function (row) {
  12529. return _this17.findRowIndexOf(selection, row) > -1;
  12530. });
  12531. }
  12532. }
  12533. return rowList;
  12534. },
  12535. /**
  12536. * 如果为虚拟树,将树结构拍平
  12537. * @returns
  12538. */
  12539. handleVirtualTreeToList: function handleVirtualTreeToList() {
  12540. var treeOpts = this.treeOpts,
  12541. treeConfig = this.treeConfig,
  12542. treeExpandeds = this.treeExpandeds,
  12543. afterTreeFullData = this.afterTreeFullData,
  12544. afterFullData = this.afterFullData;
  12545. if (treeConfig && treeOpts.transform) {
  12546. var fullData = [];
  12547. var expandMaps = new Map();
  12548. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(afterTreeFullData, function (row, index, items, path, parent) {
  12549. if (!parent || expandMaps.has(parent) && treeExpandeds.indexOf(parent) > -1) {
  12550. expandMaps.set(row, 1);
  12551. fullData.push(row);
  12552. }
  12553. }, {
  12554. children: treeOpts.mapChildren
  12555. });
  12556. this.afterFullData = fullData;
  12557. this.updateScrollYStatus(fullData);
  12558. return fullData;
  12559. }
  12560. return afterFullData;
  12561. },
  12562. /**
  12563. * 获取处理后全量的表格数据
  12564. * 如果存在筛选条件,继续处理
  12565. */
  12566. updateAfterFullData: function updateAfterFullData() {
  12567. var _this18 = this;
  12568. var tableFullColumn = this.tableFullColumn,
  12569. tableFullData = this.tableFullData,
  12570. filterOpts = this.filterOpts,
  12571. sortOpts = this.sortOpts,
  12572. treeConfig = this.treeConfig,
  12573. treeOpts = this.treeOpts,
  12574. tableFullTreeData = this.tableFullTreeData;
  12575. var allRemoteFilter = filterOpts.remote,
  12576. allFilterMethod = filterOpts.filterMethod;
  12577. var allRemoteSort = sortOpts.remote,
  12578. allSortMethod = sortOpts.sortMethod,
  12579. sortMultiple = sortOpts.multiple,
  12580. chronological = sortOpts.chronological;
  12581. var transform = treeOpts.transform;
  12582. var tableData = [];
  12583. var tableTree = [];
  12584. var filterColumns = [];
  12585. var orderColumns = [];
  12586. tableFullColumn.forEach(function (column) {
  12587. var field = column.field,
  12588. sortable = column.sortable,
  12589. order = column.order,
  12590. filters = column.filters;
  12591. if (!allRemoteFilter && filters && filters.length) {
  12592. var valueList = [];
  12593. var itemList = [];
  12594. filters.forEach(function (item) {
  12595. if (item.checked) {
  12596. itemList.push(item);
  12597. valueList.push(item.value);
  12598. }
  12599. });
  12600. if (itemList.length) {
  12601. filterColumns.push({
  12602. column: column,
  12603. valueList: valueList,
  12604. itemList: itemList
  12605. });
  12606. }
  12607. }
  12608. if (!allRemoteSort && sortable && order) {
  12609. orderColumns.push({
  12610. column: column,
  12611. field: field,
  12612. property: field,
  12613. order: order,
  12614. sortTime: column.sortTime
  12615. });
  12616. }
  12617. });
  12618. if (sortMultiple && chronological && orderColumns.length > 1) {
  12619. orderColumns = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.orderBy(orderColumns, 'sortTime');
  12620. }
  12621. if (filterColumns.length) {
  12622. var handleFilter = function handleFilter(row) {
  12623. return filterColumns.every(function (_ref) {
  12624. var column = _ref.column,
  12625. valueList = _ref.valueList,
  12626. itemList = _ref.itemList;
  12627. if (valueList.length && !allRemoteFilter) {
  12628. var filterMethod = column.filterMethod,
  12629. filterRender = column.filterRender,
  12630. field = column.field;
  12631. var compConf = filterRender ? v_x_e_table.renderer.get(filterRender.name) : null;
  12632. var compFilterMethod = compConf && compConf.renderFilter ? compConf.filterMethod : null;
  12633. var defaultFilterMethod = compConf ? compConf.defaultFilterMethod : null;
  12634. var cellValue = utils.getCellValue(row, column);
  12635. if (filterMethod) {
  12636. return itemList.some(function (item) {
  12637. return filterMethod({
  12638. value: item.value,
  12639. option: item,
  12640. cellValue: cellValue,
  12641. row: row,
  12642. column: column,
  12643. $table: _this18
  12644. });
  12645. });
  12646. } else if (compFilterMethod) {
  12647. return itemList.some(function (item) {
  12648. return compFilterMethod({
  12649. value: item.value,
  12650. option: item,
  12651. cellValue: cellValue,
  12652. row: row,
  12653. column: column,
  12654. $table: _this18
  12655. });
  12656. });
  12657. } else if (allFilterMethod) {
  12658. return allFilterMethod({
  12659. options: itemList,
  12660. values: valueList,
  12661. cellValue: cellValue,
  12662. row: row,
  12663. column: column
  12664. });
  12665. } else if (defaultFilterMethod) {
  12666. return itemList.some(function (item) {
  12667. return defaultFilterMethod({
  12668. value: item.value,
  12669. option: item,
  12670. cellValue: cellValue,
  12671. row: row,
  12672. column: column,
  12673. $table: _this18
  12674. });
  12675. });
  12676. }
  12677. return valueList.indexOf(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, field)) > -1;
  12678. }
  12679. return true;
  12680. });
  12681. };
  12682. if (treeConfig && transform) {
  12683. // 筛选虚拟树
  12684. tableTree = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.searchTree(tableFullTreeData, handleFilter, _objectSpread2(_objectSpread2({}, treeOpts), {}, {
  12685. original: true
  12686. }));
  12687. tableData = tableTree;
  12688. } else {
  12689. tableData = treeConfig ? tableFullTreeData.filter(handleFilter) : tableFullData.filter(handleFilter);
  12690. tableTree = tableData;
  12691. }
  12692. } else {
  12693. if (treeConfig && transform) {
  12694. // 还原虚拟树
  12695. tableTree = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.searchTree(tableFullTreeData, function () {
  12696. return true;
  12697. }, _objectSpread2(_objectSpread2({}, treeOpts), {}, {
  12698. original: true
  12699. }));
  12700. tableData = tableTree;
  12701. } else {
  12702. tableData = treeConfig ? tableFullTreeData.slice(0) : tableFullData.slice(0);
  12703. tableTree = tableData;
  12704. }
  12705. }
  12706. var firstOrderColumn = orderColumns[0];
  12707. if (!allRemoteSort && firstOrderColumn) {
  12708. if (treeConfig && transform) {
  12709. // 虚拟树和列表一样,只能排序根级节点
  12710. if (allSortMethod) {
  12711. var sortRests = allSortMethod({
  12712. data: tableTree,
  12713. sortList: orderColumns,
  12714. $table: this
  12715. });
  12716. tableTree = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(sortRests) ? sortRests : tableTree;
  12717. } else {
  12718. tableTree = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.orderBy(tableTree, orderColumns.map(function (_ref2) {
  12719. var column = _ref2.column,
  12720. order = _ref2.order;
  12721. return [getOrderField(_this18, column), order];
  12722. }));
  12723. }
  12724. tableData = tableTree;
  12725. } else {
  12726. if (allSortMethod) {
  12727. var _sortRests = allSortMethod({
  12728. data: tableData,
  12729. column: firstOrderColumn.column,
  12730. property: firstOrderColumn.field,
  12731. field: firstOrderColumn.field,
  12732. order: firstOrderColumn.order,
  12733. sortList: orderColumns,
  12734. $table: this
  12735. });
  12736. tableData = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(_sortRests) ? _sortRests : tableData;
  12737. } else {
  12738. // 兼容 v4
  12739. if (sortMultiple) {
  12740. tableData = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.orderBy(tableData, orderColumns.map(function (_ref3) {
  12741. var column = _ref3.column,
  12742. order = _ref3.order;
  12743. return [getOrderField(_this18, column), order];
  12744. }));
  12745. } else {
  12746. // 兼容 v2,在 v4 中废弃, sortBy 不能为数组
  12747. var sortByConfs;
  12748. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(firstOrderColumn.sortBy)) {
  12749. sortByConfs = firstOrderColumn.sortBy.map(function (item) {
  12750. return [item, firstOrderColumn.order];
  12751. });
  12752. }
  12753. tableData = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.orderBy(tableData, sortByConfs || [firstOrderColumn].map(function (_ref4) {
  12754. var column = _ref4.column,
  12755. order = _ref4.order;
  12756. return [getOrderField(_this18, column), order];
  12757. }));
  12758. }
  12759. }
  12760. tableTree = tableData;
  12761. }
  12762. }
  12763. this.afterFullData = tableData;
  12764. this.afterTreeFullData = tableTree;
  12765. this.updateAfterDataIndex();
  12766. },
  12767. /**
  12768. * 预编译
  12769. * 对渲染中的数据提前解析序号及索引。牺牲提前编译耗时换取渲染中额外损耗,使运行时更加流畅
  12770. */
  12771. updateAfterDataIndex: function updateAfterDataIndex() {
  12772. var _this19 = this;
  12773. var treeConfig = this.treeConfig,
  12774. afterFullData = this.afterFullData,
  12775. fullDataRowIdData = this.fullDataRowIdData,
  12776. fullAllDataRowIdData = this.fullAllDataRowIdData,
  12777. afterTreeFullData = this.afterTreeFullData,
  12778. treeOpts = this.treeOpts;
  12779. if (treeConfig) {
  12780. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(afterTreeFullData, function (row, index, items, path) {
  12781. var rowid = getRowid(_this19, row);
  12782. var allrest = fullAllDataRowIdData[rowid];
  12783. var seq = path.map(function (num, i) {
  12784. return i % 2 === 0 ? Number(num) + 1 : '.';
  12785. }).join('');
  12786. if (allrest) {
  12787. allrest.seq = seq;
  12788. allrest._index = index;
  12789. } else {
  12790. var rest = {
  12791. row: row,
  12792. rowid: rowid,
  12793. seq: seq,
  12794. index: -1,
  12795. $index: -1,
  12796. _index: index,
  12797. items: [],
  12798. parent: null,
  12799. level: 0
  12800. };
  12801. fullAllDataRowIdData[rowid] = rest;
  12802. fullDataRowIdData[rowid] = rest;
  12803. }
  12804. }, {
  12805. children: treeOpts.transform ? treeOpts.mapChildren : treeOpts.children
  12806. });
  12807. } else {
  12808. afterFullData.forEach(function (row, index) {
  12809. var rowid = getRowid(_this19, row);
  12810. var allrest = fullAllDataRowIdData[rowid];
  12811. var seq = index + 1;
  12812. if (allrest) {
  12813. allrest.seq = seq;
  12814. allrest._index = index;
  12815. } else {
  12816. var rest = {
  12817. row: row,
  12818. rowid: rowid,
  12819. seq: seq,
  12820. index: -1,
  12821. $index: -1,
  12822. _index: index,
  12823. items: [],
  12824. parent: null,
  12825. level: 0
  12826. };
  12827. fullAllDataRowIdData[rowid] = rest;
  12828. fullDataRowIdData[rowid] = rest;
  12829. }
  12830. });
  12831. }
  12832. },
  12833. /**
  12834. * 只对 tree-config 有效,获取行的父级
  12835. */
  12836. getParentRow: function getParentRow(rowOrRowid) {
  12837. var treeConfig = this.treeConfig,
  12838. fullDataRowIdData = this.fullDataRowIdData;
  12839. if (rowOrRowid && treeConfig) {
  12840. var rowid;
  12841. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isString(rowOrRowid)) {
  12842. rowid = rowOrRowid;
  12843. } else {
  12844. rowid = getRowid(this, rowOrRowid);
  12845. }
  12846. if (rowid) {
  12847. return fullDataRowIdData[rowid] ? fullDataRowIdData[rowid].parent : null;
  12848. }
  12849. }
  12850. return null;
  12851. },
  12852. /**
  12853. * 根据行的唯一主键获取行
  12854. * @param {String/Number} rowid 行主键
  12855. */
  12856. getRowById: function getRowById(cellValue) {
  12857. var fullDataRowIdData = this.fullDataRowIdData;
  12858. var rowid = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eqNull(cellValue) ? '' : encodeURIComponent(cellValue);
  12859. return fullDataRowIdData[rowid] ? fullDataRowIdData[rowid].row : null;
  12860. },
  12861. /**
  12862. * 根据行获取行的唯一主键
  12863. * @param {Row} row 行对象
  12864. */
  12865. getRowid: function getRowid(row) {
  12866. var fullAllDataRowMap = this.fullAllDataRowMap;
  12867. return fullAllDataRowMap.has(row) ? fullAllDataRowMap.get(row).rowid : null;
  12868. },
  12869. /**
  12870. * 获取处理后的表格数据
  12871. * 如果存在筛选条件,继续处理
  12872. * 如果存在排序,继续处理
  12873. */
  12874. getTableData: function getTableData() {
  12875. var tableFullData = this.tableFullData,
  12876. afterFullData = this.afterFullData,
  12877. tableData = this.tableData,
  12878. footerTableData = this.footerTableData;
  12879. return {
  12880. fullData: tableFullData.slice(0),
  12881. visibleData: afterFullData.slice(0),
  12882. tableData: tableData.slice(0),
  12883. footerData: footerTableData.slice(0)
  12884. };
  12885. },
  12886. /**
  12887. * 处理数据加载默认行为
  12888. * 默认执行一次,除非被重置
  12889. */
  12890. handleLoadDefaults: function handleLoadDefaults() {
  12891. var _this20 = this;
  12892. if (this.checkboxConfig) {
  12893. this.handleDefaultSelectionChecked();
  12894. }
  12895. if (this.radioConfig) {
  12896. this.handleDefaultRadioChecked();
  12897. }
  12898. if (this.expandConfig) {
  12899. this.handleDefaultRowExpand();
  12900. }
  12901. if (this.treeConfig) {
  12902. this.handleDefaultTreeExpand();
  12903. }
  12904. if (this.mergeCells) {
  12905. this.handleDefaultMergeCells();
  12906. }
  12907. if (this.mergeFooterItems) {
  12908. this.handleDefaultMergeFooterItems();
  12909. }
  12910. this.$nextTick(function () {
  12911. return setTimeout(_this20.recalculate);
  12912. });
  12913. },
  12914. /**
  12915. * 处理初始化的默认行为
  12916. * 只会执行一次
  12917. */
  12918. handleInitDefaults: function handleInitDefaults() {
  12919. var sortConfig = this.sortConfig;
  12920. if (sortConfig) {
  12921. this.handleDefaultSort();
  12922. }
  12923. },
  12924. /**
  12925. * 隐藏指定列
  12926. */
  12927. hideColumn: function hideColumn(fieldOrColumn) {
  12928. var column = handleFieldOrColumn(this, fieldOrColumn);
  12929. if (column) {
  12930. column.visible = false;
  12931. }
  12932. return this.handleCustom();
  12933. },
  12934. /**
  12935. * 显示指定列
  12936. */
  12937. showColumn: function showColumn(fieldOrColumn) {
  12938. var column = handleFieldOrColumn(this, fieldOrColumn);
  12939. if (column) {
  12940. column.visible = true;
  12941. }
  12942. return this.handleCustom();
  12943. },
  12944. /**
  12945. * 手动重置列的显示隐藏、列宽拖动的状态;
  12946. * 如果为 true 则重置所有状态
  12947. * 如果已关联工具栏,则会同步更新
  12948. */
  12949. resetColumn: function resetColumn(options) {
  12950. var customOpts = this.customOpts;
  12951. var checkMethod = customOpts.checkMethod;
  12952. var opts = Object.assign({
  12953. visible: true,
  12954. resizable: options === true
  12955. }, options);
  12956. this.tableFullColumn.forEach(function (column) {
  12957. if (opts.resizable) {
  12958. column.resizeWidth = 0;
  12959. }
  12960. if (!checkMethod || checkMethod({
  12961. column: column
  12962. })) {
  12963. column.visible = column.defaultVisible;
  12964. }
  12965. });
  12966. if (opts.resizable) {
  12967. this.saveCustomResizable(true);
  12968. }
  12969. return this.handleCustom();
  12970. },
  12971. handleCustom: function handleCustom() {
  12972. this.saveCustomVisible();
  12973. this.analyColumnWidth();
  12974. return this.refreshColumn();
  12975. },
  12976. /**
  12977. * 还原自定义列操作状态
  12978. */
  12979. restoreCustomStorage: function restoreCustomStorage() {
  12980. var id = this.id,
  12981. collectColumn = this.collectColumn,
  12982. customConfig = this.customConfig,
  12983. customOpts = this.customOpts;
  12984. var storage = customOpts.storage;
  12985. var isAllStorage = customOpts.storage === true;
  12986. var isResizable = isAllStorage || storage && storage.resizable;
  12987. var isVisible = isAllStorage || storage && storage.visible;
  12988. if (customConfig && (isResizable || isVisible)) {
  12989. var customMap = {};
  12990. if (!id) {
  12991. errLog('vxe.error.reqProp', ['id']);
  12992. return;
  12993. }
  12994. if (isResizable) {
  12995. var columnWidthStorage = getCustomStorageMap(resizableStorageKey)[id];
  12996. if (columnWidthStorage) {
  12997. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.each(columnWidthStorage, function (resizeWidth, field) {
  12998. customMap[field] = {
  12999. field: field,
  13000. resizeWidth: resizeWidth
  13001. };
  13002. });
  13003. }
  13004. }
  13005. if (isVisible) {
  13006. var columnVisibleStorage = getCustomStorageMap(visibleStorageKey)[id];
  13007. if (columnVisibleStorage) {
  13008. var colVisibles = columnVisibleStorage.split('|');
  13009. var colHides = colVisibles[0] ? colVisibles[0].split(',') : [];
  13010. var colShows = colVisibles[1] ? colVisibles[1].split(',') : [];
  13011. colHides.forEach(function (field) {
  13012. if (customMap[field]) {
  13013. customMap[field].visible = false;
  13014. } else {
  13015. customMap[field] = {
  13016. field: field,
  13017. visible: false
  13018. };
  13019. }
  13020. });
  13021. colShows.forEach(function (field) {
  13022. if (customMap[field]) {
  13023. customMap[field].visible = true;
  13024. } else {
  13025. customMap[field] = {
  13026. field: field,
  13027. visible: true
  13028. };
  13029. }
  13030. });
  13031. }
  13032. }
  13033. var keyMap = {};
  13034. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(collectColumn, function (column) {
  13035. var colKey = column.getKey();
  13036. if (colKey) {
  13037. keyMap[colKey] = column;
  13038. }
  13039. });
  13040. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.each(customMap, function (_ref5, field) {
  13041. var visible = _ref5.visible,
  13042. resizeWidth = _ref5.resizeWidth;
  13043. var column = keyMap[field];
  13044. if (column) {
  13045. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNumber(resizeWidth)) {
  13046. column.resizeWidth = resizeWidth;
  13047. }
  13048. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isBoolean(visible)) {
  13049. column.visible = visible;
  13050. }
  13051. }
  13052. });
  13053. }
  13054. },
  13055. saveCustomVisible: function saveCustomVisible() {
  13056. var id = this.id,
  13057. collectColumn = this.collectColumn,
  13058. customConfig = this.customConfig,
  13059. customOpts = this.customOpts;
  13060. var checkMethod = customOpts.checkMethod,
  13061. storage = customOpts.storage;
  13062. var isAllStorage = customOpts.storage === true;
  13063. var isVisible = isAllStorage || storage && storage.visible;
  13064. if (customConfig && isVisible) {
  13065. var columnVisibleStorageMap = getCustomStorageMap(visibleStorageKey);
  13066. var colHides = [];
  13067. var colShows = [];
  13068. if (!id) {
  13069. errLog('vxe.error.reqProp', ['id']);
  13070. return;
  13071. }
  13072. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(collectColumn, function (column) {
  13073. if (!checkMethod || checkMethod({
  13074. column: column
  13075. })) {
  13076. if (!column.visible && column.defaultVisible) {
  13077. var colKey = column.getKey();
  13078. if (colKey) {
  13079. colHides.push(colKey);
  13080. }
  13081. } else if (column.visible && !column.defaultVisible) {
  13082. var _colKey = column.getKey();
  13083. if (_colKey) {
  13084. colShows.push(_colKey);
  13085. }
  13086. }
  13087. }
  13088. });
  13089. columnVisibleStorageMap[id] = [colHides.join(',')].concat(colShows.length ? [colShows.join(',')] : []).join('|') || undefined;
  13090. localStorage.setItem(visibleStorageKey, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toJSONString(columnVisibleStorageMap));
  13091. }
  13092. },
  13093. saveCustomResizable: function saveCustomResizable(isReset) {
  13094. var id = this.id,
  13095. collectColumn = this.collectColumn,
  13096. customConfig = this.customConfig,
  13097. customOpts = this.customOpts;
  13098. var storage = customOpts.storage;
  13099. var isAllStorage = customOpts.storage === true;
  13100. var isResizable = isAllStorage || storage && storage.resizable;
  13101. if (customConfig && isResizable) {
  13102. var columnWidthStorageMap = getCustomStorageMap(resizableStorageKey);
  13103. var columnWidthStorage;
  13104. if (!id) {
  13105. errLog('vxe.error.reqProp', ['id']);
  13106. return;
  13107. }
  13108. if (!isReset) {
  13109. columnWidthStorage = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isPlainObject(columnWidthStorageMap[id]) ? columnWidthStorageMap[id] : {};
  13110. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(collectColumn, function (column) {
  13111. if (column.resizeWidth) {
  13112. var colKey = column.getKey();
  13113. if (colKey) {
  13114. columnWidthStorage[colKey] = column.renderWidth;
  13115. }
  13116. }
  13117. });
  13118. }
  13119. columnWidthStorageMap[id] = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isEmpty(columnWidthStorage) ? undefined : columnWidthStorage;
  13120. localStorage.setItem(resizableStorageKey, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toJSONString(columnWidthStorageMap));
  13121. }
  13122. },
  13123. /**
  13124. * 刷新列配置
  13125. */
  13126. refreshColumn: function refreshColumn() {
  13127. var _this21 = this;
  13128. return this.parseColumns().then(function () {
  13129. return _this21.refreshScroll();
  13130. }).then(function () {
  13131. return _this21.recalculate();
  13132. });
  13133. },
  13134. /**
  13135. * 刷新列信息
  13136. * 将固定的列左边、右边分别靠边
  13137. */
  13138. parseColumns: function parseColumns() {
  13139. var _this22 = this;
  13140. var leftList = [];
  13141. var centerList = [];
  13142. var rightList = [];
  13143. var collectColumn = this.collectColumn,
  13144. tableFullColumn = this.tableFullColumn,
  13145. isGroup = this.isGroup,
  13146. columnStore = this.columnStore,
  13147. sXOpts = this.sXOpts,
  13148. scrollXStore = this.scrollXStore; // 如果是分组表头,如果子列全部被隐藏,则根列也隐藏
  13149. if (isGroup) {
  13150. var leftGroupList = [];
  13151. var centerGroupList = [];
  13152. var rightGroupList = [];
  13153. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(collectColumn, function (column, index, items, path, parent) {
  13154. var isColGroup = hasChildrenList(column); // 如果是分组,必须按组设置固定列,不允许给子列设置固定
  13155. if (parent && parent.fixed) {
  13156. column.fixed = parent.fixed;
  13157. }
  13158. if (parent && column.fixed !== parent.fixed) {
  13159. errLog('vxe.error.groupFixed');
  13160. }
  13161. if (isColGroup) {
  13162. column.visible = !!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.findTree(column.children, function (subColumn) {
  13163. return hasChildrenList(subColumn) ? null : subColumn.visible;
  13164. });
  13165. } else if (column.visible) {
  13166. if (column.fixed === 'left') {
  13167. leftList.push(column);
  13168. } else if (column.fixed === 'right') {
  13169. rightList.push(column);
  13170. } else {
  13171. centerList.push(column);
  13172. }
  13173. }
  13174. });
  13175. collectColumn.forEach(function (column) {
  13176. if (column.visible) {
  13177. if (column.fixed === 'left') {
  13178. leftGroupList.push(column);
  13179. } else if (column.fixed === 'right') {
  13180. rightGroupList.push(column);
  13181. } else {
  13182. centerGroupList.push(column);
  13183. }
  13184. }
  13185. });
  13186. this.tableGroupColumn = leftGroupList.concat(centerGroupList).concat(rightGroupList);
  13187. } else {
  13188. // 重新分配列
  13189. tableFullColumn.forEach(function (column) {
  13190. if (column.visible) {
  13191. if (column.fixed === 'left') {
  13192. leftList.push(column);
  13193. } else if (column.fixed === 'right') {
  13194. rightList.push(column);
  13195. } else {
  13196. centerList.push(column);
  13197. }
  13198. }
  13199. });
  13200. }
  13201. var visibleColumn = leftList.concat(centerList).concat(rightList);
  13202. var scrollXLoad = sXOpts.enabled && sXOpts.gt > -1 && sXOpts.gt < tableFullColumn.length;
  13203. this.hasFixedColumn = leftList.length > 0 || rightList.length > 0;
  13204. Object.assign(columnStore, {
  13205. leftList: leftList,
  13206. centerList: centerList,
  13207. rightList: rightList
  13208. });
  13209. if (scrollXLoad) {
  13210. if (false) {}
  13211. var _computeVirtualX = computeVirtualX(this),
  13212. visibleSize = _computeVirtualX.visibleSize;
  13213. scrollXStore.startIndex = 0;
  13214. scrollXStore.endIndex = visibleSize;
  13215. scrollXStore.visibleSize = visibleSize;
  13216. } // 如果列被显示/隐藏,则清除合并状态
  13217. // 如果列被设置为固定,则清除合并状态
  13218. if (visibleColumn.length !== this.visibleColumn.length || !this.visibleColumn.every(function (column, index) {
  13219. return column === visibleColumn[index];
  13220. })) {
  13221. this.clearMergeCells();
  13222. this.clearMergeFooterItems();
  13223. }
  13224. this.scrollXLoad = scrollXLoad;
  13225. this.visibleColumn = visibleColumn;
  13226. this.handleTableColumn();
  13227. return this.updateFooter().then(function () {
  13228. return _this22.recalculate();
  13229. }).then(function () {
  13230. _this22.updateCellAreas();
  13231. return _this22.recalculate();
  13232. });
  13233. },
  13234. /**
  13235. * 指定列宽的列进行拆分
  13236. */
  13237. analyColumnWidth: function analyColumnWidth() {
  13238. var columnOpts = this.columnOpts;
  13239. var defaultWidth = columnOpts.width,
  13240. defaultMinWidth = columnOpts.minWidth;
  13241. var resizeList = [];
  13242. var pxList = [];
  13243. var pxMinList = [];
  13244. var scaleList = [];
  13245. var scaleMinList = [];
  13246. var autoList = [];
  13247. this.tableFullColumn.forEach(function (column) {
  13248. if (defaultWidth && !column.width) {
  13249. column.width = defaultWidth;
  13250. }
  13251. if (defaultMinWidth && !column.minWidth) {
  13252. column.minWidth = defaultMinWidth;
  13253. }
  13254. if (column.visible) {
  13255. if (column.resizeWidth) {
  13256. resizeList.push(column);
  13257. } else if (dom.isPx(column.width)) {
  13258. pxList.push(column);
  13259. } else if (dom.isScale(column.width)) {
  13260. scaleList.push(column);
  13261. } else if (dom.isPx(column.minWidth)) {
  13262. pxMinList.push(column);
  13263. } else if (dom.isScale(column.minWidth)) {
  13264. scaleMinList.push(column);
  13265. } else {
  13266. autoList.push(column);
  13267. }
  13268. }
  13269. });
  13270. Object.assign(this.columnStore, {
  13271. resizeList: resizeList,
  13272. pxList: pxList,
  13273. pxMinList: pxMinList,
  13274. scaleList: scaleList,
  13275. scaleMinList: scaleMinList,
  13276. autoList: autoList
  13277. });
  13278. },
  13279. /**
  13280. * 刷新滚动操作,手动同步滚动相关位置(对于某些特殊的操作,比如滚动条错位、固定列不同步)
  13281. */
  13282. refreshScroll: function refreshScroll() {
  13283. var _this23 = this;
  13284. var lastScrollLeft = this.lastScrollLeft,
  13285. lastScrollTop = this.lastScrollTop;
  13286. var $refs = this.$refs;
  13287. var tableBody = $refs.tableBody,
  13288. leftBody = $refs.leftBody,
  13289. rightBody = $refs.rightBody,
  13290. tableFooter = $refs.tableFooter;
  13291. var tableBodyElem = tableBody ? tableBody.$el : null;
  13292. var leftBodyElem = leftBody ? leftBody.$el : null;
  13293. var rightBodyElem = rightBody ? rightBody.$el : null;
  13294. var tableFooterElem = tableFooter ? tableFooter.$el : null;
  13295. return new Promise(function (resolve) {
  13296. // 还原滚动条位置
  13297. if (lastScrollLeft || lastScrollTop) {
  13298. return restoreScrollLocation(_this23, lastScrollLeft, lastScrollTop).then(function () {
  13299. // 存在滚动行为未结束情况
  13300. setTimeout(resolve, 30);
  13301. });
  13302. } // 重置
  13303. setScrollTop(tableBodyElem, lastScrollTop);
  13304. setScrollTop(leftBodyElem, lastScrollTop);
  13305. setScrollTop(rightBodyElem, lastScrollTop);
  13306. setScrollLeft(tableFooterElem, lastScrollLeft); // 存在滚动行为未结束情况
  13307. setTimeout(resolve, 30);
  13308. });
  13309. },
  13310. /**
  13311. * 计算单元格列宽,动态分配可用剩余空间
  13312. * 支持 width=? width=?px width=?% min-width=? min-width=?px min-width=?%
  13313. */
  13314. recalculate: function recalculate(refull) {
  13315. var _this24 = this;
  13316. var $refs = this.$refs;
  13317. var tableBody = $refs.tableBody,
  13318. tableHeader = $refs.tableHeader,
  13319. tableFooter = $refs.tableFooter;
  13320. var bodyElem = tableBody ? tableBody.$el : null;
  13321. var headerElem = tableHeader ? tableHeader.$el : null;
  13322. var footerElem = tableFooter ? tableFooter.$el : null;
  13323. if (bodyElem) {
  13324. this.autoCellWidth(headerElem, bodyElem, footerElem);
  13325. if (refull === true) {
  13326. // 初始化时需要在列计算之后再执行优化运算,达到最优显示效果
  13327. return this.computeScrollLoad().then(function () {
  13328. _this24.autoCellWidth(headerElem, bodyElem, footerElem);
  13329. return _this24.computeScrollLoad();
  13330. });
  13331. }
  13332. }
  13333. return this.computeScrollLoad();
  13334. },
  13335. /**
  13336. * 列宽算法
  13337. * 支持 px、%、固定 混合分配
  13338. * 支持动态列表调整分配
  13339. * 支持自动分配偏移量
  13340. * @param {Element} headerElem
  13341. * @param {Element} bodyElem
  13342. * @param {Element} footerElem
  13343. * @param {Number} bodyWidth
  13344. */
  13345. autoCellWidth: function autoCellWidth(headerElem, bodyElem, footerElem) {
  13346. var tableWidth = 0;
  13347. var minCellWidth = 40; // 列宽最少限制 40px
  13348. var bodyWidth = bodyElem.clientWidth - 1;
  13349. var remainWidth = bodyWidth;
  13350. var meanWidth = remainWidth / 100;
  13351. var fit = this.fit,
  13352. columnStore = this.columnStore;
  13353. var resizeList = columnStore.resizeList,
  13354. pxMinList = columnStore.pxMinList,
  13355. pxList = columnStore.pxList,
  13356. scaleList = columnStore.scaleList,
  13357. scaleMinList = columnStore.scaleMinList,
  13358. autoList = columnStore.autoList; // 最小宽
  13359. pxMinList.forEach(function (column) {
  13360. var minWidth = parseInt(column.minWidth);
  13361. tableWidth += minWidth;
  13362. column.renderWidth = minWidth;
  13363. }); // 最小百分比
  13364. scaleMinList.forEach(function (column) {
  13365. var scaleWidth = Math.floor(parseInt(column.minWidth) * meanWidth);
  13366. tableWidth += scaleWidth;
  13367. column.renderWidth = scaleWidth;
  13368. }); // 固定百分比
  13369. scaleList.forEach(function (column) {
  13370. var scaleWidth = Math.floor(parseInt(column.width) * meanWidth);
  13371. tableWidth += scaleWidth;
  13372. column.renderWidth = scaleWidth;
  13373. }); // 固定宽
  13374. pxList.forEach(function (column) {
  13375. var width = parseInt(column.width);
  13376. tableWidth += width;
  13377. column.renderWidth = width;
  13378. }); // 调整了列宽
  13379. resizeList.forEach(function (column) {
  13380. var width = parseInt(column.resizeWidth);
  13381. tableWidth += width;
  13382. column.renderWidth = width;
  13383. });
  13384. remainWidth -= tableWidth;
  13385. meanWidth = remainWidth > 0 ? Math.floor(remainWidth / (scaleMinList.length + pxMinList.length + autoList.length)) : 0;
  13386. if (fit) {
  13387. if (remainWidth > 0) {
  13388. scaleMinList.concat(pxMinList).forEach(function (column) {
  13389. tableWidth += meanWidth;
  13390. column.renderWidth += meanWidth;
  13391. });
  13392. }
  13393. } else {
  13394. meanWidth = minCellWidth;
  13395. } // 自适应
  13396. autoList.forEach(function (column) {
  13397. var width = Math.max(meanWidth, minCellWidth);
  13398. column.renderWidth = width;
  13399. tableWidth += width;
  13400. });
  13401. if (fit) {
  13402. /**
  13403. * 偏移量算法
  13404. * 如果所有列足够放的情况下,从最后动态列开始分配
  13405. */
  13406. var dynamicList = scaleList.concat(scaleMinList).concat(pxMinList).concat(autoList);
  13407. var dynamicSize = dynamicList.length - 1;
  13408. if (dynamicSize > 0) {
  13409. var odiffer = bodyWidth - tableWidth;
  13410. if (odiffer > 0) {
  13411. while (odiffer > 0 && dynamicSize >= 0) {
  13412. odiffer--;
  13413. dynamicList[dynamicSize--].renderWidth++;
  13414. }
  13415. tableWidth = bodyWidth;
  13416. }
  13417. }
  13418. }
  13419. var tableHeight = bodyElem.offsetHeight;
  13420. var overflowY = bodyElem.scrollHeight > bodyElem.clientHeight;
  13421. this.scrollbarWidth = overflowY ? bodyElem.offsetWidth - bodyElem.clientWidth : 0;
  13422. this.overflowY = overflowY;
  13423. this.tableWidth = tableWidth;
  13424. this.tableHeight = tableHeight;
  13425. if (headerElem) {
  13426. this.headerHeight = headerElem.clientHeight;
  13427. this.$nextTick(function () {
  13428. // 检测是否同步滚动
  13429. if (headerElem && bodyElem && headerElem.scrollLeft !== bodyElem.scrollLeft) {
  13430. headerElem.scrollLeft = bodyElem.scrollLeft;
  13431. }
  13432. });
  13433. } else {
  13434. this.headerHeight = 0;
  13435. }
  13436. if (footerElem) {
  13437. var footerHeight = footerElem.offsetHeight;
  13438. this.scrollbarHeight = Math.max(footerHeight - footerElem.clientHeight, 0);
  13439. this.overflowX = tableWidth > footerElem.clientWidth;
  13440. this.footerHeight = footerHeight;
  13441. } else {
  13442. this.footerHeight = 0;
  13443. this.scrollbarHeight = Math.max(tableHeight - bodyElem.clientHeight, 0);
  13444. this.overflowX = tableWidth > bodyWidth;
  13445. }
  13446. this.updateHeight();
  13447. this.parentHeight = Math.max(this.headerHeight + this.footerHeight + 20, this.getParentHeight());
  13448. if (this.overflowX) {
  13449. this.checkScrolling();
  13450. }
  13451. },
  13452. updateHeight: function updateHeight() {
  13453. this.customHeight = methods_calcHeight(this, 'height');
  13454. this.customMaxHeight = methods_calcHeight(this, 'maxHeight');
  13455. },
  13456. updateStyle: function updateStyle() {
  13457. var _this25 = this;
  13458. var $refs = this.$refs,
  13459. isGroup = this.isGroup,
  13460. fullColumnIdData = this.fullColumnIdData,
  13461. tableColumn = this.tableColumn,
  13462. customHeight = this.customHeight,
  13463. customMaxHeight = this.customMaxHeight,
  13464. border = this.border,
  13465. headerHeight = this.headerHeight,
  13466. showFooter = this.showFooter,
  13467. allColumnOverflow = this.showOverflow,
  13468. allColumnHeaderOverflow = this.showHeaderOverflow,
  13469. allColumnFooterOverflow = this.showFooterOverflow,
  13470. footerHeight = this.footerHeight,
  13471. tableHeight = this.tableHeight,
  13472. tableWidth = this.tableWidth,
  13473. scrollbarHeight = this.scrollbarHeight,
  13474. scrollbarWidth = this.scrollbarWidth,
  13475. scrollXLoad = this.scrollXLoad,
  13476. scrollYLoad = this.scrollYLoad,
  13477. cellOffsetWidth = this.cellOffsetWidth,
  13478. columnStore = this.columnStore,
  13479. elemStore = this.elemStore,
  13480. editStore = this.editStore,
  13481. currentRow = this.currentRow,
  13482. mouseConfig = this.mouseConfig,
  13483. keyboardConfig = this.keyboardConfig,
  13484. keyboardOpts = this.keyboardOpts,
  13485. spanMethod = this.spanMethod,
  13486. mergeList = this.mergeList,
  13487. mergeFooterList = this.mergeFooterList,
  13488. footerSpanMethod = this.footerSpanMethod,
  13489. isAllOverflow = this.isAllOverflow,
  13490. visibleColumn = this.visibleColumn;
  13491. var containerList = ['main', 'left', 'right'];
  13492. var emptyPlaceholderElem = $refs.emptyPlaceholder;
  13493. var bodyWrapperElem = elemStore['main-body-wrapper'];
  13494. if (emptyPlaceholderElem) {
  13495. emptyPlaceholderElem.style.top = "".concat(headerHeight, "px");
  13496. emptyPlaceholderElem.style.height = bodyWrapperElem ? "".concat(bodyWrapperElem.offsetHeight - scrollbarHeight, "px") : '';
  13497. }
  13498. if (customHeight > 0) {
  13499. if (showFooter) {
  13500. customHeight += scrollbarHeight;
  13501. }
  13502. }
  13503. containerList.forEach(function (name, index) {
  13504. var fixedType = index > 0 ? name : '';
  13505. var layoutList = ['header', 'body', 'footer'];
  13506. var fixedColumn = columnStore["".concat(fixedType, "List")];
  13507. var fixedWrapperElem = $refs["".concat(fixedType, "Container")];
  13508. layoutList.forEach(function (layout) {
  13509. var wrapperElem = elemStore["".concat(name, "-").concat(layout, "-wrapper")];
  13510. var tableElem = elemStore["".concat(name, "-").concat(layout, "-table")];
  13511. if (layout === 'header') {
  13512. // 表头体样式处理
  13513. // 横向滚动渲染
  13514. var tWidth = tableWidth;
  13515. var renderColumnList = tableColumn;
  13516. if (isGroup) {
  13517. renderColumnList = visibleColumn;
  13518. } else {
  13519. // 如果是使用优化模式
  13520. if (fixedType) {
  13521. if (scrollXLoad || allColumnHeaderOverflow) {
  13522. renderColumnList = fixedColumn;
  13523. }
  13524. }
  13525. }
  13526. tWidth = renderColumnList.reduce(function (previous, column) {
  13527. return previous + column.renderWidth;
  13528. }, 0);
  13529. if (tableElem) {
  13530. tableElem.style.width = tWidth ? "".concat(tWidth + scrollbarWidth, "px") : ''; // 修复 IE 中高度无法自适应问题
  13531. if (browse.msie) {
  13532. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.arrayEach(tableElem.querySelectorAll('.vxe-resizable'), function (resizeElem) {
  13533. resizeElem.style.height = "".concat(resizeElem.parentNode.offsetHeight, "px");
  13534. });
  13535. }
  13536. }
  13537. var repairElem = elemStore["".concat(name, "-").concat(layout, "-repair")];
  13538. if (repairElem) {
  13539. repairElem.style.width = "".concat(tableWidth, "px");
  13540. }
  13541. var listElem = elemStore["".concat(name, "-").concat(layout, "-list")];
  13542. if (isGroup && listElem) {
  13543. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.arrayEach(listElem.querySelectorAll('.col--group'), function (thElem) {
  13544. var colNode = _this25.getColumnNode(thElem);
  13545. if (colNode) {
  13546. var column = colNode.item;
  13547. var showHeaderOverflow = column.showHeaderOverflow;
  13548. var cellOverflow = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isBoolean(showHeaderOverflow) ? showHeaderOverflow : allColumnHeaderOverflow;
  13549. var showEllipsis = cellOverflow === 'ellipsis';
  13550. var showTitle = cellOverflow === 'title';
  13551. var showTooltip = cellOverflow === true || cellOverflow === 'tooltip';
  13552. var hasEllipsis = showTitle || showTooltip || showEllipsis;
  13553. var childWidth = 0;
  13554. var countChild = 0;
  13555. if (hasEllipsis) {
  13556. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(column.children, function (item) {
  13557. if (!item.children || !column.children.length) {
  13558. countChild++;
  13559. }
  13560. childWidth += item.renderWidth;
  13561. });
  13562. }
  13563. thElem.style.width = hasEllipsis ? "".concat(childWidth - countChild - (border ? 2 : 0), "px") : '';
  13564. }
  13565. });
  13566. }
  13567. } else if (layout === 'body') {
  13568. var emptyBlockElem = elemStore["".concat(name, "-").concat(layout, "-emptyBlock")];
  13569. if (methods_isNodeElement(wrapperElem)) {
  13570. if (customMaxHeight) {
  13571. wrapperElem.style.maxHeight = "".concat(fixedType ? customMaxHeight - headerHeight - (showFooter ? 0 : scrollbarHeight) : customMaxHeight - headerHeight, "px");
  13572. } else {
  13573. if (customHeight > 0) {
  13574. wrapperElem.style.height = "".concat(fixedType ? (customHeight > 0 ? customHeight - headerHeight - footerHeight : tableHeight) - (showFooter ? 0 : scrollbarHeight) : customHeight - headerHeight - footerHeight, "px");
  13575. } else {
  13576. wrapperElem.style.height = '';
  13577. }
  13578. }
  13579. } // 如果是固定列
  13580. if (fixedWrapperElem) {
  13581. var isRightFixed = fixedType === 'right';
  13582. var _fixedColumn = columnStore["".concat(fixedType, "List")];
  13583. if (methods_isNodeElement(wrapperElem)) {
  13584. wrapperElem.style.top = "".concat(headerHeight, "px");
  13585. }
  13586. fixedWrapperElem.style.height = "".concat((customHeight > 0 ? customHeight - headerHeight - footerHeight : tableHeight) + headerHeight + footerHeight - scrollbarHeight * (showFooter ? 2 : 1), "px");
  13587. fixedWrapperElem.style.width = "".concat(_fixedColumn.reduce(function (previous, column) {
  13588. return previous + column.renderWidth;
  13589. }, isRightFixed ? scrollbarWidth : 0), "px");
  13590. }
  13591. var _tWidth = tableWidth;
  13592. var _renderColumnList = tableColumn; // 如果是使用优化模式
  13593. if (fixedType) {
  13594. if (scrollXLoad || scrollYLoad || (allColumnOverflow ? isAllOverflow : allColumnOverflow)) {
  13595. if (!mergeList.length && !spanMethod && !(keyboardConfig && keyboardOpts.isMerge)) {
  13596. _renderColumnList = fixedColumn;
  13597. } else {
  13598. _renderColumnList = visibleColumn;
  13599. }
  13600. } else {
  13601. _renderColumnList = visibleColumn;
  13602. }
  13603. }
  13604. _tWidth = _renderColumnList.reduce(function (previous, column) {
  13605. return previous + column.renderWidth;
  13606. }, 0);
  13607. if (tableElem) {
  13608. tableElem.style.width = _tWidth ? "".concat(_tWidth, "px") : ''; // 兼容性处理
  13609. tableElem.style.paddingRight = scrollbarWidth && fixedType && (browse['-moz'] || browse.safari) ? "".concat(scrollbarWidth, "px") : '';
  13610. }
  13611. if (emptyBlockElem) {
  13612. emptyBlockElem.style.width = _tWidth ? "".concat(_tWidth, "px") : '';
  13613. }
  13614. } else if (layout === 'footer') {
  13615. var _tWidth2 = tableWidth;
  13616. var _renderColumnList2 = tableColumn; // 如果是使用优化模式
  13617. if (fixedType) {
  13618. if (scrollXLoad || allColumnFooterOverflow) {
  13619. if (!mergeFooterList.length || !footerSpanMethod) {
  13620. _renderColumnList2 = fixedColumn;
  13621. } else {
  13622. _renderColumnList2 = visibleColumn;
  13623. }
  13624. } else {
  13625. _renderColumnList2 = visibleColumn;
  13626. }
  13627. }
  13628. _tWidth2 = _renderColumnList2.reduce(function (previous, column) {
  13629. return previous + column.renderWidth;
  13630. }, 0);
  13631. if (methods_isNodeElement(wrapperElem)) {
  13632. // 如果是固定列
  13633. if (fixedWrapperElem) {
  13634. wrapperElem.style.top = "".concat(customHeight > 0 ? customHeight - footerHeight : tableHeight + headerHeight, "px");
  13635. }
  13636. wrapperElem.style.marginTop = "".concat(-scrollbarHeight, "px");
  13637. }
  13638. if (tableElem) {
  13639. tableElem.style.width = _tWidth2 ? "".concat(_tWidth2 + scrollbarWidth, "px") : '';
  13640. }
  13641. }
  13642. var colgroupElem = elemStore["".concat(name, "-").concat(layout, "-colgroup")];
  13643. if (colgroupElem) {
  13644. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.arrayEach(colgroupElem.children, function (colElem) {
  13645. var colid = colElem.getAttribute('name');
  13646. if (colid === 'col_gutter') {
  13647. colElem.style.width = "".concat(scrollbarWidth, "px");
  13648. }
  13649. if (fullColumnIdData[colid]) {
  13650. var column = fullColumnIdData[colid].column;
  13651. var showHeaderOverflow = column.showHeaderOverflow,
  13652. showFooterOverflow = column.showFooterOverflow,
  13653. showOverflow = column.showOverflow;
  13654. var cellOverflow;
  13655. colElem.style.width = "".concat(column.renderWidth, "px");
  13656. if (layout === 'header') {
  13657. 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;
  13658. } else if (layout === 'footer') {
  13659. 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;
  13660. } else {
  13661. 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;
  13662. }
  13663. var showEllipsis = cellOverflow === 'ellipsis';
  13664. var showTitle = cellOverflow === 'title';
  13665. var showTooltip = cellOverflow === true || cellOverflow === 'tooltip';
  13666. var hasEllipsis = showTitle || showTooltip || showEllipsis;
  13667. var _listElem = elemStore["".concat(name, "-").concat(layout, "-list")]; // 滚动的渲染不支持动态行高
  13668. if (layout === 'header' || layout === 'footer') {
  13669. if (scrollXLoad && !hasEllipsis) {
  13670. hasEllipsis = true;
  13671. }
  13672. } else {
  13673. if ((scrollXLoad || scrollYLoad) && !hasEllipsis) {
  13674. hasEllipsis = true;
  13675. }
  13676. }
  13677. if (_listElem) {
  13678. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.arrayEach(_listElem.querySelectorAll(".".concat(column.id)), function (elem) {
  13679. var colspan = parseInt(elem.getAttribute('colspan') || 1);
  13680. var cellElem = elem.querySelector('.vxe-cell');
  13681. var colWidth = column.renderWidth;
  13682. if (cellElem) {
  13683. if (colspan > 1) {
  13684. var columnIndex = _this25.getColumnIndex(column);
  13685. for (var _index = 1; _index < colspan; _index++) {
  13686. var nextColumn = _this25.getColumns(columnIndex + _index);
  13687. if (nextColumn) {
  13688. colWidth += nextColumn.renderWidth;
  13689. }
  13690. }
  13691. }
  13692. cellElem.style.width = hasEllipsis ? "".concat(colWidth - cellOffsetWidth * colspan, "px") : '';
  13693. }
  13694. });
  13695. }
  13696. }
  13697. });
  13698. }
  13699. });
  13700. });
  13701. if (currentRow) {
  13702. this.setCurrentRow(currentRow);
  13703. }
  13704. if (mouseConfig && mouseConfig.selected && editStore.selected.row && editStore.selected.column) {
  13705. this.addColSdCls();
  13706. }
  13707. return this.$nextTick();
  13708. },
  13709. /**
  13710. * 处理固定列的显示状态
  13711. */
  13712. checkScrolling: function checkScrolling() {
  13713. var _this$$refs = this.$refs,
  13714. tableBody = _this$$refs.tableBody,
  13715. leftContainer = _this$$refs.leftContainer,
  13716. rightContainer = _this$$refs.rightContainer;
  13717. var bodyElem = tableBody ? tableBody.$el : null;
  13718. if (bodyElem) {
  13719. if (leftContainer) {
  13720. dom[bodyElem.scrollLeft > 0 ? 'addClass' : 'removeClass'](leftContainer, 'scrolling--middle');
  13721. }
  13722. if (rightContainer) {
  13723. dom[bodyElem.clientWidth < bodyElem.scrollWidth - Math.ceil(bodyElem.scrollLeft) ? 'addClass' : 'removeClass'](rightContainer, 'scrolling--middle');
  13724. }
  13725. }
  13726. },
  13727. preventEvent: function preventEvent(evnt, type, args, next, end) {
  13728. var _this26 = this;
  13729. var evntList = v_x_e_table.interceptor.get(type);
  13730. var rest;
  13731. if (!evntList.some(function (func) {
  13732. return func(Object.assign({
  13733. $grid: _this26.$xegrid,
  13734. $table: _this26,
  13735. $event: evnt
  13736. }, args)) === false;
  13737. })) {
  13738. if (next) {
  13739. rest = next();
  13740. }
  13741. }
  13742. if (end) {
  13743. end();
  13744. }
  13745. return rest;
  13746. },
  13747. /**
  13748. * 全局按下事件处理
  13749. */
  13750. handleGlobalMousedownEvent: function handleGlobalMousedownEvent(evnt) {
  13751. var _this27 = this;
  13752. var $el = this.$el,
  13753. $refs = this.$refs,
  13754. $xegrid = this.$xegrid,
  13755. $toolbar = this.$toolbar,
  13756. mouseConfig = this.mouseConfig,
  13757. editStore = this.editStore,
  13758. ctxMenuStore = this.ctxMenuStore,
  13759. editOpts = this.editOpts,
  13760. filterStore = this.filterStore,
  13761. getRowNode = this.getRowNode;
  13762. var actived = editStore.actived;
  13763. var ctxWrapper = $refs.ctxWrapper,
  13764. filterWrapper = $refs.filterWrapper,
  13765. validTip = $refs.validTip;
  13766. if (filterWrapper) {
  13767. if (getEventTargetNode(evnt, $el, 'vxe-cell--filter').flag) {// 如果点击了筛选按钮
  13768. } else if (getEventTargetNode(evnt, filterWrapper.$el).flag) {// 如果点击筛选容器
  13769. } else {
  13770. if (!getEventTargetNode(evnt, document.body, 'vxe-table--ignore-clear').flag) {
  13771. this.preventEvent(evnt, 'event.clearFilter', filterStore.args, this.closeFilter);
  13772. }
  13773. }
  13774. } // 如果已激活了编辑状态
  13775. if (actived.row) {
  13776. if (!(editOpts.autoClear === false)) {
  13777. // 如果是激活状态,点击了单元格之外
  13778. var cell = actived.args.cell;
  13779. if (!cell || !getEventTargetNode(evnt, cell).flag) {
  13780. if (validTip && getEventTargetNode(evnt, validTip.$el).flag) {// 如果是激活状态,且点击了校验提示框
  13781. } else if (!this.lastCallTime || this.lastCallTime + 50 < Date.now()) {
  13782. if (!getEventTargetNode(evnt, document.body, 'vxe-table--ignore-clear').flag) {
  13783. // 如果手动调用了激活单元格,避免触发源被移除后导致重复关闭
  13784. this.preventEvent(evnt, 'event.clearActived', actived.args, function () {
  13785. var isClearActived;
  13786. if (editOpts.mode === 'row') {
  13787. var rowNode = getEventTargetNode(evnt, $el, 'vxe-body--row'); // row 方式,如果点击了不同行
  13788. isClearActived = rowNode.flag ? getRowNode(rowNode.targetElem).item !== actived.args.row : false;
  13789. } else {
  13790. // cell 方式,如果是非编辑列
  13791. isClearActived = !getEventTargetNode(evnt, $el, 'col--edit').flag;
  13792. } // 如果点击表头行,则清除激活状态
  13793. if (!isClearActived) {
  13794. isClearActived = getEventTargetNode(evnt, $el, 'vxe-header--row').flag;
  13795. } // 如果点击表尾行,则清除激活状态
  13796. if (!isClearActived) {
  13797. isClearActived = getEventTargetNode(evnt, $el, 'vxe-footer--row').flag;
  13798. } // 如果固定了高度且点击了行之外的空白处,则清除激活状态
  13799. if (!isClearActived && _this27.height && !_this27.overflowY) {
  13800. var bodyWrapperElem = evnt.target;
  13801. if (methods_hasClass(bodyWrapperElem, 'vxe-table--body-wrapper')) {
  13802. isClearActived = evnt.offsetY < bodyWrapperElem.clientHeight;
  13803. }
  13804. }
  13805. if (isClearActived || // 如果点击了当前表格之外
  13806. !getEventTargetNode(evnt, $el).flag) {
  13807. setTimeout(function () {
  13808. return _this27.clearEdit(evnt);
  13809. });
  13810. }
  13811. });
  13812. }
  13813. }
  13814. }
  13815. }
  13816. } else if (mouseConfig) {
  13817. if (!getEventTargetNode(evnt, $el).flag && !($xegrid && getEventTargetNode(evnt, $xegrid.$el).flag) && !(ctxWrapper && getEventTargetNode(evnt, ctxWrapper.$el).flag) && !($toolbar && getEventTargetNode(evnt, $toolbar.$el).flag)) {
  13818. this.clearSelected();
  13819. if (!getEventTargetNode(evnt, document.body, 'vxe-table--ignore-areas-clear').flag) {
  13820. this.preventEvent(evnt, 'event.clearAreas', {}, function () {
  13821. _this27.clearCellAreas();
  13822. _this27.clearCopyCellArea();
  13823. });
  13824. }
  13825. }
  13826. } // 如果配置了快捷菜单且,点击了其他地方则关闭
  13827. if (ctxMenuStore.visible && ctxWrapper && !getEventTargetNode(evnt, ctxWrapper.$el).flag) {
  13828. this.closeMenu();
  13829. } // 最后激活的表格
  13830. this.isActivated = getEventTargetNode(evnt, ($xegrid || this).$el).flag;
  13831. },
  13832. /**
  13833. * 窗口失焦事件处理
  13834. */
  13835. handleGlobalBlurEvent: function handleGlobalBlurEvent() {
  13836. this.closeFilter();
  13837. this.closeMenu();
  13838. },
  13839. /**
  13840. * 全局滚动事件
  13841. */
  13842. handleGlobalMousewheelEvent: function handleGlobalMousewheelEvent() {
  13843. this.closeTooltip();
  13844. this.closeMenu();
  13845. },
  13846. /**
  13847. * 表格键盘事件
  13848. */
  13849. keydownEvent: function keydownEvent(evnt) {
  13850. var _this28 = this;
  13851. var filterStore = this.filterStore,
  13852. ctxMenuStore = this.ctxMenuStore,
  13853. editStore = this.editStore,
  13854. keyboardConfig = this.keyboardConfig,
  13855. mouseConfig = this.mouseConfig,
  13856. mouseOpts = this.mouseOpts,
  13857. keyboardOpts = this.keyboardOpts;
  13858. var actived = editStore.actived;
  13859. var keyCode = evnt.keyCode;
  13860. var isEsc = keyCode === 27;
  13861. if (isEsc) {
  13862. this.preventEvent(evnt, 'event.keydown', null, function () {
  13863. _this28.emitEvent('keydown-start', {}, evnt);
  13864. if (keyboardConfig && mouseConfig && mouseOpts.area && _this28.handleKeyboardEvent) {
  13865. _this28.handleKeyboardEvent(evnt);
  13866. } else if (actived.row || filterStore.visible || ctxMenuStore.visible) {
  13867. evnt.stopPropagation(); // 如果按下了 Esc 键,关闭快捷菜单、筛选
  13868. _this28.closeFilter();
  13869. _this28.closeMenu();
  13870. if (keyboardConfig && keyboardOpts.isEsc) {
  13871. // 如果是激活编辑状态,则取消编辑
  13872. if (actived.row) {
  13873. var params = actived.args;
  13874. _this28.clearEdit(evnt); // 如果配置了选中功能,则为选中状态
  13875. if (mouseConfig && mouseOpts.selected) {
  13876. _this28.$nextTick(function () {
  13877. return _this28.handleSelected(params, evnt);
  13878. });
  13879. }
  13880. }
  13881. }
  13882. }
  13883. _this28.emitEvent('keydown', {}, evnt);
  13884. _this28.emitEvent('keydown-end', {}, evnt);
  13885. });
  13886. }
  13887. },
  13888. /**
  13889. * 全局键盘事件
  13890. */
  13891. handleGlobalKeydownEvent: function handleGlobalKeydownEvent(evnt) {
  13892. var _this29 = this;
  13893. // 该行为只对当前激活的表格有效
  13894. if (this.isActivated) {
  13895. this.preventEvent(evnt, 'event.keydown', null, function () {
  13896. var filterStore = _this29.filterStore,
  13897. isCtxMenu = _this29.isCtxMenu,
  13898. ctxMenuStore = _this29.ctxMenuStore,
  13899. editStore = _this29.editStore,
  13900. editOpts = _this29.editOpts,
  13901. editConfig = _this29.editConfig,
  13902. mouseConfig = _this29.mouseConfig,
  13903. mouseOpts = _this29.mouseOpts,
  13904. keyboardConfig = _this29.keyboardConfig,
  13905. keyboardOpts = _this29.keyboardOpts,
  13906. treeConfig = _this29.treeConfig,
  13907. treeOpts = _this29.treeOpts,
  13908. highlightCurrentRow = _this29.highlightCurrentRow,
  13909. currentRow = _this29.currentRow,
  13910. bodyCtxMenu = _this29.bodyCtxMenu,
  13911. rowOpts = _this29.rowOpts;
  13912. var selected = editStore.selected,
  13913. actived = editStore.actived;
  13914. var keyCode = evnt.keyCode;
  13915. var isBack = keyCode === 8;
  13916. var isTab = keyCode === 9;
  13917. var isEnter = keyCode === 13;
  13918. var isEsc = keyCode === 27;
  13919. var isSpacebar = keyCode === 32;
  13920. var isLeftArrow = keyCode === 37;
  13921. var isUpArrow = keyCode === 38;
  13922. var isRightArrow = keyCode === 39;
  13923. var isDwArrow = keyCode === 40;
  13924. var isDel = keyCode === 46;
  13925. var isF2 = keyCode === 113;
  13926. var isContextMenu = keyCode === 93;
  13927. var hasMetaKey = evnt.metaKey;
  13928. var hasCtrlKey = evnt.ctrlKey;
  13929. var hasShiftKey = evnt.shiftKey;
  13930. var hasAltKey = evnt.altKey;
  13931. var operArrow = isLeftArrow || isUpArrow || isRightArrow || isDwArrow;
  13932. var operCtxMenu = isCtxMenu && ctxMenuStore.visible && (isEnter || isSpacebar || operArrow);
  13933. var isEditStatus = isEnableConf(editConfig) && actived.column && actived.row;
  13934. var params;
  13935. if (filterStore.visible) {
  13936. if (isEsc) {
  13937. _this29.closeFilter();
  13938. }
  13939. return;
  13940. }
  13941. if (operCtxMenu) {
  13942. // 如果配置了右键菜单; 支持方向键操作、回车
  13943. evnt.preventDefault();
  13944. if (ctxMenuStore.showChild && hasChildrenList(ctxMenuStore.selected)) {
  13945. _this29.moveCtxMenu(evnt, keyCode, ctxMenuStore, 'selectChild', 37, false, ctxMenuStore.selected.children);
  13946. } else {
  13947. _this29.moveCtxMenu(evnt, keyCode, ctxMenuStore, 'selected', 39, true, _this29.ctxMenuList);
  13948. }
  13949. } else if (keyboardConfig && mouseConfig && mouseOpts.area && _this29.handleKeyboardEvent) {
  13950. _this29.handleKeyboardEvent(evnt);
  13951. } else if (keyboardConfig && isSpacebar && keyboardOpts.isChecked && selected.row && selected.column && (selected.column.type === 'checkbox' || selected.column.type === 'radio')) {
  13952. // 空格键支持选中复选框
  13953. evnt.preventDefault();
  13954. if (selected.column.type === 'checkbox') {
  13955. _this29.handleToggleCheckRowEvent(evnt, selected.args);
  13956. } else {
  13957. _this29.triggerRadioRowEvent(evnt, selected.args);
  13958. }
  13959. } else if (isF2 && isEnableConf(editConfig)) {
  13960. if (!isEditStatus) {
  13961. // 如果按下了 F2 键
  13962. if (selected.row && selected.column) {
  13963. evnt.stopPropagation();
  13964. evnt.preventDefault();
  13965. _this29.handleActived(selected.args, evnt);
  13966. }
  13967. }
  13968. } else if (isContextMenu) {
  13969. // 如果按下上下文键
  13970. _this29._keyCtx = selected.row && selected.column && bodyCtxMenu.length;
  13971. clearTimeout(_this29.keyCtxTimeout);
  13972. _this29.keyCtxTimeout = setTimeout(function () {
  13973. _this29._keyCtx = false;
  13974. }, 1000);
  13975. } else if (isEnter && !hasAltKey && keyboardConfig && keyboardOpts.isEnter && (selected.row || actived.row || treeConfig && (rowOpts.isCurrent || highlightCurrentRow) && currentRow)) {
  13976. // 退出选中
  13977. if (hasCtrlKey) {
  13978. // 如果是激活编辑状态,则取消编辑
  13979. if (actived.row) {
  13980. params = actived.args;
  13981. _this29.clearEdit(evnt); // 如果配置了选中功能,则为选中状态
  13982. if (mouseConfig && mouseOpts.selected) {
  13983. _this29.$nextTick(function () {
  13984. return _this29.handleSelected(params, evnt);
  13985. });
  13986. }
  13987. }
  13988. } else {
  13989. // 如果是激活状态,退则出到上一行/下一行
  13990. if (selected.row || actived.row) {
  13991. var targetArgs = selected.row ? selected.args : actived.args;
  13992. if (hasShiftKey) {
  13993. if (keyboardOpts.enterToTab) {
  13994. _this29.moveTabSelected(targetArgs, hasShiftKey, evnt);
  13995. } else {
  13996. _this29.moveSelected(targetArgs, isLeftArrow, true, isRightArrow, false, evnt);
  13997. }
  13998. } else {
  13999. if (keyboardOpts.enterToTab) {
  14000. _this29.moveTabSelected(targetArgs, hasShiftKey, evnt);
  14001. } else {
  14002. _this29.moveSelected(targetArgs, isLeftArrow, false, isRightArrow, true, evnt);
  14003. }
  14004. }
  14005. } else if (treeConfig && (rowOpts.isCurrent || highlightCurrentRow) && currentRow) {
  14006. // 如果是树形表格当前行回车移动到子节点
  14007. var childrens = currentRow[treeOpts.children];
  14008. if (childrens && childrens.length) {
  14009. evnt.preventDefault();
  14010. var targetRow = childrens[0];
  14011. params = {
  14012. $table: _this29,
  14013. row: targetRow
  14014. };
  14015. _this29.setTreeExpand(currentRow, true).then(function () {
  14016. return _this29.scrollToRow(targetRow);
  14017. }).then(function () {
  14018. return _this29.triggerCurrentRowEvent(evnt, params);
  14019. });
  14020. }
  14021. }
  14022. }
  14023. } else if (operArrow && keyboardConfig && keyboardOpts.isArrow) {
  14024. if (!isEditStatus) {
  14025. // 如果按下了方向键
  14026. if (selected.row && selected.column) {
  14027. _this29.moveSelected(selected.args, isLeftArrow, isUpArrow, isRightArrow, isDwArrow, evnt);
  14028. } else if ((isUpArrow || isDwArrow) && (rowOpts.isCurrent || highlightCurrentRow)) {
  14029. // 当前行按键上下移动
  14030. _this29.moveCurrentRow(isUpArrow, isDwArrow, evnt);
  14031. }
  14032. }
  14033. } else if (isTab && keyboardConfig && keyboardOpts.isTab) {
  14034. // 如果按下了 Tab 键切换
  14035. if (selected.row || selected.column) {
  14036. _this29.moveTabSelected(selected.args, hasShiftKey, evnt);
  14037. } else if (actived.row || actived.column) {
  14038. _this29.moveTabSelected(actived.args, hasShiftKey, evnt);
  14039. }
  14040. } else if (keyboardConfig && (isDel || (treeConfig && (rowOpts.isCurrent || highlightCurrentRow) && currentRow ? isBack && keyboardOpts.isArrow : isBack))) {
  14041. if (!isEditStatus) {
  14042. var delMethod = keyboardOpts.delMethod,
  14043. backMethod = keyboardOpts.backMethod; // 如果是删除键
  14044. if (keyboardOpts.isDel && (selected.row || selected.column)) {
  14045. if (delMethod) {
  14046. delMethod({
  14047. row: selected.row,
  14048. rowIndex: _this29.getRowIndex(selected.row),
  14049. column: selected.column,
  14050. columnIndex: _this29.getColumnIndex(selected.column),
  14051. $table: _this29
  14052. });
  14053. } else {
  14054. methods_setCellValue(selected.row, selected.column, null);
  14055. }
  14056. if (isBack) {
  14057. if (backMethod) {
  14058. backMethod({
  14059. row: selected.row,
  14060. rowIndex: _this29.getRowIndex(selected.row),
  14061. column: selected.column,
  14062. columnIndex: _this29.getColumnIndex(selected.column),
  14063. $table: _this29
  14064. });
  14065. } else {
  14066. _this29.handleActived(selected.args, evnt);
  14067. }
  14068. } else if (isDel) {
  14069. // 如果按下 del 键,更新表尾数据
  14070. _this29.updateFooter();
  14071. }
  14072. } else if (isBack && keyboardOpts.isArrow && treeConfig && (rowOpts.isCurrent || highlightCurrentRow) && currentRow) {
  14073. // 如果树形表格回退键关闭当前行返回父节点
  14074. var _XEUtils$findTree = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.findTree(_this29.afterFullData, function (item) {
  14075. return item === currentRow;
  14076. }, treeOpts),
  14077. parentRow = _XEUtils$findTree.parent;
  14078. if (parentRow) {
  14079. evnt.preventDefault();
  14080. params = {
  14081. $table: _this29,
  14082. row: parentRow
  14083. };
  14084. _this29.setTreeExpand(parentRow, false).then(function () {
  14085. return _this29.scrollToRow(parentRow);
  14086. }).then(function () {
  14087. return _this29.triggerCurrentRowEvent(evnt, params);
  14088. });
  14089. }
  14090. }
  14091. }
  14092. } 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)) {
  14093. var editMethod = keyboardOpts.editMethod; // 启用编辑后,空格键功能将失效
  14094. // if (isSpacebar) {
  14095. // evnt.preventDefault()
  14096. // }
  14097. // 如果是按下非功能键之外允许直接编辑
  14098. if (selected.column && selected.row && isEnableConf(selected.column.editRender)) {
  14099. var beforeEditMethod = editOpts.beforeEditMethod || editOpts.activeMethod;
  14100. if (!beforeEditMethod || beforeEditMethod(_objectSpread2(_objectSpread2({}, selected.args), {}, {
  14101. $table: _this29
  14102. }))) {
  14103. if (editMethod) {
  14104. editMethod({
  14105. row: selected.row,
  14106. rowIndex: _this29.getRowIndex(selected.row),
  14107. column: selected.column,
  14108. columnIndex: _this29.getColumnIndex(selected.column),
  14109. $table: _this29
  14110. });
  14111. } else {
  14112. methods_setCellValue(selected.row, selected.column, null);
  14113. _this29.handleActived(selected.args, evnt);
  14114. }
  14115. }
  14116. }
  14117. }
  14118. _this29.emitEvent('keydown', {}, evnt);
  14119. });
  14120. }
  14121. },
  14122. handleGlobalPasteEvent: function handleGlobalPasteEvent(evnt) {
  14123. var isActivated = this.isActivated,
  14124. keyboardConfig = this.keyboardConfig,
  14125. keyboardOpts = this.keyboardOpts,
  14126. mouseConfig = this.mouseConfig,
  14127. mouseOpts = this.mouseOpts,
  14128. editStore = this.editStore,
  14129. filterStore = this.filterStore;
  14130. var actived = editStore.actived;
  14131. if (isActivated && !filterStore.visible) {
  14132. if (!(actived.row || actived.column)) {
  14133. if (keyboardConfig && keyboardOpts.isClip && mouseConfig && mouseOpts.area && this.handlePasteCellAreaEvent) {
  14134. this.handlePasteCellAreaEvent(evnt);
  14135. }
  14136. }
  14137. this.emitEvent('paste', {}, evnt);
  14138. }
  14139. },
  14140. handleGlobalCopyEvent: function handleGlobalCopyEvent(evnt) {
  14141. var isActivated = this.isActivated,
  14142. keyboardConfig = this.keyboardConfig,
  14143. keyboardOpts = this.keyboardOpts,
  14144. mouseConfig = this.mouseConfig,
  14145. mouseOpts = this.mouseOpts,
  14146. editStore = this.editStore,
  14147. filterStore = this.filterStore;
  14148. var actived = editStore.actived;
  14149. if (isActivated && !filterStore.visible) {
  14150. if (!(actived.row || actived.column)) {
  14151. if (keyboardConfig && keyboardOpts.isClip && mouseConfig && mouseOpts.area && this.handleCopyCellAreaEvent) {
  14152. this.handleCopyCellAreaEvent(evnt);
  14153. }
  14154. }
  14155. this.emitEvent('copy', {}, evnt);
  14156. }
  14157. },
  14158. handleGlobalCutEvent: function handleGlobalCutEvent(evnt) {
  14159. var isActivated = this.isActivated,
  14160. keyboardConfig = this.keyboardConfig,
  14161. keyboardOpts = this.keyboardOpts,
  14162. mouseConfig = this.mouseConfig,
  14163. mouseOpts = this.mouseOpts,
  14164. editStore = this.editStore,
  14165. filterStore = this.filterStore;
  14166. var actived = editStore.actived;
  14167. if (isActivated && !filterStore.visible) {
  14168. if (!(actived.row || actived.column)) {
  14169. if (keyboardConfig && keyboardOpts.isClip && mouseConfig && mouseOpts.area && this.handleCutCellAreaEvent) {
  14170. this.handleCutCellAreaEvent(evnt);
  14171. }
  14172. }
  14173. this.emitEvent('cut', {}, evnt);
  14174. }
  14175. },
  14176. handleGlobalResizeEvent: function handleGlobalResizeEvent() {
  14177. this.closeMenu();
  14178. this.updateCellAreas();
  14179. this.recalculate(true);
  14180. },
  14181. handleTargetEnterEvent: function handleTargetEnterEvent(isClear) {
  14182. var $tooltip = this.$refs.tooltip;
  14183. clearTimeout(this.tooltipTimeout);
  14184. if (isClear) {
  14185. this.closeTooltip();
  14186. } else {
  14187. if ($tooltip) {
  14188. $tooltip.setActived(true);
  14189. }
  14190. }
  14191. },
  14192. handleTargetLeaveEvent: function handleTargetLeaveEvent() {
  14193. var _this30 = this;
  14194. var tooltipOpts = this.tooltipOpts;
  14195. var $tooltip = this.$refs.tooltip;
  14196. if ($tooltip) {
  14197. $tooltip.setActived(false);
  14198. }
  14199. if (tooltipOpts.enterable) {
  14200. this.tooltipTimeout = setTimeout(function () {
  14201. $tooltip = _this30.$refs.tooltip;
  14202. if ($tooltip && !$tooltip.isActived()) {
  14203. _this30.closeTooltip();
  14204. }
  14205. }, tooltipOpts.leaveDelay);
  14206. } else {
  14207. this.closeTooltip();
  14208. }
  14209. },
  14210. triggerHeaderHelpEvent: function triggerHeaderHelpEvent(evnt, params) {
  14211. var column = params.column;
  14212. var titlePrefix = column.titlePrefix || column.titleHelp;
  14213. if (titlePrefix.content || titlePrefix.message) {
  14214. var $refs = this.$refs,
  14215. tooltipStore = this.tooltipStore;
  14216. var content = getFuncText(titlePrefix.content || titlePrefix.message);
  14217. this.handleTargetEnterEvent(true);
  14218. tooltipStore.visible = true;
  14219. tooltipStore.currOpts = _objectSpread2(_objectSpread2({}, titlePrefix), {}, {
  14220. content: null
  14221. });
  14222. this.$nextTick(function () {
  14223. var $tooltip = $refs.tooltip;
  14224. if ($tooltip) {
  14225. $tooltip.open(evnt.currentTarget, content);
  14226. }
  14227. });
  14228. }
  14229. },
  14230. /**
  14231. * 触发表头 tooltip 事件
  14232. */
  14233. triggerHeaderTooltipEvent: function triggerHeaderTooltipEvent(evnt, params) {
  14234. var tooltipStore = this.tooltipStore;
  14235. var column = params.column;
  14236. var titleElem = evnt.currentTarget;
  14237. this.handleTargetEnterEvent(tooltipStore.column !== column || tooltipStore.row);
  14238. if (tooltipStore.column !== column || !tooltipStore.visible) {
  14239. this.handleTooltip(evnt, titleElem, titleElem, null, params);
  14240. }
  14241. },
  14242. /**
  14243. * 触发单元格 tooltip 事件
  14244. */
  14245. triggerBodyTooltipEvent: function triggerBodyTooltipEvent(evnt, params) {
  14246. var editConfig = this.editConfig,
  14247. editOpts = this.editOpts,
  14248. editStore = this.editStore,
  14249. tooltipStore = this.tooltipStore;
  14250. var actived = editStore.actived;
  14251. var row = params.row,
  14252. column = params.column;
  14253. var cell = evnt.currentTarget;
  14254. this.handleTargetEnterEvent(tooltipStore.column !== column || tooltipStore.row !== row);
  14255. if (isEnableConf(editConfig)) {
  14256. if (editOpts.mode === 'row' && actived.row === row || actived.row === row && actived.column === column) {
  14257. return;
  14258. }
  14259. }
  14260. if (tooltipStore.column !== column || tooltipStore.row !== row || !tooltipStore.visible) {
  14261. var overflowElem;
  14262. var tipElem;
  14263. if (column.treeNode) {
  14264. overflowElem = cell.querySelector('.vxe-tree-cell');
  14265. if (column.type === 'html') {
  14266. tipElem = cell.querySelector('.vxe-cell--html');
  14267. }
  14268. } else {
  14269. tipElem = cell.querySelector(column.type === 'html' ? '.vxe-cell--html' : '.vxe-cell--label');
  14270. }
  14271. this.handleTooltip(evnt, cell, overflowElem || cell.children[0], tipElem, params);
  14272. }
  14273. },
  14274. /**
  14275. * 触发表尾 tooltip 事件
  14276. */
  14277. triggerFooterTooltipEvent: function triggerFooterTooltipEvent(evnt, params) {
  14278. var column = params.column;
  14279. var tooltipStore = this.tooltipStore;
  14280. var cell = evnt.currentTarget;
  14281. this.handleTargetEnterEvent(true);
  14282. if (tooltipStore.column !== column || !tooltipStore.visible) {
  14283. this.handleTooltip(evnt, cell, cell.querySelector('.vxe-cell--item') || cell.children[0], null, params);
  14284. }
  14285. },
  14286. /**
  14287. * 处理显示 tooltip
  14288. * @param {Event} evnt 事件
  14289. * @param {ColumnInfo} column 列配置
  14290. * @param {Row} row 行对象
  14291. */
  14292. handleTooltip: function handleTooltip(evnt, cell, overflowElem, tipElem, params) {
  14293. params.cell = cell;
  14294. var $refs = this.$refs,
  14295. tooltipOpts = this.tooltipOpts,
  14296. tooltipStore = this.tooltipStore;
  14297. var column = params.column,
  14298. row = params.row;
  14299. var showAll = tooltipOpts.showAll,
  14300. enabled = tooltipOpts.enabled,
  14301. contentMethod = tooltipOpts.contentMethod;
  14302. var customContent = contentMethod ? contentMethod(params) : null;
  14303. var useCustom = contentMethod && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eqNull(customContent);
  14304. var content = useCustom ? customContent : (column.type === 'html' ? overflowElem.innerText : overflowElem.textContent).trim();
  14305. var isCellOverflow = overflowElem.scrollWidth > overflowElem.clientWidth;
  14306. if (content && (showAll || enabled || useCustom || isCellOverflow)) {
  14307. Object.assign(tooltipStore, {
  14308. row: row,
  14309. column: column,
  14310. visible: true,
  14311. currOpts: null
  14312. });
  14313. this.$nextTick(function () {
  14314. var $tooltip = $refs.tooltip;
  14315. if ($tooltip) {
  14316. $tooltip.open(isCellOverflow ? overflowElem : tipElem || overflowElem, utils.formatText(content));
  14317. }
  14318. });
  14319. }
  14320. return this.$nextTick();
  14321. },
  14322. openTooltip: function openTooltip(target, content) {
  14323. var $refs = this.$refs;
  14324. var commTip = $refs.commTip;
  14325. if (commTip) {
  14326. return commTip.open(target, content);
  14327. }
  14328. return this.$nextTick();
  14329. },
  14330. /**
  14331. * 关闭 tooltip
  14332. */
  14333. closeTooltip: function closeTooltip() {
  14334. var $refs = this.$refs,
  14335. tooltipStore = this.tooltipStore;
  14336. var tooltip = $refs.tooltip;
  14337. var commTip = $refs.commTip;
  14338. if (tooltipStore.visible) {
  14339. Object.assign(tooltipStore, {
  14340. row: null,
  14341. column: null,
  14342. content: null,
  14343. visible: false,
  14344. currOpts: null
  14345. });
  14346. if (tooltip) {
  14347. tooltip.close();
  14348. }
  14349. }
  14350. if (commTip) {
  14351. commTip.close();
  14352. }
  14353. return this.$nextTick();
  14354. },
  14355. /**
  14356. * 判断列头复选框是否被选中
  14357. */
  14358. isAllCheckboxChecked: function isAllCheckboxChecked() {
  14359. return this.isAllSelected;
  14360. },
  14361. /**
  14362. * 判断列头复选框是否被半选
  14363. */
  14364. isAllCheckboxIndeterminate: function isAllCheckboxIndeterminate() {
  14365. return !this.isAllSelected && this.isIndeterminate;
  14366. },
  14367. isCheckboxIndeterminate: function isCheckboxIndeterminate() {
  14368. warnLog('vxe.error.delFunc', ['isCheckboxIndeterminate', 'isAllCheckboxIndeterminate']);
  14369. return this.isAllCheckboxIndeterminate();
  14370. },
  14371. /**
  14372. * 获取复选框半选状态的行数据
  14373. */
  14374. getCheckboxIndeterminateRecords: function getCheckboxIndeterminateRecords(isFull) {
  14375. var _this31 = this;
  14376. var treeConfig = this.treeConfig,
  14377. treeIndeterminates = this.treeIndeterminates,
  14378. afterFullData = this.afterFullData;
  14379. if (treeConfig) {
  14380. return isFull ? treeIndeterminates.slice(0) : treeIndeterminates.filter(function (row) {
  14381. return _this31.findRowIndexOf(afterFullData, row) > -1;
  14382. });
  14383. }
  14384. return [];
  14385. },
  14386. /**
  14387. * 处理默认勾选
  14388. */
  14389. handleDefaultSelectionChecked: function handleDefaultSelectionChecked() {
  14390. var fullDataRowIdData = this.fullDataRowIdData,
  14391. checkboxOpts = this.checkboxOpts;
  14392. var checkAll = checkboxOpts.checkAll,
  14393. checkRowKeys = checkboxOpts.checkRowKeys;
  14394. if (checkAll) {
  14395. this.setAllCheckboxRow(true);
  14396. } else if (checkRowKeys) {
  14397. var defSelection = [];
  14398. checkRowKeys.forEach(function (rowid) {
  14399. if (fullDataRowIdData[rowid]) {
  14400. defSelection.push(fullDataRowIdData[rowid].row);
  14401. }
  14402. });
  14403. this.setCheckboxRow(defSelection, true);
  14404. }
  14405. },
  14406. /**
  14407. * 用于多选行,设置行为选中状态,第二个参数为选中与否
  14408. * @param {Array/Row} rows 行数据
  14409. * @param {Boolean} value 是否选中
  14410. */
  14411. setCheckboxRow: function setCheckboxRow(rows, value) {
  14412. var _this32 = this;
  14413. if (rows && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(rows)) {
  14414. rows = [rows];
  14415. }
  14416. rows.forEach(function (row) {
  14417. return _this32.handleSelectRow({
  14418. row: row
  14419. }, !!value);
  14420. });
  14421. return this.$nextTick();
  14422. },
  14423. isCheckedByCheckboxRow: function isCheckedByCheckboxRow(row) {
  14424. var selection = this.selection;
  14425. var checkField = this.checkboxOpts.checkField;
  14426. if (checkField) {
  14427. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, checkField);
  14428. }
  14429. return this.findRowIndexOf(selection, row) > -1;
  14430. },
  14431. isIndeterminateByCheckboxRow: function isIndeterminateByCheckboxRow(row) {
  14432. var treeIndeterminates = this.treeIndeterminates;
  14433. return this.findRowIndexOf(treeIndeterminates, row) > -1 && !this.isCheckedByCheckboxRow(row);
  14434. },
  14435. /**
  14436. * 多选,行选中事件
  14437. * value 选中true 不选false 半选-1
  14438. */
  14439. handleSelectRow: function handleSelectRow(_ref6, value) {
  14440. var _this33 = this;
  14441. var row = _ref6.row;
  14442. var selection = this.selection,
  14443. afterFullData = this.afterFullData,
  14444. treeConfig = this.treeConfig,
  14445. treeOpts = this.treeOpts,
  14446. treeIndeterminates = this.treeIndeterminates,
  14447. checkboxOpts = this.checkboxOpts;
  14448. var checkField = checkboxOpts.checkField,
  14449. checkStrictly = checkboxOpts.checkStrictly,
  14450. checkMethod = checkboxOpts.checkMethod;
  14451. if (checkField) {
  14452. if (treeConfig && !checkStrictly) {
  14453. if (value === -1) {
  14454. if (this.findRowIndexOf(treeIndeterminates, row) === -1) {
  14455. treeIndeterminates.push(row);
  14456. }
  14457. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.set(row, checkField, false);
  14458. } else {
  14459. // 更新子节点状态
  14460. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree([row], function (item) {
  14461. if (_this33.eqRow(item, row) || !checkMethod || checkMethod({
  14462. row: item
  14463. })) {
  14464. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.set(item, checkField, value);
  14465. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.remove(treeIndeterminates, function (half) {
  14466. return _this33.eqRow(half, item);
  14467. });
  14468. _this33.handleCheckboxReserveRow(row, value);
  14469. }
  14470. }, treeOpts);
  14471. } // 如果存在父节点,更新父节点状态
  14472. var matchObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.findTree(afterFullData, function (item) {
  14473. return _this33.eqRow(item, row);
  14474. }, treeOpts);
  14475. if (matchObj && matchObj.parent) {
  14476. var parentStatus;
  14477. var vItems = checkMethod ? matchObj.items.filter(function (item) {
  14478. return checkMethod({
  14479. row: item
  14480. });
  14481. }) : matchObj.items;
  14482. var indeterminatesItem = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.find(matchObj.items, function (item) {
  14483. return _this33.findRowIndexOf(treeIndeterminates, item) > -1;
  14484. });
  14485. if (indeterminatesItem) {
  14486. parentStatus = -1;
  14487. } else {
  14488. var selectItems = matchObj.items.filter(function (item) {
  14489. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(item, checkField);
  14490. });
  14491. parentStatus = selectItems.filter(function (item) {
  14492. return _this33.findRowIndexOf(vItems, item) > -1;
  14493. }).length === vItems.length ? true : selectItems.length || value === -1 ? -1 : false;
  14494. }
  14495. return this.handleSelectRow({
  14496. row: matchObj.parent
  14497. }, parentStatus);
  14498. }
  14499. } else {
  14500. if (!checkMethod || checkMethod({
  14501. row: row
  14502. })) {
  14503. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.set(row, checkField, value);
  14504. this.handleCheckboxReserveRow(row, value);
  14505. }
  14506. }
  14507. } else {
  14508. if (treeConfig && !checkStrictly) {
  14509. if (value === -1) {
  14510. if (this.findRowIndexOf(treeIndeterminates, row) === -1) {
  14511. treeIndeterminates.push(row);
  14512. }
  14513. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.remove(selection, function (item) {
  14514. return _this33.eqRow(item, row);
  14515. });
  14516. } else {
  14517. // 更新子节点状态
  14518. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree([row], function (item) {
  14519. if (_this33.eqRow(item, row) || !checkMethod || checkMethod({
  14520. row: item
  14521. })) {
  14522. if (value) {
  14523. selection.push(item);
  14524. } else {
  14525. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.remove(selection, function (select) {
  14526. return _this33.eqRow(select, item);
  14527. });
  14528. }
  14529. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.remove(treeIndeterminates, function (half) {
  14530. return _this33.eqRow(half, item);
  14531. });
  14532. _this33.handleCheckboxReserveRow(row, value);
  14533. }
  14534. }, treeOpts);
  14535. } // 如果存在父节点,更新父节点状态
  14536. var _matchObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.findTree(afterFullData, function (item) {
  14537. return _this33.eqRow(item, row);
  14538. }, treeOpts);
  14539. if (_matchObj && _matchObj.parent) {
  14540. var _parentStatus;
  14541. var _vItems = checkMethod ? _matchObj.items.filter(function (item) {
  14542. return checkMethod({
  14543. row: item
  14544. });
  14545. }) : _matchObj.items;
  14546. var _indeterminatesItem = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.find(_matchObj.items, function (item) {
  14547. return _this33.findRowIndexOf(treeIndeterminates, item) > -1;
  14548. });
  14549. if (_indeterminatesItem) {
  14550. _parentStatus = -1;
  14551. } else {
  14552. var _selectItems = _matchObj.items.filter(function (item) {
  14553. return _this33.findRowIndexOf(selection, item) > -1;
  14554. });
  14555. _parentStatus = _selectItems.filter(function (item) {
  14556. return _this33.findRowIndexOf(_vItems, item) > -1;
  14557. }).length === _vItems.length ? true : _selectItems.length || value === -1 ? -1 : false;
  14558. }
  14559. return this.handleSelectRow({
  14560. row: _matchObj.parent
  14561. }, _parentStatus);
  14562. }
  14563. } else {
  14564. if (!checkMethod || checkMethod({
  14565. row: row
  14566. })) {
  14567. if (value) {
  14568. if (this.findRowIndexOf(selection, row) === -1) {
  14569. selection.push(row);
  14570. }
  14571. } else {
  14572. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.remove(selection, function (item) {
  14573. return _this33.eqRow(item, row);
  14574. });
  14575. }
  14576. this.handleCheckboxReserveRow(row, value);
  14577. }
  14578. }
  14579. }
  14580. this.checkSelectionStatus();
  14581. },
  14582. handleToggleCheckRowEvent: function handleToggleCheckRowEvent(evnt, params) {
  14583. var selection = this.selection,
  14584. checkboxOpts = this.checkboxOpts;
  14585. var checkField = checkboxOpts.checkField;
  14586. var row = params.row;
  14587. var value = checkField ? !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, checkField) : this.findRowIndexOf(selection, row) === -1;
  14588. if (evnt) {
  14589. this.triggerCheckRowEvent(evnt, params, value);
  14590. } else {
  14591. this.handleSelectRow(params, value);
  14592. }
  14593. },
  14594. triggerCheckRowEvent: function triggerCheckRowEvent(evnt, params, value) {
  14595. var checkMethod = this.checkboxOpts.checkMethod;
  14596. if (!checkMethod || checkMethod({
  14597. row: params.row
  14598. })) {
  14599. this.handleSelectRow(params, value);
  14600. this.emitEvent('checkbox-change', Object.assign({
  14601. records: this.getCheckboxRecords(),
  14602. reserves: this.getCheckboxReserveRecords(),
  14603. indeterminates: this.getCheckboxIndeterminateRecords(),
  14604. checked: value
  14605. }, params), evnt);
  14606. }
  14607. },
  14608. /**
  14609. * 多选,切换某一行的选中状态
  14610. */
  14611. toggleCheckboxRow: function toggleCheckboxRow(row) {
  14612. this.handleToggleCheckRowEvent(null, {
  14613. row: row
  14614. });
  14615. return this.$nextTick();
  14616. },
  14617. /**
  14618. * 用于多选行,设置所有行的选中状态
  14619. * @param {Boolean} value 是否选中
  14620. */
  14621. setAllCheckboxRow: function setAllCheckboxRow(value) {
  14622. var _this34 = this;
  14623. var afterFullData = this.afterFullData,
  14624. treeConfig = this.treeConfig,
  14625. treeOpts = this.treeOpts,
  14626. selection = this.selection,
  14627. checkboxReserveRowMap = this.checkboxReserveRowMap,
  14628. checkboxOpts = this.checkboxOpts;
  14629. var checkField = checkboxOpts.checkField,
  14630. reserve = checkboxOpts.reserve,
  14631. checkStrictly = checkboxOpts.checkStrictly,
  14632. checkMethod = checkboxOpts.checkMethod;
  14633. var selectRows = [];
  14634. var beforeSelection = treeConfig ? [] : selection.filter(function (row) {
  14635. return _this34.findRowIndexOf(afterFullData, row) === -1;
  14636. });
  14637. if (checkStrictly) {
  14638. this.isAllSelected = value;
  14639. } else {
  14640. /**
  14641. * 绑定属性方式(高性能,有污染)
  14642. * 必须在行数据存在对应的属性,否则将不响应
  14643. */
  14644. if (checkField) {
  14645. var checkValFn = function checkValFn(row) {
  14646. if (!checkMethod || checkMethod({
  14647. row: row
  14648. })) {
  14649. if (value) {
  14650. selectRows.push(row);
  14651. }
  14652. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.set(row, checkField, value);
  14653. }
  14654. }; // 如果存在选中方法
  14655. // 如果方法成立,则更新值,否则忽略该数据
  14656. if (treeConfig) {
  14657. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(afterFullData, checkValFn, treeOpts);
  14658. } else {
  14659. afterFullData.forEach(checkValFn);
  14660. }
  14661. } else {
  14662. /**
  14663. * 默认方式(低性能,无污染)
  14664. * 无需任何属性,直接绑定
  14665. */
  14666. if (treeConfig) {
  14667. if (value) {
  14668. /**
  14669. * 如果是树勾选
  14670. * 如果方法成立,则添加到临时集合中
  14671. */
  14672. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(afterFullData, function (row) {
  14673. if (!checkMethod || checkMethod({
  14674. row: row
  14675. })) {
  14676. selectRows.push(row);
  14677. }
  14678. }, treeOpts);
  14679. } else {
  14680. /**
  14681. * 如果是树取消
  14682. * 如果方法成立,则不添加到临时集合中
  14683. */
  14684. if (checkMethod) {
  14685. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(afterFullData, function (row) {
  14686. if (checkMethod({
  14687. row: row
  14688. }) ? 0 : _this34.findRowIndexOf(selection, row) > -1) {
  14689. selectRows.push(row);
  14690. }
  14691. }, treeOpts);
  14692. }
  14693. }
  14694. } else {
  14695. if (value) {
  14696. /**
  14697. * 如果是行勾选
  14698. * 如果存在选中方法且成立或者本身已勾选,则添加到临时集合中
  14699. * 如果不存在选中方法,则添加所有数据到临时集合中
  14700. */
  14701. if (checkMethod) {
  14702. selectRows = afterFullData.filter(function (row) {
  14703. return _this34.findRowIndexOf(selection, row) > -1 || checkMethod({
  14704. row: row
  14705. });
  14706. });
  14707. } else {
  14708. selectRows = afterFullData.slice(0);
  14709. }
  14710. } else {
  14711. /**
  14712. * 如果是行取消
  14713. * 如果方法成立,则不添加到临时集合中;如果方法不成立则判断当前是否已勾选,如果已被勾选则添加到新集合中
  14714. * 如果不存在选中方法,无需处理,临时集合默认为空
  14715. */
  14716. if (checkMethod) {
  14717. selectRows = afterFullData.filter(function (row) {
  14718. return checkMethod({
  14719. row: row
  14720. }) ? 0 : _this34.findRowIndexOf(selection, row) > -1;
  14721. });
  14722. }
  14723. }
  14724. }
  14725. }
  14726. if (reserve) {
  14727. if (value) {
  14728. selectRows.forEach(function (row) {
  14729. checkboxReserveRowMap[getRowid(_this34, row)] = row;
  14730. });
  14731. } else {
  14732. afterFullData.forEach(function (row) {
  14733. return _this34.handleCheckboxReserveRow(row, false);
  14734. });
  14735. }
  14736. }
  14737. this.selection = checkField ? [] : beforeSelection.concat(selectRows);
  14738. }
  14739. this.treeIndeterminates = [];
  14740. this.checkSelectionStatus();
  14741. },
  14742. checkSelectionStatus: function checkSelectionStatus() {
  14743. var _this35 = this;
  14744. var afterFullData = this.afterFullData,
  14745. selection = this.selection,
  14746. treeIndeterminates = this.treeIndeterminates,
  14747. checkboxOpts = this.checkboxOpts,
  14748. treeConfig = this.treeConfig;
  14749. var checkField = checkboxOpts.checkField,
  14750. halfField = checkboxOpts.halfField,
  14751. checkStrictly = checkboxOpts.checkStrictly,
  14752. checkMethod = checkboxOpts.checkMethod;
  14753. if (!checkStrictly) {
  14754. var disableRows = [];
  14755. var checkRows = [];
  14756. var isAllResolve = false;
  14757. var isAllSelected = false;
  14758. var isIndeterminate = false;
  14759. if (checkField) {
  14760. isAllResolve = afterFullData.every(checkMethod ? function (row) {
  14761. if (!checkMethod({
  14762. row: row
  14763. })) {
  14764. disableRows.push(row);
  14765. return true;
  14766. }
  14767. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, checkField)) {
  14768. checkRows.push(row);
  14769. return true;
  14770. }
  14771. return false;
  14772. } : function (row) {
  14773. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, checkField);
  14774. });
  14775. isAllSelected = isAllResolve && afterFullData.length !== disableRows.length;
  14776. if (treeConfig) {
  14777. if (halfField) {
  14778. isIndeterminate = !isAllSelected && afterFullData.some(function (row) {
  14779. 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) || _this35.findRowIndexOf(treeIndeterminates, row) > -1;
  14780. });
  14781. } else {
  14782. isIndeterminate = !isAllSelected && afterFullData.some(function (row) {
  14783. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, checkField) || _this35.findRowIndexOf(treeIndeterminates, row) > -1;
  14784. });
  14785. }
  14786. } else {
  14787. if (halfField) {
  14788. isIndeterminate = !isAllSelected && afterFullData.some(function (row) {
  14789. 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);
  14790. });
  14791. } else {
  14792. isIndeterminate = !isAllSelected && afterFullData.some(function (row) {
  14793. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, checkField);
  14794. });
  14795. }
  14796. }
  14797. } else {
  14798. isAllResolve = afterFullData.every(checkMethod ? function (row) {
  14799. if (!checkMethod({
  14800. row: row
  14801. })) {
  14802. disableRows.push(row);
  14803. return true;
  14804. }
  14805. if (_this35.findRowIndexOf(selection, row) > -1) {
  14806. checkRows.push(row);
  14807. return true;
  14808. }
  14809. return false;
  14810. } : function (row) {
  14811. return _this35.findRowIndexOf(selection, row) > -1;
  14812. });
  14813. isAllSelected = isAllResolve && afterFullData.length !== disableRows.length;
  14814. if (treeConfig) {
  14815. isIndeterminate = !isAllSelected && afterFullData.some(function (row) {
  14816. return _this35.findRowIndexOf(treeIndeterminates, row) > -1 || _this35.findRowIndexOf(selection, row) > -1;
  14817. });
  14818. } else {
  14819. isIndeterminate = !isAllSelected && afterFullData.some(function (row) {
  14820. return _this35.findRowIndexOf(selection, row) > -1;
  14821. });
  14822. }
  14823. }
  14824. this.isAllSelected = isAllSelected;
  14825. this.isIndeterminate = isIndeterminate;
  14826. }
  14827. },
  14828. // 还原展开、选中等相关状态
  14829. handleReserveStatus: function handleReserveStatus() {
  14830. var expandColumn = this.expandColumn,
  14831. treeOpts = this.treeOpts,
  14832. treeConfig = this.treeConfig,
  14833. fullDataRowIdData = this.fullDataRowIdData,
  14834. fullAllDataRowMap = this.fullAllDataRowMap,
  14835. currentRow = this.currentRow,
  14836. selectRow = this.selectRow,
  14837. radioReserveRow = this.radioReserveRow,
  14838. radioOpts = this.radioOpts,
  14839. checkboxOpts = this.checkboxOpts,
  14840. selection = this.selection,
  14841. rowExpandeds = this.rowExpandeds,
  14842. treeExpandeds = this.treeExpandeds,
  14843. expandOpts = this.expandOpts; // 单选框
  14844. if (selectRow && !fullAllDataRowMap.has(selectRow)) {
  14845. this.selectRow = null; // 刷新单选行状态
  14846. } // 还原保留选中状态
  14847. if (radioOpts.reserve && radioReserveRow) {
  14848. var rowid = getRowid(this, radioReserveRow);
  14849. if (fullDataRowIdData[rowid]) {
  14850. this.setRadioRow(fullDataRowIdData[rowid].row);
  14851. }
  14852. } // 复选框
  14853. this.selection = getRecoverRow(this, selection); // 刷新多选行状态
  14854. // 还原保留选中状态
  14855. if (checkboxOpts.reserve) {
  14856. this.setCheckboxRow(handleReserveRow(this, this.checkboxReserveRowMap), true);
  14857. }
  14858. if (currentRow && !fullAllDataRowMap.has(currentRow)) {
  14859. this.currentRow = null; // 刷新当前行状态
  14860. } // 行展开
  14861. this.rowExpandeds = expandColumn ? getRecoverRow(this, rowExpandeds) : []; // 刷新行展开状态
  14862. // 还原保留状态
  14863. if (expandColumn && expandOpts.reserve) {
  14864. this.setRowExpand(handleReserveRow(this, this.rowExpandedReserveRowMap), true);
  14865. } // 树展开
  14866. this.treeExpandeds = treeConfig ? getRecoverRow(this, treeExpandeds) : []; // 刷新树展开状态
  14867. if (treeConfig && treeOpts.reserve) {
  14868. this.setTreeExpand(handleReserveRow(this, this.treeExpandedReserveRowMap), true);
  14869. }
  14870. },
  14871. /**
  14872. * 获取单选框保留选中的行
  14873. */
  14874. getRadioReserveRecord: function getRadioReserveRecord(isFull) {
  14875. var fullDataRowIdData = this.fullDataRowIdData,
  14876. radioReserveRow = this.radioReserveRow,
  14877. radioOpts = this.radioOpts,
  14878. afterFullData = this.afterFullData,
  14879. treeConfig = this.treeConfig,
  14880. treeOpts = this.treeOpts;
  14881. if (radioOpts.reserve && radioReserveRow) {
  14882. var rowid = getRowid(this, radioReserveRow);
  14883. if (isFull) {
  14884. if (!fullDataRowIdData[rowid]) {
  14885. return radioReserveRow;
  14886. }
  14887. } else {
  14888. var rowkey = getRowkey(this);
  14889. if (treeConfig) {
  14890. var matchObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.findTree(afterFullData, function (row) {
  14891. return rowid === external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, rowkey);
  14892. }, treeOpts);
  14893. if (matchObj) {
  14894. return radioReserveRow;
  14895. }
  14896. } else {
  14897. if (!afterFullData.some(function (row) {
  14898. return rowid === external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, rowkey);
  14899. })) {
  14900. return radioReserveRow;
  14901. }
  14902. }
  14903. }
  14904. }
  14905. return null;
  14906. },
  14907. clearRadioReserve: function clearRadioReserve() {
  14908. this.radioReserveRow = null;
  14909. return this.$nextTick();
  14910. },
  14911. handleRadioReserveRow: function handleRadioReserveRow(row) {
  14912. var radioOpts = this.radioOpts;
  14913. if (radioOpts.reserve) {
  14914. this.radioReserveRow = row;
  14915. }
  14916. },
  14917. /**
  14918. * 获取复选框保留选中的行
  14919. */
  14920. getCheckboxReserveRecords: function getCheckboxReserveRecords(isFull) {
  14921. var _this36 = this;
  14922. var fullDataRowIdData = this.fullDataRowIdData,
  14923. afterFullData = this.afterFullData,
  14924. checkboxReserveRowMap = this.checkboxReserveRowMap,
  14925. checkboxOpts = this.checkboxOpts,
  14926. treeConfig = this.treeConfig,
  14927. treeOpts = this.treeOpts;
  14928. var reserveSelection = [];
  14929. if (checkboxOpts.reserve) {
  14930. var afterFullIdMaps = {};
  14931. if (treeConfig) {
  14932. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(afterFullData, function (row) {
  14933. afterFullIdMaps[getRowid(_this36, row)] = 1;
  14934. }, treeOpts);
  14935. } else {
  14936. afterFullData.forEach(function (row) {
  14937. afterFullIdMaps[getRowid(_this36, row)] = 1;
  14938. });
  14939. }
  14940. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.each(checkboxReserveRowMap, function (oldRow, oldRowid) {
  14941. if (oldRow) {
  14942. if (isFull) {
  14943. if (!fullDataRowIdData[oldRowid]) {
  14944. reserveSelection.push(oldRow);
  14945. }
  14946. } else {
  14947. if (!afterFullIdMaps[oldRowid]) {
  14948. reserveSelection.push(oldRow);
  14949. }
  14950. }
  14951. }
  14952. });
  14953. }
  14954. return reserveSelection;
  14955. },
  14956. clearCheckboxReserve: function clearCheckboxReserve() {
  14957. this.checkboxReserveRowMap = {};
  14958. return this.$nextTick();
  14959. },
  14960. handleCheckboxReserveRow: function handleCheckboxReserveRow(row, checked) {
  14961. var checkboxReserveRowMap = this.checkboxReserveRowMap,
  14962. checkboxOpts = this.checkboxOpts;
  14963. if (checkboxOpts.reserve) {
  14964. var rowid = getRowid(this, row);
  14965. if (checked) {
  14966. checkboxReserveRowMap[rowid] = row;
  14967. } else if (checkboxReserveRowMap[rowid]) {
  14968. delete checkboxReserveRowMap[rowid];
  14969. }
  14970. }
  14971. },
  14972. /**
  14973. * 多选,选中所有事件
  14974. */
  14975. triggerCheckAllEvent: function triggerCheckAllEvent(evnt, value) {
  14976. this.setAllCheckboxRow(value);
  14977. this.emitEvent('checkbox-all', {
  14978. records: this.getCheckboxRecords(),
  14979. reserves: this.getCheckboxReserveRecords(),
  14980. indeterminates: this.getCheckboxIndeterminateRecords(),
  14981. checked: value
  14982. }, evnt);
  14983. },
  14984. /**
  14985. * 多选,切换所有行的选中状态
  14986. */
  14987. toggleAllCheckboxRow: function toggleAllCheckboxRow() {
  14988. this.triggerCheckAllEvent(null, !this.isAllSelected);
  14989. return this.$nextTick();
  14990. },
  14991. /**
  14992. * 用于多选行,手动清空用户的选择
  14993. * 清空行为不管是否被禁用还是保留记录,都将彻底清空选中状态
  14994. */
  14995. clearCheckboxRow: function clearCheckboxRow() {
  14996. var _this37 = this;
  14997. var tableFullData = this.tableFullData,
  14998. treeConfig = this.treeConfig,
  14999. treeOpts = this.treeOpts,
  15000. checkboxOpts = this.checkboxOpts;
  15001. var checkField = checkboxOpts.checkField,
  15002. reserve = checkboxOpts.reserve;
  15003. if (checkField) {
  15004. if (treeConfig) {
  15005. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(tableFullData, function (item) {
  15006. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.set(item, checkField, false);
  15007. }, treeOpts);
  15008. } else {
  15009. tableFullData.forEach(function (item) {
  15010. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.set(item, checkField, false);
  15011. });
  15012. }
  15013. }
  15014. if (reserve) {
  15015. tableFullData.forEach(function (row) {
  15016. return _this37.handleCheckboxReserveRow(row, false);
  15017. });
  15018. }
  15019. this.isAllSelected = false;
  15020. this.isIndeterminate = false;
  15021. this.selection = [];
  15022. this.treeIndeterminates = [];
  15023. return this.$nextTick();
  15024. },
  15025. /**
  15026. * 处理单选框默认勾选
  15027. */
  15028. handleDefaultRadioChecked: function handleDefaultRadioChecked() {
  15029. var radioOpts = this.radioOpts,
  15030. fullDataRowIdData = this.fullDataRowIdData;
  15031. var rowid = radioOpts.checkRowKey,
  15032. reserve = radioOpts.reserve;
  15033. if (rowid) {
  15034. if (fullDataRowIdData[rowid]) {
  15035. this.setRadioRow(fullDataRowIdData[rowid].row);
  15036. }
  15037. if (reserve) {
  15038. var rowkey = getRowkey(this);
  15039. this.radioReserveRow = _defineProperty({}, rowkey, rowid);
  15040. }
  15041. }
  15042. },
  15043. /**
  15044. * 单选,行选中事件
  15045. */
  15046. triggerRadioRowEvent: function triggerRadioRowEvent(evnt, params) {
  15047. var oldValue = this.selectRow,
  15048. radioOpts = this.radioOpts;
  15049. var row = params.row;
  15050. var newValue = row;
  15051. var isChange = oldValue !== newValue;
  15052. if (isChange) {
  15053. this.setRadioRow(newValue);
  15054. } else if (!radioOpts.strict) {
  15055. isChange = oldValue === newValue;
  15056. if (isChange) {
  15057. newValue = null;
  15058. this.clearRadioRow();
  15059. }
  15060. }
  15061. if (isChange) {
  15062. this.emitEvent('radio-change', _objectSpread2({
  15063. oldValue: oldValue,
  15064. newValue: newValue
  15065. }, params), evnt);
  15066. }
  15067. },
  15068. triggerCurrentRowEvent: function triggerCurrentRowEvent(evnt, params) {
  15069. var oldValue = this.currentRow;
  15070. var newValue = params.row;
  15071. var isChange = oldValue !== newValue;
  15072. this.setCurrentRow(newValue);
  15073. if (isChange) {
  15074. this.emitEvent('current-change', _objectSpread2({
  15075. oldValue: oldValue,
  15076. newValue: newValue
  15077. }, params), evnt);
  15078. }
  15079. },
  15080. /**
  15081. * 用于当前行,设置某一行为高亮状态
  15082. * @param {Row} row 行对象
  15083. */
  15084. setCurrentRow: function setCurrentRow(row) {
  15085. var $el = this.$el,
  15086. rowOpts = this.rowOpts;
  15087. this.clearCurrentRow();
  15088. this.clearCurrentColumn();
  15089. this.currentRow = row;
  15090. if (rowOpts.isCurrent || this.highlightCurrentRow) {
  15091. if ($el) {
  15092. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.arrayEach($el.querySelectorAll("[rowid=\"".concat(getRowid(this, row), "\"]")), function (elem) {
  15093. return addClass(elem, 'row--current');
  15094. });
  15095. }
  15096. }
  15097. return this.$nextTick();
  15098. },
  15099. isCheckedByRadioRow: function isCheckedByRadioRow(row) {
  15100. return this.selectRow === row;
  15101. },
  15102. /**
  15103. * 用于单选行,设置某一行为选中状态
  15104. * @param {Row} row 行对象
  15105. */
  15106. setRadioRow: function setRadioRow(row) {
  15107. var radioOpts = this.radioOpts;
  15108. var checkMethod = radioOpts.checkMethod;
  15109. if (row && (!checkMethod || checkMethod({
  15110. row: row
  15111. }))) {
  15112. this.selectRow = row;
  15113. this.handleRadioReserveRow(row);
  15114. }
  15115. return this.$nextTick();
  15116. },
  15117. /**
  15118. * 用于当前行,手动清空当前高亮的状态
  15119. */
  15120. clearCurrentRow: function clearCurrentRow() {
  15121. var $el = this.$el;
  15122. this.currentRow = null;
  15123. this.hoverRow = null;
  15124. if ($el) {
  15125. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.arrayEach($el.querySelectorAll('.row--current'), function (elem) {
  15126. return methods_removeClass(elem, 'row--current');
  15127. });
  15128. }
  15129. return this.$nextTick();
  15130. },
  15131. /**
  15132. * 用于单选行,手动清空用户的选择
  15133. */
  15134. clearRadioRow: function clearRadioRow() {
  15135. this.selectRow = null;
  15136. return this.$nextTick();
  15137. },
  15138. /**
  15139. * 用于当前行,获取当前行的数据
  15140. */
  15141. getCurrentRecord: function getCurrentRecord() {
  15142. return this.rowOpts.isCurrent || this.highlightCurrentRow ? this.currentRow : null;
  15143. },
  15144. /**
  15145. * 用于单选行,获取当已选中的数据
  15146. */
  15147. getRadioRecord: function getRadioRecord(isFull) {
  15148. var treeConfig = this.treeConfig,
  15149. treeOpts = this.treeOpts,
  15150. selectRow = this.selectRow,
  15151. fullDataRowIdData = this.fullDataRowIdData,
  15152. afterFullData = this.afterFullData;
  15153. if (selectRow) {
  15154. var rowid = getRowid(this, selectRow);
  15155. if (isFull) {
  15156. if (!fullDataRowIdData[rowid]) {
  15157. return selectRow;
  15158. }
  15159. } else {
  15160. if (treeConfig) {
  15161. var rowkey = getRowkey(this);
  15162. var matchObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.findTree(afterFullData, function (row) {
  15163. return rowid === external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, rowkey);
  15164. }, treeOpts);
  15165. if (matchObj) {
  15166. return selectRow;
  15167. }
  15168. } else {
  15169. if (afterFullData.indexOf(selectRow) > -1) {
  15170. return selectRow;
  15171. }
  15172. }
  15173. }
  15174. }
  15175. return null;
  15176. },
  15177. /**
  15178. * 行 hover 事件
  15179. */
  15180. triggerHoverEvent: function triggerHoverEvent(evnt, _ref7) {
  15181. var row = _ref7.row;
  15182. this.setHoverRow(row);
  15183. },
  15184. setHoverRow: function setHoverRow(row) {
  15185. var $el = this.$el;
  15186. var rowid = getRowid(this, row);
  15187. this.clearHoverRow();
  15188. if ($el) {
  15189. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.arrayEach($el.querySelectorAll("[rowid=\"".concat(rowid, "\"]")), function (elem) {
  15190. return addClass(elem, 'row--hover');
  15191. });
  15192. }
  15193. this.hoverRow = row;
  15194. },
  15195. clearHoverRow: function clearHoverRow() {
  15196. var $el = this.$el;
  15197. if ($el) {
  15198. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.arrayEach($el.querySelectorAll('.vxe-body--row.row--hover'), function (elem) {
  15199. return methods_removeClass(elem, 'row--hover');
  15200. });
  15201. }
  15202. this.hoverRow = null;
  15203. },
  15204. triggerHeaderCellClickEvent: function triggerHeaderCellClickEvent(evnt, params) {
  15205. var _lastResizeTime = this._lastResizeTime,
  15206. sortOpts = this.sortOpts;
  15207. var column = params.column;
  15208. var cell = evnt.currentTarget;
  15209. var triggerResizable = _lastResizeTime && _lastResizeTime > Date.now() - 300;
  15210. var triggerSort = getEventTargetNode(evnt, cell, 'vxe-cell--sort').flag;
  15211. var triggerFilter = getEventTargetNode(evnt, cell, 'vxe-cell--filter').flag;
  15212. if (sortOpts.trigger === 'cell' && !(triggerResizable || triggerSort || triggerFilter)) {
  15213. this.triggerSortEvent(evnt, column, getNextSortOrder(this, column));
  15214. }
  15215. this.emitEvent('header-cell-click', Object.assign({
  15216. triggerResizable: triggerResizable,
  15217. triggerSort: triggerSort,
  15218. triggerFilter: triggerFilter,
  15219. cell: cell
  15220. }, params), evnt);
  15221. if (this.columnOpts.isCurrent || this.highlightCurrentColumn) {
  15222. return this.setCurrentColumn(column);
  15223. }
  15224. return this.$nextTick();
  15225. },
  15226. triggerHeaderCellDblclickEvent: function triggerHeaderCellDblclickEvent(evnt, params) {
  15227. this.emitEvent('header-cell-dblclick', Object.assign({
  15228. cell: evnt.currentTarget
  15229. }, params), evnt);
  15230. },
  15231. getCurrentColumn: function getCurrentColumn() {
  15232. return this.columnOpts.isCurrent || this.highlightCurrentColumn ? this.currentColumn : null;
  15233. },
  15234. /**
  15235. * 用于当前列,设置某列行为高亮状态
  15236. * @param {ColumnInfo} fieldOrColumn 列配置
  15237. */
  15238. setCurrentColumn: function setCurrentColumn(fieldOrColumn) {
  15239. var column = handleFieldOrColumn(this, fieldOrColumn);
  15240. if (column) {
  15241. this.clearCurrentRow();
  15242. this.clearCurrentColumn();
  15243. this.currentColumn = column;
  15244. }
  15245. return this.$nextTick();
  15246. },
  15247. /**
  15248. * 用于当前列,手动清空当前高亮的状态
  15249. */
  15250. clearCurrentColumn: function clearCurrentColumn() {
  15251. this.currentColumn = null;
  15252. return this.$nextTick();
  15253. },
  15254. checkValidate: function checkValidate(type) {
  15255. if (v_x_e_table._valid) {
  15256. return this.triggerValidate(type);
  15257. }
  15258. return this.$nextTick();
  15259. },
  15260. /**
  15261. * 当单元格发生改变时
  15262. * 如果存在规则,则校验
  15263. */
  15264. handleChangeCell: function handleChangeCell(evnt, params) {
  15265. var _this38 = this;
  15266. this.checkValidate('blur').catch(function (e) {
  15267. return e;
  15268. }).then(function () {
  15269. _this38.handleActived(params, evnt).then(function () {
  15270. return _this38.checkValidate('change');
  15271. }).catch(function (e) {
  15272. return e;
  15273. });
  15274. });
  15275. },
  15276. /**
  15277. * 列点击事件
  15278. * 如果是单击模式,则激活为编辑状态
  15279. * 如果是双击模式,则单击后选中状态
  15280. */
  15281. triggerCellClickEvent: function triggerCellClickEvent(evnt, params) {
  15282. var highlightCurrentRow = this.highlightCurrentRow,
  15283. editStore = this.editStore,
  15284. radioOpts = this.radioOpts,
  15285. expandOpts = this.expandOpts,
  15286. treeOpts = this.treeOpts,
  15287. editConfig = this.editConfig,
  15288. editOpts = this.editOpts,
  15289. checkboxOpts = this.checkboxOpts,
  15290. rowOpts = this.rowOpts;
  15291. var actived = editStore.actived;
  15292. var _params = params,
  15293. row = _params.row,
  15294. column = _params.column;
  15295. var type = column.type,
  15296. treeNode = column.treeNode;
  15297. var isRadioType = type === 'radio';
  15298. var isCheckboxType = type === 'checkbox';
  15299. var isExpandType = type === 'expand';
  15300. var cell = evnt.currentTarget;
  15301. var triggerRadio = isRadioType && getEventTargetNode(evnt, cell, 'vxe-cell--radio').flag;
  15302. var triggerCheckbox = isCheckboxType && getEventTargetNode(evnt, cell, 'vxe-cell--checkbox').flag;
  15303. var triggerTreeNode = treeNode && getEventTargetNode(evnt, cell, 'vxe-tree--btn-wrapper').flag;
  15304. var triggerExpandNode = isExpandType && getEventTargetNode(evnt, cell, 'vxe-table--expanded').flag;
  15305. params = Object.assign({
  15306. cell: cell,
  15307. triggerRadio: triggerRadio,
  15308. triggerCheckbox: triggerCheckbox,
  15309. triggerTreeNode: triggerTreeNode,
  15310. triggerExpandNode: triggerExpandNode
  15311. }, params);
  15312. if (!triggerCheckbox && !triggerRadio) {
  15313. // 如果是展开行
  15314. if (!triggerExpandNode && (expandOpts.trigger === 'row' || isExpandType && expandOpts.trigger === 'cell')) {
  15315. this.triggerRowExpandEvent(evnt, params);
  15316. } // 如果是树形表格
  15317. if (treeOpts.trigger === 'row' || treeNode && treeOpts.trigger === 'cell') {
  15318. this.triggerTreeExpandEvent(evnt, params);
  15319. }
  15320. } // 如果点击了树节点
  15321. if (!triggerTreeNode) {
  15322. if (!triggerExpandNode) {
  15323. // 如果是高亮行
  15324. if (rowOpts.isCurrent || highlightCurrentRow) {
  15325. if (!triggerCheckbox && !triggerRadio) {
  15326. this.triggerCurrentRowEvent(evnt, params);
  15327. }
  15328. } // 如果是单选框
  15329. if (!triggerRadio && (radioOpts.trigger === 'row' || isRadioType && radioOpts.trigger === 'cell')) {
  15330. this.triggerRadioRowEvent(evnt, params);
  15331. } // 如果是复选框
  15332. if (!triggerCheckbox && (checkboxOpts.trigger === 'row' || isCheckboxType && checkboxOpts.trigger === 'cell')) {
  15333. this.handleToggleCheckRowEvent(evnt, params);
  15334. }
  15335. } // 如果设置了单元格选中功能,则不会使用点击事件去处理(只能支持双击模式)
  15336. if (isEnableConf(editConfig)) {
  15337. if (editOpts.trigger === 'manual') {
  15338. if (actived.args && actived.row === row && column !== actived.column) {
  15339. this.handleChangeCell(evnt, params);
  15340. }
  15341. } else if (!actived.args || row !== actived.row || column !== actived.column) {
  15342. if (editOpts.trigger === 'click') {
  15343. this.handleChangeCell(evnt, params);
  15344. } else if (editOpts.trigger === 'dblclick') {
  15345. if (editOpts.mode === 'row' && actived.row === row) {
  15346. this.handleChangeCell(evnt, params);
  15347. }
  15348. }
  15349. }
  15350. }
  15351. }
  15352. this.emitEvent('cell-click', params, evnt);
  15353. },
  15354. /**
  15355. * 列双击点击事件
  15356. * 如果是双击模式,则激活为编辑状态
  15357. */
  15358. triggerCellDblclickEvent: function triggerCellDblclickEvent(evnt, params) {
  15359. var _this39 = this;
  15360. var editStore = this.editStore,
  15361. editConfig = this.editConfig,
  15362. editOpts = this.editOpts;
  15363. var actived = editStore.actived;
  15364. var cell = evnt.currentTarget;
  15365. params.cell = cell;
  15366. if (isEnableConf(editConfig) && editOpts.trigger === 'dblclick') {
  15367. if (!actived.args || evnt.currentTarget !== actived.args.cell) {
  15368. if (editOpts.mode === 'row') {
  15369. this.checkValidate('blur').catch(function (e) {
  15370. return e;
  15371. }).then(function () {
  15372. _this39.handleActived(params, evnt).then(function () {
  15373. return _this39.checkValidate('change');
  15374. }).catch(function (e) {
  15375. return e;
  15376. });
  15377. });
  15378. } else if (editOpts.mode === 'cell') {
  15379. this.handleActived(params, evnt).then(function () {
  15380. return _this39.checkValidate('change');
  15381. }).catch(function (e) {
  15382. return e;
  15383. });
  15384. }
  15385. }
  15386. }
  15387. this.emitEvent('cell-dblclick', params, evnt);
  15388. },
  15389. handleDefaultSort: function handleDefaultSort() {
  15390. var _this40 = this;
  15391. var sortConfig = this.sortConfig,
  15392. sortOpts = this.sortOpts;
  15393. var defaultSort = sortOpts.defaultSort;
  15394. if (defaultSort) {
  15395. if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(defaultSort)) {
  15396. defaultSort = [defaultSort];
  15397. }
  15398. if (defaultSort.length) {
  15399. (sortConfig.multiple ? defaultSort : defaultSort.slice(0, 1)).forEach(function (item, index) {
  15400. var field = item.field,
  15401. order = item.order;
  15402. if (field && order) {
  15403. var column = _this40.getColumnByField(field);
  15404. if (column && column.sortable) {
  15405. column.order = order;
  15406. column.sortTime = Date.now() + index;
  15407. }
  15408. }
  15409. });
  15410. if (!sortOpts.remote) {
  15411. this.handleTableData(true).then(this.updateStyle);
  15412. }
  15413. }
  15414. }
  15415. },
  15416. /**
  15417. * 点击排序事件
  15418. */
  15419. triggerSortEvent: function triggerSortEvent(evnt, column, order) {
  15420. var sortOpts = this.sortOpts;
  15421. var field = column.field,
  15422. sortable = column.sortable,
  15423. remoteSort = column.remoteSort;
  15424. if (sortable || remoteSort) {
  15425. if (!order || column.order === order) {
  15426. this.clearSort(sortOpts.multiple ? column : null);
  15427. } else {
  15428. this.sort({
  15429. field: field,
  15430. order: order
  15431. });
  15432. }
  15433. var params = {
  15434. column: column,
  15435. field: field,
  15436. property: field,
  15437. order: column.order,
  15438. sortList: this.getSortColumns()
  15439. };
  15440. this.emitEvent('sort-change', params, evnt);
  15441. }
  15442. },
  15443. sort: function sort(sortConfs, sortOrder) {
  15444. var _this41 = this;
  15445. var sortOpts = this.sortOpts;
  15446. var multiple = sortOpts.multiple,
  15447. remote = sortOpts.remote,
  15448. orders = sortOpts.orders;
  15449. if (sortConfs) {
  15450. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isString(sortConfs)) {
  15451. sortConfs = [{
  15452. field: sortConfs,
  15453. order: sortOrder
  15454. }];
  15455. }
  15456. }
  15457. if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(sortConfs)) {
  15458. sortConfs = [sortConfs];
  15459. }
  15460. if (sortConfs.length) {
  15461. var firstSortColumn;
  15462. if (!multiple) {
  15463. clearAllSort(this);
  15464. }
  15465. (multiple ? sortConfs : [sortConfs[0]]).forEach(function (confs, index) {
  15466. var field = confs.field,
  15467. order = confs.order;
  15468. var column = field;
  15469. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isString(field)) {
  15470. column = _this41.getColumnByField(field);
  15471. }
  15472. if (column && (column.sortable || column.remoteSort)) {
  15473. if (!firstSortColumn) {
  15474. firstSortColumn = column;
  15475. }
  15476. if (orders.indexOf(order) === -1) {
  15477. order = getNextSortOrder(_this41, column);
  15478. }
  15479. if (column.order !== order) {
  15480. column.order = order;
  15481. }
  15482. column.sortTime = Date.now() + index;
  15483. }
  15484. }); // 如果是服务端排序,则跳过本地排序处理
  15485. if (!remote || firstSortColumn && firstSortColumn.remoteSort) {
  15486. this.handleTableData(true);
  15487. }
  15488. return this.$nextTick().then(this.updateStyle);
  15489. }
  15490. return this.$nextTick();
  15491. },
  15492. /**
  15493. * 清空指定列的排序条件
  15494. * 如果为空则清空所有列的排序条件
  15495. * @param {String} column 列或字段名
  15496. */
  15497. clearSort: function clearSort(fieldOrColumn) {
  15498. var sortOpts = this.sortOpts;
  15499. if (fieldOrColumn) {
  15500. var column = handleFieldOrColumn(this, fieldOrColumn);
  15501. if (column) {
  15502. column.order = null;
  15503. }
  15504. } else {
  15505. clearAllSort(this);
  15506. }
  15507. if (!sortOpts.remote) {
  15508. this.handleTableData(true);
  15509. }
  15510. return this.$nextTick().then(this.updateStyle);
  15511. },
  15512. // 在 v3 中废弃
  15513. getSortColumn: function getSortColumn() {
  15514. if (false) {}
  15515. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.find(this.tableFullColumn, function (column) {
  15516. return (column.sortable || column.remoteSort) && column.order;
  15517. });
  15518. },
  15519. isSort: function isSort(fieldOrColumn) {
  15520. if (fieldOrColumn) {
  15521. var column = handleFieldOrColumn(this, fieldOrColumn);
  15522. return column && column.sortable && !!column.order;
  15523. }
  15524. return this.getSortColumns().length > 0;
  15525. },
  15526. getSortColumns: function getSortColumns() {
  15527. var _this$sortOpts = this.sortOpts,
  15528. multiple = _this$sortOpts.multiple,
  15529. chronological = _this$sortOpts.chronological;
  15530. var sortList = [];
  15531. this.tableFullColumn.forEach(function (column) {
  15532. var field = column.field,
  15533. order = column.order;
  15534. if ((column.sortable || column.remoteSort) && order) {
  15535. sortList.push({
  15536. column: column,
  15537. field: field,
  15538. property: field,
  15539. order: order,
  15540. sortTime: column.sortTime
  15541. });
  15542. }
  15543. });
  15544. if (multiple && chronological && sortList.length > 1) {
  15545. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.orderBy(sortList, 'sortTime');
  15546. }
  15547. return sortList;
  15548. },
  15549. /**
  15550. * 关闭筛选
  15551. * @param {Event} evnt 事件
  15552. */
  15553. closeFilter: function closeFilter() {
  15554. var filterStore = this.filterStore;
  15555. var column = filterStore.column,
  15556. visible = filterStore.visible;
  15557. Object.assign(filterStore, {
  15558. isAllSelected: false,
  15559. isIndeterminate: false,
  15560. options: [],
  15561. visible: false
  15562. });
  15563. if (visible) {
  15564. this.emitEvent('filter-visible', {
  15565. column: column,
  15566. field: column.field,
  15567. property: column.field,
  15568. filterList: this.getCheckedFilters(),
  15569. visible: false
  15570. }, null);
  15571. }
  15572. return this.$nextTick();
  15573. },
  15574. /**
  15575. * 判断指定列是否为筛选状态,如果为空则判断所有列
  15576. * @param {String} fieldOrColumn 字段名
  15577. */
  15578. isFilter: function isFilter(fieldOrColumn) {
  15579. var column = handleFieldOrColumn(this, fieldOrColumn);
  15580. if (column) {
  15581. return column.filters && column.filters.some(function (option) {
  15582. return option.checked;
  15583. });
  15584. }
  15585. return this.getCheckedFilters().length > 0;
  15586. },
  15587. /**
  15588. * 判断展开行是否懒加载完成
  15589. * @param {Row} row 行对象
  15590. */
  15591. isRowExpandLoaded: function isRowExpandLoaded(row) {
  15592. var rest = this.fullAllDataRowMap.get(row);
  15593. return rest && rest.expandLoaded;
  15594. },
  15595. clearRowExpandLoaded: function clearRowExpandLoaded(row) {
  15596. var _this42 = this;
  15597. var expandOpts = this.expandOpts,
  15598. expandLazyLoadeds = this.expandLazyLoadeds,
  15599. fullAllDataRowMap = this.fullAllDataRowMap;
  15600. var lazy = expandOpts.lazy;
  15601. var rest = fullAllDataRowMap.get(row);
  15602. if (lazy && rest) {
  15603. rest.expandLoaded = false;
  15604. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.remove(expandLazyLoadeds, function (item) {
  15605. return _this42.eqRow(item, row);
  15606. });
  15607. }
  15608. return this.$nextTick();
  15609. },
  15610. /**
  15611. * 重新懒加载展开行,并展开内容
  15612. * @param {Row} row 行对象
  15613. */
  15614. reloadRowExpand: function reloadRowExpand(row) {
  15615. var _this43 = this;
  15616. var expandOpts = this.expandOpts,
  15617. expandLazyLoadeds = this.expandLazyLoadeds;
  15618. var lazy = expandOpts.lazy;
  15619. if (lazy && this.findRowIndexOf(expandLazyLoadeds, row) === -1) {
  15620. this.clearRowExpandLoaded(row).then(function () {
  15621. return _this43.handleAsyncRowExpand(row);
  15622. });
  15623. }
  15624. return this.$nextTick();
  15625. },
  15626. reloadExpandContent: function reloadExpandContent(row) {
  15627. if (false) {} // 即将废弃
  15628. return this.reloadRowExpand(row);
  15629. },
  15630. /**
  15631. * 展开行事件
  15632. */
  15633. triggerRowExpandEvent: function triggerRowExpandEvent(evnt, params) {
  15634. var expandOpts = this.expandOpts,
  15635. expandLazyLoadeds = this.expandLazyLoadeds,
  15636. column = this.expandColumn;
  15637. var row = params.row;
  15638. var lazy = expandOpts.lazy;
  15639. if (!lazy || this.findRowIndexOf(expandLazyLoadeds, row) === -1) {
  15640. var expanded = !this.isExpandByRow(row);
  15641. var columnIndex = this.getColumnIndex(column);
  15642. var $columnIndex = this.getVMColumnIndex(column);
  15643. this.setRowExpand(row, expanded);
  15644. this.emitEvent('toggle-row-expand', {
  15645. expanded: expanded,
  15646. column: column,
  15647. columnIndex: columnIndex,
  15648. $columnIndex: $columnIndex,
  15649. row: row,
  15650. rowIndex: this.getRowIndex(row),
  15651. $rowIndex: this.getVMRowIndex(row)
  15652. }, evnt);
  15653. }
  15654. },
  15655. /**
  15656. * 切换展开行
  15657. */
  15658. toggleRowExpand: function toggleRowExpand(row) {
  15659. return this.setRowExpand(row, !this.isExpandByRow(row));
  15660. },
  15661. /**
  15662. * 处理默认展开行
  15663. */
  15664. handleDefaultRowExpand: function handleDefaultRowExpand() {
  15665. var expandOpts = this.expandOpts,
  15666. fullDataRowIdData = this.fullDataRowIdData;
  15667. var expandAll = expandOpts.expandAll,
  15668. expandRowKeys = expandOpts.expandRowKeys;
  15669. if (expandAll) {
  15670. this.setAllRowExpand(true);
  15671. } else if (expandRowKeys) {
  15672. var defExpandeds = [];
  15673. expandRowKeys.forEach(function (rowid) {
  15674. if (fullDataRowIdData[rowid]) {
  15675. defExpandeds.push(fullDataRowIdData[rowid].row);
  15676. }
  15677. });
  15678. this.setRowExpand(defExpandeds, true);
  15679. }
  15680. },
  15681. /**
  15682. * 设置所有行的展开与否
  15683. * @param {Boolean} expanded 是否展开
  15684. */
  15685. setAllRowExpand: function setAllRowExpand(expanded) {
  15686. return this.setRowExpand(this.expandOpts.lazy ? this.tableData : this.tableFullData, expanded);
  15687. },
  15688. handleAsyncRowExpand: function handleAsyncRowExpand(row) {
  15689. var _this44 = this;
  15690. var rest = this.fullAllDataRowMap.get(row);
  15691. return new Promise(function (resolve) {
  15692. _this44.expandLazyLoadeds.push(row);
  15693. _this44.expandOpts.loadMethod({
  15694. $table: _this44,
  15695. row: row,
  15696. rowIndex: _this44.getRowIndex(row),
  15697. $rowIndex: _this44.getVMRowIndex(row)
  15698. }).then(function () {
  15699. rest.expandLoaded = true;
  15700. _this44.rowExpandeds.push(row);
  15701. }).catch(function () {
  15702. rest.expandLoaded = false;
  15703. }).finally(function () {
  15704. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.remove(_this44.expandLazyLoadeds, function (item) {
  15705. return _this44.eqRow(item, row);
  15706. });
  15707. resolve(_this44.$nextTick().then(_this44.recalculate));
  15708. });
  15709. });
  15710. },
  15711. /**
  15712. * 设置展开行,二个参数设置这一行展开与否
  15713. * 支持单行
  15714. * 支持多行
  15715. * @param {Array/Row} rows 行数据
  15716. * @param {Boolean} expanded 是否展开
  15717. */
  15718. setRowExpand: function setRowExpand(rows, expanded) {
  15719. var _this45 = this;
  15720. var fullAllDataRowMap = this.fullAllDataRowMap,
  15721. expandLazyLoadeds = this.expandLazyLoadeds,
  15722. expandOpts = this.expandOpts,
  15723. column = this.expandColumn;
  15724. var rowExpandeds = this.rowExpandeds;
  15725. var reserve = expandOpts.reserve,
  15726. lazy = expandOpts.lazy,
  15727. accordion = expandOpts.accordion,
  15728. toggleMethod = expandOpts.toggleMethod;
  15729. var lazyRests = [];
  15730. var columnIndex = this.getColumnIndex(column);
  15731. var $columnIndex = this.getVMColumnIndex(column);
  15732. if (rows) {
  15733. if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(rows)) {
  15734. rows = [rows];
  15735. }
  15736. if (accordion) {
  15737. // 只能同时展开一个
  15738. rowExpandeds = [];
  15739. rows = rows.slice(rows.length - 1, rows.length);
  15740. }
  15741. var validRows = toggleMethod ? rows.filter(function (row) {
  15742. return toggleMethod({
  15743. expanded: expanded,
  15744. column: column,
  15745. columnIndex: columnIndex,
  15746. $columnIndex: $columnIndex,
  15747. row: row,
  15748. rowIndex: _this45.getRowIndex(row),
  15749. $rowIndex: _this45.getVMRowIndex(row)
  15750. });
  15751. }) : rows;
  15752. if (expanded) {
  15753. validRows.forEach(function (row) {
  15754. if (_this45.findRowIndexOf(rowExpandeds, row) === -1) {
  15755. var rest = fullAllDataRowMap.get(row);
  15756. var isLoad = lazy && !rest.expandLoaded && _this45.findRowIndexOf(expandLazyLoadeds, row) === -1;
  15757. if (isLoad) {
  15758. lazyRests.push(_this45.handleAsyncRowExpand(row));
  15759. } else {
  15760. rowExpandeds.push(row);
  15761. }
  15762. }
  15763. });
  15764. } else {
  15765. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.remove(rowExpandeds, function (row) {
  15766. return _this45.findRowIndexOf(validRows, row) > -1;
  15767. });
  15768. }
  15769. if (reserve) {
  15770. validRows.forEach(function (row) {
  15771. return _this45.handleRowExpandReserve(row, expanded);
  15772. });
  15773. }
  15774. }
  15775. this.rowExpandeds = rowExpandeds;
  15776. return Promise.all(lazyRests).then(this.recalculate);
  15777. },
  15778. /**
  15779. * 判断行是否为展开状态
  15780. * @param {Row} row 行对象
  15781. */
  15782. isExpandByRow: function isExpandByRow(row) {
  15783. var rowExpandeds = this.rowExpandeds;
  15784. return this.findRowIndexOf(rowExpandeds, row) > -1;
  15785. },
  15786. /**
  15787. * 手动清空展开行状态,数据会恢复成未展开的状态
  15788. */
  15789. clearRowExpand: function clearRowExpand() {
  15790. var _this46 = this;
  15791. var expandOpts = this.expandOpts,
  15792. rowExpandeds = this.rowExpandeds,
  15793. tableFullData = this.tableFullData;
  15794. var reserve = expandOpts.reserve;
  15795. var isExists = rowExpandeds.length;
  15796. this.rowExpandeds = [];
  15797. if (reserve) {
  15798. tableFullData.forEach(function (row) {
  15799. return _this46.handleRowExpandReserve(row, false);
  15800. });
  15801. }
  15802. return this.$nextTick().then(function () {
  15803. if (isExists) {
  15804. _this46.recalculate();
  15805. }
  15806. });
  15807. },
  15808. clearRowExpandReserve: function clearRowExpandReserve() {
  15809. this.rowExpandedReserveRowMap = {};
  15810. return this.$nextTick();
  15811. },
  15812. handleRowExpandReserve: function handleRowExpandReserve(row, expanded) {
  15813. var rowExpandedReserveRowMap = this.rowExpandedReserveRowMap,
  15814. expandOpts = this.expandOpts;
  15815. if (expandOpts.reserve) {
  15816. var rowid = getRowid(this, row);
  15817. if (expanded) {
  15818. rowExpandedReserveRowMap[rowid] = row;
  15819. } else if (rowExpandedReserveRowMap[rowid]) {
  15820. delete rowExpandedReserveRowMap[rowid];
  15821. }
  15822. }
  15823. },
  15824. getRowExpandRecords: function getRowExpandRecords() {
  15825. return this.rowExpandeds.slice(0);
  15826. },
  15827. getTreeExpandRecords: function getTreeExpandRecords() {
  15828. return this.treeExpandeds.slice(0);
  15829. },
  15830. /**
  15831. * 获取数表格状态
  15832. */
  15833. getTreeStatus: function getTreeStatus() {
  15834. if (this.treeConfig) {
  15835. return {
  15836. config: this.treeOpts,
  15837. rowExpandeds: this.getTreeExpandRecords()
  15838. };
  15839. }
  15840. return null;
  15841. },
  15842. /**
  15843. * 判断树节点是否懒加载完成
  15844. * @param {Row} row 行对象
  15845. */
  15846. isTreeExpandLoaded: function isTreeExpandLoaded(row) {
  15847. var rest = this.fullAllDataRowMap.get(row);
  15848. return rest && rest.treeLoaded;
  15849. },
  15850. clearTreeExpandLoaded: function clearTreeExpandLoaded(row) {
  15851. var treeOpts = this.treeOpts,
  15852. treeExpandeds = this.treeExpandeds,
  15853. fullAllDataRowMap = this.fullAllDataRowMap;
  15854. var transform = treeOpts.transform,
  15855. lazy = treeOpts.lazy;
  15856. var rest = fullAllDataRowMap.get(row);
  15857. if (lazy && rest) {
  15858. rest.treeLoaded = false;
  15859. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.remove(treeExpandeds, function (item) {
  15860. return row === item;
  15861. });
  15862. }
  15863. if (transform) {
  15864. this.handleVirtualTreeToList();
  15865. return this.handleTableData();
  15866. }
  15867. return this.$nextTick();
  15868. },
  15869. /**
  15870. * 重新懒加载树节点,并展开该节点
  15871. * @param {Row} row 行对象
  15872. */
  15873. reloadTreeExpand: function reloadTreeExpand(row) {
  15874. var _this47 = this;
  15875. var treeOpts = this.treeOpts,
  15876. treeLazyLoadeds = this.treeLazyLoadeds;
  15877. var transform = treeOpts.transform,
  15878. lazy = treeOpts.lazy,
  15879. hasChild = treeOpts.hasChild;
  15880. if (lazy && row[hasChild] && treeLazyLoadeds.indexOf(row) === -1) {
  15881. this.clearTreeExpandLoaded(row).then(function () {
  15882. return _this47.handleAsyncTreeExpandChilds(row);
  15883. }).then(function () {
  15884. if (transform) {
  15885. _this47.handleVirtualTreeToList();
  15886. return _this47.handleTableData();
  15887. }
  15888. }).then(function () {
  15889. return _this47.recalculate();
  15890. });
  15891. }
  15892. return this.$nextTick();
  15893. },
  15894. reloadTreeChilds: function reloadTreeChilds(row) {
  15895. if (false) {} // 即将废弃
  15896. return this.reloadTreeExpand(row);
  15897. },
  15898. /**
  15899. * 展开树节点事件
  15900. */
  15901. triggerTreeExpandEvent: function triggerTreeExpandEvent(evnt, params) {
  15902. var treeOpts = this.treeOpts,
  15903. treeLazyLoadeds = this.treeLazyLoadeds;
  15904. var row = params.row,
  15905. column = params.column;
  15906. var lazy = treeOpts.lazy;
  15907. if (!lazy || treeLazyLoadeds.indexOf(row) === -1) {
  15908. var expanded = !this.isTreeExpandByRow(row);
  15909. var columnIndex = this.getColumnIndex(column);
  15910. var $columnIndex = this.getVMColumnIndex(column);
  15911. this.setTreeExpand(row, expanded);
  15912. this.emitEvent('toggle-tree-expand', {
  15913. expanded: expanded,
  15914. column: column,
  15915. columnIndex: columnIndex,
  15916. $columnIndex: $columnIndex,
  15917. row: row
  15918. }, evnt);
  15919. }
  15920. },
  15921. /**
  15922. * 切换/展开树节点
  15923. */
  15924. toggleTreeExpand: function toggleTreeExpand(row) {
  15925. return this.setTreeExpand(row, !this.isTreeExpandByRow(row));
  15926. },
  15927. /**
  15928. * 处理默认展开树节点
  15929. */
  15930. handleDefaultTreeExpand: function handleDefaultTreeExpand() {
  15931. var treeConfig = this.treeConfig,
  15932. treeOpts = this.treeOpts,
  15933. tableFullData = this.tableFullData;
  15934. if (treeConfig) {
  15935. var expandAll = treeOpts.expandAll,
  15936. expandRowKeys = treeOpts.expandRowKeys;
  15937. if (expandAll) {
  15938. this.setAllTreeExpand(true);
  15939. } else if (expandRowKeys) {
  15940. var defExpandeds = [];
  15941. var rowkey = getRowkey(this);
  15942. expandRowKeys.forEach(function (rowid) {
  15943. var matchObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.findTree(tableFullData, function (item) {
  15944. return rowid === external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(item, rowkey);
  15945. }, treeOpts);
  15946. if (matchObj) {
  15947. defExpandeds.push(matchObj.item);
  15948. }
  15949. });
  15950. this.setTreeExpand(defExpandeds, true);
  15951. }
  15952. }
  15953. },
  15954. handleAsyncTreeExpandChilds: function handleAsyncTreeExpandChilds(row) {
  15955. var _this48 = this;
  15956. var fullAllDataRowMap = this.fullAllDataRowMap,
  15957. treeExpandeds = this.treeExpandeds,
  15958. treeOpts = this.treeOpts,
  15959. treeLazyLoadeds = this.treeLazyLoadeds,
  15960. checkboxOpts = this.checkboxOpts;
  15961. var transform = treeOpts.transform,
  15962. loadMethod = treeOpts.loadMethod;
  15963. var checkStrictly = checkboxOpts.checkStrictly;
  15964. var rest = fullAllDataRowMap.get(row);
  15965. return new Promise(function (resolve) {
  15966. treeLazyLoadeds.push(row);
  15967. loadMethod({
  15968. $table: _this48,
  15969. row: row
  15970. }).then(function (childRecords) {
  15971. // 响应成功后则展开行,并将子节点挂载到该节点下
  15972. rest.treeLoaded = true;
  15973. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.remove(treeLazyLoadeds, function (item) {
  15974. return item === row;
  15975. });
  15976. if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(childRecords)) {
  15977. childRecords = [];
  15978. }
  15979. if (childRecords) {
  15980. return _this48.loadTreeChildren(row, childRecords).then(function (childRows) {
  15981. if (childRows.length && treeExpandeds.indexOf(row) === -1) {
  15982. treeExpandeds.push(row);
  15983. } // 如果当前节点已选中,则展开后子节点也被选中
  15984. if (!checkStrictly && _this48.isCheckedByCheckboxRow(row)) {
  15985. _this48.setCheckboxRow(childRows, true);
  15986. }
  15987. return _this48.$nextTick().then(function () {
  15988. if (transform) {
  15989. return _this48.handleTableData();
  15990. }
  15991. });
  15992. });
  15993. }
  15994. }).catch(function () {
  15995. // 如果响应异常,则不展开,再次点击后将重新触发懒加载
  15996. rest.treeLoaded = false;
  15997. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.remove(treeLazyLoadeds, function (item) {
  15998. return item === row;
  15999. });
  16000. }).finally(function () {
  16001. _this48.$nextTick().then(function () {
  16002. return _this48.recalculate();
  16003. }).then(function () {
  16004. return resolve();
  16005. });
  16006. });
  16007. });
  16008. },
  16009. /**
  16010. * 设置所有树节点的展开与否
  16011. * @param {Boolean} expanded 是否展开
  16012. */
  16013. setAllTreeExpand: function setAllTreeExpand(expanded) {
  16014. var tableFullData = this.tableFullData,
  16015. treeOpts = this.treeOpts;
  16016. var lazy = treeOpts.lazy,
  16017. children = treeOpts.children;
  16018. var expandeds = [];
  16019. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(tableFullData, function (row) {
  16020. var rowChildren = row[children];
  16021. if (lazy || rowChildren && rowChildren.length) {
  16022. expandeds.push(row);
  16023. }
  16024. }, treeOpts);
  16025. return this.setTreeExpand(expandeds, expanded);
  16026. },
  16027. /**
  16028. * 默认,展开与收起树节点
  16029. * @param rows
  16030. * @param expanded
  16031. * @returns
  16032. */
  16033. handleBaseTreeExpand: function handleBaseTreeExpand(rows, expanded) {
  16034. var _this49 = this;
  16035. var fullAllDataRowMap = this.fullAllDataRowMap,
  16036. tableFullData = this.tableFullData,
  16037. treeExpandeds = this.treeExpandeds,
  16038. treeOpts = this.treeOpts,
  16039. treeLazyLoadeds = this.treeLazyLoadeds,
  16040. treeNodeColumn = this.treeNodeColumn;
  16041. var reserve = treeOpts.reserve,
  16042. lazy = treeOpts.lazy,
  16043. hasChild = treeOpts.hasChild,
  16044. children = treeOpts.children,
  16045. accordion = treeOpts.accordion,
  16046. toggleMethod = treeOpts.toggleMethod;
  16047. var result = [];
  16048. var columnIndex = this.getColumnIndex(treeNodeColumn);
  16049. var $columnIndex = this.getVMColumnIndex(treeNodeColumn);
  16050. var validRows = toggleMethod ? rows.filter(function (row) {
  16051. return toggleMethod({
  16052. expanded: expanded,
  16053. column: treeNodeColumn,
  16054. columnIndex: columnIndex,
  16055. $columnIndex: $columnIndex,
  16056. row: row
  16057. });
  16058. }) : rows;
  16059. if (accordion) {
  16060. validRows = validRows.length ? [validRows[validRows.length - 1]] : []; // 同一级只能展开一个
  16061. var matchObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.findTree(tableFullData, function (item) {
  16062. return item === validRows[0];
  16063. }, treeOpts);
  16064. if (matchObj) {
  16065. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.remove(treeExpandeds, function (item) {
  16066. return matchObj.items.indexOf(item) > -1;
  16067. });
  16068. }
  16069. }
  16070. if (expanded) {
  16071. validRows.forEach(function (row) {
  16072. if (treeExpandeds.indexOf(row) === -1) {
  16073. var rest = fullAllDataRowMap.get(row);
  16074. var isLoad = lazy && row[hasChild] && !rest.treeLoaded && treeLazyLoadeds.indexOf(row) === -1; // 是否使用懒加载
  16075. if (isLoad) {
  16076. result.push(_this49.handleAsyncTreeExpandChilds(row));
  16077. } else {
  16078. if (row[children] && row[children].length) {
  16079. treeExpandeds.push(row);
  16080. }
  16081. }
  16082. }
  16083. });
  16084. } else {
  16085. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.remove(treeExpandeds, function (row) {
  16086. return validRows.indexOf(row) > -1;
  16087. });
  16088. }
  16089. if (reserve) {
  16090. validRows.forEach(function (row) {
  16091. return _this49.handleTreeExpandReserve(row, expanded);
  16092. });
  16093. }
  16094. return Promise.all(result).then(this.recalculate);
  16095. },
  16096. /**
  16097. * 虚拟树的展开与收起
  16098. * @param rows
  16099. * @param expanded
  16100. * @returns
  16101. */
  16102. handleVirtualTreeExpand: function handleVirtualTreeExpand(rows, expanded) {
  16103. var _this50 = this;
  16104. return this.handleBaseTreeExpand(rows, expanded).then(function () {
  16105. _this50.handleVirtualTreeToList();
  16106. return _this50.handleTableData();
  16107. }).then(function () {
  16108. return _this50.recalculate();
  16109. });
  16110. },
  16111. /**
  16112. * 设置展开树形节点,二个参数设置这一行展开与否
  16113. * 支持单行
  16114. * 支持多行
  16115. * @param {Array/Row} rows 行数据
  16116. * @param {Boolean} expanded 是否展开
  16117. */
  16118. setTreeExpand: function setTreeExpand(rows, expanded) {
  16119. var treeOpts = this.treeOpts;
  16120. var transform = treeOpts.transform;
  16121. if (rows) {
  16122. if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(rows)) {
  16123. rows = [rows];
  16124. }
  16125. if (rows.length) {
  16126. // 如果为虚拟树
  16127. if (transform) {
  16128. return this.handleVirtualTreeExpand(rows, expanded);
  16129. } else {
  16130. return this.handleBaseTreeExpand(rows, expanded);
  16131. }
  16132. }
  16133. }
  16134. return this.$nextTick();
  16135. },
  16136. /**
  16137. * 判断行是否为树形节点展开状态
  16138. * @param {Row} row 行对象
  16139. */
  16140. isTreeExpandByRow: function isTreeExpandByRow(row) {
  16141. return this.treeExpandeds.indexOf(row) > -1;
  16142. },
  16143. /**
  16144. * 手动清空树形节点的展开状态,数据会恢复成未展开的状态
  16145. */
  16146. clearTreeExpand: function clearTreeExpand() {
  16147. var _this51 = this;
  16148. var treeOpts = this.treeOpts,
  16149. treeExpandeds = this.treeExpandeds,
  16150. tableFullData = this.tableFullData;
  16151. var transform = treeOpts.transform,
  16152. reserve = treeOpts.reserve;
  16153. var isExists = treeExpandeds.length;
  16154. this.treeExpandeds = [];
  16155. if (reserve) {
  16156. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(tableFullData, function (row) {
  16157. return _this51.handleTreeExpandReserve(row, false);
  16158. }, treeOpts);
  16159. }
  16160. return this.handleTableData().then(function () {
  16161. if (transform) {
  16162. _this51.handleVirtualTreeToList();
  16163. return _this51.handleTableData();
  16164. }
  16165. }).then(function () {
  16166. if (isExists) {
  16167. _this51.recalculate();
  16168. }
  16169. });
  16170. },
  16171. clearTreeExpandReserve: function clearTreeExpandReserve() {
  16172. this.treeExpandedReserveRowMap = {};
  16173. return this.$nextTick();
  16174. },
  16175. handleTreeExpandReserve: function handleTreeExpandReserve(row, expanded) {
  16176. var treeExpandedReserveRowMap = this.treeExpandedReserveRowMap,
  16177. treeOpts = this.treeOpts;
  16178. if (treeOpts.reserve) {
  16179. var rowid = getRowid(this, row);
  16180. if (expanded) {
  16181. treeExpandedReserveRowMap[rowid] = row;
  16182. } else if (treeExpandedReserveRowMap[rowid]) {
  16183. delete treeExpandedReserveRowMap[rowid];
  16184. }
  16185. }
  16186. },
  16187. /**
  16188. * 获取表格的滚动状态
  16189. */
  16190. getScroll: function getScroll() {
  16191. var $refs = this.$refs,
  16192. scrollXLoad = this.scrollXLoad,
  16193. scrollYLoad = this.scrollYLoad;
  16194. var bodyElem = $refs.tableBody.$el;
  16195. return {
  16196. virtualX: scrollXLoad,
  16197. virtualY: scrollYLoad,
  16198. scrollTop: bodyElem.scrollTop,
  16199. scrollLeft: bodyElem.scrollLeft
  16200. };
  16201. },
  16202. /**
  16203. * 横向 X 可视渲染事件处理
  16204. */
  16205. triggerScrollXEvent: function triggerScrollXEvent() {
  16206. this.loadScrollXData();
  16207. },
  16208. loadScrollXData: function loadScrollXData() {
  16209. var mergeList = this.mergeList,
  16210. mergeFooterList = this.mergeFooterList,
  16211. scrollXStore = this.scrollXStore;
  16212. var startIndex = scrollXStore.startIndex,
  16213. endIndex = scrollXStore.endIndex,
  16214. offsetSize = scrollXStore.offsetSize;
  16215. var _computeVirtualX2 = computeVirtualX(this),
  16216. toVisibleIndex = _computeVirtualX2.toVisibleIndex,
  16217. visibleSize = _computeVirtualX2.visibleSize;
  16218. var offsetItem = {
  16219. startIndex: Math.max(0, toVisibleIndex - 1 - offsetSize),
  16220. endIndex: toVisibleIndex + visibleSize + offsetSize
  16221. };
  16222. calculateMergerOffserIndex(mergeList.concat(mergeFooterList), offsetItem, 'col');
  16223. var offsetStartIndex = offsetItem.startIndex,
  16224. offsetEndIndex = offsetItem.endIndex;
  16225. if (toVisibleIndex <= startIndex || toVisibleIndex >= endIndex - visibleSize - 1) {
  16226. if (startIndex !== offsetStartIndex || endIndex !== offsetEndIndex) {
  16227. scrollXStore.startIndex = offsetStartIndex;
  16228. scrollXStore.endIndex = offsetEndIndex;
  16229. this.updateScrollXData();
  16230. }
  16231. }
  16232. this.closeTooltip();
  16233. },
  16234. /**
  16235. * 纵向 Y 可视渲染事件处理
  16236. */
  16237. triggerScrollYEvent: function triggerScrollYEvent(evnt) {
  16238. var scrollYStore = this.scrollYStore;
  16239. var adaptive = scrollYStore.adaptive,
  16240. offsetSize = scrollYStore.offsetSize,
  16241. visibleSize = scrollYStore.visibleSize; // webkit 浏览器使用最佳的渲染方式,且最高渲染量不能大于 40 条
  16242. if (isWebkit && adaptive && offsetSize * 2 + visibleSize <= 40) {
  16243. this.loadScrollYData(evnt);
  16244. } else {
  16245. this.debounceScrollY(evnt);
  16246. }
  16247. },
  16248. debounceScrollY: external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.debounce(function (evnt) {
  16249. this.loadScrollYData(evnt);
  16250. }, debounceScrollYDuration, {
  16251. leading: false,
  16252. trailing: true
  16253. }),
  16254. /**
  16255. * 纵向 Y 可视渲染处理
  16256. */
  16257. loadScrollYData: function loadScrollYData(evnt) {
  16258. var mergeList = this.mergeList,
  16259. scrollYStore = this.scrollYStore;
  16260. var startIndex = scrollYStore.startIndex,
  16261. endIndex = scrollYStore.endIndex,
  16262. visibleSize = scrollYStore.visibleSize,
  16263. offsetSize = scrollYStore.offsetSize,
  16264. rowHeight = scrollYStore.rowHeight;
  16265. var scrollBodyElem = evnt.currentTarget || evnt.target;
  16266. var scrollTop = scrollBodyElem.scrollTop;
  16267. var toVisibleIndex = Math.floor(scrollTop / rowHeight);
  16268. var offsetItem = {
  16269. startIndex: Math.max(0, toVisibleIndex - 1 - offsetSize),
  16270. endIndex: toVisibleIndex + visibleSize + offsetSize
  16271. };
  16272. calculateMergerOffserIndex(mergeList, offsetItem, 'row');
  16273. var offsetStartIndex = offsetItem.startIndex,
  16274. offsetEndIndex = offsetItem.endIndex;
  16275. if (toVisibleIndex <= startIndex || toVisibleIndex >= endIndex - visibleSize - 1) {
  16276. if (startIndex !== offsetStartIndex || endIndex !== offsetEndIndex) {
  16277. scrollYStore.startIndex = offsetStartIndex;
  16278. scrollYStore.endIndex = offsetEndIndex;
  16279. this.updateScrollYData();
  16280. }
  16281. }
  16282. },
  16283. // 计算可视渲染相关数据
  16284. computeScrollLoad: function computeScrollLoad() {
  16285. var _this52 = this;
  16286. return this.$nextTick().then(function () {
  16287. var sYOpts = _this52.sYOpts,
  16288. sXOpts = _this52.sXOpts,
  16289. scrollXLoad = _this52.scrollXLoad,
  16290. scrollYLoad = _this52.scrollYLoad,
  16291. scrollXStore = _this52.scrollXStore,
  16292. scrollYStore = _this52.scrollYStore; // 计算 X 逻辑
  16293. if (scrollXLoad) {
  16294. var _computeVirtualX3 = computeVirtualX(_this52),
  16295. visibleXSize = _computeVirtualX3.visibleSize;
  16296. var offsetXSize = sXOpts.oSize ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(sXOpts.oSize) : browse.msie ? 10 : browse.edge ? 5 : 0;
  16297. scrollXStore.offsetSize = offsetXSize;
  16298. scrollXStore.visibleSize = visibleXSize;
  16299. scrollXStore.endIndex = Math.max(scrollXStore.startIndex + scrollXStore.visibleSize + offsetXSize, scrollXStore.endIndex);
  16300. _this52.updateScrollXData();
  16301. } else {
  16302. _this52.updateScrollXSpace();
  16303. } // 计算 Y 逻辑
  16304. var _computeVirtualY = computeVirtualY(_this52),
  16305. rowHeight = _computeVirtualY.rowHeight,
  16306. visibleYSize = _computeVirtualY.visibleSize;
  16307. scrollYStore.rowHeight = rowHeight;
  16308. if (scrollYLoad) {
  16309. var offsetYSize = sYOpts.oSize ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(sYOpts.oSize) : browse.msie ? 20 : browse.edge ? 10 : 0;
  16310. scrollYStore.offsetSize = offsetYSize;
  16311. scrollYStore.visibleSize = visibleYSize;
  16312. scrollYStore.endIndex = Math.max(scrollYStore.startIndex + visibleYSize + offsetYSize, scrollYStore.endIndex);
  16313. _this52.updateScrollYData();
  16314. } else {
  16315. _this52.updateScrollYSpace();
  16316. }
  16317. _this52.rowHeight = rowHeight;
  16318. _this52.$nextTick(_this52.updateStyle);
  16319. });
  16320. },
  16321. handleTableColumn: function handleTableColumn() {
  16322. var scrollXLoad = this.scrollXLoad,
  16323. visibleColumn = this.visibleColumn,
  16324. scrollXStore = this.scrollXStore;
  16325. this.tableColumn = scrollXLoad ? visibleColumn.slice(scrollXStore.startIndex, scrollXStore.endIndex) : visibleColumn.slice(0);
  16326. },
  16327. updateScrollXData: function updateScrollXData() {
  16328. var _this53 = this;
  16329. // this.tableColumn = []
  16330. this.$nextTick(function () {
  16331. _this53.handleTableColumn();
  16332. _this53.updateScrollXSpace();
  16333. });
  16334. },
  16335. // 更新横向 X 可视渲染上下剩余空间大小
  16336. updateScrollXSpace: function updateScrollXSpace() {
  16337. var $refs = this.$refs,
  16338. isGroup = this.isGroup,
  16339. elemStore = this.elemStore,
  16340. visibleColumn = this.visibleColumn,
  16341. scrollXStore = this.scrollXStore,
  16342. scrollXLoad = this.scrollXLoad,
  16343. tableWidth = this.tableWidth,
  16344. scrollbarWidth = this.scrollbarWidth;
  16345. var tableHeader = $refs.tableHeader,
  16346. tableBody = $refs.tableBody,
  16347. tableFooter = $refs.tableFooter;
  16348. var tableBodyElem = tableBody ? tableBody.$el : null;
  16349. if (tableBodyElem) {
  16350. var tableHeaderElem = tableHeader ? tableHeader.$el : null;
  16351. var tableFooterElem = tableFooter ? tableFooter.$el : null;
  16352. var headerElem = tableHeaderElem ? tableHeaderElem.querySelector('.vxe-table--header') : null;
  16353. var bodyElem = tableBodyElem.querySelector('.vxe-table--body');
  16354. var footerElem = tableFooterElem ? tableFooterElem.querySelector('.vxe-table--footer') : null;
  16355. var leftSpaceWidth = visibleColumn.slice(0, scrollXStore.startIndex).reduce(function (previous, column) {
  16356. return previous + column.renderWidth;
  16357. }, 0);
  16358. var marginLeft = '';
  16359. if (scrollXLoad) {
  16360. marginLeft = "".concat(leftSpaceWidth, "px");
  16361. }
  16362. if (headerElem) {
  16363. headerElem.style.marginLeft = isGroup ? '' : marginLeft;
  16364. }
  16365. bodyElem.style.marginLeft = marginLeft;
  16366. if (footerElem) {
  16367. footerElem.style.marginLeft = marginLeft;
  16368. }
  16369. var containerList = ['main'];
  16370. containerList.forEach(function (name) {
  16371. var layoutList = ['header', 'body', 'footer'];
  16372. layoutList.forEach(function (layout) {
  16373. var xSpaceElem = elemStore["".concat(name, "-").concat(layout, "-xSpace")];
  16374. if (xSpaceElem) {
  16375. xSpaceElem.style.width = scrollXLoad ? "".concat(tableWidth + (layout === 'header' ? scrollbarWidth : 0), "px") : '';
  16376. }
  16377. });
  16378. });
  16379. this.$nextTick(this.updateStyle);
  16380. }
  16381. },
  16382. updateScrollYData: function updateScrollYData() {
  16383. var _this54 = this;
  16384. // this.tableData = []
  16385. this.$nextTick(function () {
  16386. _this54.handleTableData();
  16387. _this54.updateScrollYSpace();
  16388. });
  16389. },
  16390. // 更新纵向 Y 可视渲染上下剩余空间大小
  16391. updateScrollYSpace: function updateScrollYSpace() {
  16392. var elemStore = this.elemStore,
  16393. scrollYStore = this.scrollYStore,
  16394. scrollYLoad = this.scrollYLoad,
  16395. afterFullData = this.afterFullData;
  16396. var startIndex = scrollYStore.startIndex,
  16397. rowHeight = scrollYStore.rowHeight;
  16398. var bodyHeight = afterFullData.length * rowHeight;
  16399. var topSpaceHeight = Math.max(0, startIndex * rowHeight);
  16400. var containerList = ['main', 'left', 'right'];
  16401. var marginTop = '';
  16402. var ySpaceHeight = '';
  16403. if (scrollYLoad) {
  16404. marginTop = "".concat(topSpaceHeight, "px");
  16405. ySpaceHeight = "".concat(bodyHeight, "px");
  16406. }
  16407. containerList.forEach(function (name) {
  16408. var layoutList = ['header', 'body', 'footer'];
  16409. var tableElem = elemStore["".concat(name, "-body-table")];
  16410. if (tableElem) {
  16411. tableElem.style.marginTop = marginTop;
  16412. }
  16413. layoutList.forEach(function (layout) {
  16414. var ySpaceElem = elemStore["".concat(name, "-").concat(layout, "-ySpace")];
  16415. if (ySpaceElem) {
  16416. ySpaceElem.style.height = ySpaceHeight;
  16417. }
  16418. });
  16419. });
  16420. this.$nextTick(this.updateStyle);
  16421. },
  16422. /**
  16423. * 如果有滚动条,则滚动到对应的位置
  16424. * @param {Number} scrollLeft 左距离
  16425. * @param {Number} scrollTop 上距离
  16426. */
  16427. scrollTo: function scrollTo(scrollLeft, scrollTop) {
  16428. var _this55 = this;
  16429. var $refs = this.$refs;
  16430. var tableBody = $refs.tableBody,
  16431. rightBody = $refs.rightBody,
  16432. tableFooter = $refs.tableFooter;
  16433. var tableBodyElem = tableBody ? tableBody.$el : null;
  16434. var rightBodyElem = rightBody ? rightBody.$el : null;
  16435. var tableFooterElem = tableFooter ? tableFooter.$el : null;
  16436. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNumber(scrollLeft)) {
  16437. setScrollLeft(tableFooterElem || tableBodyElem, scrollLeft);
  16438. }
  16439. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNumber(scrollTop)) {
  16440. setScrollTop(rightBodyElem || tableBodyElem, scrollTop);
  16441. }
  16442. if (this.scrollXLoad || this.scrollYLoad) {
  16443. return new Promise(function (resolve) {
  16444. return setTimeout(function () {
  16445. return resolve(_this55.$nextTick());
  16446. }, 50);
  16447. });
  16448. }
  16449. return this.$nextTick();
  16450. },
  16451. /**
  16452. * 如果有滚动条,则滚动到对应的行
  16453. * @param {Row} row 行对象
  16454. * @param {ColumnInfo} column 列配置
  16455. */
  16456. scrollToRow: function scrollToRow(row, fieldOrColumn) {
  16457. var rest = [];
  16458. if (row) {
  16459. if (this.treeConfig) {
  16460. rest.push(this.scrollToTreeRow(row));
  16461. } else {
  16462. rest.push(rowToVisible(this, row));
  16463. }
  16464. }
  16465. if (fieldOrColumn) {
  16466. rest.push(this.scrollToColumn(fieldOrColumn));
  16467. }
  16468. return Promise.all(rest);
  16469. },
  16470. /**
  16471. * 如果有滚动条,则滚动到对应的列
  16472. * @param {ColumnInfo} column 列配置
  16473. */
  16474. scrollToColumn: function scrollToColumn(fieldOrColumn) {
  16475. var column = handleFieldOrColumn(this, fieldOrColumn);
  16476. if (column && this.fullColumnMap.has(column)) {
  16477. return colToVisible(this, column);
  16478. }
  16479. return this.$nextTick();
  16480. },
  16481. /**
  16482. * 对于树形结构中,可以直接滚动到指定深层节点中
  16483. * 对于某些特定的场景可能会用到,比如定位到某一节点
  16484. * @param {Row} row 行对象
  16485. */
  16486. scrollToTreeRow: function scrollToTreeRow(row) {
  16487. var _this56 = this;
  16488. var tableFullData = this.tableFullData,
  16489. treeConfig = this.treeConfig,
  16490. treeOpts = this.treeOpts;
  16491. var rests = [];
  16492. if (treeConfig) {
  16493. var matchObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.findTree(tableFullData, function (item) {
  16494. return item === row;
  16495. }, treeOpts);
  16496. if (matchObj) {
  16497. var nodes = matchObj.nodes;
  16498. nodes.forEach(function (row, index) {
  16499. if (index < nodes.length - 1 && !_this56.isTreeExpandByRow(row)) {
  16500. rests.push(_this56.setTreeExpand(row, true));
  16501. }
  16502. });
  16503. }
  16504. }
  16505. return Promise.all(rests).then(function () {
  16506. return rowToVisible(_this56, row);
  16507. });
  16508. },
  16509. /**
  16510. * 手动清除滚动相关信息,还原到初始状态
  16511. */
  16512. clearScroll: function clearScroll() {
  16513. var $refs = this.$refs,
  16514. scrollXStore = this.scrollXStore,
  16515. scrollYStore = this.scrollYStore;
  16516. var tableBody = $refs.tableBody,
  16517. rightBody = $refs.rightBody,
  16518. tableFooter = $refs.tableFooter;
  16519. var tableBodyElem = tableBody ? tableBody.$el : null;
  16520. var rightBodyElem = rightBody ? rightBody.$el : null;
  16521. var tableFooterElem = tableFooter ? tableFooter.$el : null;
  16522. if (rightBodyElem) {
  16523. restoreScrollListener(rightBodyElem);
  16524. rightBodyElem.scrollTop = 0;
  16525. }
  16526. if (tableFooterElem) {
  16527. tableFooterElem.scrollLeft = 0;
  16528. }
  16529. if (tableBodyElem) {
  16530. restoreScrollListener(tableBodyElem);
  16531. tableBodyElem.scrollTop = 0;
  16532. tableBodyElem.scrollLeft = 0;
  16533. }
  16534. scrollXStore.startIndex = 0;
  16535. scrollYStore.startIndex = 0;
  16536. return this.$nextTick();
  16537. },
  16538. /**
  16539. * 更新表尾合计
  16540. */
  16541. updateFooter: function updateFooter() {
  16542. var showFooter = this.showFooter,
  16543. visibleColumn = this.visibleColumn,
  16544. footerMethod = this.footerMethod;
  16545. if (showFooter && footerMethod) {
  16546. this.footerTableData = visibleColumn.length ? footerMethod({
  16547. columns: visibleColumn,
  16548. data: this.afterFullData,
  16549. $table: this,
  16550. $grid: this.$xegrid
  16551. }) : [];
  16552. }
  16553. return this.$nextTick();
  16554. },
  16555. /**
  16556. * 更新列状态
  16557. * 如果组件值 v-model 发生 change 时,调用改函数用于更新某一列编辑状态
  16558. * 如果单元格配置了校验规则,则会进行校验
  16559. */
  16560. updateStatus: function updateStatus(scope, cellValue) {
  16561. var _this57 = this;
  16562. var customVal = !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isUndefined(cellValue);
  16563. return this.$nextTick().then(function () {
  16564. var $refs = _this57.$refs,
  16565. editRules = _this57.editRules,
  16566. validStore = _this57.validStore;
  16567. if (scope && $refs.tableBody && editRules) {
  16568. var row = scope.row,
  16569. column = scope.column;
  16570. var type = 'change';
  16571. if (_this57.hasCellRules(type, row, column)) {
  16572. var cell = _this57.getCell(row, column);
  16573. if (cell) {
  16574. return _this57.validCellRules(type, row, column, cellValue).then(function () {
  16575. if (customVal && validStore.visible) {
  16576. methods_setCellValue(row, column, cellValue);
  16577. }
  16578. _this57.clearValidate();
  16579. }).catch(function (_ref8) {
  16580. var rule = _ref8.rule;
  16581. if (customVal) {
  16582. methods_setCellValue(row, column, cellValue);
  16583. }
  16584. _this57.showValidTooltip({
  16585. rule: rule,
  16586. row: row,
  16587. column: column,
  16588. cell: cell
  16589. });
  16590. });
  16591. }
  16592. }
  16593. }
  16594. });
  16595. },
  16596. handleDefaultMergeCells: function handleDefaultMergeCells() {
  16597. this.setMergeCells(this.mergeCells);
  16598. },
  16599. /**
  16600. * 设置合并单元格
  16601. * @param {TableMergeConfig[]} merges { row: Row|number, column: ColumnInfo|number, rowspan: number, colspan: number }
  16602. */
  16603. setMergeCells: function setMergeCells(merges) {
  16604. var _this58 = this;
  16605. if (this.spanMethod) {
  16606. errLog('vxe.error.errConflicts', ['merge-cells', 'span-method']);
  16607. }
  16608. setMerges(this, merges, this.mergeList, this.afterFullData);
  16609. return this.$nextTick().then(function () {
  16610. return _this58.updateCellAreas();
  16611. });
  16612. },
  16613. /**
  16614. * 移除单元格合并
  16615. * @param {TableMergeConfig[]} merges 多个或数组 [{row:Row|number, col:ColumnInfo|number}]
  16616. */
  16617. removeMergeCells: function removeMergeCells(merges) {
  16618. var _this59 = this;
  16619. if (this.spanMethod) {
  16620. errLog('vxe.error.errConflicts', ['merge-cells', 'span-method']);
  16621. }
  16622. var rest = removeMerges(this, merges, this.mergeList, this.afterFullData);
  16623. return this.$nextTick().then(function () {
  16624. _this59.updateCellAreas();
  16625. return rest;
  16626. });
  16627. },
  16628. /**
  16629. * 获取所有被合并的单元格
  16630. */
  16631. getMergeCells: function getMergeCells() {
  16632. return this.mergeList.slice(0);
  16633. },
  16634. /**
  16635. * 清除所有单元格合并
  16636. */
  16637. clearMergeCells: function clearMergeCells() {
  16638. this.mergeList = [];
  16639. return this.$nextTick();
  16640. },
  16641. handleDefaultMergeFooterItems: function handleDefaultMergeFooterItems() {
  16642. this.setMergeFooterItems(this.mergeFooterItems);
  16643. },
  16644. setMergeFooterItems: function setMergeFooterItems(merges) {
  16645. var _this60 = this;
  16646. if (this.footerSpanMethod) {
  16647. errLog('vxe.error.errConflicts', ['merge-footer-items', 'footer-span-method']);
  16648. }
  16649. setMerges(this, merges, this.mergeFooterList, null);
  16650. return this.$nextTick().then(function () {
  16651. return _this60.updateCellAreas();
  16652. });
  16653. },
  16654. removeMergeFooterItems: function removeMergeFooterItems(merges) {
  16655. var _this61 = this;
  16656. if (this.footerSpanMethod) {
  16657. errLog('vxe.error.errConflicts', ['merge-footer-items', 'footer-span-method']);
  16658. }
  16659. var rest = removeMerges(this, merges, this.mergeFooterList, null);
  16660. return this.$nextTick().then(function () {
  16661. _this61.updateCellAreas();
  16662. return rest;
  16663. });
  16664. },
  16665. /**
  16666. * 获取所有被合并的表尾
  16667. */
  16668. getMergeFooterItems: function getMergeFooterItems() {
  16669. return this.mergeFooterList.slice(0);
  16670. },
  16671. /**
  16672. * 清除所有表尾合并
  16673. */
  16674. clearMergeFooterItems: function clearMergeFooterItems() {
  16675. this.mergeFooterList = [];
  16676. return this.$nextTick();
  16677. },
  16678. updateZindex: function updateZindex() {
  16679. if (this.zIndex) {
  16680. this.tZindex = this.zIndex;
  16681. } else if (this.tZindex < utils.getLastZIndex()) {
  16682. this.tZindex = utils.nextZIndex();
  16683. }
  16684. },
  16685. updateCellAreas: function updateCellAreas() {
  16686. if (this.mouseConfig && this.mouseOpts.area && this.handleUpdateCellAreas) {
  16687. this.handleUpdateCellAreas();
  16688. }
  16689. },
  16690. emitEvent: function emitEvent(type, params, evnt) {
  16691. this.$emit(type, Object.assign({
  16692. $table: this,
  16693. $grid: this.$xegrid,
  16694. $event: evnt
  16695. }, params));
  16696. },
  16697. focus: function focus() {
  16698. this.isActivated = true;
  16699. return this.$nextTick();
  16700. },
  16701. blur: function blur() {
  16702. this.isActivated = false;
  16703. return this.$nextTick();
  16704. },
  16705. // 连接工具栏
  16706. connect: function connect($toolbar) {
  16707. if ($toolbar && $toolbar.syncUpdate) {
  16708. $toolbar.syncUpdate({
  16709. collectColumn: this.collectColumn,
  16710. $table: this
  16711. });
  16712. this.$toolbar = $toolbar;
  16713. } else {
  16714. errLog('vxe.error.barUnableLink');
  16715. }
  16716. return this.$nextTick();
  16717. },
  16718. /*************************
  16719. * Publish methods
  16720. *************************/
  16721. getCell: function getCell(row, column) {
  16722. var $refs = this.$refs;
  16723. var rowid = getRowid(this, row);
  16724. var bodyElem = $refs["".concat(column.fixed || 'table', "Body")] || $refs.tableBody;
  16725. if (bodyElem && bodyElem.$el) {
  16726. return bodyElem.$el.querySelector(".vxe-body--row[rowid=\"".concat(rowid, "\"] .").concat(column.id));
  16727. }
  16728. return null;
  16729. },
  16730. getCellLabel: function getCellLabel(row, column) {
  16731. var formatter = column.formatter;
  16732. var cellValue = utils.getCellValue(row, column);
  16733. var cellLabel = cellValue;
  16734. if (formatter) {
  16735. var rest, formatData;
  16736. var fullAllDataRowMap = this.fullAllDataRowMap;
  16737. var colid = column.id;
  16738. var cacheFormat = fullAllDataRowMap.has(row);
  16739. if (cacheFormat) {
  16740. rest = fullAllDataRowMap.get(row);
  16741. formatData = rest.formatData;
  16742. if (!formatData) {
  16743. formatData = fullAllDataRowMap.get(row).formatData = {};
  16744. }
  16745. if (rest && formatData[colid]) {
  16746. if (formatData[colid].value === cellValue) {
  16747. return formatData[colid].label;
  16748. }
  16749. }
  16750. }
  16751. var formatParams = {
  16752. cellValue: cellValue,
  16753. row: row,
  16754. rowIndex: this.getRowIndex(row),
  16755. column: column,
  16756. columnIndex: this.getColumnIndex(column)
  16757. };
  16758. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isString(formatter)) {
  16759. var globalFunc = formats.get(formatter);
  16760. cellLabel = globalFunc ? globalFunc(formatParams) : '';
  16761. } else if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(formatter)) {
  16762. var _globalFunc = formats.get(formatter[0]);
  16763. cellLabel = _globalFunc ? _globalFunc.apply(void 0, [formatParams].concat(_toConsumableArray(formatter.slice(1)))) : '';
  16764. } else {
  16765. cellLabel = formatter(formatParams);
  16766. }
  16767. if (formatData) {
  16768. formatData[colid] = {
  16769. value: cellValue,
  16770. label: cellLabel
  16771. };
  16772. }
  16773. }
  16774. return cellLabel;
  16775. },
  16776. findRowIndexOf: function findRowIndexOf(list, row) {
  16777. var _this62 = this;
  16778. return row ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.findIndexOf(list, function (item) {
  16779. return _this62.eqRow(item, row);
  16780. }) : -1;
  16781. },
  16782. eqRow: function eqRow(row1, row2) {
  16783. if (row1 && row2) {
  16784. if (row1 === row2) {
  16785. return true;
  16786. }
  16787. return getRowid(this, row1) === getRowid(this, row2);
  16788. }
  16789. return false;
  16790. },
  16791. /*************************
  16792. * Publish methods
  16793. *************************/
  16794. getSetupOptions: function getSetupOptions() {
  16795. return src_conf;
  16796. }
  16797. }; // Module methods
  16798. var funcs = 'setFilter,openFilter,clearFilter,getCheckedFilters,closeMenu,setActiveCellArea,getActiveCellArea,getCellAreas,clearCellAreas,copyCellArea,cutCellArea,pasteCellArea,getCopyCellArea,getCopyCellAreas,clearCopyCellArea,setCellAreas,openFind,openReplace,closeFNR,getSelectedCell,clearSelected,insert,insertAt,remove,removeCheckboxRow,removeRadioRow,removeCurrentRow,getRecordset,getInsertRecords,getRemoveRecords,getUpdateRecords,clearEdit,clearActived,getEditRecord,getActiveRecord,isEditByRow,isActiveByRow,setEditRow,setActiveRow,setEditCell,setActiveCell,setSelectCell,clearValidate,fullValidate,validate,openExport,openPrint,exportData,openImport,importData,saveFile,readFile,importByFile,print'.split(',');
  16799. funcs.forEach(function (name) {
  16800. Methods[name] = function () {
  16801. if (false) {}
  16802. return this["_".concat(name)] ? this["_".concat(name)].apply(this, arguments) : null;
  16803. };
  16804. });
  16805. /* harmony default export */ var methods = (Methods);
  16806. // CONCATENATED MODULE: ./packages/loading/src/loading.js
  16807. /* harmony default export */ var src_loading = ({
  16808. name: 'VxeLoading',
  16809. props: {
  16810. value: Boolean,
  16811. icon: String,
  16812. text: String
  16813. },
  16814. computed: {
  16815. loadingIcon: function loadingIcon() {
  16816. return this.icon || src_conf.icon.LOADING;
  16817. },
  16818. loadingText: function loadingText() {
  16819. var loadingText = src_conf.loadingText;
  16820. return this.text || (loadingText === null ? loadingText : src_conf.i18n('vxe.loading.text'));
  16821. }
  16822. },
  16823. render: function render(h) {
  16824. var loadingIcon = this.loadingIcon,
  16825. loadingText = this.loadingText;
  16826. return h('div', {
  16827. class: ['vxe-loading', {
  16828. 'is--visible': this.value
  16829. }]
  16830. }, [h('div', {
  16831. class: 'vxe-loading--chunk'
  16832. }, [loadingIcon ? h('i', {
  16833. class: loadingIcon
  16834. }) : h('div', {
  16835. class: 'vxe-loading--spinner'
  16836. }), loadingText ? h('div', {
  16837. class: 'vxe-loading--text'
  16838. }, "".concat(loadingText)) : null])]);
  16839. }
  16840. });
  16841. // CONCATENATED MODULE: ./packages/loading/index.js
  16842. var Loading = Object.assign(src_loading, {
  16843. install: function install(Vue) {
  16844. Vue.component(src_loading.name, src_loading);
  16845. }
  16846. });
  16847. /* harmony default export */ var packages_loading = (src_loading);
  16848. // CONCATENATED MODULE: ./packages/table/src/table.js
  16849. /**
  16850. * 渲染浮固定列
  16851. * 分别渲染左边固定列和右边固定列
  16852. * 如果宽度足够情况下,则不需要渲染固定列
  16853. * @param {Function} h 创建 VNode 函数
  16854. * @param {Object} $xetable 表格实例
  16855. * @param {String} fixedType 固定列类型
  16856. */
  16857. function renderFixed(h, $xetable, fixedType) {
  16858. var _e = $xetable._e,
  16859. tableData = $xetable.tableData,
  16860. tableColumn = $xetable.tableColumn,
  16861. tableGroupColumn = $xetable.tableGroupColumn,
  16862. vSize = $xetable.vSize,
  16863. showHeader = $xetable.showHeader,
  16864. showFooter = $xetable.showFooter,
  16865. columnStore = $xetable.columnStore,
  16866. footerTableData = $xetable.footerTableData;
  16867. var fixedColumn = columnStore["".concat(fixedType, "List")];
  16868. return h('div', {
  16869. class: "vxe-table--fixed-".concat(fixedType, "-wrapper"),
  16870. ref: "".concat(fixedType, "Container")
  16871. }, [showHeader ? h(packages_header, {
  16872. props: {
  16873. fixedType: fixedType,
  16874. tableData: tableData,
  16875. tableColumn: tableColumn,
  16876. tableGroupColumn: tableGroupColumn,
  16877. size: vSize,
  16878. fixedColumn: fixedColumn
  16879. },
  16880. ref: "".concat(fixedType, "Header")
  16881. }) : _e(), h('vxe-table-body', {
  16882. props: {
  16883. fixedType: fixedType,
  16884. tableData: tableData,
  16885. tableColumn: tableColumn,
  16886. fixedColumn: fixedColumn,
  16887. size: vSize
  16888. },
  16889. ref: "".concat(fixedType, "Body")
  16890. }), showFooter ? h('vxe-table-footer', {
  16891. props: {
  16892. footerTableData: footerTableData,
  16893. tableColumn: tableColumn,
  16894. fixedColumn: fixedColumn,
  16895. fixedType: fixedType,
  16896. size: vSize
  16897. },
  16898. ref: "".concat(fixedType, "Footer")
  16899. }) : _e()]);
  16900. }
  16901. function renderEmptyContenet(h, _vm) {
  16902. var $scopedSlots = _vm.$scopedSlots,
  16903. emptyOpts = _vm.emptyOpts;
  16904. var emptyContent = '';
  16905. var params = {
  16906. $table: _vm
  16907. };
  16908. if ($scopedSlots.empty) {
  16909. emptyContent = $scopedSlots.empty.call(_vm, params, h);
  16910. } else {
  16911. var compConf = emptyOpts.name ? v_x_e_table.renderer.get(emptyOpts.name) : null;
  16912. var renderEmpty = compConf ? compConf.renderEmpty : null;
  16913. if (renderEmpty) {
  16914. emptyContent = getSlotVNs(renderEmpty.call(_vm, h, emptyOpts, params));
  16915. } else {
  16916. emptyContent = getFuncText(_vm.emptyText) || src_conf.i18n('vxe.table.emptyText');
  16917. }
  16918. }
  16919. return emptyContent;
  16920. }
  16921. function handleUupdateResize(_vm) {
  16922. var $el = _vm.$el;
  16923. if ($el && $el.clientWidth && $el.clientHeight) {
  16924. _vm.recalculate();
  16925. }
  16926. }
  16927. /* harmony default export */ var table = ({
  16928. name: 'VxeTable',
  16929. mixins: [size],
  16930. props: {
  16931. /** 基本属性 */
  16932. id: String,
  16933. // 数据
  16934. data: Array,
  16935. // 表格的高度
  16936. height: [Number, String],
  16937. // 表格的最大高度
  16938. maxHeight: [Number, String],
  16939. // 已废弃,被 column-config.resizable 替换
  16940. resizable: {
  16941. type: Boolean,
  16942. default: function _default() {
  16943. return src_conf.table.resizable;
  16944. }
  16945. },
  16946. // 是否带有斑马纹
  16947. stripe: {
  16948. type: Boolean,
  16949. default: function _default() {
  16950. return src_conf.table.stripe;
  16951. }
  16952. },
  16953. // 是否带有边框
  16954. border: {
  16955. type: [Boolean, String],
  16956. default: function _default() {
  16957. return src_conf.table.border;
  16958. }
  16959. },
  16960. // 是否圆角边框
  16961. round: {
  16962. type: Boolean,
  16963. default: function _default() {
  16964. return src_conf.table.round;
  16965. }
  16966. },
  16967. // 表格的尺寸
  16968. size: {
  16969. type: String,
  16970. default: function _default() {
  16971. return src_conf.table.size || src_conf.size;
  16972. }
  16973. },
  16974. // 列的宽度是否自撑开(可能会被废弃的参数,不要使用)
  16975. fit: {
  16976. type: Boolean,
  16977. default: function _default() {
  16978. return src_conf.table.fit;
  16979. }
  16980. },
  16981. // 表格是否加载中
  16982. loading: Boolean,
  16983. // 所有的列对其方式
  16984. align: {
  16985. type: String,
  16986. default: function _default() {
  16987. return src_conf.table.align;
  16988. }
  16989. },
  16990. // 所有的表头列的对齐方式
  16991. headerAlign: {
  16992. type: String,
  16993. default: function _default() {
  16994. return src_conf.table.headerAlign;
  16995. }
  16996. },
  16997. // 所有的表尾列的对齐方式
  16998. footerAlign: {
  16999. type: String,
  17000. default: function _default() {
  17001. return src_conf.table.footerAlign;
  17002. }
  17003. },
  17004. // 是否显示表头
  17005. showHeader: {
  17006. type: Boolean,
  17007. default: function _default() {
  17008. return src_conf.table.showHeader;
  17009. }
  17010. },
  17011. // 已废弃,被 row-config.isCurrent 替换
  17012. highlightCurrentRow: {
  17013. type: Boolean,
  17014. default: function _default() {
  17015. return src_conf.table.highlightCurrentRow;
  17016. }
  17017. },
  17018. // 已废弃,被 row-config.isHover 替换
  17019. highlightHoverRow: {
  17020. type: Boolean,
  17021. default: function _default() {
  17022. return src_conf.table.highlightHoverRow;
  17023. }
  17024. },
  17025. // 已废弃,被 column-config.isCurrent 替换
  17026. highlightCurrentColumn: {
  17027. type: Boolean,
  17028. default: function _default() {
  17029. return src_conf.table.highlightCurrentColumn;
  17030. }
  17031. },
  17032. // 已废弃,被 column-config.isHover 替换
  17033. highlightHoverColumn: {
  17034. type: Boolean,
  17035. default: function _default() {
  17036. return src_conf.table.highlightHoverColumn;
  17037. }
  17038. },
  17039. // 已废弃,直接删除
  17040. highlightCell: Boolean,
  17041. // 是否显示表尾合计
  17042. showFooter: Boolean,
  17043. // 表尾合计的计算方法
  17044. footerMethod: Function,
  17045. // 给行附加 className
  17046. rowClassName: [String, Function],
  17047. // 给单元格附加 className
  17048. cellClassName: [String, Function],
  17049. // 给表头的行附加 className
  17050. headerRowClassName: [String, Function],
  17051. // 给表头的单元格附加 className
  17052. headerCellClassName: [String, Function],
  17053. // 给表尾的行附加 className
  17054. footerRowClassName: [String, Function],
  17055. // 给表尾的单元格附加 className
  17056. footerCellClassName: [String, Function],
  17057. // 给单元格附加样式
  17058. cellStyle: [Object, Function],
  17059. // 给表头单元格附加样式
  17060. headerCellStyle: [Object, Function],
  17061. // 给表尾单元格附加样式
  17062. footerCellStyle: [Object, Function],
  17063. // 给行附加样式
  17064. rowStyle: [Object, Function],
  17065. // 给表头行附加样式
  17066. headerRowStyle: [Object, Function],
  17067. // 给表尾行附加样式
  17068. footerRowStyle: [Object, Function],
  17069. // 合并指定单元格
  17070. mergeCells: Array,
  17071. // 合并指定的表尾
  17072. mergeFooterItems: Array,
  17073. // 自定义合并行或列的方法
  17074. spanMethod: Function,
  17075. // 表尾合并行或列
  17076. footerSpanMethod: Function,
  17077. // 设置所有内容过长时显示为省略号
  17078. showOverflow: {
  17079. type: [Boolean, String],
  17080. default: function _default() {
  17081. return src_conf.table.showOverflow;
  17082. }
  17083. },
  17084. // 设置表头所有内容过长时显示为省略号
  17085. showHeaderOverflow: {
  17086. type: [Boolean, String],
  17087. default: function _default() {
  17088. return src_conf.table.showHeaderOverflow;
  17089. }
  17090. },
  17091. // 设置表尾所有内容过长时显示为省略号
  17092. showFooterOverflow: {
  17093. type: [Boolean, String],
  17094. default: function _default() {
  17095. return src_conf.table.showFooterOverflow;
  17096. }
  17097. },
  17098. /** 高级属性 */
  17099. // (即将废弃)columnKey 已废弃,被 column-config.useKey 替换
  17100. columnKey: Boolean,
  17101. // (即将废弃)rowKey 已废弃,被 row-config.useKey 替换
  17102. rowKey: Boolean,
  17103. // (即将废弃)rowId 已废弃,被 row-config.keyField 替换
  17104. rowId: {
  17105. type: String,
  17106. default: function _default() {
  17107. return src_conf.table.rowId;
  17108. }
  17109. },
  17110. zIndex: Number,
  17111. emptyText: {
  17112. type: String,
  17113. default: function _default() {
  17114. return src_conf.table.emptyText;
  17115. }
  17116. },
  17117. keepSource: {
  17118. type: Boolean,
  17119. default: function _default() {
  17120. return src_conf.table.keepSource;
  17121. }
  17122. },
  17123. // 是否自动监听父容器变化去更新响应式表格宽高
  17124. autoResize: {
  17125. type: Boolean,
  17126. default: function _default() {
  17127. return src_conf.table.autoResize;
  17128. }
  17129. },
  17130. // 是否自动根据状态属性去更新响应式表格宽高
  17131. syncResize: [Boolean, String, Number],
  17132. // 列配置信息
  17133. columnConfig: Object,
  17134. // 行配置信息
  17135. rowConfig: Object,
  17136. // 列调整配置项
  17137. resizableConfig: Object,
  17138. // 序号配置项
  17139. seqConfig: Object,
  17140. // 排序配置项
  17141. sortConfig: Object,
  17142. // 筛选配置项
  17143. filterConfig: Object,
  17144. // 单选框配置
  17145. radioConfig: Object,
  17146. // 复选框配置项
  17147. checkboxConfig: Object,
  17148. // tooltip 配置项
  17149. tooltipConfig: Object,
  17150. // 导出配置项
  17151. exportConfig: [Boolean, Object],
  17152. // 导入配置项
  17153. importConfig: [Boolean, Object],
  17154. // 打印配置项
  17155. printConfig: Object,
  17156. // 展开行配置项
  17157. expandConfig: Object,
  17158. // 树形结构配置项
  17159. treeConfig: [Boolean, Object],
  17160. // 快捷菜单配置项
  17161. menuConfig: [Boolean, Object],
  17162. // 在 v4 中废弃 contextMenu
  17163. contextMenu: [Boolean, Object],
  17164. // 鼠标配置项
  17165. mouseConfig: Object,
  17166. // 区域配置项
  17167. areaConfig: Object,
  17168. // 按键配置项
  17169. keyboardConfig: Object,
  17170. // 复制/粘贴配置项
  17171. clipConfig: Object,
  17172. // 查找/替换配置项
  17173. fnrConfig: Object,
  17174. // 编辑配置项
  17175. editConfig: [Boolean, Object],
  17176. // 校验配置项
  17177. validConfig: Object,
  17178. // 校验规则配置项
  17179. editRules: Object,
  17180. // 加载中配置项
  17181. loadingConfig: Object,
  17182. // 空内容渲染配置项
  17183. emptyRender: [Boolean, Object],
  17184. // 自定义列配置项
  17185. customConfig: [Boolean, Object],
  17186. // 横向虚拟滚动配置项
  17187. scrollX: Object,
  17188. // 纵向虚拟滚动配置项
  17189. scrollY: Object,
  17190. // (即将废弃)优化相关
  17191. animat: {
  17192. type: Boolean,
  17193. default: function _default() {
  17194. return src_conf.table.animat;
  17195. }
  17196. },
  17197. // (可能会被废弃的参数,不要使用)
  17198. delayHover: {
  17199. type: Number,
  17200. default: function _default() {
  17201. return src_conf.table.delayHover;
  17202. }
  17203. },
  17204. // 额外的参数
  17205. params: Object
  17206. },
  17207. components: {
  17208. VxeTableBody: src_body
  17209. },
  17210. provide: function provide() {
  17211. return {
  17212. $xetable: this,
  17213. xecolgroup: null
  17214. };
  17215. },
  17216. inject: {
  17217. $xegrid: {
  17218. default: null
  17219. }
  17220. },
  17221. data: function data() {
  17222. return {
  17223. tId: "".concat(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.uniqueId()),
  17224. // 低性能的静态列
  17225. staticColumns: [],
  17226. // 渲染的列分组
  17227. tableGroupColumn: [],
  17228. // 可视区渲染的列
  17229. tableColumn: [],
  17230. // 渲染中的数据
  17231. tableData: [],
  17232. // 是否启用了横向 X 可视渲染方式加载
  17233. scrollXLoad: false,
  17234. // 是否启用了纵向 Y 可视渲染方式加载
  17235. scrollYLoad: false,
  17236. // 是否存在纵向滚动条
  17237. overflowY: true,
  17238. // 是否存在横向滚动条
  17239. overflowX: false,
  17240. // 纵向滚动条的宽度
  17241. scrollbarWidth: 0,
  17242. // 横向滚动条的高度
  17243. scrollbarHeight: 0,
  17244. // 行高
  17245. rowHeight: 0,
  17246. // 表格父容器的高度
  17247. parentHeight: 0,
  17248. // 是否使用分组表头
  17249. isGroup: false,
  17250. isAllOverflow: false,
  17251. // 复选框属性,是否全选
  17252. isAllSelected: false,
  17253. // 复选框属性,有选中且非全选状态
  17254. isIndeterminate: false,
  17255. // 复选框属性,已选中的行
  17256. selection: [],
  17257. // 当前行
  17258. currentRow: null,
  17259. // 单选框属性,选中列
  17260. currentColumn: null,
  17261. // 单选框属性,选中行
  17262. selectRow: null,
  17263. // 表尾合计数据
  17264. footerTableData: [],
  17265. // 展开列信息
  17266. expandColumn: null,
  17267. hasFixedColumn: false,
  17268. // 树节点列信息
  17269. treeNodeColumn: null,
  17270. // 已展开的行
  17271. rowExpandeds: [],
  17272. // 懒加载中的展开行的列表
  17273. expandLazyLoadeds: [],
  17274. // 已展开树节点
  17275. treeExpandeds: [],
  17276. // 懒加载中的树节点的列表
  17277. treeLazyLoadeds: [],
  17278. // 树节点不确定状态的列表
  17279. treeIndeterminates: [],
  17280. // 合并单元格的对象集
  17281. mergeList: [],
  17282. // 合并表尾数据的对象集
  17283. mergeFooterList: [],
  17284. // 初始化标识
  17285. initStore: {
  17286. filter: false,
  17287. import: false,
  17288. export: false
  17289. },
  17290. // 当前选中的筛选列
  17291. filterStore: {
  17292. isAllSelected: false,
  17293. isIndeterminate: false,
  17294. style: null,
  17295. options: [],
  17296. column: null,
  17297. multiple: false,
  17298. visible: false,
  17299. maxHeight: null
  17300. },
  17301. // 存放列相关的信息
  17302. columnStore: {
  17303. leftList: [],
  17304. centerList: [],
  17305. rightList: [],
  17306. resizeList: [],
  17307. pxList: [],
  17308. pxMinList: [],
  17309. scaleList: [],
  17310. scaleMinList: [],
  17311. autoList: []
  17312. },
  17313. // 存放快捷菜单的信息
  17314. ctxMenuStore: {
  17315. selected: null,
  17316. visible: false,
  17317. showChild: false,
  17318. selectChild: null,
  17319. list: [],
  17320. style: null
  17321. },
  17322. // 存放可编辑相关信息
  17323. editStore: {
  17324. indexs: {
  17325. columns: []
  17326. },
  17327. titles: {
  17328. columns: []
  17329. },
  17330. // 选中源
  17331. selected: {
  17332. row: null,
  17333. column: null
  17334. },
  17335. // 已复制源
  17336. copyed: {
  17337. cut: false,
  17338. rows: [],
  17339. columns: []
  17340. },
  17341. // 激活
  17342. actived: {
  17343. row: null,
  17344. column: null
  17345. },
  17346. insertList: [],
  17347. removeList: []
  17348. },
  17349. // 存放 tooltip 相关信息
  17350. tooltipStore: {
  17351. row: null,
  17352. column: null,
  17353. visible: false,
  17354. currOpts: null
  17355. },
  17356. // 存放数据校验相关信息
  17357. validStore: {
  17358. visible: false,
  17359. row: null,
  17360. column: null,
  17361. content: '',
  17362. rule: null,
  17363. isArrow: false
  17364. },
  17365. // 导入相关信息
  17366. importStore: {
  17367. inited: false,
  17368. file: null,
  17369. type: '',
  17370. modeList: [],
  17371. typeList: [],
  17372. filename: '',
  17373. visible: false
  17374. },
  17375. importParams: {
  17376. mode: '',
  17377. types: null,
  17378. message: true
  17379. },
  17380. // 导出相关信息
  17381. exportStore: {
  17382. inited: false,
  17383. name: '',
  17384. modeList: [],
  17385. typeList: [],
  17386. columns: [],
  17387. isPrint: false,
  17388. hasFooter: false,
  17389. hasTree: false,
  17390. hasMerge: false,
  17391. hasColgroup: false,
  17392. visible: false
  17393. },
  17394. exportParams: {
  17395. filename: '',
  17396. sheetName: '',
  17397. mode: '',
  17398. type: '',
  17399. isColgroup: false,
  17400. isMerge: false,
  17401. isAllExpand: false,
  17402. useStyle: false,
  17403. original: false,
  17404. message: true,
  17405. isHeader: false,
  17406. isFooter: false
  17407. }
  17408. };
  17409. },
  17410. computed: {
  17411. validOpts: function validOpts() {
  17412. return Object.assign({
  17413. message: 'default'
  17414. }, src_conf.table.validConfig, this.validConfig);
  17415. },
  17416. sXOpts: function sXOpts() {
  17417. return Object.assign({}, src_conf.table.scrollX, this.scrollX);
  17418. },
  17419. sYOpts: function sYOpts() {
  17420. return Object.assign({}, src_conf.table.scrollY, this.scrollY);
  17421. },
  17422. rowHeightMaps: function rowHeightMaps() {
  17423. return {
  17424. default: 48,
  17425. medium: 44,
  17426. small: 40,
  17427. mini: 36
  17428. };
  17429. },
  17430. columnOpts: function columnOpts() {
  17431. return Object.assign({}, src_conf.table.columnConfig, this.columnConfig);
  17432. },
  17433. rowOpts: function rowOpts() {
  17434. return Object.assign({}, src_conf.table.rowConfig, this.rowConfig);
  17435. },
  17436. resizableOpts: function resizableOpts() {
  17437. return Object.assign({}, src_conf.table.resizableConfig, this.resizableConfig);
  17438. },
  17439. seqOpts: function seqOpts() {
  17440. return Object.assign({
  17441. startIndex: 0
  17442. }, src_conf.table.seqConfig, this.seqConfig);
  17443. },
  17444. radioOpts: function radioOpts() {
  17445. return Object.assign({}, src_conf.table.radioConfig, this.radioConfig);
  17446. },
  17447. checkboxOpts: function checkboxOpts() {
  17448. return Object.assign({}, src_conf.table.checkboxConfig, this.checkboxConfig);
  17449. },
  17450. tooltipOpts: function tooltipOpts() {
  17451. return Object.assign({}, src_conf.tooltip, src_conf.table.tooltipConfig, this.tooltipConfig);
  17452. },
  17453. tipConfig: function tipConfig() {
  17454. return _objectSpread2(_objectSpread2({}, this.tooltipOpts), this.tooltipStore.currOpts);
  17455. },
  17456. validTipOpts: function validTipOpts() {
  17457. return Object.assign({
  17458. isArrow: false
  17459. }, this.tooltipOpts);
  17460. },
  17461. editOpts: function editOpts() {
  17462. return Object.assign({}, src_conf.table.editConfig, this.editConfig);
  17463. },
  17464. sortOpts: function sortOpts() {
  17465. return Object.assign({
  17466. orders: ['asc', 'desc', null]
  17467. }, src_conf.table.sortConfig, this.sortConfig);
  17468. },
  17469. filterOpts: function filterOpts() {
  17470. return Object.assign({}, src_conf.table.filterConfig, this.filterConfig);
  17471. },
  17472. mouseOpts: function mouseOpts() {
  17473. return Object.assign({}, src_conf.table.mouseConfig, this.mouseConfig);
  17474. },
  17475. areaOpts: function areaOpts() {
  17476. return Object.assign({}, src_conf.table.areaConfig, this.areaConfig);
  17477. },
  17478. keyboardOpts: function keyboardOpts() {
  17479. return Object.assign({}, src_conf.table.keyboardConfig, this.keyboardConfig);
  17480. },
  17481. clipOpts: function clipOpts() {
  17482. return Object.assign({}, src_conf.table.clipConfig, this.clipConfig);
  17483. },
  17484. fnrOpts: function fnrOpts() {
  17485. return Object.assign({}, src_conf.table.fnrConfig, this.fnrConfig);
  17486. },
  17487. hasTip: function hasTip() {
  17488. return v_x_e_table._tooltip;
  17489. },
  17490. headerCtxMenu: function headerCtxMenu() {
  17491. var headerOpts = this.ctxMenuOpts.header;
  17492. return headerOpts && headerOpts.options ? headerOpts.options : [];
  17493. },
  17494. bodyCtxMenu: function bodyCtxMenu() {
  17495. var bodyOpts = this.ctxMenuOpts.body;
  17496. return bodyOpts && bodyOpts.options ? bodyOpts.options : [];
  17497. },
  17498. footerCtxMenu: function footerCtxMenu() {
  17499. var footerOpts = this.ctxMenuOpts.footer;
  17500. return footerOpts && footerOpts.options ? footerOpts.options : [];
  17501. },
  17502. isCtxMenu: function isCtxMenu() {
  17503. return !!((this.contextMenu || this.menuConfig) && isEnableConf(this.ctxMenuOpts) && (this.headerCtxMenu.length || this.bodyCtxMenu.length || this.footerCtxMenu.length));
  17504. },
  17505. ctxMenuOpts: function ctxMenuOpts() {
  17506. return Object.assign({}, src_conf.table.menuConfig, this.contextMenu, this.menuConfig);
  17507. },
  17508. ctxMenuList: function ctxMenuList() {
  17509. var rest = [];
  17510. this.ctxMenuStore.list.forEach(function (list) {
  17511. list.forEach(function (item) {
  17512. rest.push(item);
  17513. });
  17514. });
  17515. return rest;
  17516. },
  17517. exportOpts: function exportOpts() {
  17518. return Object.assign({}, src_conf.table.exportConfig, this.exportConfig);
  17519. },
  17520. importOpts: function importOpts() {
  17521. return Object.assign({}, src_conf.table.importConfig, this.importConfig);
  17522. },
  17523. printOpts: function printOpts() {
  17524. return Object.assign({}, src_conf.table.printConfig, this.printConfig);
  17525. },
  17526. expandOpts: function expandOpts() {
  17527. return Object.assign({}, src_conf.table.expandConfig, this.expandConfig);
  17528. },
  17529. treeOpts: function treeOpts() {
  17530. return Object.assign({}, src_conf.table.treeConfig, this.treeConfig);
  17531. },
  17532. emptyOpts: function emptyOpts() {
  17533. return Object.assign({}, src_conf.table.emptyRender, this.emptyRender);
  17534. },
  17535. loadingOpts: function loadingOpts() {
  17536. return Object.assign({}, src_conf.table.loadingConfig, this.loadingConfig);
  17537. },
  17538. cellOffsetWidth: function cellOffsetWidth() {
  17539. return this.border ? Math.max(2, Math.ceil(this.scrollbarWidth / this.tableColumn.length)) : 1;
  17540. },
  17541. customOpts: function customOpts() {
  17542. return Object.assign({}, src_conf.table.customConfig, this.customConfig);
  17543. },
  17544. tableBorder: function tableBorder() {
  17545. var border = this.border;
  17546. if (border === true) {
  17547. return 'full';
  17548. }
  17549. if (border) {
  17550. return border;
  17551. }
  17552. return 'default';
  17553. },
  17554. /**
  17555. * 判断列全选的复选框是否禁用
  17556. */
  17557. isAllCheckboxDisabled: function isAllCheckboxDisabled() {
  17558. var tableFullData = this.tableFullData,
  17559. tableData = this.tableData,
  17560. treeConfig = this.treeConfig,
  17561. checkboxOpts = this.checkboxOpts;
  17562. var strict = checkboxOpts.strict,
  17563. checkMethod = checkboxOpts.checkMethod;
  17564. if (strict) {
  17565. if (tableData.length || tableFullData.length) {
  17566. if (checkMethod) {
  17567. if (treeConfig) {// 暂时不支持树形结构
  17568. } // 如果所有行都被禁用
  17569. return tableFullData.every(function (row) {
  17570. return !checkMethod({
  17571. row: row
  17572. });
  17573. });
  17574. }
  17575. return false;
  17576. }
  17577. return true;
  17578. }
  17579. return false;
  17580. }
  17581. },
  17582. watch: {
  17583. data: function data(value) {
  17584. var _this = this;
  17585. var inited = this.inited,
  17586. initStatus = this.initStatus;
  17587. this.loadTableData(value).then(function () {
  17588. _this.inited = true;
  17589. _this.initStatus = true;
  17590. if (!initStatus) {
  17591. _this.handleLoadDefaults();
  17592. }
  17593. if (!inited) {
  17594. _this.handleInitDefaults();
  17595. }
  17596. if ((_this.scrollXLoad || _this.scrollYLoad) && _this.expandColumn) {
  17597. warnLog('vxe.error.scrollErrProp', ['column.type=expand']);
  17598. }
  17599. _this.recalculate();
  17600. });
  17601. },
  17602. staticColumns: function staticColumns(value) {
  17603. this.handleColumn(value);
  17604. },
  17605. tableColumn: function tableColumn() {
  17606. this.analyColumnWidth();
  17607. },
  17608. showHeader: function showHeader() {
  17609. var _this2 = this;
  17610. this.$nextTick(function () {
  17611. _this2.recalculate(true).then(function () {
  17612. return _this2.refreshScroll();
  17613. });
  17614. });
  17615. },
  17616. showFooter: function showFooter() {
  17617. var _this3 = this;
  17618. this.$nextTick(function () {
  17619. _this3.recalculate(true).then(function () {
  17620. return _this3.refreshScroll();
  17621. });
  17622. });
  17623. },
  17624. height: function height() {
  17625. var _this4 = this;
  17626. this.$nextTick(function () {
  17627. return _this4.recalculate(true);
  17628. });
  17629. },
  17630. maxHeight: function maxHeight() {
  17631. var _this5 = this;
  17632. this.$nextTick(function () {
  17633. return _this5.recalculate(true);
  17634. });
  17635. },
  17636. syncResize: function syncResize(value) {
  17637. var _this6 = this;
  17638. if (value) {
  17639. handleUupdateResize(this);
  17640. this.$nextTick(function () {
  17641. handleUupdateResize(_this6);
  17642. setTimeout(function () {
  17643. return handleUupdateResize(_this6);
  17644. });
  17645. });
  17646. }
  17647. },
  17648. mergeCells: function mergeCells(value) {
  17649. var _this7 = this;
  17650. this.clearMergeCells();
  17651. this.$nextTick(function () {
  17652. return _this7.setMergeCells(value);
  17653. });
  17654. },
  17655. mergeFooterItems: function mergeFooterItems(value) {
  17656. var _this8 = this;
  17657. this.clearMergeFooterItems();
  17658. this.$nextTick(function () {
  17659. return _this8.setMergeFooterItems(value);
  17660. });
  17661. }
  17662. },
  17663. created: function created() {
  17664. var _this9 = this;
  17665. var _Object$assign = Object.assign(this, {
  17666. tZindex: 0,
  17667. elemStore: {},
  17668. // 存放横向 X 虚拟滚动相关的信息
  17669. scrollXStore: {},
  17670. // 存放纵向 Y 虚拟滚动相关信息
  17671. scrollYStore: {},
  17672. // 表格宽度
  17673. tableWidth: 0,
  17674. // 表格高度
  17675. tableHeight: 0,
  17676. // 表头高度
  17677. headerHeight: 0,
  17678. // 表尾高度
  17679. footerHeight: 0,
  17680. // 当前 hover 行
  17681. // hoverRow: null,
  17682. // 最后滚动位置
  17683. lastScrollLeft: 0,
  17684. lastScrollTop: 0,
  17685. // 单选框属性,已选中保留的行
  17686. radioReserveRow: null,
  17687. // 复选框属性,已选中保留的行
  17688. checkboxReserveRowMap: {},
  17689. // 行数据,已展开保留的行
  17690. rowExpandedReserveRowMap: {},
  17691. // 树结构数据,已展开保留的行
  17692. treeExpandedReserveRowMap: {},
  17693. // 完整数据、条件处理后
  17694. tableFullData: [],
  17695. afterFullData: [],
  17696. // 收集的列配置(带分组)
  17697. collectColumn: [],
  17698. // 完整所有列(不带分组)
  17699. tableFullColumn: [],
  17700. // 渲染所有列
  17701. visibleColumn: [],
  17702. // 缓存数据集
  17703. fullAllDataRowMap: new Map(),
  17704. fullAllDataRowIdData: {},
  17705. fullDataRowMap: new Map(),
  17706. fullDataRowIdData: {},
  17707. fullColumnMap: new Map(),
  17708. fullColumnIdData: {},
  17709. fullColumnFieldData: {}
  17710. }),
  17711. scrollXStore = _Object$assign.scrollXStore,
  17712. sYOpts = _Object$assign.sYOpts,
  17713. scrollYStore = _Object$assign.scrollYStore,
  17714. data = _Object$assign.data,
  17715. editOpts = _Object$assign.editOpts,
  17716. treeOpts = _Object$assign.treeOpts,
  17717. treeConfig = _Object$assign.treeConfig,
  17718. showOverflow = _Object$assign.showOverflow,
  17719. rowOpts = _Object$assign.rowOpts;
  17720. if (false) { var exportConfig, exportOpts, importConfig, importOpts; }
  17721. if (false) { var customOpts; } // v4 中只支持对象类型
  17722. if (false) {} // 检查是否有安装需要的模块
  17723. if (false) {}
  17724. Object.assign(scrollYStore, {
  17725. startIndex: 0,
  17726. endIndex: 1,
  17727. visibleSize: 0,
  17728. adaptive: sYOpts.adaptive !== false
  17729. });
  17730. Object.assign(scrollXStore, {
  17731. startIndex: 0,
  17732. endIndex: 1,
  17733. visibleSize: 0
  17734. });
  17735. this.loadTableData(data).then(function () {
  17736. if (data && data.length) {
  17737. _this9.inited = true;
  17738. _this9.initStatus = true;
  17739. _this9.handleLoadDefaults();
  17740. _this9.handleInitDefaults();
  17741. }
  17742. _this9.updateStyle();
  17743. });
  17744. GlobalEvent.on(this, 'paste', this.handleGlobalPasteEvent);
  17745. GlobalEvent.on(this, 'copy', this.handleGlobalCopyEvent);
  17746. GlobalEvent.on(this, 'cut', this.handleGlobalCutEvent);
  17747. GlobalEvent.on(this, 'mousedown', this.handleGlobalMousedownEvent);
  17748. GlobalEvent.on(this, 'blur', this.handleGlobalBlurEvent);
  17749. GlobalEvent.on(this, 'mousewheel', this.handleGlobalMousewheelEvent);
  17750. GlobalEvent.on(this, 'keydown', this.handleGlobalKeydownEvent);
  17751. GlobalEvent.on(this, 'resize', this.handleGlobalResizeEvent);
  17752. GlobalEvent.on(this, 'contextmenu', this.handleGlobalContextmenuEvent);
  17753. this.preventEvent(null, 'created');
  17754. },
  17755. mounted: function mounted() {
  17756. var _this10 = this;
  17757. if (false) { var $listeners; }
  17758. if (this.autoResize) {
  17759. var resizeObserver = createResizeEvent(function () {
  17760. return _this10.recalculate(true);
  17761. });
  17762. resizeObserver.observe(this.$el);
  17763. resizeObserver.observe(this.getParentElem());
  17764. this.$resize = resizeObserver;
  17765. }
  17766. this.preventEvent(null, 'mounted');
  17767. },
  17768. activated: function activated() {
  17769. var _this11 = this;
  17770. this.recalculate().then(function () {
  17771. return _this11.refreshScroll();
  17772. });
  17773. this.preventEvent(null, 'activated');
  17774. },
  17775. deactivated: function deactivated() {
  17776. this.preventEvent(null, 'deactivated');
  17777. },
  17778. beforeDestroy: function beforeDestroy() {
  17779. if (this.$resize) {
  17780. this.$resize.disconnect();
  17781. }
  17782. this.closeFilter();
  17783. this.closeMenu();
  17784. this.preventEvent(null, 'beforeDestroy');
  17785. },
  17786. destroyed: function destroyed() {
  17787. GlobalEvent.off(this, 'paste');
  17788. GlobalEvent.off(this, 'copy');
  17789. GlobalEvent.off(this, 'cut');
  17790. GlobalEvent.off(this, 'mousedown');
  17791. GlobalEvent.off(this, 'blur');
  17792. GlobalEvent.off(this, 'mousewheel');
  17793. GlobalEvent.off(this, 'keydown');
  17794. GlobalEvent.off(this, 'resize');
  17795. GlobalEvent.off(this, 'contextmenu');
  17796. this.preventEvent(null, 'destroyed');
  17797. },
  17798. render: function render(h) {
  17799. var _e = this._e,
  17800. tId = this.tId,
  17801. tableData = this.tableData,
  17802. tableColumn = this.tableColumn,
  17803. tableGroupColumn = this.tableGroupColumn,
  17804. isGroup = this.isGroup,
  17805. loading = this.loading,
  17806. stripe = this.stripe,
  17807. showHeader = this.showHeader,
  17808. height = this.height,
  17809. tableBorder = this.tableBorder,
  17810. treeOpts = this.treeOpts,
  17811. treeConfig = this.treeConfig,
  17812. mouseConfig = this.mouseConfig,
  17813. mouseOpts = this.mouseOpts,
  17814. vSize = this.vSize,
  17815. validOpts = this.validOpts,
  17816. showFooter = this.showFooter,
  17817. overflowX = this.overflowX,
  17818. overflowY = this.overflowY,
  17819. scrollXLoad = this.scrollXLoad,
  17820. scrollYLoad = this.scrollYLoad,
  17821. scrollbarHeight = this.scrollbarHeight,
  17822. highlightCell = this.highlightCell,
  17823. highlightHoverRow = this.highlightHoverRow,
  17824. highlightHoverColumn = this.highlightHoverColumn,
  17825. editConfig = this.editConfig,
  17826. validTipOpts = this.validTipOpts,
  17827. initStore = this.initStore,
  17828. columnStore = this.columnStore,
  17829. filterStore = this.filterStore,
  17830. ctxMenuStore = this.ctxMenuStore,
  17831. ctxMenuOpts = this.ctxMenuOpts,
  17832. footerTableData = this.footerTableData,
  17833. hasTip = this.hasTip,
  17834. columnOpts = this.columnOpts,
  17835. rowOpts = this.rowOpts,
  17836. loadingOpts = this.loadingOpts;
  17837. var leftList = columnStore.leftList,
  17838. rightList = columnStore.rightList;
  17839. return h('div', {
  17840. class: ['vxe-table', 'vxe-table--render-default', "tid_".concat(tId), vSize ? "size--".concat(vSize) : '', "border--".concat(tableBorder), {
  17841. 'vxe-editable': !!editConfig,
  17842. 'cell--highlight': highlightCell,
  17843. 'cell--selected': mouseConfig && mouseOpts.selected,
  17844. 'cell--area': mouseConfig && mouseOpts.area,
  17845. 'row--highlight': rowOpts.isHover || highlightHoverRow,
  17846. 'column--highlight': columnOpts.isHover || highlightHoverColumn,
  17847. 'is--header': showHeader,
  17848. 'is--footer': showFooter,
  17849. 'is--group': isGroup,
  17850. 'is--tree-line': treeConfig && treeOpts.line,
  17851. 'is--fixed-left': leftList.length,
  17852. 'is--fixed-right': rightList.length,
  17853. 'is--animat': !!this.animat,
  17854. 'is--round': this.round,
  17855. 'is--stripe': !treeConfig && stripe,
  17856. 'is--loading': loading,
  17857. 'is--empty': !loading && !tableData.length,
  17858. 'is--scroll-y': overflowY,
  17859. 'is--scroll-x': overflowX,
  17860. 'is--virtual-x': scrollXLoad,
  17861. 'is--virtual-y': scrollYLoad
  17862. }],
  17863. on: {
  17864. keydown: this.keydownEvent
  17865. }
  17866. }, [
  17867. /**
  17868. * 隐藏列
  17869. */
  17870. h('div', {
  17871. class: 'vxe-table-slots',
  17872. ref: 'hideColumn'
  17873. }, this.$slots.default), h('div', {
  17874. class: 'vxe-table--render-wrapper'
  17875. }, [h('div', {
  17876. class: 'vxe-table--main-wrapper'
  17877. }, [
  17878. /**
  17879. * 表头
  17880. */
  17881. showHeader ? h(packages_header, {
  17882. ref: 'tableHeader',
  17883. props: {
  17884. tableData: tableData,
  17885. tableColumn: tableColumn,
  17886. tableGroupColumn: tableGroupColumn,
  17887. size: vSize
  17888. }
  17889. }) : _e(),
  17890. /**
  17891. * 表体
  17892. */
  17893. h('vxe-table-body', {
  17894. ref: 'tableBody',
  17895. props: {
  17896. tableData: tableData,
  17897. tableColumn: tableColumn,
  17898. size: vSize
  17899. }
  17900. }),
  17901. /**
  17902. * 表尾
  17903. */
  17904. showFooter ? h('vxe-table-footer', {
  17905. ref: 'tableFooter',
  17906. props: {
  17907. footerTableData: footerTableData,
  17908. tableColumn: tableColumn,
  17909. size: vSize
  17910. }
  17911. }) : _e()]), h('div', {
  17912. class: 'vxe-table--fixed-wrapper'
  17913. }, [
  17914. /**
  17915. * 左侧固定区域
  17916. */
  17917. leftList && leftList.length && overflowX ? renderFixed(h, this, 'left') : _e(),
  17918. /**
  17919. * 右侧固定区域
  17920. */
  17921. rightList && rightList.length && overflowX ? renderFixed(h, this, 'right') : _e()])]),
  17922. /**
  17923. * 空数据
  17924. */
  17925. h('div', {
  17926. ref: 'emptyPlaceholder',
  17927. class: 'vxe-table--empty-placeholder'
  17928. }, [h('div', {
  17929. class: 'vxe-table--empty-content'
  17930. }, renderEmptyContenet(h, this))]),
  17931. /**
  17932. * 边框线
  17933. */
  17934. h('div', {
  17935. class: 'vxe-table--border-line'
  17936. }),
  17937. /**
  17938. * 列宽线
  17939. */
  17940. h('div', {
  17941. class: 'vxe-table--resizable-bar',
  17942. style: overflowX ? {
  17943. 'padding-bottom': "".concat(scrollbarHeight, "px")
  17944. } : null,
  17945. ref: 'resizeBar'
  17946. }),
  17947. /**
  17948. * 加载中
  17949. */
  17950. h(packages_loading, {
  17951. class: 'vxe-table--loading',
  17952. props: {
  17953. value: loading,
  17954. icon: loadingOpts.icon,
  17955. text: loadingOpts.text
  17956. }
  17957. }),
  17958. /**
  17959. * 筛选
  17960. */
  17961. initStore.filter ? h('vxe-table-filter', {
  17962. ref: 'filterWrapper',
  17963. props: {
  17964. filterStore: filterStore
  17965. }
  17966. }) : _e(),
  17967. /**
  17968. * 导入
  17969. */
  17970. initStore.import && this.importConfig ? h('vxe-import-panel', {
  17971. props: {
  17972. defaultOptions: this.importParams,
  17973. storeData: this.importStore
  17974. }
  17975. }) : _e(),
  17976. /**
  17977. * 导出/打印
  17978. */
  17979. initStore.export && (this.exportConfig || this.printConfig) ? h('vxe-export-panel', {
  17980. props: {
  17981. defaultOptions: this.exportParams,
  17982. storeData: this.exportStore
  17983. }
  17984. }) : _e(),
  17985. /**
  17986. * 快捷菜单
  17987. */
  17988. ctxMenuStore.visible && this.isCtxMenu ? h('vxe-table-context-menu', {
  17989. ref: 'ctxWrapper',
  17990. props: {
  17991. ctxMenuStore: ctxMenuStore,
  17992. ctxMenuOpts: ctxMenuOpts
  17993. }
  17994. }) : _e(),
  17995. /**
  17996. * 通用提示
  17997. */
  17998. hasTip ? h('vxe-tooltip', {
  17999. ref: 'commTip',
  18000. props: {
  18001. isArrow: false,
  18002. enterable: false
  18003. }
  18004. }) : _e(),
  18005. /**
  18006. * 工具提示
  18007. */
  18008. hasTip ? h('vxe-tooltip', {
  18009. ref: 'tooltip',
  18010. props: this.tipConfig
  18011. }) : _e(),
  18012. /**
  18013. * 校验提示
  18014. */
  18015. hasTip && this.editRules && validOpts.showMessage && (validOpts.message === 'default' ? !height : validOpts.message === 'tooltip') ? h('vxe-tooltip', {
  18016. ref: 'validTip',
  18017. class: 'vxe-table--valid-error',
  18018. props: validOpts.message === 'tooltip' || tableData.length === 1 ? validTipOpts : null
  18019. }) : _e()]);
  18020. },
  18021. methods: methods
  18022. });
  18023. // CONCATENATED MODULE: ./packages/table/index.js
  18024. var Table = Object.assign(table, {
  18025. install: function install(Vue) {
  18026. if (typeof window !== 'undefined' && window.VXETableMixin) {
  18027. table.mixins.push(window.VXETableMixin);
  18028. delete window.VXETableMixin;
  18029. }
  18030. v_x_e_table.Vue = Vue;
  18031. v_x_e_table.Table = table;
  18032. v_x_e_table.TableComponent = table;
  18033. if (!Vue.prototype.$vxe) {
  18034. Vue.prototype.$vxe = {
  18035. t: v_x_e_table.t,
  18036. _t: v_x_e_table._t
  18037. };
  18038. } else {
  18039. Vue.prototype.$vxe.t = v_x_e_table.t;
  18040. Vue.prototype.$vxe._t = v_x_e_table._t;
  18041. }
  18042. Vue.component(table.name, table);
  18043. Vue.component(src_body.name, src_body);
  18044. }
  18045. });
  18046. /* harmony default export */ var packages_table = (Table);
  18047. // CONCATENATED MODULE: ./packages/filter/src/panel.js
  18048. /* harmony default export */ var panel = ({
  18049. name: 'VxeTableFilter',
  18050. props: {
  18051. filterStore: Object
  18052. },
  18053. computed: {
  18054. hasCheckOption: function hasCheckOption() {
  18055. var filterStore = this.filterStore;
  18056. return filterStore && filterStore.options.some(function (option) {
  18057. return option.checked;
  18058. });
  18059. }
  18060. },
  18061. render: function render(h) {
  18062. var $xetable = this.$parent,
  18063. filterStore = this.filterStore;
  18064. var args = filterStore.args,
  18065. column = filterStore.column;
  18066. var filterRender = column ? column.filterRender : null;
  18067. var compConf = filterRender ? v_x_e_table.renderer.get(filterRender.name) : null;
  18068. var filterClassName = compConf ? compConf.filterClassName : '';
  18069. return h('div', {
  18070. class: ['vxe-table--filter-wrapper', 'filter--prevent-default', compConf && compConf.className ? compConf.className : '', utils.getClass(filterClassName, Object.assign({
  18071. $panel: this,
  18072. $table: $xetable
  18073. }, args)), {
  18074. 'is--animat': $xetable.animat,
  18075. 'is--multiple': filterStore.multiple,
  18076. 'is--active': filterStore.visible
  18077. }],
  18078. style: filterStore.style
  18079. }, filterStore.visible ? this.renderOptions(h, filterRender, compConf).concat(this.renderFooter(h)) : []);
  18080. },
  18081. methods: {
  18082. renderOptions: function renderOptions(h, filterRender, compConf) {
  18083. var _this = this;
  18084. var $xetable = this.$parent,
  18085. filterStore = this.filterStore;
  18086. var args = filterStore.args,
  18087. column = filterStore.column,
  18088. multiple = filterStore.multiple,
  18089. maxHeight = filterStore.maxHeight;
  18090. var slots = column.slots;
  18091. if (slots && slots.filter) {
  18092. return [h('div', {
  18093. class: 'vxe-table--filter-template'
  18094. }, $xetable.callSlot(slots.filter, Object.assign({
  18095. $panel: this,
  18096. context: this
  18097. }, args), h))];
  18098. } else if (compConf && compConf.renderFilter) {
  18099. return [h('div', {
  18100. class: 'vxe-table--filter-template'
  18101. }, getSlotVNs(compConf.renderFilter.call($xetable, h, filterRender, Object.assign({
  18102. $panel: this,
  18103. context: this
  18104. }, args))))];
  18105. }
  18106. var isAllChecked = multiple ? filterStore.isAllSelected : !filterStore.options.some(function (item) {
  18107. return item._checked;
  18108. });
  18109. var isAllIndeterminate = multiple && filterStore.isIndeterminate;
  18110. return [h('ul', {
  18111. class: 'vxe-table--filter-header'
  18112. }, [h('li', {
  18113. class: ['vxe-table--filter-option', {
  18114. 'is--checked': isAllChecked,
  18115. 'is--indeterminate': isAllIndeterminate
  18116. }],
  18117. attrs: {
  18118. title: src_conf.i18n(multiple ? 'vxe.table.allTitle' : 'vxe.table.allFilter')
  18119. },
  18120. on: {
  18121. click: function click(evnt) {
  18122. _this.changeAllOption(evnt, !filterStore.isAllSelected);
  18123. }
  18124. }
  18125. }, (multiple ? [h('span', {
  18126. class: ['vxe-checkbox--icon', isAllIndeterminate ? src_conf.icon.TABLE_CHECKBOX_INDETERMINATE : isAllChecked ? src_conf.icon.TABLE_CHECKBOX_CHECKED : src_conf.icon.TABLE_CHECKBOX_UNCHECKED]
  18127. })] : []).concat([h('span', {
  18128. class: 'vxe-checkbox--label'
  18129. }, src_conf.i18n('vxe.table.allFilter'))]))]), h('ul', {
  18130. class: 'vxe-table--filter-body',
  18131. style: maxHeight ? {
  18132. maxHeight: "".concat(maxHeight, "px")
  18133. } : {}
  18134. }, filterStore.options.map(function (item) {
  18135. var isChecked = item._checked;
  18136. var isIndeterminate = false;
  18137. return h('li', {
  18138. class: ['vxe-table--filter-option', {
  18139. 'is--checked': isChecked
  18140. }],
  18141. attrs: {
  18142. title: item.label
  18143. },
  18144. on: {
  18145. click: function click(evnt) {
  18146. _this.changeOption(evnt, !item._checked, item);
  18147. }
  18148. }
  18149. }, (multiple ? [h('span', {
  18150. class: ['vxe-checkbox--icon', isIndeterminate ? src_conf.icon.TABLE_CHECKBOX_INDETERMINATE : isChecked ? src_conf.icon.TABLE_CHECKBOX_CHECKED : src_conf.icon.TABLE_CHECKBOX_UNCHECKED]
  18151. })] : []).concat([h('span', {
  18152. class: 'vxe-checkbox--label'
  18153. }, utils.formatText(item.label, 1))]));
  18154. }))];
  18155. },
  18156. renderFooter: function renderFooter(h) {
  18157. var hasCheckOption = this.hasCheckOption,
  18158. filterStore = this.filterStore;
  18159. var column = filterStore.column,
  18160. multiple = filterStore.multiple;
  18161. var filterRender = column.filterRender;
  18162. var compConf = filterRender ? v_x_e_table.renderer.get(filterRender.name) : null;
  18163. var isDisabled = !hasCheckOption && !filterStore.isAllSelected && !filterStore.isIndeterminate;
  18164. 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', {
  18165. class: 'vxe-table--filter-footer'
  18166. }, [h('button', {
  18167. class: {
  18168. 'is--disabled': isDisabled
  18169. },
  18170. attrs: {
  18171. disabled: isDisabled
  18172. },
  18173. on: {
  18174. click: this.confirmFilter
  18175. }
  18176. }, src_conf.i18n('vxe.table.confirmFilter')), h('button', {
  18177. on: {
  18178. click: this.resetFilter
  18179. }
  18180. }, src_conf.i18n('vxe.table.resetFilter'))])] : [];
  18181. },
  18182. // 全部筛选事件
  18183. filterCheckAllEvent: function filterCheckAllEvent(evnt, value) {
  18184. var filterStore = this.filterStore;
  18185. filterStore.options.forEach(function (option) {
  18186. option._checked = value;
  18187. option.checked = value;
  18188. });
  18189. filterStore.isAllSelected = value;
  18190. filterStore.isIndeterminate = false;
  18191. },
  18192. /*************************
  18193. * Publish methods
  18194. *************************/
  18195. // (单选)筛选发生改变
  18196. changeRadioOption: function changeRadioOption(evnt, checked, item) {
  18197. var $xetable = this.$parent,
  18198. filterStore = this.filterStore;
  18199. filterStore.options.forEach(function (option) {
  18200. option._checked = false;
  18201. });
  18202. item._checked = checked;
  18203. $xetable.checkFilterOptions();
  18204. this.confirmFilter(evnt);
  18205. },
  18206. // (多选)筛选发生改变
  18207. changeMultipleOption: function changeMultipleOption(evnt, checked, item) {
  18208. var $xetable = this.$parent;
  18209. item._checked = checked;
  18210. $xetable.checkFilterOptions();
  18211. },
  18212. changeAllOption: function changeAllOption(evnt, checked) {
  18213. if (this.filterStore.multiple) {
  18214. this.filterCheckAllEvent(evnt, checked);
  18215. } else {
  18216. this.resetFilter(evnt);
  18217. }
  18218. },
  18219. // 筛选发生改变
  18220. changeOption: function changeOption(evnt, checked, item) {
  18221. if (this.filterStore.multiple) {
  18222. this.changeMultipleOption(evnt, checked, item);
  18223. } else {
  18224. this.changeRadioOption(evnt, checked, item);
  18225. }
  18226. },
  18227. // 确认筛选
  18228. confirmFilter: function confirmFilter(evnt) {
  18229. var $xetable = this.$parent,
  18230. filterStore = this.filterStore;
  18231. filterStore.options.forEach(function (option) {
  18232. option.checked = option._checked;
  18233. });
  18234. $xetable.confirmFilterEvent(evnt);
  18235. },
  18236. // 重置筛选
  18237. resetFilter: function resetFilter(evnt) {
  18238. var $xetable = this.$parent;
  18239. $xetable.resetFilterEvent(evnt);
  18240. }
  18241. /*************************
  18242. * Publish methods
  18243. *************************/
  18244. }
  18245. });
  18246. // CONCATENATED MODULE: ./packages/filter/src/mixin.js
  18247. /* harmony default export */ var src_mixin = ({
  18248. methods: {
  18249. /**
  18250. * 手动弹出筛选面板
  18251. * @param column
  18252. */
  18253. _openFilter: function _openFilter(fieldOrColumn) {
  18254. var column = handleFieldOrColumn(this, fieldOrColumn);
  18255. if (column && column.filters) {
  18256. var elemStore = this.elemStore;
  18257. var fixed = column.fixed;
  18258. return this.scrollToColumn(column).then(function () {
  18259. var headerWrapperElem = elemStore["".concat(fixed || 'main', "-header-wrapper")] || elemStore['main-header-wrapper'];
  18260. if (headerWrapperElem) {
  18261. var filterBtnElem = headerWrapperElem.querySelector(".vxe-header--column.".concat(column.id, " .vxe-filter--btn"));
  18262. dom.triggerEvent(filterBtnElem, 'click');
  18263. }
  18264. });
  18265. }
  18266. return this.$nextTick();
  18267. },
  18268. /**
  18269. * 修改筛选条件列表
  18270. * @param {ColumnInfo} fieldOrColumn 列
  18271. * @param {Array} options 选项
  18272. */
  18273. _setFilter: function _setFilter(fieldOrColumn, options) {
  18274. var column = handleFieldOrColumn(this, fieldOrColumn);
  18275. if (column && column.filters && options) {
  18276. column.filters = toFilters(options);
  18277. }
  18278. return this.$nextTick();
  18279. },
  18280. checkFilterOptions: function checkFilterOptions() {
  18281. var filterStore = this.filterStore;
  18282. filterStore.isAllSelected = filterStore.options.every(function (item) {
  18283. return item._checked;
  18284. });
  18285. filterStore.isIndeterminate = !filterStore.isAllSelected && filterStore.options.some(function (item) {
  18286. return item._checked;
  18287. });
  18288. },
  18289. /**
  18290. * 点击筛选事件
  18291. * 当筛选图标被点击时触发
  18292. * 更新选项是否全部状态
  18293. * 打开筛选面板
  18294. * @param {Event} evnt 事件
  18295. * @param {ColumnInfo} column 列配置
  18296. * @param {Object} params 参数
  18297. */
  18298. triggerFilterEvent: function triggerFilterEvent(evnt, column, params) {
  18299. var _this = this;
  18300. var filterStore = this.filterStore;
  18301. if (filterStore.column === column && filterStore.visible) {
  18302. filterStore.visible = false;
  18303. } else {
  18304. var targetElem = evnt.target,
  18305. pageX = evnt.pageX;
  18306. var filters = column.filters,
  18307. filterMultiple = column.filterMultiple,
  18308. filterRender = column.filterRender;
  18309. var compConf = filterRender ? v_x_e_table.renderer.get(filterRender.name) : null;
  18310. var filterRecoverMethod = column.filterRecoverMethod || (compConf ? compConf.filterRecoverMethod : null);
  18311. var _DomTools$getDomNode = dom.getDomNode(),
  18312. visibleWidth = _DomTools$getDomNode.visibleWidth;
  18313. Object.assign(filterStore, {
  18314. args: params,
  18315. multiple: filterMultiple,
  18316. options: filters,
  18317. column: column,
  18318. style: null,
  18319. visible: true
  18320. }); // 复原状态
  18321. filterStore.options.forEach(function (option) {
  18322. var _checked = option._checked,
  18323. checked = option.checked;
  18324. option._checked = checked;
  18325. if (!checked && _checked !== checked) {
  18326. if (filterRecoverMethod) {
  18327. filterRecoverMethod({
  18328. option: option,
  18329. column: column,
  18330. $table: _this
  18331. });
  18332. }
  18333. }
  18334. });
  18335. this.checkFilterOptions();
  18336. this.initStore.filter = true;
  18337. this.$nextTick(function () {
  18338. var $refs = _this.$refs;
  18339. var bodyElem = $refs.tableBody.$el;
  18340. var filterWrapperElem = $refs.filterWrapper.$el;
  18341. var filterWidth = 0;
  18342. var filterHeight = 0;
  18343. var filterHeadElem = null;
  18344. var filterFootElem = null;
  18345. if (filterWrapperElem) {
  18346. filterWidth = filterWrapperElem.offsetWidth;
  18347. filterHeight = filterWrapperElem.offsetHeight;
  18348. filterHeadElem = filterWrapperElem.querySelector('.vxe-table--filter-header');
  18349. filterFootElem = filterWrapperElem.querySelector('.vxe-table--filter-footer');
  18350. }
  18351. var centerWidth = filterWidth / 2;
  18352. var minMargin = 10;
  18353. var maxLeft = bodyElem.clientWidth - filterWidth - minMargin;
  18354. var left, right;
  18355. var style = {
  18356. top: "".concat(targetElem.offsetTop + targetElem.offsetParent.offsetTop + targetElem.offsetHeight + 8, "px")
  18357. }; // 判断面板不能大于表格高度
  18358. var maxHeight = null;
  18359. if (filterHeight >= bodyElem.clientHeight) {
  18360. maxHeight = Math.max(60, bodyElem.clientHeight - (filterFootElem ? filterFootElem.offsetHeight : 0) - (filterHeadElem ? filterHeadElem.offsetHeight : 0));
  18361. }
  18362. if (column.fixed === 'left') {
  18363. left = targetElem.offsetLeft + targetElem.offsetParent.offsetLeft - centerWidth;
  18364. } else if (column.fixed === 'right') {
  18365. right = targetElem.offsetParent.offsetWidth - targetElem.offsetLeft + (targetElem.offsetParent.offsetParent.offsetWidth - targetElem.offsetParent.offsetLeft) - column.renderWidth - centerWidth;
  18366. } else {
  18367. left = targetElem.offsetLeft + targetElem.offsetParent.offsetLeft - centerWidth - bodyElem.scrollLeft;
  18368. }
  18369. if (left) {
  18370. var overflowWidth = pageX + filterWidth - centerWidth + minMargin - visibleWidth;
  18371. if (overflowWidth > 0) {
  18372. left -= overflowWidth;
  18373. }
  18374. style.left = "".concat(Math.min(maxLeft, Math.max(minMargin, left)), "px");
  18375. } else if (right) {
  18376. var _overflowWidth = pageX + filterWidth - centerWidth + minMargin - visibleWidth;
  18377. if (_overflowWidth > 0) {
  18378. right += _overflowWidth;
  18379. }
  18380. style.right = "".concat(Math.max(minMargin, right), "px");
  18381. }
  18382. filterStore.style = style;
  18383. filterStore.maxHeight = maxHeight;
  18384. });
  18385. }
  18386. this.emitEvent('filter-visible', {
  18387. column: column,
  18388. field: column.field,
  18389. property: column.field,
  18390. filterList: this.getCheckedFilters(),
  18391. visible: filterStore.visible
  18392. }, evnt);
  18393. },
  18394. _getCheckedFilters: function _getCheckedFilters() {
  18395. var tableFullColumn = this.tableFullColumn;
  18396. var filterList = [];
  18397. tableFullColumn.filter(function (column) {
  18398. var field = column.field,
  18399. filters = column.filters;
  18400. var valueList = [];
  18401. var dataList = [];
  18402. if (filters && filters.length) {
  18403. filters.forEach(function (item) {
  18404. if (item.checked) {
  18405. valueList.push(item.value);
  18406. dataList.push(item.data);
  18407. }
  18408. });
  18409. if (valueList.length) {
  18410. filterList.push({
  18411. column: column,
  18412. field: field,
  18413. property: field,
  18414. values: valueList,
  18415. datas: dataList
  18416. });
  18417. }
  18418. }
  18419. });
  18420. return filterList;
  18421. },
  18422. /**
  18423. * 确认筛选
  18424. * 当筛选面板中的确定按钮被按下时触发
  18425. * @param {Event} evnt 事件
  18426. */
  18427. confirmFilterEvent: function confirmFilterEvent(evnt) {
  18428. var _this2 = this;
  18429. var filterStore = this.filterStore,
  18430. filterOpts = this.filterOpts,
  18431. oldScrollXLoad = this.scrollXLoad,
  18432. oldScrollYLoad = this.scrollYLoad;
  18433. var column = filterStore.column;
  18434. var field = column.field;
  18435. var values = [];
  18436. var datas = [];
  18437. column.filters.forEach(function (item) {
  18438. if (item.checked) {
  18439. values.push(item.value);
  18440. datas.push(item.data);
  18441. }
  18442. });
  18443. var filterList = this.getCheckedFilters(); // 如果是服务端筛选,则跳过本地筛选处理
  18444. if (!filterOpts.remote) {
  18445. this.handleTableData(true);
  18446. this.checkSelectionStatus();
  18447. }
  18448. this.emitEvent('filter-change', {
  18449. column: column,
  18450. field: field,
  18451. property: field,
  18452. values: values,
  18453. datas: datas,
  18454. filters: filterList,
  18455. filterList: filterList
  18456. }, evnt);
  18457. this.closeFilter();
  18458. this.updateFooter().then(function () {
  18459. var scrollXLoad = _this2.scrollXLoad,
  18460. scrollYLoad = _this2.scrollYLoad;
  18461. if (oldScrollXLoad || scrollXLoad || oldScrollYLoad || scrollYLoad) {
  18462. if (oldScrollXLoad || scrollXLoad) {
  18463. _this2.updateScrollXSpace();
  18464. }
  18465. if (oldScrollYLoad || scrollYLoad) {
  18466. _this2.updateScrollYSpace();
  18467. }
  18468. return _this2.refreshScroll();
  18469. }
  18470. }).then(function () {
  18471. _this2.updateCellAreas();
  18472. return _this2.recalculate(true);
  18473. }).then(function () {
  18474. // 存在滚动行为未结束情况
  18475. setTimeout(function () {
  18476. return _this2.recalculate();
  18477. }, 50);
  18478. });
  18479. },
  18480. handleClearFilter: function handleClearFilter(column) {
  18481. if (column) {
  18482. var filters = column.filters,
  18483. filterRender = column.filterRender;
  18484. if (filters) {
  18485. var compConf = filterRender ? v_x_e_table.renderer.get(filterRender.name) : null;
  18486. var filterResetMethod = column.filterResetMethod || (compConf ? compConf.filterResetMethod : null);
  18487. filters.forEach(function (item) {
  18488. item._checked = false;
  18489. item.checked = false;
  18490. if (!filterResetMethod) {
  18491. item.data = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.clone(item.resetValue, true);
  18492. }
  18493. });
  18494. if (filterResetMethod) {
  18495. filterResetMethod({
  18496. options: filters,
  18497. column: column,
  18498. $table: this
  18499. });
  18500. }
  18501. }
  18502. }
  18503. },
  18504. /**
  18505. * 重置筛选
  18506. * 当筛选面板中的重置按钮被按下时触发
  18507. * @param {Event} evnt 事件
  18508. */
  18509. resetFilterEvent: function resetFilterEvent(evnt) {
  18510. this.handleClearFilter(this.filterStore.column);
  18511. this.confirmFilterEvent(evnt);
  18512. },
  18513. /**
  18514. * 清空指定列的筛选条件
  18515. * 如果为空则清空所有列的筛选条件
  18516. * @param {String} fieldOrColumn 列
  18517. */
  18518. _clearFilter: function _clearFilter(fieldOrColumn) {
  18519. var filterStore = this.filterStore;
  18520. var column;
  18521. if (fieldOrColumn) {
  18522. column = handleFieldOrColumn(this, fieldOrColumn);
  18523. if (column) {
  18524. this.handleClearFilter(column);
  18525. }
  18526. } else {
  18527. this.visibleColumn.forEach(this.handleClearFilter);
  18528. }
  18529. if (!fieldOrColumn || column !== filterStore.column) {
  18530. Object.assign(filterStore, {
  18531. isAllSelected: false,
  18532. isIndeterminate: false,
  18533. style: null,
  18534. options: [],
  18535. column: null,
  18536. multiple: false,
  18537. visible: false
  18538. });
  18539. }
  18540. return this.updateData();
  18541. }
  18542. }
  18543. });
  18544. // CONCATENATED MODULE: ./packages/filter/index.js
  18545. var Filter = {
  18546. Panel: panel,
  18547. install: function install(Vue) {
  18548. v_x_e_table.reg('filter');
  18549. packages_table.mixins.push(src_mixin);
  18550. Vue.component(panel.name, panel);
  18551. }
  18552. };
  18553. /* harmony default export */ var filter = (Filter);
  18554. // CONCATENATED MODULE: ./packages/menu/src/panel.js
  18555. /* harmony default export */ var src_panel = ({
  18556. name: 'VxeTableContextMenu',
  18557. props: {
  18558. ctxMenuStore: Object,
  18559. ctxMenuOpts: Object
  18560. },
  18561. mounted: function mounted() {
  18562. document.body.appendChild(this.$el);
  18563. },
  18564. beforeDestroy: function beforeDestroy() {
  18565. var $el = this.$el;
  18566. if ($el.parentNode) {
  18567. $el.parentNode.removeChild($el);
  18568. }
  18569. },
  18570. render: function render(h) {
  18571. var $xetable = this.$parent;
  18572. var _e = this._e,
  18573. ctxMenuOpts = this.ctxMenuOpts,
  18574. ctxMenuStore = this.ctxMenuStore;
  18575. return h('div', {
  18576. class: ['vxe-table--context-menu-wrapper', ctxMenuOpts.className],
  18577. style: ctxMenuStore.style
  18578. }, ctxMenuStore.list.map(function (options, gIndex) {
  18579. return options.every(function (item) {
  18580. return item.visible === false;
  18581. }) ? _e() : h('ul', {
  18582. class: 'vxe-context-menu--option-wrapper',
  18583. key: gIndex
  18584. }, options.map(function (item, index) {
  18585. var hasChildMenus = item.children && item.children.some(function (child) {
  18586. return child.visible !== false;
  18587. });
  18588. return item.visible === false ? null : h('li', {
  18589. class: [item.className, {
  18590. 'link--disabled': item.disabled,
  18591. 'link--active': item === ctxMenuStore.selected
  18592. }],
  18593. key: "".concat(gIndex, "_").concat(index)
  18594. }, [h('a', {
  18595. class: 'vxe-context-menu--link',
  18596. on: {
  18597. click: function click(evnt) {
  18598. $xetable.ctxMenuLinkEvent(evnt, item);
  18599. },
  18600. mouseover: function mouseover(evnt) {
  18601. $xetable.ctxMenuMouseoverEvent(evnt, item);
  18602. },
  18603. mouseout: function mouseout(evnt) {
  18604. $xetable.ctxMenuMouseoutEvent(evnt, item);
  18605. }
  18606. }
  18607. }, [h('i', {
  18608. class: ['vxe-context-menu--link-prefix', item.prefixIcon]
  18609. }), h('span', {
  18610. class: 'vxe-context-menu--link-content'
  18611. }, getFuncText(item.name)), h('i', {
  18612. class: ['vxe-context-menu--link-suffix', hasChildMenus ? item.suffixIcon || 'suffix--haschild' : item.suffixIcon]
  18613. })]), hasChildMenus ? h('ul', {
  18614. class: ['vxe-table--context-menu-clild-wrapper', {
  18615. 'is--show': item === ctxMenuStore.selected && ctxMenuStore.showChild
  18616. }]
  18617. }, item.children.map(function (child, cIndex) {
  18618. return child.visible === false ? null : h('li', {
  18619. class: [child.className, {
  18620. 'link--disabled': child.disabled,
  18621. 'link--active': child === ctxMenuStore.selectChild
  18622. }],
  18623. key: "".concat(gIndex, "_").concat(index, "_").concat(cIndex)
  18624. }, [h('a', {
  18625. class: 'vxe-context-menu--link',
  18626. on: {
  18627. click: function click(evnt) {
  18628. $xetable.ctxMenuLinkEvent(evnt, child);
  18629. },
  18630. mouseover: function mouseover(evnt) {
  18631. $xetable.ctxMenuMouseoverEvent(evnt, item, child);
  18632. },
  18633. mouseout: function mouseout(evnt) {
  18634. $xetable.ctxMenuMouseoutEvent(evnt, item, child);
  18635. }
  18636. }
  18637. }, [h('i', {
  18638. class: ['vxe-context-menu--link-prefix', child.prefixIcon]
  18639. }), h('span', {
  18640. class: 'vxe-context-menu--link-content'
  18641. }, getFuncText(child.name))])]);
  18642. })) : null]);
  18643. }));
  18644. }));
  18645. }
  18646. });
  18647. // CONCATENATED MODULE: ./packages/menu/src/mixin.js
  18648. /* harmony default export */ var menu_src_mixin = ({
  18649. methods: {
  18650. /**
  18651. * 关闭快捷菜单
  18652. */
  18653. _closeMenu: function _closeMenu() {
  18654. Object.assign(this.ctxMenuStore, {
  18655. visible: false,
  18656. selected: null,
  18657. selectChild: null,
  18658. showChild: false
  18659. });
  18660. return this.$nextTick();
  18661. },
  18662. // 处理菜单的移动
  18663. moveCtxMenu: function moveCtxMenu(evnt, keyCode, ctxMenuStore, property, operKey, operRest, menuList) {
  18664. var selectItem;
  18665. var selectIndex = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.findIndexOf(menuList, function (item) {
  18666. return ctxMenuStore[property] === item;
  18667. });
  18668. if (keyCode === operKey) {
  18669. if (operRest && utils.hasChildrenList(ctxMenuStore.selected)) {
  18670. ctxMenuStore.showChild = true;
  18671. } else {
  18672. ctxMenuStore.showChild = false;
  18673. ctxMenuStore.selectChild = null;
  18674. }
  18675. } else if (keyCode === 38) {
  18676. for (var len = selectIndex - 1; len >= 0; len--) {
  18677. if (menuList[len].visible !== false) {
  18678. selectItem = menuList[len];
  18679. break;
  18680. }
  18681. }
  18682. ctxMenuStore[property] = selectItem || menuList[menuList.length - 1];
  18683. } else if (keyCode === 40) {
  18684. for (var index = selectIndex + 1; index < menuList.length; index++) {
  18685. if (menuList[index].visible !== false) {
  18686. selectItem = menuList[index];
  18687. break;
  18688. }
  18689. }
  18690. ctxMenuStore[property] = selectItem || menuList[0];
  18691. } else if (ctxMenuStore[property] && (keyCode === 13 || keyCode === 32)) {
  18692. this.ctxMenuLinkEvent(evnt, ctxMenuStore[property]);
  18693. }
  18694. },
  18695. /**
  18696. * 快捷菜单事件处理
  18697. */
  18698. handleGlobalContextmenuEvent: function handleGlobalContextmenuEvent(evnt) {
  18699. var $refs = this.$refs,
  18700. tId = this.tId,
  18701. editStore = this.editStore,
  18702. menuConfig = this.menuConfig,
  18703. contextMenu = this.contextMenu,
  18704. ctxMenuStore = this.ctxMenuStore,
  18705. ctxMenuOpts = this.ctxMenuOpts,
  18706. mouseConfig = this.mouseConfig,
  18707. mouseOpts = this.mouseOpts;
  18708. var selected = editStore.selected;
  18709. var layoutList = ['header', 'body', 'footer'];
  18710. if (isEnableConf(menuConfig) || contextMenu) {
  18711. if (ctxMenuStore.visible && $refs.ctxWrapper && dom.getEventTargetNode(evnt, $refs.ctxWrapper.$el).flag) {
  18712. evnt.preventDefault();
  18713. return;
  18714. }
  18715. if (this._keyCtx) {
  18716. var type = 'body';
  18717. var params = {
  18718. type: type,
  18719. $grid: this.$xegrid,
  18720. $table: this,
  18721. keyboard: true,
  18722. columns: this.visibleColumn.slice(0),
  18723. $event: evnt
  18724. }; // 如果开启单元格区域
  18725. if (mouseConfig && mouseOpts.area) {
  18726. var activeArea = this.getActiveCellArea();
  18727. if (activeArea && activeArea.row && activeArea.column) {
  18728. params.row = activeArea.row;
  18729. params.column = activeArea.column;
  18730. this.openContextMenu(evnt, type, params);
  18731. return;
  18732. }
  18733. } else if (mouseConfig && mouseOpts.selected) {
  18734. // 如果启用键盘导航且已选中单元格
  18735. if (selected.row && selected.column) {
  18736. params.row = selected.row;
  18737. params.column = selected.column;
  18738. this.openContextMenu(evnt, type, params);
  18739. return;
  18740. }
  18741. }
  18742. } // 分别匹配表尾、内容、表尾的快捷菜单
  18743. for (var index = 0; index < layoutList.length; index++) {
  18744. var layout = layoutList[index];
  18745. var columnTargetNode = dom.getEventTargetNode(evnt, this.$el, "vxe-".concat(layout, "--column"), function (target) {
  18746. // target=td|th,直接向上找 table 去匹配即可
  18747. return target.parentNode.parentNode.parentNode.getAttribute('xid') === tId;
  18748. });
  18749. var _params = {
  18750. type: layout,
  18751. $grid: this.$xegrid,
  18752. $table: this,
  18753. columns: this.visibleColumn.slice(0),
  18754. $event: evnt
  18755. };
  18756. if (columnTargetNode.flag) {
  18757. var cell = columnTargetNode.targetElem;
  18758. var column = this.getColumnNode(cell).item;
  18759. var typePrefix = "".concat(layout, "-");
  18760. Object.assign(_params, {
  18761. column: column,
  18762. columnIndex: this.getColumnIndex(column),
  18763. cell: cell
  18764. });
  18765. if (layout === 'body') {
  18766. var row = this.getRowNode(cell.parentNode).item;
  18767. typePrefix = '';
  18768. _params.row = row;
  18769. _params.rowIndex = this.getRowIndex(row);
  18770. }
  18771. this.openContextMenu(evnt, layout, _params); // 在 v4 中废弃事件 cell-context-menu、header-cell-context-menu、footer-cell-context-menu
  18772. if (this.$listeners["".concat(typePrefix, "cell-context-menu")]) {
  18773. if (false) {}
  18774. this.emitEvent("".concat(typePrefix, "cell-context-menu"), _params, evnt);
  18775. } else {
  18776. this.emitEvent("".concat(typePrefix, "cell-menu"), _params, evnt);
  18777. }
  18778. return;
  18779. } else if (dom.getEventTargetNode(evnt, this.$el, "vxe-table--".concat(layout, "-wrapper"), function (target) {
  18780. return target.getAttribute('xid') === tId;
  18781. }).flag) {
  18782. if (ctxMenuOpts.trigger === 'cell') {
  18783. evnt.preventDefault();
  18784. } else {
  18785. this.openContextMenu(evnt, layout, _params);
  18786. }
  18787. return;
  18788. }
  18789. }
  18790. }
  18791. if ($refs.filterWrapper && !dom.getEventTargetNode(evnt, $refs.filterWrapper.$el).flag) {
  18792. this.closeFilter();
  18793. }
  18794. this.closeMenu();
  18795. },
  18796. /**
  18797. * 显示快捷菜单
  18798. */
  18799. openContextMenu: function openContextMenu(evnt, type, params) {
  18800. var _this = this;
  18801. var isCtxMenu = this.isCtxMenu,
  18802. ctxMenuStore = this.ctxMenuStore,
  18803. ctxMenuOpts = this.ctxMenuOpts;
  18804. var config = ctxMenuOpts[type];
  18805. var visibleMethod = ctxMenuOpts.visibleMethod;
  18806. if (config) {
  18807. var options = config.options,
  18808. disabled = config.disabled;
  18809. if (disabled) {
  18810. evnt.preventDefault();
  18811. } else if (isCtxMenu && options && options.length) {
  18812. params.options = options;
  18813. this.preventEvent(evnt, 'event.showMenu', params, function () {
  18814. if (!visibleMethod || visibleMethod(params)) {
  18815. evnt.preventDefault();
  18816. _this.updateZindex();
  18817. var _DomTools$getDomNode = dom.getDomNode(),
  18818. scrollTop = _DomTools$getDomNode.scrollTop,
  18819. scrollLeft = _DomTools$getDomNode.scrollLeft,
  18820. visibleHeight = _DomTools$getDomNode.visibleHeight,
  18821. visibleWidth = _DomTools$getDomNode.visibleWidth;
  18822. var top = evnt.clientY + scrollTop;
  18823. var left = evnt.clientX + scrollLeft;
  18824. var handleVisible = function handleVisible() {
  18825. Object.assign(ctxMenuStore, {
  18826. args: params,
  18827. visible: true,
  18828. list: options,
  18829. selected: null,
  18830. selectChild: null,
  18831. showChild: false,
  18832. style: {
  18833. zIndex: _this.tZindex,
  18834. top: "".concat(top, "px"),
  18835. left: "".concat(left, "px")
  18836. }
  18837. });
  18838. _this.$nextTick(function () {
  18839. var ctxElem = _this.$refs.ctxWrapper.$el;
  18840. var clientHeight = ctxElem.clientHeight;
  18841. var clientWidth = ctxElem.clientWidth;
  18842. var _DomTools$getAbsolute = dom.getAbsolutePos(ctxElem),
  18843. boundingTop = _DomTools$getAbsolute.boundingTop,
  18844. boundingLeft = _DomTools$getAbsolute.boundingLeft;
  18845. var offsetTop = boundingTop + clientHeight - visibleHeight;
  18846. var offsetLeft = boundingLeft + clientWidth - visibleWidth;
  18847. if (offsetTop > -10) {
  18848. ctxMenuStore.style.top = "".concat(Math.max(scrollTop + 2, top - clientHeight - 2), "px");
  18849. }
  18850. if (offsetLeft > -10) {
  18851. ctxMenuStore.style.left = "".concat(Math.max(scrollLeft + 2, left - clientWidth - 2), "px");
  18852. }
  18853. });
  18854. };
  18855. var keyboard = params.keyboard,
  18856. row = params.row,
  18857. column = params.column;
  18858. if (keyboard && row && column) {
  18859. _this.scrollToRow(row, column).then(function () {
  18860. var cell = _this.getCell(row, column);
  18861. var _DomTools$getAbsolute2 = dom.getAbsolutePos(cell),
  18862. boundingTop = _DomTools$getAbsolute2.boundingTop,
  18863. boundingLeft = _DomTools$getAbsolute2.boundingLeft;
  18864. top = boundingTop + scrollTop + Math.floor(cell.offsetHeight / 2);
  18865. left = boundingLeft + scrollLeft + Math.floor(cell.offsetWidth / 2);
  18866. handleVisible();
  18867. });
  18868. } else {
  18869. handleVisible();
  18870. }
  18871. } else {
  18872. _this.closeMenu();
  18873. }
  18874. });
  18875. }
  18876. }
  18877. this.closeFilter();
  18878. },
  18879. ctxMenuMouseoverEvent: function ctxMenuMouseoverEvent(evnt, item, child) {
  18880. var menuElem = evnt.currentTarget;
  18881. var ctxMenuStore = this.ctxMenuStore;
  18882. evnt.preventDefault();
  18883. evnt.stopPropagation();
  18884. ctxMenuStore.selected = item;
  18885. ctxMenuStore.selectChild = child;
  18886. if (!child) {
  18887. ctxMenuStore.showChild = utils.hasChildrenList(item);
  18888. if (ctxMenuStore.showChild) {
  18889. this.$nextTick(function () {
  18890. var childWrapperElem = menuElem.nextElementSibling;
  18891. if (childWrapperElem) {
  18892. var _DomTools$getAbsolute3 = dom.getAbsolutePos(menuElem),
  18893. boundingTop = _DomTools$getAbsolute3.boundingTop,
  18894. boundingLeft = _DomTools$getAbsolute3.boundingLeft,
  18895. visibleHeight = _DomTools$getAbsolute3.visibleHeight,
  18896. visibleWidth = _DomTools$getAbsolute3.visibleWidth;
  18897. var posTop = boundingTop + menuElem.offsetHeight;
  18898. var posLeft = boundingLeft + menuElem.offsetWidth;
  18899. var left = '';
  18900. var right = ''; // 是否超出右侧
  18901. if (posLeft + childWrapperElem.offsetWidth > visibleWidth - 10) {
  18902. left = 'auto';
  18903. right = "".concat(menuElem.offsetWidth, "px");
  18904. } // 是否超出底部
  18905. var top = '';
  18906. var bottom = '';
  18907. if (posTop + childWrapperElem.offsetHeight > visibleHeight - 10) {
  18908. top = 'auto';
  18909. bottom = '0';
  18910. }
  18911. childWrapperElem.style.left = left;
  18912. childWrapperElem.style.right = right;
  18913. childWrapperElem.style.top = top;
  18914. childWrapperElem.style.bottom = bottom;
  18915. }
  18916. });
  18917. }
  18918. }
  18919. },
  18920. ctxMenuMouseoutEvent: function ctxMenuMouseoutEvent(evnt, item) {
  18921. var ctxMenuStore = this.ctxMenuStore;
  18922. if (!item.children) {
  18923. ctxMenuStore.selected = null;
  18924. }
  18925. ctxMenuStore.selectChild = null;
  18926. },
  18927. /**
  18928. * 快捷菜单点击事件
  18929. */
  18930. ctxMenuLinkEvent: function ctxMenuLinkEvent(evnt, menu) {
  18931. // 如果一级菜单有配置 code 则允许点击,否则不能点击
  18932. if (!menu.disabled && (menu.code || !menu.children || !menu.children.length)) {
  18933. var ctxMenuMethod = v_x_e_table.menus.get(menu.code);
  18934. var params = Object.assign({
  18935. menu: menu,
  18936. $grid: this.$xegrid,
  18937. $table: this,
  18938. $event: evnt
  18939. }, this.ctxMenuStore.args);
  18940. if (ctxMenuMethod) {
  18941. ctxMenuMethod.call(this, params, evnt);
  18942. } // 在 v4 中废弃事件 context-menu-click
  18943. if (this.$listeners['context-menu-click']) {
  18944. if (false) {}
  18945. this.emitEvent('context-menu-click', params, evnt);
  18946. } else {
  18947. this.emitEvent('menu-click', params, evnt);
  18948. }
  18949. this.closeMenu();
  18950. }
  18951. }
  18952. }
  18953. });
  18954. // CONCATENATED MODULE: ./packages/menu/index.js
  18955. var Menu = {
  18956. Panel: src_panel,
  18957. install: function install(Vue) {
  18958. v_x_e_table.reg('menu');
  18959. packages_table.mixins.push(menu_src_mixin);
  18960. Vue.component(src_panel.name, src_panel);
  18961. }
  18962. };
  18963. /* harmony default export */ var packages_menu = (Menu);
  18964. // CONCATENATED MODULE: ./packages/edit/src/mixin.js
  18965. function insertTreeRow(_vm, newRecords, isAppend) {
  18966. var tableFullTreeData = _vm.tableFullTreeData,
  18967. afterFullData = _vm.afterFullData,
  18968. fullDataRowIdData = _vm.fullDataRowIdData,
  18969. fullAllDataRowIdData = _vm.fullAllDataRowIdData,
  18970. treeOpts = _vm.treeOpts;
  18971. var rowField = treeOpts.rowField,
  18972. parentField = treeOpts.parentField,
  18973. children = treeOpts.children,
  18974. mapChildren = treeOpts.mapChildren;
  18975. var funcName = isAppend ? 'push' : 'unshift';
  18976. newRecords.forEach(function (item) {
  18977. var parentRowId = item[parentField];
  18978. var rowid = getRowid(_vm, item);
  18979. var matchObj = parentRowId ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.findTree(tableFullTreeData, function (item) {
  18980. return parentRowId === item[rowField];
  18981. }, {
  18982. children: mapChildren
  18983. }) : null;
  18984. if (matchObj) {
  18985. var parentRow = matchObj.item;
  18986. var parentRest = fullAllDataRowIdData[getRowid(_vm, parentRow)];
  18987. var parentLevel = parentRest ? parentRest.level : 0;
  18988. var parentChilds = parentRow[children];
  18989. if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(parentChilds)) {
  18990. parentChilds = parentRow[children] = [];
  18991. }
  18992. parentChilds[funcName](item);
  18993. var rest = {
  18994. row: item,
  18995. rowid: rowid,
  18996. seq: -1,
  18997. index: -1,
  18998. _index: -1,
  18999. $index: -1,
  19000. items: parentChilds,
  19001. parent: parent,
  19002. level: parentLevel + 1
  19003. };
  19004. fullDataRowIdData[rowid] = rest;
  19005. fullAllDataRowIdData[rowid] = rest;
  19006. } else {
  19007. if (false) {}
  19008. afterFullData[funcName](item);
  19009. tableFullTreeData[funcName](item);
  19010. var _rest = {
  19011. row: item,
  19012. rowid: rowid,
  19013. seq: -1,
  19014. index: -1,
  19015. _index: -1,
  19016. $index: -1,
  19017. items: tableFullTreeData,
  19018. parent: null,
  19019. level: 0
  19020. };
  19021. fullDataRowIdData[rowid] = _rest;
  19022. fullAllDataRowIdData[rowid] = _rest;
  19023. }
  19024. });
  19025. }
  19026. /* harmony default export */ var edit_src_mixin = ({
  19027. methods: {
  19028. /**
  19029. * 往表格中插入临时数据
  19030. *
  19031. * @param {*} records
  19032. */
  19033. _insert: function _insert(records) {
  19034. return this.insertAt(records);
  19035. },
  19036. /**
  19037. * 往表格指定行中插入临时数据
  19038. * 如果 row 为空则从插入到顶部
  19039. * 如果 row 为 -1 则从插入到底部
  19040. * 如果 row 为有效行则插入到该行的位置
  19041. * @param {Object/Array} records 新的数据
  19042. * @param {Row} row 指定行
  19043. */
  19044. _insertAt: function _insertAt(records, row) {
  19045. var _this = this,
  19046. _editStore$insertList;
  19047. var tableFullTreeData = this.tableFullTreeData,
  19048. mergeList = this.mergeList,
  19049. afterFullData = this.afterFullData,
  19050. editStore = this.editStore,
  19051. tableFullData = this.tableFullData,
  19052. treeConfig = this.treeConfig,
  19053. fullDataRowIdData = this.fullDataRowIdData,
  19054. fullAllDataRowIdData = this.fullAllDataRowIdData,
  19055. treeOpts = this.treeOpts;
  19056. var transform = treeOpts.transform,
  19057. rowField = treeOpts.rowField,
  19058. mapChildren = treeOpts.mapChildren;
  19059. if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(records)) {
  19060. records = [records];
  19061. }
  19062. var newRecords = records.map(function (record) {
  19063. return _this.defineField(Object.assign({}, record));
  19064. });
  19065. if (!row) {
  19066. // 如果为虚拟树
  19067. if (treeConfig && transform) {
  19068. insertTreeRow(this, newRecords, false);
  19069. } else {
  19070. afterFullData.unshift.apply(afterFullData, _toConsumableArray(newRecords));
  19071. tableFullData.unshift.apply(tableFullData, _toConsumableArray(newRecords)); // 刷新单元格合并
  19072. mergeList.forEach(function (mergeItem) {
  19073. var mergeRowIndex = mergeItem.row;
  19074. if (mergeRowIndex > 0) {
  19075. mergeItem.row = mergeRowIndex + newRecords.length;
  19076. }
  19077. });
  19078. }
  19079. } else {
  19080. if (row === -1) {
  19081. // 如果为虚拟树
  19082. if (treeConfig && transform) {
  19083. insertTreeRow(this, newRecords, true);
  19084. } else {
  19085. afterFullData.push.apply(afterFullData, _toConsumableArray(newRecords));
  19086. tableFullData.push.apply(tableFullData, _toConsumableArray(newRecords)); // 刷新单元格合并
  19087. mergeList.forEach(function (mergeItem) {
  19088. var mergeRowIndex = mergeItem.row,
  19089. mergeRowspan = mergeItem.rowspan;
  19090. if (mergeRowIndex + mergeRowspan > afterFullData.length) {
  19091. mergeItem.rowspan = mergeRowspan + newRecords.length;
  19092. }
  19093. });
  19094. }
  19095. } else {
  19096. // 如果为虚拟树
  19097. if (treeConfig && transform) {
  19098. var matchObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.findTree(tableFullTreeData, function (item) {
  19099. return row[rowField] === item[rowField];
  19100. }, {
  19101. children: mapChildren
  19102. });
  19103. if (matchObj) {
  19104. var parentRow = matchObj.parent;
  19105. var parentChilds = matchObj.items;
  19106. var parentRest = fullAllDataRowIdData[getRowid(this, parentRow)];
  19107. var parentLevel = parentRest ? parentRest.level : 0;
  19108. newRecords.forEach(function (item, i) {
  19109. var rowid = getRowid(_this, item);
  19110. if (false) {}
  19111. if (parentRow) {
  19112. item[treeOpts.parentField] = parentRow[rowField];
  19113. }
  19114. parentChilds.splice(matchObj.index + i, 0, item);
  19115. var rest = {
  19116. row: item,
  19117. rowid: rowid,
  19118. seq: -1,
  19119. index: -1,
  19120. _index: -1,
  19121. $index: -1,
  19122. items: parentChilds,
  19123. parent: parentRow,
  19124. level: parentLevel + 1
  19125. };
  19126. fullDataRowIdData[rowid] = rest;
  19127. fullAllDataRowIdData[rowid] = rest;
  19128. });
  19129. } else {
  19130. if (false) {}
  19131. insertTreeRow(this, newRecords, true);
  19132. }
  19133. } else {
  19134. if (treeConfig) {
  19135. throw new Error(getLog('vxe.error.noTree', ['insert']));
  19136. }
  19137. var afIndex = -1; // 如果是可视索引
  19138. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNumber(row)) {
  19139. if (row < afterFullData.length) {
  19140. afIndex = row;
  19141. }
  19142. } else {
  19143. afIndex = this.findRowIndexOf(afterFullData, row);
  19144. }
  19145. if (afIndex === -1) {
  19146. throw new Error(errLog('vxe.error.unableInsert'));
  19147. }
  19148. afterFullData.splice.apply(afterFullData, [afIndex, 0].concat(_toConsumableArray(newRecords)));
  19149. tableFullData.splice.apply(tableFullData, [this.findRowIndexOf(tableFullData, row), 0].concat(_toConsumableArray(newRecords))); // 刷新单元格合并
  19150. mergeList.forEach(function (mergeItem) {
  19151. var mergeRowIndex = mergeItem.row,
  19152. mergeRowspan = mergeItem.rowspan;
  19153. if (mergeRowIndex > afIndex) {
  19154. mergeItem.row = mergeRowIndex + newRecords.length;
  19155. } else if (mergeRowIndex + mergeRowspan > afIndex) {
  19156. mergeItem.rowspan = mergeRowspan + newRecords.length;
  19157. }
  19158. });
  19159. }
  19160. }
  19161. }
  19162. (_editStore$insertList = editStore.insertList).unshift.apply(_editStore$insertList, _toConsumableArray(newRecords));
  19163. this.handleTableData(treeConfig && transform);
  19164. if (!(treeConfig && transform)) {
  19165. this.updateAfterDataIndex();
  19166. }
  19167. this.updateFooter();
  19168. this.cacheRowMap();
  19169. this.checkSelectionStatus();
  19170. if (this.scrollYLoad) {
  19171. this.updateScrollYSpace();
  19172. }
  19173. return this.$nextTick().then(function () {
  19174. _this.updateCellAreas();
  19175. return _this.recalculate();
  19176. }).then(function () {
  19177. return {
  19178. row: newRecords.length ? newRecords[newRecords.length - 1] : null,
  19179. rows: newRecords
  19180. };
  19181. });
  19182. },
  19183. /**
  19184. * 删除指定行数据
  19185. * 如果传 row 则删除一行
  19186. * 如果传 rows 则删除多行
  19187. * 如果为空则删除所有
  19188. */
  19189. _remove: function _remove(rows) {
  19190. var _this2 = this;
  19191. var afterFullData = this.afterFullData,
  19192. tableFullData = this.tableFullData,
  19193. tableFullTreeData = this.tableFullTreeData,
  19194. treeConfig = this.treeConfig,
  19195. mergeList = this.mergeList,
  19196. editStore = this.editStore,
  19197. checkboxOpts = this.checkboxOpts,
  19198. selection = this.selection,
  19199. isInsertByRow = this.isInsertByRow,
  19200. treeOpts = this.treeOpts;
  19201. var transform = treeOpts.transform;
  19202. var actived = editStore.actived,
  19203. removeList = editStore.removeList,
  19204. insertList = editStore.insertList;
  19205. var checkField = checkboxOpts.checkField;
  19206. var rest = [];
  19207. if (!rows) {
  19208. rows = tableFullData;
  19209. } else if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(rows)) {
  19210. rows = [rows];
  19211. } // 如果是新增,则保存记录
  19212. rows.forEach(function (row) {
  19213. if (!isInsertByRow(row)) {
  19214. removeList.push(row);
  19215. }
  19216. }); // 如果绑定了多选属性,则更新状态
  19217. if (!checkField) {
  19218. rows.forEach(function (row) {
  19219. var sIndex = _this2.findRowIndexOf(selection, row);
  19220. if (sIndex > -1) {
  19221. selection.splice(sIndex, 1);
  19222. }
  19223. });
  19224. } // 从数据源中移除
  19225. if (tableFullData === rows) {
  19226. rows = rest = tableFullData.slice(0);
  19227. this.tableFullData = [];
  19228. this.afterFullData = [];
  19229. this.clearMergeCells();
  19230. } else {
  19231. // 如果为虚拟树
  19232. if (treeConfig && transform) {
  19233. rows.forEach(function (row) {
  19234. var rowid = getRowid(_this2, row);
  19235. var matchObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.findTree(tableFullTreeData, function (item) {
  19236. return rowid === getRowid(_this2, item);
  19237. }, treeOpts);
  19238. if (matchObj) {
  19239. var rItems = matchObj.items.splice(matchObj.index, 1);
  19240. rest.push(rItems[0]);
  19241. }
  19242. var afIndex = _this2.findRowIndexOf(afterFullData, row);
  19243. if (afIndex > -1) {
  19244. afterFullData.splice(afIndex, 1);
  19245. }
  19246. });
  19247. } else {
  19248. rows.forEach(function (row) {
  19249. var tfIndex = _this2.findRowIndexOf(tableFullData, row);
  19250. if (tfIndex > -1) {
  19251. var rItems = tableFullData.splice(tfIndex, 1);
  19252. rest.push(rItems[0]);
  19253. }
  19254. var afIndex = _this2.findRowIndexOf(afterFullData, row);
  19255. if (afIndex > -1) {
  19256. // 刷新单元格合并
  19257. mergeList.forEach(function (mergeItem) {
  19258. var mergeRowIndex = mergeItem.row,
  19259. mergeRowspan = mergeItem.rowspan;
  19260. if (mergeRowIndex > afIndex) {
  19261. mergeItem.row = mergeRowIndex - 1;
  19262. } else if (mergeRowIndex + mergeRowspan > afIndex) {
  19263. mergeItem.rowspan = mergeRowspan - 1;
  19264. }
  19265. });
  19266. afterFullData.splice(afIndex, 1);
  19267. }
  19268. });
  19269. }
  19270. } // 如果当前行被激活编辑,则清除激活状态
  19271. if (actived.row && this.findRowIndexOf(rows, actived.row) > -1) {
  19272. this.clearActived();
  19273. } // 从新增中移除已删除的数据
  19274. rows.forEach(function (row) {
  19275. var iIndex = _this2.findRowIndexOf(insertList, row);
  19276. if (iIndex > -1) {
  19277. insertList.splice(iIndex, 1);
  19278. }
  19279. });
  19280. this.handleTableData(treeConfig && transform);
  19281. if (!(treeConfig && transform)) {
  19282. this.updateAfterDataIndex();
  19283. }
  19284. this.updateFooter();
  19285. this.cacheRowMap();
  19286. this.checkSelectionStatus();
  19287. if (this.scrollYLoad) {
  19288. this.updateScrollYSpace();
  19289. }
  19290. return this.$nextTick().then(function () {
  19291. _this2.updateCellAreas();
  19292. return _this2.recalculate();
  19293. }).then(function () {
  19294. return {
  19295. row: rest.length ? rest[rest.length - 1] : null,
  19296. rows: rest
  19297. };
  19298. });
  19299. },
  19300. /**
  19301. * 删除复选框选中的数据
  19302. */
  19303. _removeCheckboxRow: function _removeCheckboxRow() {
  19304. var _this3 = this;
  19305. return this.remove(this.getCheckboxRecords()).then(function (params) {
  19306. _this3.clearCheckboxRow();
  19307. return params;
  19308. });
  19309. },
  19310. /**
  19311. * 删除单选框选中的数据
  19312. */
  19313. _removeRadioRow: function _removeRadioRow() {
  19314. var _this4 = this;
  19315. var radioRecord = this.getRadioRecord();
  19316. return this.remove(radioRecord || []).then(function (params) {
  19317. _this4.clearRadioRow();
  19318. return params;
  19319. });
  19320. },
  19321. /**
  19322. * 删除当前行选中的数据
  19323. */
  19324. _removeCurrentRow: function _removeCurrentRow() {
  19325. var _this5 = this;
  19326. var currentRecord = this.getCurrentRecord();
  19327. return this.remove(currentRecord || []).then(function (params) {
  19328. _this5.clearCurrentRow();
  19329. return params;
  19330. });
  19331. },
  19332. /**
  19333. * 获取表格数据集,包含新增、删除、修改
  19334. */
  19335. _getRecordset: function _getRecordset() {
  19336. return {
  19337. insertRecords: this.getInsertRecords(),
  19338. removeRecords: this.getRemoveRecords(),
  19339. updateRecords: this.getUpdateRecords()
  19340. };
  19341. },
  19342. /**
  19343. * 获取新增的临时数据
  19344. */
  19345. _getInsertRecords: function _getInsertRecords() {
  19346. var _this6 = this;
  19347. var treeConfig = this.treeConfig,
  19348. tableFullTreeData = this.tableFullTreeData,
  19349. tableFullData = this.tableFullData,
  19350. treeOpts = this.treeOpts;
  19351. var insertList = this.editStore.insertList;
  19352. var insertRecords = [];
  19353. if (insertList.length) {
  19354. // 如果为虚拟树
  19355. if (treeConfig && treeOpts.transform) {
  19356. insertList.forEach(function (row) {
  19357. var rowid = getRowid(_this6, row);
  19358. var matchObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.findTree(tableFullTreeData, function (item) {
  19359. return rowid === getRowid(_this6, item);
  19360. }, treeOpts);
  19361. if (matchObj) {
  19362. insertRecords.push(row);
  19363. }
  19364. });
  19365. } else {
  19366. insertList.forEach(function (row) {
  19367. if (tableFullData.indexOf(row) > -1) {
  19368. insertRecords.push(row);
  19369. }
  19370. });
  19371. }
  19372. }
  19373. return insertRecords;
  19374. },
  19375. /**
  19376. * 获取已删除的数据
  19377. */
  19378. _getRemoveRecords: function _getRemoveRecords() {
  19379. return this.editStore.removeList;
  19380. },
  19381. /**
  19382. * 获取更新数据
  19383. * 只精准匹配 row 的更改
  19384. * 如果是树表格,子节点更改状态不会影响父节点的更新状态
  19385. */
  19386. _getUpdateRecords: function _getUpdateRecords() {
  19387. var keepSource = this.keepSource,
  19388. tableFullData = this.tableFullData,
  19389. isUpdateByRow = this.isUpdateByRow,
  19390. treeConfig = this.treeConfig,
  19391. treeOpts = this.treeOpts,
  19392. editStore = this.editStore;
  19393. if (keepSource) {
  19394. var actived = editStore.actived;
  19395. var row = actived.row,
  19396. column = actived.column;
  19397. if (row || column) {
  19398. this._syncActivedCell();
  19399. }
  19400. if (treeConfig) {
  19401. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.filterTree(tableFullData, function (row) {
  19402. return isUpdateByRow(row);
  19403. }, treeOpts);
  19404. }
  19405. return tableFullData.filter(function (row) {
  19406. return isUpdateByRow(row);
  19407. });
  19408. }
  19409. return [];
  19410. },
  19411. /**
  19412. * 处理激活编辑
  19413. */
  19414. handleActived: function handleActived(params, evnt) {
  19415. var _this7 = this;
  19416. var editStore = this.editStore,
  19417. editOpts = this.editOpts,
  19418. tableColumn = this.tableColumn,
  19419. editConfig = this.editConfig,
  19420. mouseConfig = this.mouseConfig;
  19421. var mode = editOpts.mode;
  19422. var actived = editStore.actived;
  19423. var row = params.row,
  19424. column = params.column;
  19425. var editRender = column.editRender;
  19426. var cell = params.cell = params.cell || this.getCell(row, column);
  19427. var beforeEditMethod = editOpts.beforeEditMethod || editOpts.activeMethod;
  19428. if (isEnableConf(editConfig) && isEnableConf(editRender) && cell) {
  19429. if (actived.row !== row || (mode === 'cell' ? actived.column !== column : false)) {
  19430. // 判断是否禁用编辑
  19431. var type = 'edit-disabled';
  19432. if (!beforeEditMethod || beforeEditMethod(_objectSpread2(_objectSpread2({}, params), {}, {
  19433. $table: this
  19434. }))) {
  19435. if (mouseConfig) {
  19436. this.clearSelected(evnt);
  19437. this.clearCellAreas(evnt);
  19438. this.clearCopyCellArea(evnt);
  19439. }
  19440. this.closeTooltip();
  19441. if (actived.column) {
  19442. this.clearActived(evnt);
  19443. }
  19444. type = 'edit-actived';
  19445. column.renderHeight = cell.offsetHeight;
  19446. actived.args = params;
  19447. actived.row = row;
  19448. actived.column = column;
  19449. if (mode === 'row') {
  19450. tableColumn.forEach(function (column) {
  19451. return _this7._getColumnModel(row, column);
  19452. });
  19453. } else {
  19454. this._getColumnModel(row, column);
  19455. }
  19456. this.$nextTick(function () {
  19457. _this7.handleFocus(params, evnt);
  19458. });
  19459. }
  19460. this.emitEvent(type, {
  19461. row: row,
  19462. rowIndex: this.getRowIndex(row),
  19463. $rowIndex: this.getVMRowIndex(row),
  19464. column: column,
  19465. columnIndex: this.getColumnIndex(column),
  19466. $columnIndex: this.getVMColumnIndex(column)
  19467. }, evnt);
  19468. } else {
  19469. var oldColumn = actived.column;
  19470. if (mouseConfig) {
  19471. this.clearSelected(evnt);
  19472. this.clearCellAreas(evnt);
  19473. this.clearCopyCellArea(evnt);
  19474. }
  19475. if (oldColumn !== column) {
  19476. var oldModel = oldColumn.model;
  19477. if (oldModel.update) {
  19478. utils.setCellValue(row, oldColumn, oldModel.value);
  19479. }
  19480. this.clearValidate();
  19481. }
  19482. column.renderHeight = cell.offsetHeight;
  19483. actived.args = params;
  19484. actived.column = column;
  19485. setTimeout(function () {
  19486. _this7.handleFocus(params, evnt);
  19487. });
  19488. }
  19489. this.focus();
  19490. }
  19491. return this.$nextTick();
  19492. },
  19493. _getColumnModel: function _getColumnModel(row, column) {
  19494. var model = column.model,
  19495. editRender = column.editRender;
  19496. if (editRender) {
  19497. model.value = utils.getCellValue(row, column);
  19498. model.update = false;
  19499. }
  19500. },
  19501. _setColumnModel: function _setColumnModel(row, column) {
  19502. var model = column.model,
  19503. editRender = column.editRender;
  19504. if (editRender && model.update) {
  19505. utils.setCellValue(row, column, model.value);
  19506. model.update = false;
  19507. model.value = null;
  19508. }
  19509. },
  19510. _syncActivedCell: function _syncActivedCell() {
  19511. var _this8 = this;
  19512. var tableColumn = this.tableColumn,
  19513. editStore = this.editStore,
  19514. editOpts = this.editOpts;
  19515. var actived = editStore.actived;
  19516. var row = actived.row,
  19517. column = actived.column;
  19518. if (row || column) {
  19519. if (editOpts.mode === 'row') {
  19520. tableColumn.forEach(function (column) {
  19521. return _this8._setColumnModel(row, column);
  19522. });
  19523. } else {
  19524. this._setColumnModel(row, column);
  19525. }
  19526. }
  19527. },
  19528. _clearActived: function _clearActived(evnt) {
  19529. // if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
  19530. // warnLog('vxe.error.delFunc', ['clearActived', 'clearEdit'])
  19531. // }
  19532. // 即将废弃
  19533. return this.clearEdit(evnt);
  19534. },
  19535. /**
  19536. * 清除激活的编辑
  19537. */
  19538. _clearEdit: function _clearEdit(evnt) {
  19539. var editStore = this.editStore;
  19540. var actived = editStore.actived;
  19541. var row = actived.row,
  19542. column = actived.column;
  19543. if (row || column) {
  19544. this._syncActivedCell();
  19545. actived.args = null;
  19546. actived.row = null;
  19547. actived.column = null;
  19548. this.updateFooter();
  19549. this.emitEvent('edit-closed', {
  19550. row: row,
  19551. rowIndex: this.getRowIndex(row),
  19552. $rowIndex: this.getVMRowIndex(row),
  19553. column: column,
  19554. columnIndex: this.getColumnIndex(column),
  19555. $columnIndex: this.getVMColumnIndex(column)
  19556. }, evnt);
  19557. }
  19558. return v_x_e_table._valid ? this.clearValidate() : this.$nextTick();
  19559. },
  19560. _getActiveRecord: function _getActiveRecord() {
  19561. // if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
  19562. // warnLog('vxe.error.delFunc', ['getActiveRecord', 'getEditRecord'])
  19563. // }
  19564. // 即将废弃
  19565. return this.getEditRecord();
  19566. },
  19567. _getEditRecord: function _getEditRecord() {
  19568. var $el = this.$el,
  19569. editStore = this.editStore,
  19570. afterFullData = this.afterFullData;
  19571. var actived = editStore.actived;
  19572. var args = actived.args,
  19573. row = actived.row;
  19574. if (args && this.findRowIndexOf(afterFullData, row) > -1 && $el.querySelectorAll('.vxe-body--column.col--actived').length) {
  19575. return Object.assign({}, args);
  19576. }
  19577. return null;
  19578. },
  19579. _isActiveByRow: function _isActiveByRow(row) {
  19580. // if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
  19581. // warnLog('vxe.error.delFunc', ['isActiveByRow', 'isEditByRow'])
  19582. // }
  19583. // 即将废弃
  19584. return this.isEditByRow(row);
  19585. },
  19586. /**
  19587. * 判断行是否为激活编辑状态
  19588. * @param {Row} row 行对象
  19589. */
  19590. _isEditByRow: function _isEditByRow(row) {
  19591. return this.editStore.actived.row === row;
  19592. },
  19593. /**
  19594. * 处理聚焦
  19595. */
  19596. handleFocus: function handleFocus(params) {
  19597. var row = params.row,
  19598. column = params.column,
  19599. cell = params.cell;
  19600. var editRender = column.editRender;
  19601. if (isEnableConf(editRender)) {
  19602. var compRender = v_x_e_table.renderer.get(editRender.name);
  19603. var autofocus = editRender.autofocus,
  19604. autoselect = editRender.autoselect;
  19605. var inputElem;
  19606. if (!autofocus && compRender) {
  19607. autofocus = compRender.autofocus;
  19608. }
  19609. if (!autoselect && compRender) {
  19610. autoselect = compRender.autoselect;
  19611. } // 如果指定了聚焦 class
  19612. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(autofocus)) {
  19613. inputElem = autofocus.call(this, params);
  19614. } else if (autofocus) {
  19615. inputElem = cell.querySelector(autofocus);
  19616. if (inputElem) {
  19617. inputElem.focus();
  19618. }
  19619. }
  19620. if (inputElem) {
  19621. if (autoselect) {
  19622. inputElem.select();
  19623. } else {
  19624. // 保持一致行为,光标移到末端
  19625. if (browse.msie) {
  19626. var textRange = inputElem.createTextRange();
  19627. textRange.collapse(false);
  19628. textRange.select();
  19629. }
  19630. }
  19631. } else {
  19632. // 显示到可视区中
  19633. this.scrollToRow(row, column);
  19634. }
  19635. }
  19636. },
  19637. _setActiveRow: function _setActiveRow(row) {
  19638. // if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
  19639. // warnLog('vxe.error.delFunc', ['setActiveRow', 'setEditRow'])
  19640. // }
  19641. // 即将废弃
  19642. return this.setEditRow(row);
  19643. },
  19644. /**
  19645. * 激活行编辑
  19646. */
  19647. _setEditRow: function _setEditRow(row) {
  19648. return this.setEditCell(row, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.find(this.visibleColumn, function (column) {
  19649. return isEnableConf(column.editRender);
  19650. }));
  19651. },
  19652. _setActiveCell: function _setActiveCell(row) {
  19653. // if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
  19654. // warnLog('vxe.error.delFunc', ['setActiveCell', 'setEditCell'])
  19655. // }
  19656. // 即将废弃
  19657. return this.setEditCell(row);
  19658. },
  19659. /**
  19660. * 激活单元格编辑
  19661. */
  19662. _setEditCell: function _setEditCell(row, fieldOrColumn) {
  19663. var _this9 = this;
  19664. var editConfig = this.editConfig;
  19665. var column = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isString(fieldOrColumn) ? this.getColumnByField(fieldOrColumn) : fieldOrColumn;
  19666. if (row && column && isEnableConf(editConfig) && isEnableConf(column.editRender)) {
  19667. return this.scrollToRow(row, true).then(function () {
  19668. var cell = _this9.getCell(row, column);
  19669. if (cell) {
  19670. _this9.handleActived({
  19671. row: row,
  19672. rowIndex: _this9.getRowIndex(row),
  19673. column: column,
  19674. columnIndex: _this9.getColumnIndex(column),
  19675. cell: cell,
  19676. $table: _this9
  19677. });
  19678. _this9.lastCallTime = Date.now();
  19679. }
  19680. });
  19681. }
  19682. return this.$nextTick();
  19683. },
  19684. /**
  19685. * 只对 trigger=dblclick 有效,选中单元格
  19686. */
  19687. _setSelectCell: function _setSelectCell(row, fieldOrColumn) {
  19688. var tableData = this.tableData,
  19689. editOpts = this.editOpts,
  19690. visibleColumn = this.visibleColumn;
  19691. var column = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isString(fieldOrColumn) ? this.getColumnByField(fieldOrColumn) : fieldOrColumn;
  19692. if (row && column && editOpts.trigger !== 'manual') {
  19693. var rowIndex = this.findRowIndexOf(tableData, row);
  19694. if (rowIndex > -1) {
  19695. var cell = this.getCell(row, column);
  19696. var params = {
  19697. row: row,
  19698. rowIndex: rowIndex,
  19699. column: column,
  19700. columnIndex: visibleColumn.indexOf(column),
  19701. cell: cell
  19702. };
  19703. this.handleSelected(params, {});
  19704. }
  19705. }
  19706. return this.$nextTick();
  19707. },
  19708. /**
  19709. * 处理选中源
  19710. */
  19711. handleSelected: function handleSelected(params, evnt) {
  19712. var _this10 = this;
  19713. var mouseConfig = this.mouseConfig,
  19714. mouseOpts = this.mouseOpts,
  19715. editOpts = this.editOpts,
  19716. editStore = this.editStore;
  19717. var actived = editStore.actived,
  19718. selected = editStore.selected;
  19719. var row = params.row,
  19720. column = params.column;
  19721. var isMouseSelected = mouseConfig && mouseOpts.selected;
  19722. var selectMethod = function selectMethod() {
  19723. if (isMouseSelected && (selected.row !== row || selected.column !== column)) {
  19724. if (actived.row !== row || (editOpts.mode === 'cell' ? actived.column !== column : false)) {
  19725. _this10.clearActived(evnt);
  19726. _this10.clearSelected(evnt);
  19727. _this10.clearCellAreas(evnt);
  19728. _this10.clearCopyCellArea(evnt);
  19729. selected.args = params;
  19730. selected.row = row;
  19731. selected.column = column;
  19732. if (isMouseSelected) {
  19733. _this10.addColSdCls();
  19734. }
  19735. _this10.focus();
  19736. if (evnt) {
  19737. _this10.emitEvent('cell-selected', params, evnt);
  19738. }
  19739. }
  19740. }
  19741. return _this10.$nextTick();
  19742. };
  19743. return selectMethod();
  19744. },
  19745. /**
  19746. * 获取选中的单元格
  19747. */
  19748. _getSelectedCell: function _getSelectedCell() {
  19749. var _this$editStore$selec = this.editStore.selected,
  19750. args = _this$editStore$selec.args,
  19751. column = _this$editStore$selec.column;
  19752. if (args && column) {
  19753. return Object.assign({}, args);
  19754. }
  19755. return null;
  19756. },
  19757. /**
  19758. * 清除所选中源状态
  19759. */
  19760. _clearSelected: function _clearSelected() {
  19761. var selected = this.editStore.selected;
  19762. selected.row = null;
  19763. selected.column = null;
  19764. this.reColTitleSdCls();
  19765. this.reColSdCls();
  19766. return this.$nextTick();
  19767. },
  19768. reColTitleSdCls: function reColTitleSdCls() {
  19769. var headerElem = this.elemStore['main-header-list'];
  19770. if (headerElem) {
  19771. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.arrayEach(headerElem.querySelectorAll('.col--title-selected'), function (elem) {
  19772. return dom.removeClass(elem, 'col--title-selected');
  19773. });
  19774. }
  19775. },
  19776. reColSdCls: function reColSdCls() {
  19777. var cell = this.$el.querySelector('.col--selected');
  19778. if (cell) {
  19779. dom.removeClass(cell, 'col--selected');
  19780. }
  19781. },
  19782. addColSdCls: function addColSdCls() {
  19783. var selected = this.editStore.selected;
  19784. var row = selected.row,
  19785. column = selected.column;
  19786. this.reColSdCls();
  19787. if (row && column) {
  19788. var cell = this.getCell(row, column);
  19789. if (cell) {
  19790. dom.addClass(cell, 'col--selected');
  19791. }
  19792. }
  19793. }
  19794. }
  19795. });
  19796. // CONCATENATED MODULE: ./packages/edit/index.js
  19797. var Edit = {
  19798. install: function install() {
  19799. v_x_e_table.reg('edit');
  19800. packages_table.mixins.push(edit_src_mixin);
  19801. }
  19802. };
  19803. /* harmony default export */ var edit = (Edit);
  19804. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
  19805. function _arrayWithHoles(arr) {
  19806. if (Array.isArray(arr)) return arr;
  19807. }
  19808. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
  19809. function _iterableToArrayLimit(arr, i) {
  19810. var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
  19811. if (_i == null) return;
  19812. var _arr = [];
  19813. var _n = true;
  19814. var _d = false;
  19815. var _s, _e;
  19816. try {
  19817. for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
  19818. _arr.push(_s.value);
  19819. if (i && _arr.length === i) break;
  19820. }
  19821. } catch (err) {
  19822. _d = true;
  19823. _e = err;
  19824. } finally {
  19825. try {
  19826. if (!_n && _i["return"] != null) _i["return"]();
  19827. } finally {
  19828. if (_d) throw _e;
  19829. }
  19830. }
  19831. return _arr;
  19832. }
  19833. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
  19834. function _nonIterableRest() {
  19835. throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  19836. }
  19837. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js
  19838. function _slicedToArray(arr, i) {
  19839. return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
  19840. }
  19841. // CONCATENATED MODULE: ./packages/modal/src/modal.js
  19842. var allActivedModals = [];
  19843. var msgQueue = [];
  19844. /* harmony default export */ var modal = ({
  19845. name: 'VxeModal',
  19846. mixins: [size],
  19847. props: {
  19848. value: Boolean,
  19849. id: String,
  19850. type: {
  19851. type: String,
  19852. default: 'modal'
  19853. },
  19854. loading: {
  19855. type: Boolean,
  19856. default: null
  19857. },
  19858. status: String,
  19859. iconStatus: String,
  19860. className: String,
  19861. top: {
  19862. type: [Number, String],
  19863. default: function _default() {
  19864. return src_conf.modal.top;
  19865. }
  19866. },
  19867. position: [String, Object],
  19868. title: String,
  19869. duration: {
  19870. type: [Number, String],
  19871. default: function _default() {
  19872. return src_conf.modal.duration;
  19873. }
  19874. },
  19875. // 请使用 content
  19876. message: [String, Function],
  19877. content: [String, Function],
  19878. cancelButtonText: {
  19879. type: String,
  19880. default: function _default() {
  19881. return src_conf.modal.cancelButtonText;
  19882. }
  19883. },
  19884. confirmButtonText: {
  19885. type: String,
  19886. default: function _default() {
  19887. return src_conf.modal.confirmButtonText;
  19888. }
  19889. },
  19890. lockView: {
  19891. type: Boolean,
  19892. default: function _default() {
  19893. return src_conf.modal.lockView;
  19894. }
  19895. },
  19896. lockScroll: Boolean,
  19897. mask: {
  19898. type: Boolean,
  19899. default: function _default() {
  19900. return src_conf.modal.mask;
  19901. }
  19902. },
  19903. maskClosable: {
  19904. type: Boolean,
  19905. default: function _default() {
  19906. return src_conf.modal.maskClosable;
  19907. }
  19908. },
  19909. escClosable: {
  19910. type: Boolean,
  19911. default: function _default() {
  19912. return src_conf.modal.escClosable;
  19913. }
  19914. },
  19915. resize: {
  19916. type: Boolean,
  19917. default: function _default() {
  19918. return src_conf.modal.resize;
  19919. }
  19920. },
  19921. showHeader: {
  19922. type: Boolean,
  19923. default: function _default() {
  19924. return src_conf.modal.showHeader;
  19925. }
  19926. },
  19927. showFooter: {
  19928. type: Boolean,
  19929. default: function _default() {
  19930. return src_conf.modal.showFooter;
  19931. }
  19932. },
  19933. showZoom: {
  19934. type: Boolean,
  19935. default: null
  19936. },
  19937. showClose: {
  19938. type: Boolean,
  19939. default: function _default() {
  19940. return src_conf.modal.showClose;
  19941. }
  19942. },
  19943. dblclickZoom: {
  19944. type: Boolean,
  19945. default: function _default() {
  19946. return src_conf.modal.dblclickZoom;
  19947. }
  19948. },
  19949. width: [Number, String],
  19950. height: [Number, String],
  19951. minWidth: {
  19952. type: [Number, String],
  19953. default: function _default() {
  19954. return src_conf.modal.minWidth;
  19955. }
  19956. },
  19957. minHeight: {
  19958. type: [Number, String],
  19959. default: function _default() {
  19960. return src_conf.modal.minHeight;
  19961. }
  19962. },
  19963. zIndex: Number,
  19964. marginSize: {
  19965. type: [Number, String],
  19966. default: function _default() {
  19967. return src_conf.modal.marginSize;
  19968. }
  19969. },
  19970. fullscreen: Boolean,
  19971. draggable: {
  19972. type: Boolean,
  19973. default: function _default() {
  19974. return src_conf.modal.draggable;
  19975. }
  19976. },
  19977. remember: {
  19978. type: Boolean,
  19979. default: function _default() {
  19980. return src_conf.modal.remember;
  19981. }
  19982. },
  19983. destroyOnClose: {
  19984. type: Boolean,
  19985. default: function _default() {
  19986. return src_conf.modal.destroyOnClose;
  19987. }
  19988. },
  19989. showTitleOverflow: {
  19990. type: Boolean,
  19991. default: function _default() {
  19992. return src_conf.modal.showTitleOverflow;
  19993. }
  19994. },
  19995. transfer: {
  19996. type: Boolean,
  19997. default: function _default() {
  19998. return src_conf.modal.transfer;
  19999. }
  20000. },
  20001. storage: {
  20002. type: Boolean,
  20003. default: function _default() {
  20004. return src_conf.modal.storage;
  20005. }
  20006. },
  20007. storageKey: {
  20008. type: String,
  20009. default: function _default() {
  20010. return src_conf.modal.storageKey;
  20011. }
  20012. },
  20013. animat: {
  20014. type: Boolean,
  20015. default: function _default() {
  20016. return src_conf.modal.animat;
  20017. }
  20018. },
  20019. size: {
  20020. type: String,
  20021. default: function _default() {
  20022. return src_conf.modal.size || src_conf.size;
  20023. }
  20024. },
  20025. beforeHideMethod: {
  20026. type: Function,
  20027. default: function _default() {
  20028. return src_conf.modal.beforeHideMethod;
  20029. }
  20030. },
  20031. slots: Object,
  20032. events: Object
  20033. },
  20034. data: function data() {
  20035. return {
  20036. inited: false,
  20037. visible: false,
  20038. contentVisible: false,
  20039. modalTop: 0,
  20040. modalZindex: 0,
  20041. zoomLocat: null,
  20042. firstOpen: true
  20043. };
  20044. },
  20045. computed: {
  20046. isMsg: function isMsg() {
  20047. return this.type === 'message';
  20048. }
  20049. },
  20050. watch: {
  20051. width: function width() {
  20052. this.recalculate();
  20053. },
  20054. height: function height() {
  20055. this.recalculate();
  20056. },
  20057. value: function value(visible) {
  20058. this[visible ? 'open' : 'close']('model');
  20059. }
  20060. },
  20061. created: function created() {
  20062. if (this.storage && !this.id) {
  20063. errLog('vxe.error.reqProp', ['modal.id']);
  20064. }
  20065. },
  20066. mounted: function mounted() {
  20067. var $listeners = this.$listeners,
  20068. _this$events = this.events,
  20069. events = _this$events === void 0 ? {} : _this$events;
  20070. if (this.value) {
  20071. this.open();
  20072. }
  20073. this.recalculate();
  20074. if (this.escClosable) {
  20075. GlobalEvent.on(this, 'keydown', this.handleGlobalKeydownEvent);
  20076. } // 触发 inserted 事件
  20077. var type = 'inserted';
  20078. var params = {
  20079. type: type,
  20080. $modal: this,
  20081. $event: {
  20082. type: type
  20083. }
  20084. };
  20085. if ($listeners.inserted) {
  20086. this.$emit('inserted', params);
  20087. } else if (events.inserted) {
  20088. events.inserted.call(this, params);
  20089. }
  20090. },
  20091. beforeDestroy: function beforeDestroy() {
  20092. var $el = this.$el;
  20093. GlobalEvent.off(this, 'keydown');
  20094. this.removeMsgQueue();
  20095. if ($el.parentNode === document.body) {
  20096. $el.parentNode.removeChild($el);
  20097. }
  20098. },
  20099. render: function render(h) {
  20100. var _ref,
  20101. _this = this;
  20102. var _e = this._e,
  20103. $scopedSlots = this.$scopedSlots,
  20104. _this$slots = this.slots,
  20105. slots = _this$slots === void 0 ? {} : _this$slots,
  20106. inited = this.inited,
  20107. vSize = this.vSize,
  20108. className = this.className,
  20109. type = this.type,
  20110. resize = this.resize,
  20111. showClose = this.showClose,
  20112. showZoom = this.showZoom,
  20113. animat = this.animat,
  20114. draggable = this.draggable,
  20115. loading = this.loading,
  20116. status = this.status,
  20117. iconStatus = this.iconStatus,
  20118. showFooter = this.showFooter,
  20119. zoomLocat = this.zoomLocat,
  20120. modalTop = this.modalTop,
  20121. dblclickZoom = this.dblclickZoom,
  20122. contentVisible = this.contentVisible,
  20123. visible = this.visible,
  20124. title = this.title,
  20125. lockScroll = this.lockScroll,
  20126. lockView = this.lockView,
  20127. mask = this.mask,
  20128. isMsg = this.isMsg,
  20129. showTitleOverflow = this.showTitleOverflow,
  20130. destroyOnClose = this.destroyOnClose;
  20131. var content = this.content || this.message;
  20132. var defaultSlot = $scopedSlots.default || slots.default;
  20133. var footerSlot = $scopedSlots.footer || slots.footer;
  20134. var headerSlot = $scopedSlots.header || slots.header;
  20135. var titleSlot = $scopedSlots.title || slots.title;
  20136. var cornerSlot = $scopedSlots.corner || slots.corner;
  20137. var headerOns = {};
  20138. if (draggable) {
  20139. headerOns.mousedown = this.mousedownEvent;
  20140. }
  20141. if (showZoom && dblclickZoom && type === 'modal') {
  20142. headerOns.dblclick = this.toggleZoomEvent;
  20143. }
  20144. return h('div', {
  20145. 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)],
  20146. style: {
  20147. zIndex: this.modalZindex,
  20148. top: modalTop ? "".concat(modalTop, "px") : null
  20149. },
  20150. on: {
  20151. click: this.selfClickEvent
  20152. }
  20153. }, [h('div', {
  20154. class: 'vxe-modal--box',
  20155. on: {
  20156. mousedown: this.boxMousedownEvent
  20157. },
  20158. ref: 'modalBox'
  20159. }, [this.showHeader ? h('div', {
  20160. class: ['vxe-modal--header', {
  20161. 'is--draggable': draggable,
  20162. 'is--ellipsis': !isMsg && showTitleOverflow
  20163. }],
  20164. on: headerOns
  20165. }, headerSlot ? !inited || destroyOnClose && !visible ? [] : getSlotVNs(headerSlot.call(this, {
  20166. $modal: this
  20167. }, h)) : [h('div', {
  20168. class: 'vxe-modal--header-title'
  20169. }, titleSlot ? getSlotVNs(titleSlot.call(this, {
  20170. $modal: this
  20171. }, h)) : title ? getFuncText(title) : src_conf.i18n('vxe.alert.title')), h('div', {
  20172. class: 'vxe-modal--header-right'
  20173. }, [cornerSlot ? h('span', {
  20174. class: 'vxe-modal--corner-warpper'
  20175. }, getSlotVNs(cornerSlot({
  20176. $modal: this
  20177. }))) : _e(), showZoom ? h('i', {
  20178. class: ['vxe-modal--zoom-btn', 'trigger--btn', zoomLocat ? src_conf.icon.MODAL_ZOOM_OUT : src_conf.icon.MODAL_ZOOM_IN],
  20179. attrs: {
  20180. title: src_conf.i18n("vxe.modal.zoom".concat(zoomLocat ? 'Out' : 'In'))
  20181. },
  20182. on: {
  20183. click: this.toggleZoomEvent
  20184. }
  20185. }) : _e(), showClose ? h('i', {
  20186. class: ['vxe-modal--close-btn', 'trigger--btn', src_conf.icon.MODAL_CLOSE],
  20187. attrs: {
  20188. title: src_conf.i18n('vxe.modal.close')
  20189. },
  20190. on: {
  20191. click: this.closeEvent
  20192. }
  20193. }) : _e()])]) : null, h('div', {
  20194. class: 'vxe-modal--body'
  20195. }, [status ? h('div', {
  20196. class: 'vxe-modal--status-wrapper'
  20197. }, [h('i', {
  20198. class: ['vxe-modal--status-icon', iconStatus || src_conf.icon["MODAL_".concat(status).toLocaleUpperCase()]]
  20199. })]) : null, h('div', {
  20200. class: 'vxe-modal--content'
  20201. }, defaultSlot ? !inited || destroyOnClose && !visible ? [] : getSlotVNs(defaultSlot.call(this, {
  20202. $modal: this
  20203. }, h)) : getFuncText(content)),
  20204. /**
  20205. * 加载中
  20206. */
  20207. !isMsg ? h(packages_loading, {
  20208. class: 'vxe-modal--loading',
  20209. props: {
  20210. value: loading
  20211. }
  20212. }) : null]), showFooter ? h('div', {
  20213. class: 'vxe-modal--footer'
  20214. }, footerSlot ? !inited || destroyOnClose && !visible ? [] : getSlotVNs(footerSlot.call(this, {
  20215. $modal: this
  20216. }, h)) : [type === 'confirm' ? h('vxe-button', {
  20217. ref: 'cancelBtn',
  20218. on: {
  20219. click: this.cancelEvent
  20220. }
  20221. }, this.cancelButtonText || src_conf.i18n('vxe.button.cancel')) : null, h('vxe-button', {
  20222. ref: 'confirmBtn',
  20223. props: {
  20224. status: 'primary'
  20225. },
  20226. on: {
  20227. click: this.confirmEvent
  20228. }
  20229. }, this.confirmButtonText || src_conf.i18n('vxe.button.confirm'))]) : null, !isMsg && resize ? h('span', {
  20230. class: 'vxe-modal--resize'
  20231. }, ['wl', 'wr', 'swst', 'sest', 'st', 'swlb', 'selb', 'sb'].map(function (type) {
  20232. return h('span', {
  20233. class: "".concat(type, "-resize"),
  20234. attrs: {
  20235. type: type
  20236. },
  20237. on: {
  20238. mousedown: _this.dragEvent
  20239. }
  20240. });
  20241. })) : null])]);
  20242. },
  20243. methods: {
  20244. recalculate: function recalculate() {
  20245. var width = this.width,
  20246. height = this.height;
  20247. var modalBoxElem = this.getBox();
  20248. modalBoxElem.style.width = width ? isNaN(width) ? width : "".concat(width, "px") : null;
  20249. modalBoxElem.style.height = height ? isNaN(height) ? height : "".concat(height, "px") : null;
  20250. return this.$nextTick();
  20251. },
  20252. selfClickEvent: function selfClickEvent(evnt) {
  20253. if (this.maskClosable && evnt.target === this.$el) {
  20254. var type = 'mask';
  20255. this.close(type);
  20256. }
  20257. },
  20258. updateZindex: function updateZindex() {
  20259. var zIndex = this.zIndex,
  20260. modalZindex = this.modalZindex;
  20261. if (zIndex) {
  20262. this.modalZindex = zIndex;
  20263. } else if (modalZindex < utils.getLastZIndex()) {
  20264. this.modalZindex = utils.nextZIndex();
  20265. }
  20266. },
  20267. closeEvent: function closeEvent(evnt) {
  20268. var _this$events2 = this.events,
  20269. events = _this$events2 === void 0 ? {} : _this$events2;
  20270. var type = 'close';
  20271. var params = {
  20272. type: type,
  20273. $modal: this,
  20274. $event: evnt
  20275. };
  20276. if (events[type]) {
  20277. events[type].call(this, params);
  20278. } else {
  20279. this.$emit(type, params);
  20280. }
  20281. this.close(type);
  20282. },
  20283. confirmEvent: function confirmEvent(evnt) {
  20284. var _this$events3 = this.events,
  20285. events = _this$events3 === void 0 ? {} : _this$events3;
  20286. var type = 'confirm';
  20287. var params = {
  20288. type: type,
  20289. $modal: this,
  20290. $event: evnt
  20291. };
  20292. if (events[type]) {
  20293. events[type].call(this, params);
  20294. } else {
  20295. this.$emit(type, params);
  20296. }
  20297. this.close(type);
  20298. },
  20299. cancelEvent: function cancelEvent(evnt) {
  20300. var _this$events4 = this.events,
  20301. events = _this$events4 === void 0 ? {} : _this$events4;
  20302. var type = 'cancel';
  20303. var params = {
  20304. type: type,
  20305. $modal: this,
  20306. $event: evnt
  20307. };
  20308. if (events[type]) {
  20309. events[type].call(this, params);
  20310. } else {
  20311. this.$emit(type, params);
  20312. }
  20313. this.close(type);
  20314. },
  20315. open: function open() {
  20316. var _this2 = this;
  20317. var $refs = this.$refs,
  20318. _this$events5 = this.events,
  20319. events = _this$events5 === void 0 ? {} : _this$events5,
  20320. inited = this.inited,
  20321. duration = this.duration,
  20322. visible = this.visible,
  20323. isMsg = this.isMsg,
  20324. remember = this.remember,
  20325. showFooter = this.showFooter;
  20326. if (!inited) {
  20327. this.inited = true;
  20328. if (this.transfer) {
  20329. document.body.appendChild(this.$el);
  20330. }
  20331. }
  20332. if (!visible) {
  20333. if (!remember) {
  20334. this.recalculate();
  20335. }
  20336. this.visible = true;
  20337. this.contentVisible = false;
  20338. this.updateZindex();
  20339. allActivedModals.push(this);
  20340. setTimeout(function () {
  20341. _this2.contentVisible = true;
  20342. _this2.$nextTick(function () {
  20343. if (showFooter) {
  20344. var operBtn = $refs.confirmBtn || $refs.cancelBtn;
  20345. if (operBtn) {
  20346. operBtn.focus();
  20347. }
  20348. }
  20349. var type = '';
  20350. var params = {
  20351. type: type,
  20352. $modal: _this2
  20353. };
  20354. if (events.show) {
  20355. events.show.call(_this2, params);
  20356. } else {
  20357. _this2.$emit('input', true);
  20358. _this2.$emit('show', params);
  20359. }
  20360. });
  20361. }, 10);
  20362. if (isMsg) {
  20363. this.addMsgQueue();
  20364. if (duration !== -1) {
  20365. setTimeout(function () {
  20366. return _this2.close('close');
  20367. }, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(duration));
  20368. }
  20369. } else {
  20370. this.$nextTick(function () {
  20371. var firstOpen = _this2.firstOpen,
  20372. fullscreen = _this2.fullscreen;
  20373. if (!remember || firstOpen) {
  20374. _this2.updatePosition().then(function () {
  20375. setTimeout(function () {
  20376. return _this2.updatePosition();
  20377. }, 20);
  20378. });
  20379. }
  20380. if (firstOpen) {
  20381. _this2.firstOpen = false;
  20382. if (_this2.hasPosStorage()) {
  20383. _this2.restorePosStorage();
  20384. } else if (fullscreen) {
  20385. _this2.$nextTick(function () {
  20386. return _this2.maximize();
  20387. });
  20388. }
  20389. } else {
  20390. if (fullscreen) {
  20391. _this2.$nextTick(function () {
  20392. return _this2.maximize();
  20393. });
  20394. }
  20395. }
  20396. });
  20397. }
  20398. }
  20399. },
  20400. addMsgQueue: function addMsgQueue() {
  20401. if (msgQueue.indexOf(this) === -1) {
  20402. msgQueue.push(this);
  20403. }
  20404. this.updateStyle();
  20405. },
  20406. removeMsgQueue: function removeMsgQueue() {
  20407. var _this3 = this;
  20408. if (msgQueue.indexOf(this) > -1) {
  20409. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.remove(msgQueue, function (comp) {
  20410. return comp === _this3;
  20411. });
  20412. }
  20413. this.updateStyle();
  20414. },
  20415. updateStyle: function updateStyle() {
  20416. this.$nextTick(function () {
  20417. var offsetTop = 0;
  20418. msgQueue.forEach(function (comp) {
  20419. offsetTop += external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(comp.top);
  20420. comp.modalTop = offsetTop;
  20421. offsetTop += comp.$refs.modalBox.clientHeight;
  20422. });
  20423. });
  20424. },
  20425. updatePosition: function updatePosition() {
  20426. var _this4 = this;
  20427. return this.$nextTick().then(function () {
  20428. var marginSize = _this4.marginSize,
  20429. position = _this4.position;
  20430. var modalBoxElem = _this4.getBox();
  20431. var clientVisibleWidth = document.documentElement.clientWidth || document.body.clientWidth;
  20432. var clientVisibleHeight = document.documentElement.clientHeight || document.body.clientHeight;
  20433. var isPosCenter = position === 'center';
  20434. var _ref2 = isPosCenter ? {
  20435. top: position,
  20436. left: position
  20437. } : Object.assign({}, position),
  20438. top = _ref2.top,
  20439. left = _ref2.left;
  20440. var topCenter = isPosCenter || top === 'center';
  20441. var leftCenter = isPosCenter || left === 'center';
  20442. var posTop = '';
  20443. var posLeft = '';
  20444. if (left && !leftCenter) {
  20445. posLeft = isNaN(left) ? left : "".concat(left, "px");
  20446. } else {
  20447. posLeft = "".concat(Math.max(marginSize, clientVisibleWidth / 2 - modalBoxElem.offsetWidth / 2), "px");
  20448. }
  20449. if (top && !topCenter) {
  20450. posTop = isNaN(top) ? top : "".concat(top, "px");
  20451. } else {
  20452. posTop = "".concat(Math.max(marginSize, clientVisibleHeight / 2 - modalBoxElem.offsetHeight / 2), "px");
  20453. }
  20454. modalBoxElem.style.top = posTop;
  20455. modalBoxElem.style.left = posLeft;
  20456. });
  20457. },
  20458. close: function close(type) {
  20459. var _this5 = this;
  20460. var _this$events6 = this.events,
  20461. events = _this$events6 === void 0 ? {} : _this$events6,
  20462. remember = this.remember,
  20463. visible = this.visible,
  20464. isMsg = this.isMsg,
  20465. beforeHideMethod = this.beforeHideMethod;
  20466. var params = {
  20467. type: type,
  20468. $modal: this
  20469. };
  20470. if (visible) {
  20471. Promise.resolve(beforeHideMethod ? beforeHideMethod(params) : null).then(function (rest) {
  20472. if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isError(rest)) {
  20473. if (isMsg) {
  20474. _this5.removeMsgQueue();
  20475. }
  20476. _this5.contentVisible = false;
  20477. if (!remember) {
  20478. _this5.zoomLocat = null;
  20479. }
  20480. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.remove(allActivedModals, function (item) {
  20481. return item === _this5;
  20482. });
  20483. _this5.$emit('before-hide', params);
  20484. setTimeout(function () {
  20485. _this5.visible = false;
  20486. if (events.hide) {
  20487. events.hide.call(_this5, params);
  20488. } else {
  20489. _this5.$emit('input', false);
  20490. _this5.$emit('hide', params);
  20491. }
  20492. }, 200);
  20493. }
  20494. }).catch(function (e) {
  20495. return e;
  20496. });
  20497. }
  20498. },
  20499. handleGlobalKeydownEvent: function handleGlobalKeydownEvent(evnt) {
  20500. var _this6 = this;
  20501. var isEsc = evnt.keyCode === 27;
  20502. if (isEsc) {
  20503. var lastModal = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.max(allActivedModals, function (item) {
  20504. return item.modalZindex;
  20505. }); // 多个时,只关掉最上层的窗口
  20506. if (lastModal) {
  20507. setTimeout(function () {
  20508. if (lastModal === _this6 && lastModal.escClosable) {
  20509. _this6.close('exit');
  20510. }
  20511. }, 10);
  20512. }
  20513. }
  20514. },
  20515. getBox: function getBox() {
  20516. return this.$refs.modalBox;
  20517. },
  20518. isMaximized: function isMaximized() {
  20519. return !!this.zoomLocat;
  20520. },
  20521. maximize: function maximize() {
  20522. var _this7 = this;
  20523. return this.$nextTick().then(function () {
  20524. if (!_this7.zoomLocat) {
  20525. var marginSize = Math.max(0, _this7.marginSize);
  20526. var modalBoxElem = _this7.getBox();
  20527. var _DomTools$getDomNode = dom.getDomNode(),
  20528. visibleHeight = _DomTools$getDomNode.visibleHeight,
  20529. visibleWidth = _DomTools$getDomNode.visibleWidth;
  20530. _this7.zoomLocat = {
  20531. top: modalBoxElem.offsetTop,
  20532. left: modalBoxElem.offsetLeft,
  20533. width: modalBoxElem.offsetWidth + (modalBoxElem.style.width ? 0 : 1),
  20534. height: modalBoxElem.offsetHeight + (modalBoxElem.style.height ? 0 : 1)
  20535. };
  20536. Object.assign(modalBoxElem.style, {
  20537. top: "".concat(marginSize, "px"),
  20538. left: "".concat(marginSize, "px"),
  20539. width: "".concat(visibleWidth - marginSize * 2, "px"),
  20540. height: "".concat(visibleHeight - marginSize * 2, "px")
  20541. });
  20542. _this7.savePosStorage();
  20543. }
  20544. });
  20545. },
  20546. revert: function revert() {
  20547. var _this8 = this;
  20548. return this.$nextTick().then(function () {
  20549. var zoomLocat = _this8.zoomLocat;
  20550. if (zoomLocat) {
  20551. var modalBoxElem = _this8.getBox();
  20552. _this8.zoomLocat = null;
  20553. Object.assign(modalBoxElem.style, {
  20554. top: "".concat(zoomLocat.top, "px"),
  20555. left: "".concat(zoomLocat.left, "px"),
  20556. width: "".concat(zoomLocat.width, "px"),
  20557. height: "".concat(zoomLocat.height, "px")
  20558. });
  20559. _this8.savePosStorage();
  20560. }
  20561. });
  20562. },
  20563. zoom: function zoom() {
  20564. var _this9 = this;
  20565. return this[this.zoomLocat ? 'revert' : 'maximize']().then(function () {
  20566. return _this9.isMaximized();
  20567. });
  20568. },
  20569. toggleZoomEvent: function toggleZoomEvent(evnt) {
  20570. var _this10 = this;
  20571. var $listeners = this.$listeners,
  20572. zoomLocat = this.zoomLocat,
  20573. _this$events7 = this.events,
  20574. events = _this$events7 === void 0 ? {} : _this$events7;
  20575. var params = {
  20576. type: zoomLocat ? 'revert' : 'max',
  20577. $modal: this,
  20578. $event: evnt
  20579. };
  20580. return this.zoom().then(function () {
  20581. if ($listeners.zoom) {
  20582. _this10.$emit('zoom', params);
  20583. } else if (events.zoom) {
  20584. events.zoom.call(_this10, params);
  20585. }
  20586. });
  20587. },
  20588. getPosition: function getPosition() {
  20589. if (!this.isMsg) {
  20590. var modalBoxElem = this.getBox();
  20591. if (modalBoxElem) {
  20592. return {
  20593. top: modalBoxElem.offsetTop,
  20594. left: modalBoxElem.offsetLeft
  20595. };
  20596. }
  20597. }
  20598. return null;
  20599. },
  20600. setPosition: function setPosition(top, left) {
  20601. if (!this.isMsg) {
  20602. var modalBoxElem = this.getBox();
  20603. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNumber(top)) {
  20604. modalBoxElem.style.top = "".concat(top, "px");
  20605. }
  20606. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNumber(left)) {
  20607. modalBoxElem.style.left = "".concat(left, "px");
  20608. }
  20609. }
  20610. return this.$nextTick();
  20611. },
  20612. boxMousedownEvent: function boxMousedownEvent() {
  20613. var modalZindex = this.modalZindex;
  20614. if (allActivedModals.some(function (_vm) {
  20615. return _vm.visible && _vm.modalZindex > modalZindex;
  20616. })) {
  20617. this.updateZindex();
  20618. }
  20619. },
  20620. mousedownEvent: function mousedownEvent(evnt) {
  20621. var _this11 = this;
  20622. var remember = this.remember,
  20623. storage = this.storage,
  20624. marginSize = this.marginSize,
  20625. zoomLocat = this.zoomLocat;
  20626. var modalBoxElem = this.getBox();
  20627. if (!zoomLocat && evnt.button === 0 && !dom.getEventTargetNode(evnt, modalBoxElem, 'trigger--btn').flag) {
  20628. evnt.preventDefault();
  20629. var domMousemove = document.onmousemove;
  20630. var domMouseup = document.onmouseup;
  20631. var disX = evnt.clientX - modalBoxElem.offsetLeft;
  20632. var disY = evnt.clientY - modalBoxElem.offsetTop;
  20633. var _DomTools$getDomNode2 = dom.getDomNode(),
  20634. visibleHeight = _DomTools$getDomNode2.visibleHeight,
  20635. visibleWidth = _DomTools$getDomNode2.visibleWidth;
  20636. document.onmousemove = function (evnt) {
  20637. evnt.preventDefault();
  20638. var offsetWidth = modalBoxElem.offsetWidth;
  20639. var offsetHeight = modalBoxElem.offsetHeight;
  20640. var minX = marginSize;
  20641. var maxX = visibleWidth - offsetWidth - marginSize - 1;
  20642. var minY = marginSize;
  20643. var maxY = visibleHeight - offsetHeight - marginSize - 1;
  20644. var left = evnt.clientX - disX;
  20645. var top = evnt.clientY - disY;
  20646. if (left > maxX) {
  20647. left = maxX;
  20648. }
  20649. if (left < minX) {
  20650. left = minX;
  20651. }
  20652. if (top > maxY) {
  20653. top = maxY;
  20654. }
  20655. if (top < minY) {
  20656. top = minY;
  20657. }
  20658. modalBoxElem.style.left = "".concat(left, "px");
  20659. modalBoxElem.style.top = "".concat(top, "px");
  20660. modalBoxElem.className = modalBoxElem.className.replace(/\s?is--drag/, '') + ' is--drag';
  20661. };
  20662. document.onmouseup = function () {
  20663. document.onmousemove = domMousemove;
  20664. document.onmouseup = domMouseup;
  20665. if (remember && storage) {
  20666. _this11.$nextTick(function () {
  20667. _this11.savePosStorage();
  20668. });
  20669. }
  20670. setTimeout(function () {
  20671. modalBoxElem.className = modalBoxElem.className.replace(/\s?is--drag/, '');
  20672. }, 50);
  20673. };
  20674. }
  20675. },
  20676. dragEvent: function dragEvent(evnt) {
  20677. var _this12 = this;
  20678. evnt.preventDefault();
  20679. var $listeners = this.$listeners,
  20680. marginSize = this.marginSize,
  20681. _this$events8 = this.events,
  20682. events = _this$events8 === void 0 ? {} : _this$events8,
  20683. remember = this.remember,
  20684. storage = this.storage;
  20685. var _DomTools$getDomNode3 = dom.getDomNode(),
  20686. visibleHeight = _DomTools$getDomNode3.visibleHeight,
  20687. visibleWidth = _DomTools$getDomNode3.visibleWidth;
  20688. var type = evnt.target.getAttribute('type');
  20689. var minWidth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(this.minWidth);
  20690. var minHeight = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(this.minHeight);
  20691. var maxWidth = visibleWidth;
  20692. var maxHeight = visibleHeight;
  20693. var modalBoxElem = this.getBox();
  20694. var domMousemove = document.onmousemove;
  20695. var domMouseup = document.onmouseup;
  20696. var clientWidth = modalBoxElem.clientWidth;
  20697. var clientHeight = modalBoxElem.clientHeight;
  20698. var disX = evnt.clientX;
  20699. var disY = evnt.clientY;
  20700. var offsetTop = modalBoxElem.offsetTop;
  20701. var offsetLeft = modalBoxElem.offsetLeft;
  20702. var params = {
  20703. type: 'resize',
  20704. $modal: this
  20705. };
  20706. document.onmousemove = function (evnt) {
  20707. evnt.preventDefault();
  20708. var dragLeft;
  20709. var dragTop;
  20710. var width;
  20711. var height;
  20712. switch (type) {
  20713. case 'wl':
  20714. dragLeft = disX - evnt.clientX;
  20715. width = dragLeft + clientWidth;
  20716. if (offsetLeft - dragLeft > marginSize) {
  20717. if (width > minWidth) {
  20718. modalBoxElem.style.width = "".concat(width < maxWidth ? width : maxWidth, "px");
  20719. modalBoxElem.style.left = "".concat(offsetLeft - dragLeft, "px");
  20720. }
  20721. }
  20722. break;
  20723. case 'swst':
  20724. dragLeft = disX - evnt.clientX;
  20725. dragTop = disY - evnt.clientY;
  20726. width = dragLeft + clientWidth;
  20727. height = dragTop + clientHeight;
  20728. if (offsetLeft - dragLeft > marginSize) {
  20729. if (width > minWidth) {
  20730. modalBoxElem.style.width = "".concat(width < maxWidth ? width : maxWidth, "px");
  20731. modalBoxElem.style.left = "".concat(offsetLeft - dragLeft, "px");
  20732. }
  20733. }
  20734. if (offsetTop - dragTop > marginSize) {
  20735. if (height > minHeight) {
  20736. modalBoxElem.style.height = "".concat(height < maxHeight ? height : maxHeight, "px");
  20737. modalBoxElem.style.top = "".concat(offsetTop - dragTop, "px");
  20738. }
  20739. }
  20740. break;
  20741. case 'swlb':
  20742. dragLeft = disX - evnt.clientX;
  20743. dragTop = evnt.clientY - disY;
  20744. width = dragLeft + clientWidth;
  20745. height = dragTop + clientHeight;
  20746. if (offsetLeft - dragLeft > marginSize) {
  20747. if (width > minWidth) {
  20748. modalBoxElem.style.width = "".concat(width < maxWidth ? width : maxWidth, "px");
  20749. modalBoxElem.style.left = "".concat(offsetLeft - dragLeft, "px");
  20750. }
  20751. }
  20752. if (offsetTop + height + marginSize < visibleHeight) {
  20753. if (height > minHeight) {
  20754. modalBoxElem.style.height = "".concat(height < maxHeight ? height : maxHeight, "px");
  20755. }
  20756. }
  20757. break;
  20758. case 'st':
  20759. dragTop = disY - evnt.clientY;
  20760. height = clientHeight + dragTop;
  20761. if (offsetTop - dragTop > marginSize) {
  20762. if (height > minHeight) {
  20763. modalBoxElem.style.height = "".concat(height < maxHeight ? height : maxHeight, "px");
  20764. modalBoxElem.style.top = "".concat(offsetTop - dragTop, "px");
  20765. }
  20766. }
  20767. break;
  20768. case 'wr':
  20769. dragLeft = evnt.clientX - disX;
  20770. width = dragLeft + clientWidth;
  20771. if (offsetLeft + width + marginSize < visibleWidth) {
  20772. if (width > minWidth) {
  20773. modalBoxElem.style.width = "".concat(width < maxWidth ? width : maxWidth, "px");
  20774. }
  20775. }
  20776. break;
  20777. case 'sest':
  20778. dragLeft = evnt.clientX - disX;
  20779. dragTop = disY - evnt.clientY;
  20780. width = dragLeft + clientWidth;
  20781. height = dragTop + clientHeight;
  20782. if (offsetLeft + width + marginSize < visibleWidth) {
  20783. if (width > minWidth) {
  20784. modalBoxElem.style.width = "".concat(width < maxWidth ? width : maxWidth, "px");
  20785. }
  20786. }
  20787. if (offsetTop - dragTop > marginSize) {
  20788. if (height > minHeight) {
  20789. modalBoxElem.style.height = "".concat(height < maxHeight ? height : maxHeight, "px");
  20790. modalBoxElem.style.top = "".concat(offsetTop - dragTop, "px");
  20791. }
  20792. }
  20793. break;
  20794. case 'selb':
  20795. dragLeft = evnt.clientX - disX;
  20796. dragTop = evnt.clientY - disY;
  20797. width = dragLeft + clientWidth;
  20798. height = dragTop + clientHeight;
  20799. if (offsetLeft + width + marginSize < visibleWidth) {
  20800. if (width > minWidth) {
  20801. modalBoxElem.style.width = "".concat(width < maxWidth ? width : maxWidth, "px");
  20802. }
  20803. }
  20804. if (offsetTop + height + marginSize < visibleHeight) {
  20805. if (height > minHeight) {
  20806. modalBoxElem.style.height = "".concat(height < maxHeight ? height : maxHeight, "px");
  20807. }
  20808. }
  20809. break;
  20810. case 'sb':
  20811. dragTop = evnt.clientY - disY;
  20812. height = dragTop + clientHeight;
  20813. if (offsetTop + height + marginSize < visibleHeight) {
  20814. if (height > minHeight) {
  20815. modalBoxElem.style.height = "".concat(height < maxHeight ? height : maxHeight, "px");
  20816. }
  20817. }
  20818. break;
  20819. }
  20820. modalBoxElem.className = modalBoxElem.className.replace(/\s?is--drag/, '') + ' is--drag';
  20821. if (remember && storage) {
  20822. _this12.savePosStorage();
  20823. }
  20824. if ($listeners.zoom) {
  20825. _this12.$emit('zoom', params);
  20826. } else if (events.zoom) {
  20827. events.zoom.call(_this12, params);
  20828. }
  20829. };
  20830. document.onmouseup = function () {
  20831. _this12.zoomLocat = null;
  20832. document.onmousemove = domMousemove;
  20833. document.onmouseup = domMouseup;
  20834. setTimeout(function () {
  20835. modalBoxElem.className = modalBoxElem.className.replace(/\s?is--drag/, '');
  20836. }, 50);
  20837. };
  20838. },
  20839. getStorageMap: function getStorageMap(key) {
  20840. var version = src_conf.version;
  20841. var rest = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toStringJSON(localStorage.getItem(key));
  20842. return rest && rest._v === version ? rest : {
  20843. _v: version
  20844. };
  20845. },
  20846. hasPosStorage: function hasPosStorage() {
  20847. var id = this.id,
  20848. remember = this.remember,
  20849. storage = this.storage,
  20850. storageKey = this.storageKey;
  20851. return !!(remember && storage && this.getStorageMap(storageKey)[id]);
  20852. },
  20853. restorePosStorage: function restorePosStorage() {
  20854. var id = this.id,
  20855. remember = this.remember,
  20856. storage = this.storage,
  20857. storageKey = this.storageKey;
  20858. if (remember && storage) {
  20859. var posStorage = this.getStorageMap(storageKey)[id];
  20860. if (posStorage) {
  20861. var modalBoxElem = this.getBox();
  20862. var _posStorage$split = posStorage.split(','),
  20863. _posStorage$split2 = _slicedToArray(_posStorage$split, 8),
  20864. left = _posStorage$split2[0],
  20865. top = _posStorage$split2[1],
  20866. width = _posStorage$split2[2],
  20867. height = _posStorage$split2[3],
  20868. zoomLeft = _posStorage$split2[4],
  20869. zoomTop = _posStorage$split2[5],
  20870. zoomWidth = _posStorage$split2[6],
  20871. zoomHeight = _posStorage$split2[7];
  20872. if (left) {
  20873. modalBoxElem.style.left = "".concat(left, "px");
  20874. }
  20875. if (top) {
  20876. modalBoxElem.style.top = "".concat(top, "px");
  20877. }
  20878. if (width) {
  20879. modalBoxElem.style.width = "".concat(width, "px");
  20880. }
  20881. if (height) {
  20882. modalBoxElem.style.height = "".concat(height, "px");
  20883. }
  20884. if (zoomLeft && zoomTop) {
  20885. this.zoomLocat = {
  20886. left: zoomLeft,
  20887. top: zoomTop,
  20888. width: zoomWidth,
  20889. height: zoomHeight
  20890. };
  20891. }
  20892. }
  20893. }
  20894. },
  20895. savePosStorage: function savePosStorage() {
  20896. var id = this.id,
  20897. remember = this.remember,
  20898. storage = this.storage,
  20899. storageKey = this.storageKey,
  20900. zoomLocat = this.zoomLocat;
  20901. if (remember && storage) {
  20902. var modalBoxElem = this.getBox();
  20903. var posStorageMap = this.getStorageMap(storageKey);
  20904. 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) {
  20905. return val ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(val) : '';
  20906. }).join(',');
  20907. localStorage.setItem(storageKey, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toJSONString(posStorageMap));
  20908. }
  20909. }
  20910. }
  20911. });
  20912. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.pad-start.js
  20913. var es_string_pad_start = __webpack_require__("4d90");
  20914. // CONCATENATED MODULE: ./packages/input/src/date.js
  20915. function toStringTimeDate(str) {
  20916. if (str) {
  20917. var rest = new Date();
  20918. var h, m, s;
  20919. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isDate(str)) {
  20920. h = str.getHours();
  20921. m = str.getMinutes();
  20922. s = str.getSeconds();
  20923. } else {
  20924. str = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toValueString(str);
  20925. var parses = str.match(/^(\d{1,2})(:(\d{1,2}))?(:(\d{1,2}))?/);
  20926. if (parses) {
  20927. h = parses[1];
  20928. m = parses[3];
  20929. s = parses[5];
  20930. }
  20931. }
  20932. rest.setHours(h || 0);
  20933. rest.setMinutes(m || 0);
  20934. rest.setSeconds(s || 0);
  20935. return rest;
  20936. }
  20937. return new Date('');
  20938. }
  20939. function getDateQuarter(date) {
  20940. var month = date.getMonth();
  20941. if (month < 3) {
  20942. return 1;
  20943. } else if (month < 6) {
  20944. return 2;
  20945. } else if (month < 9) {
  20946. return 3;
  20947. }
  20948. return 4;
  20949. }
  20950. // CONCATENATED MODULE: ./packages/input/src/number.js
  20951. function handleNumber(val) {
  20952. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isString(val) ? val.replace(/,/g, '') : val;
  20953. }
  20954. function toFloatValueFixed(inputValue, digitsValue) {
  20955. if (/^-/.test('' + inputValue)) {
  20956. return 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.ceil(inputValue, digitsValue), digitsValue);
  20957. }
  20958. return 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);
  20959. }
  20960. // CONCATENATED MODULE: ./packages/input/src/input.js
  20961. var yearSize = 12;
  20962. var monthSize = 20;
  20963. var quarterSize = 8;
  20964. function getNumberValue(_vm, val) {
  20965. var type = _vm.type,
  20966. exponential = _vm.exponential,
  20967. digitsValue = _vm.digitsValue,
  20968. inpMaxlength = _vm.inpMaxlength;
  20969. var restVal = type === 'float' ? toFloatValueFixed(val, digitsValue) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toValueString(val);
  20970. if (exponential && (val === restVal || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toValueString(val).toLowerCase() === external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(restVal).toExponential())) {
  20971. return val;
  20972. }
  20973. return restVal.slice(0, inpMaxlength);
  20974. }
  20975. function renderDateLabel(h, _vm, item, label) {
  20976. var festivalMethod = _vm.festivalMethod;
  20977. if (festivalMethod) {
  20978. var festivalRest = festivalMethod(_objectSpread2({
  20979. $input: _vm,
  20980. type: _vm.datePanelType,
  20981. viewType: _vm.datePanelType
  20982. }, item));
  20983. var festivalItem = festivalRest ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isString(festivalRest) ? {
  20984. label: festivalRest
  20985. } : festivalRest : {};
  20986. var extraItem = festivalItem.extra ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isString(festivalItem.extra) ? {
  20987. label: festivalItem.extra
  20988. } : festivalItem.extra : null;
  20989. var labels = [h('span', {
  20990. class: ['vxe-input--date-label', {
  20991. 'is-notice': festivalItem.notice
  20992. }]
  20993. }, extraItem && extraItem.label ? [h('span', label), h('span', {
  20994. class: ['vxe-input--date-label--extra', extraItem.important ? 'is-important' : '', extraItem.className],
  20995. style: extraItem.style
  20996. }, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toValueString(extraItem.label))] : label)];
  20997. var festivalLabel = festivalItem.label;
  20998. if (festivalLabel) {
  20999. // 默认最多支持3个节日重叠
  21000. var festivalLabels = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toValueString(festivalLabel).split(',');
  21001. labels.push(h('span', {
  21002. class: ['vxe-input--date-festival', festivalItem.important ? 'is-important' : '', festivalItem.className],
  21003. style: festivalItem.style
  21004. }, [festivalLabels.length > 1 ? h('span', {
  21005. class: ['vxe-input--date-festival--overlap', "overlap--".concat(festivalLabels.length)]
  21006. }, festivalLabels.map(function (label) {
  21007. return h('span', label.substring(0, 3));
  21008. })) : h('span', {
  21009. class: 'vxe-input--date-festival--label'
  21010. }, festivalLabels[0].substring(0, 3))]));
  21011. }
  21012. return labels;
  21013. }
  21014. return label;
  21015. }
  21016. function isDateDisabled(_vm, item) {
  21017. var disabledMethod = _vm.disabledMethod;
  21018. return disabledMethod && disabledMethod({
  21019. $input: _vm,
  21020. type: _vm.datePanelType,
  21021. viewType: _vm.datePanelType,
  21022. date: item.date
  21023. });
  21024. }
  21025. function renderDateDayTable(h, _vm) {
  21026. var datePanelType = _vm.datePanelType,
  21027. dateValue = _vm.dateValue,
  21028. datePanelValue = _vm.datePanelValue,
  21029. dateHeaders = _vm.dateHeaders,
  21030. dayDatas = _vm.dayDatas,
  21031. multiple = _vm.multiple,
  21032. dateListValue = _vm.dateListValue;
  21033. var matchFormat = 'yyyy-MM-dd';
  21034. return [h('table', {
  21035. class: "vxe-input--date-".concat(datePanelType, "-view"),
  21036. attrs: {
  21037. cellspacing: 0,
  21038. cellpadding: 0,
  21039. border: 0
  21040. }
  21041. }, [h('thead', [h('tr', dateHeaders.map(function (item) {
  21042. return h('th', item.label);
  21043. }))]), h('tbody', dayDatas.map(function (rows) {
  21044. return h('tr', rows.map(function (item) {
  21045. return h('td', {
  21046. class: {
  21047. 'is--prev': item.isPrev,
  21048. 'is--current': item.isCurrent,
  21049. 'is--now': item.isNow,
  21050. 'is--next': item.isNext,
  21051. 'is--disabled': isDateDisabled(_vm, item),
  21052. 'is--selected': multiple ? dateListValue.some(function (val) {
  21053. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isDateSame(val, item.date, matchFormat);
  21054. }) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isDateSame(dateValue, item.date, matchFormat),
  21055. 'is--hover': external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isDateSame(datePanelValue, item.date, matchFormat)
  21056. },
  21057. on: {
  21058. click: function click() {
  21059. return _vm.dateSelectEvent(item);
  21060. },
  21061. mouseenter: function mouseenter() {
  21062. return _vm.dateMouseenterEvent(item);
  21063. }
  21064. }
  21065. }, renderDateLabel(h, _vm, item, item.label));
  21066. }));
  21067. }))])];
  21068. }
  21069. function renderDateWeekTable(h, _vm) {
  21070. var datePanelType = _vm.datePanelType,
  21071. dateValue = _vm.dateValue,
  21072. datePanelValue = _vm.datePanelValue,
  21073. weekHeaders = _vm.weekHeaders,
  21074. weekDates = _vm.weekDates,
  21075. multiple = _vm.multiple,
  21076. dateListValue = _vm.dateListValue;
  21077. var matchFormat = 'yyyyMMdd';
  21078. return [h('table', {
  21079. class: "vxe-input--date-".concat(datePanelType, "-view"),
  21080. attrs: {
  21081. cellspacing: 0,
  21082. cellpadding: 0,
  21083. border: 0
  21084. }
  21085. }, [h('thead', [h('tr', weekHeaders.map(function (item) {
  21086. return h('th', item.label);
  21087. }))]), h('tbody', weekDates.map(function (rows) {
  21088. var isSelected = multiple ? rows.some(function (item) {
  21089. return dateListValue.some(function (val) {
  21090. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isDateSame(val, item.date, matchFormat);
  21091. });
  21092. }) : rows.some(function (item) {
  21093. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isDateSame(dateValue, item.date, matchFormat);
  21094. });
  21095. var isHover = rows.some(function (item) {
  21096. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isDateSame(datePanelValue, item.date, matchFormat);
  21097. });
  21098. return h('tr', rows.map(function (item) {
  21099. return h('td', {
  21100. class: {
  21101. 'is--prev': item.isPrev,
  21102. 'is--current': item.isCurrent,
  21103. 'is--now': item.isNow,
  21104. 'is--next': item.isNext,
  21105. 'is--disabled': isDateDisabled(_vm, item),
  21106. 'is--selected': isSelected,
  21107. 'is--hover': isHover
  21108. },
  21109. on: {
  21110. click: function click() {
  21111. return _vm.dateSelectEvent(item);
  21112. },
  21113. mouseenter: function mouseenter() {
  21114. return _vm.dateMouseenterEvent(item);
  21115. }
  21116. }
  21117. }, renderDateLabel(h, _vm, item, item.label));
  21118. }));
  21119. }))])];
  21120. }
  21121. function renderDateMonthTable(h, _vm) {
  21122. var dateValue = _vm.dateValue,
  21123. datePanelType = _vm.datePanelType,
  21124. monthDatas = _vm.monthDatas,
  21125. datePanelValue = _vm.datePanelValue,
  21126. multiple = _vm.multiple,
  21127. dateListValue = _vm.dateListValue;
  21128. var matchFormat = 'yyyyMM';
  21129. return [h('table', {
  21130. class: "vxe-input--date-".concat(datePanelType, "-view"),
  21131. attrs: {
  21132. cellspacing: 0,
  21133. cellpadding: 0,
  21134. border: 0
  21135. }
  21136. }, [h('tbody', monthDatas.map(function (rows) {
  21137. return h('tr', rows.map(function (item) {
  21138. return h('td', {
  21139. class: {
  21140. 'is--prev': item.isPrev,
  21141. 'is--current': item.isCurrent,
  21142. 'is--now': item.isNow,
  21143. 'is--next': item.isNext,
  21144. 'is--disabled': isDateDisabled(_vm, item),
  21145. 'is--selected': multiple ? dateListValue.some(function (val) {
  21146. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isDateSame(val, item.date, matchFormat);
  21147. }) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isDateSame(dateValue, item.date, matchFormat),
  21148. 'is--hover': external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isDateSame(datePanelValue, item.date, matchFormat)
  21149. },
  21150. on: {
  21151. click: function click() {
  21152. return _vm.dateSelectEvent(item);
  21153. },
  21154. mouseenter: function mouseenter() {
  21155. return _vm.dateMouseenterEvent(item);
  21156. }
  21157. }
  21158. }, renderDateLabel(h, _vm, item, src_conf.i18n("vxe.input.date.months.m".concat(item.month))));
  21159. }));
  21160. }))])];
  21161. }
  21162. function renderDateQuarterTable(h, _vm) {
  21163. var dateValue = _vm.dateValue,
  21164. datePanelType = _vm.datePanelType,
  21165. quarterDatas = _vm.quarterDatas,
  21166. datePanelValue = _vm.datePanelValue,
  21167. multiple = _vm.multiple,
  21168. dateListValue = _vm.dateListValue;
  21169. var matchFormat = 'yyyyq';
  21170. return [h('table', {
  21171. class: "vxe-input--date-".concat(datePanelType, "-view"),
  21172. attrs: {
  21173. cellspacing: 0,
  21174. cellpadding: 0,
  21175. border: 0
  21176. }
  21177. }, [h('tbody', quarterDatas.map(function (rows) {
  21178. return h('tr', rows.map(function (item) {
  21179. return h('td', {
  21180. class: {
  21181. 'is--prev': item.isPrev,
  21182. 'is--current': item.isCurrent,
  21183. 'is--now': item.isNow,
  21184. 'is--next': item.isNext,
  21185. 'is--disabled': isDateDisabled(_vm, item),
  21186. 'is--selected': multiple ? dateListValue.some(function (val) {
  21187. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isDateSame(val, item.date, matchFormat);
  21188. }) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isDateSame(dateValue, item.date, matchFormat),
  21189. 'is--hover': external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isDateSame(datePanelValue, item.date, matchFormat)
  21190. },
  21191. on: {
  21192. click: function click() {
  21193. return _vm.dateSelectEvent(item);
  21194. },
  21195. mouseenter: function mouseenter() {
  21196. return _vm.dateMouseenterEvent(item);
  21197. }
  21198. }
  21199. }, renderDateLabel(h, _vm, item, src_conf.i18n("vxe.input.date.quarters.q".concat(item.quarter))));
  21200. }));
  21201. }))])];
  21202. }
  21203. function renderDateYearTable(h, _vm) {
  21204. var dateValue = _vm.dateValue,
  21205. datePanelType = _vm.datePanelType,
  21206. yearDatas = _vm.yearDatas,
  21207. datePanelValue = _vm.datePanelValue,
  21208. multiple = _vm.multiple,
  21209. dateListValue = _vm.dateListValue;
  21210. var matchFormat = 'yyyy';
  21211. return [h('table', {
  21212. class: "vxe-input--date-".concat(datePanelType, "-view"),
  21213. attrs: {
  21214. cellspacing: 0,
  21215. cellpadding: 0,
  21216. border: 0
  21217. }
  21218. }, [h('tbody', yearDatas.map(function (rows) {
  21219. return h('tr', rows.map(function (item) {
  21220. return h('td', {
  21221. class: {
  21222. 'is--prev': item.isPrev,
  21223. 'is--current': item.isCurrent,
  21224. 'is--now': item.isNow,
  21225. 'is--next': item.isNext,
  21226. 'is--disabled': isDateDisabled(item),
  21227. 'is--selected': multiple ? dateListValue.some(function (val) {
  21228. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isDateSame(val, item.date, matchFormat);
  21229. }) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isDateSame(dateValue, item.date, matchFormat),
  21230. 'is--hover': external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isDateSame(datePanelValue, item.date, matchFormat)
  21231. },
  21232. on: {
  21233. click: function click() {
  21234. return _vm.dateSelectEvent(item);
  21235. },
  21236. mouseenter: function mouseenter() {
  21237. return _vm.dateMouseenterEvent(item);
  21238. }
  21239. }
  21240. }, renderDateLabel(h, _vm, item, item.year));
  21241. }));
  21242. }))])];
  21243. }
  21244. function renderDateTable(h, _vm) {
  21245. var datePanelType = _vm.datePanelType;
  21246. switch (datePanelType) {
  21247. case 'week':
  21248. return renderDateWeekTable(h, _vm);
  21249. case 'month':
  21250. return renderDateMonthTable(h, _vm);
  21251. case 'quarter':
  21252. return renderDateQuarterTable(h, _vm);
  21253. case 'year':
  21254. return renderDateYearTable(h, _vm);
  21255. }
  21256. return renderDateDayTable(h, _vm);
  21257. }
  21258. function renderDatePanel(h, _vm) {
  21259. var datePanelType = _vm.datePanelType,
  21260. selectDatePanelLabel = _vm.selectDatePanelLabel,
  21261. isDisabledPrevDateBtn = _vm.isDisabledPrevDateBtn,
  21262. isDisabledNextDateBtn = _vm.isDisabledNextDateBtn,
  21263. multiple = _vm.multiple,
  21264. supportMultiples = _vm.supportMultiples;
  21265. return [h('div', {
  21266. class: 'vxe-input--date-picker-header'
  21267. }, [h('div', {
  21268. class: 'vxe-input--date-picker-type-wrapper'
  21269. }, [datePanelType === 'year' ? h('span', {
  21270. class: 'vxe-input--date-picker-label'
  21271. }, selectDatePanelLabel) : h('span', {
  21272. class: 'vxe-input--date-picker-btn',
  21273. on: {
  21274. click: _vm.dateToggleTypeEvent
  21275. }
  21276. }, selectDatePanelLabel)]), h('div', {
  21277. class: 'vxe-input--date-picker-btn-wrapper'
  21278. }, [h('span', {
  21279. class: ['vxe-input--date-picker-btn vxe-input--date-picker-prev-btn', {
  21280. 'is--disabled': isDisabledPrevDateBtn
  21281. }],
  21282. on: {
  21283. click: _vm.datePrevEvent
  21284. }
  21285. }, [h('i', {
  21286. class: 'vxe-icon-caret-left'
  21287. })]), h('span', {
  21288. class: 'vxe-input--date-picker-btn vxe-input--date-picker-current-btn',
  21289. on: {
  21290. click: _vm.dateTodayMonthEvent
  21291. }
  21292. }, [h('i', {
  21293. class: 'vxe-icon-dot'
  21294. })]), h('span', {
  21295. class: ['vxe-input--date-picker-btn vxe-input--date-picker-next-btn', {
  21296. 'is--disabled': isDisabledNextDateBtn
  21297. }],
  21298. on: {
  21299. click: _vm.dateNextEvent
  21300. }
  21301. }, [h('i', {
  21302. class: 'vxe-icon-caret-right'
  21303. })]), multiple && supportMultiples ? h('span', {
  21304. class: 'vxe-input--date-picker-btn vxe-input--date-picker-confirm-btn'
  21305. }, [h('button', {
  21306. class: 'vxe-input--date-picker-confirm',
  21307. attrs: {
  21308. type: 'button'
  21309. },
  21310. on: {
  21311. click: _vm.dateConfirmEvent
  21312. }
  21313. }, src_conf.i18n('vxe.button.confirm'))]) : null])]), h('div', {
  21314. class: 'vxe-input--date-picker-body'
  21315. }, renderDateTable(h, _vm))];
  21316. }
  21317. function renderTimePanel(h, _vm) {
  21318. var dateTimeLabel = _vm.dateTimeLabel,
  21319. datetimePanelValue = _vm.datetimePanelValue,
  21320. hourList = _vm.hourList,
  21321. minuteList = _vm.minuteList,
  21322. secondList = _vm.secondList;
  21323. return [h('div', {
  21324. class: 'vxe-input--time-picker-header'
  21325. }, [h('span', {
  21326. class: 'vxe-input--time-picker-title'
  21327. }, dateTimeLabel), h('button', {
  21328. class: 'vxe-input--time-picker-confirm',
  21329. attrs: {
  21330. type: 'button'
  21331. },
  21332. on: {
  21333. click: _vm.dateConfirmEvent
  21334. }
  21335. }, src_conf.i18n('vxe.button.confirm'))]), h('div', {
  21336. ref: 'timeBody',
  21337. class: 'vxe-input--time-picker-body'
  21338. }, [h('ul', {
  21339. class: 'vxe-input--time-picker-hour-list'
  21340. }, hourList.map(function (item, index) {
  21341. return h('li', {
  21342. key: index,
  21343. class: {
  21344. 'is--selected': datetimePanelValue && datetimePanelValue.getHours() === item.value
  21345. },
  21346. on: {
  21347. click: function click(evnt) {
  21348. return _vm.dateHourEvent(evnt, item);
  21349. }
  21350. }
  21351. }, item.label);
  21352. })), h('ul', {
  21353. class: 'vxe-input--time-picker-minute-list'
  21354. }, minuteList.map(function (item, index) {
  21355. return h('li', {
  21356. key: index,
  21357. class: {
  21358. 'is--selected': datetimePanelValue && datetimePanelValue.getMinutes() === item.value
  21359. },
  21360. on: {
  21361. click: function click(evnt) {
  21362. return _vm.dateMinuteEvent(evnt, item);
  21363. }
  21364. }
  21365. }, item.label);
  21366. })), h('ul', {
  21367. class: 'vxe-input--time-picker-second-list'
  21368. }, secondList.map(function (item, index) {
  21369. return h('li', {
  21370. key: index,
  21371. class: {
  21372. 'is--selected': datetimePanelValue && datetimePanelValue.getSeconds() === item.value
  21373. },
  21374. on: {
  21375. click: function click(evnt) {
  21376. return _vm.dateSecondEvent(evnt, item);
  21377. }
  21378. }
  21379. }, item.label);
  21380. }))])];
  21381. }
  21382. function renderPanel(h, _vm) {
  21383. var type = _vm.type,
  21384. vSize = _vm.vSize,
  21385. isDatePickerType = _vm.isDatePickerType,
  21386. transfer = _vm.transfer,
  21387. animatVisible = _vm.animatVisible,
  21388. visiblePanel = _vm.visiblePanel,
  21389. panelPlacement = _vm.panelPlacement,
  21390. panelStyle = _vm.panelStyle;
  21391. var renders = [];
  21392. if (isDatePickerType) {
  21393. var _ref;
  21394. if (type === 'datetime') {
  21395. renders.push(h('div', {
  21396. class: 'vxe-input--panel-layout-wrapper'
  21397. }, [h('div', {
  21398. class: 'vxe-input--panel-left-wrapper'
  21399. }, renderDatePanel(h, _vm)), h('div', {
  21400. class: 'vxe-input--panel-right-wrapper'
  21401. }, renderTimePanel(h, _vm))]));
  21402. } else if (type === 'time') {
  21403. renders.push(h('div', {
  21404. class: 'vxe-input--panel-wrapper'
  21405. }, renderTimePanel(h, _vm)));
  21406. } else {
  21407. renders.push(h('div', {
  21408. class: 'vxe-input--panel-wrapper'
  21409. }, renderDatePanel(h, _vm)));
  21410. }
  21411. return h('div', {
  21412. ref: 'panel',
  21413. 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)],
  21414. attrs: {
  21415. placement: panelPlacement
  21416. },
  21417. style: panelStyle
  21418. }, renders);
  21419. }
  21420. return null;
  21421. }
  21422. function renderNumberIcon(h, _vm) {
  21423. return h('span', {
  21424. class: 'vxe-input--number-suffix'
  21425. }, [h('span', {
  21426. class: ['vxe-input--number-prev is--prev', {
  21427. 'is--disabled': _vm.isDisabledAddNumber
  21428. }],
  21429. on: {
  21430. mousedown: _vm.numberMousedownEvent,
  21431. mouseup: _vm.numberStopDown,
  21432. mouseleave: _vm.numberStopDown
  21433. }
  21434. }, [h('i', {
  21435. class: ['vxe-input--number-prev-icon', src_conf.icon.INPUT_PREV_NUM]
  21436. })]), h('span', {
  21437. class: ['vxe-input--number-next is--next', {
  21438. 'is--disabled': _vm.isDisabledSubtractNumber
  21439. }],
  21440. on: {
  21441. mousedown: _vm.numberMousedownEvent,
  21442. mouseup: _vm.numberStopDown,
  21443. mouseleave: _vm.numberStopDown
  21444. }
  21445. }, [h('i', {
  21446. class: ['vxe-input--number-next-icon', src_conf.icon.INPUT_NEXT_NUM]
  21447. })])]);
  21448. }
  21449. function renderDatePickerIcon(h, _vm) {
  21450. return h('span', {
  21451. class: 'vxe-input--date-picker-suffix',
  21452. on: {
  21453. click: _vm.datePickerOpenEvent
  21454. }
  21455. }, [h('i', {
  21456. class: ['vxe-input--date-picker-icon', src_conf.icon.INPUT_DATE]
  21457. })]);
  21458. }
  21459. function renderSearchIcon(h, _vm) {
  21460. return h('span', {
  21461. class: 'vxe-input--search-suffix',
  21462. on: {
  21463. click: _vm.searchEvent
  21464. }
  21465. }, [h('i', {
  21466. class: ['vxe-input--search-icon', src_conf.icon.INPUT_SEARCH]
  21467. })]);
  21468. }
  21469. function renderPasswordIcon(h, _vm) {
  21470. var showPwd = _vm.showPwd;
  21471. return h('span', {
  21472. class: 'vxe-input--password-suffix',
  21473. on: {
  21474. click: _vm.passwordToggleEvent
  21475. }
  21476. }, [h('i', {
  21477. class: ['vxe-input--password-icon', showPwd ? src_conf.icon.INPUT_SHOW_PWD : src_conf.icon.INPUT_PWD]
  21478. })]);
  21479. }
  21480. function rendePrefixIcon(h, _vm) {
  21481. var $scopedSlots = _vm.$scopedSlots,
  21482. prefixIcon = _vm.prefixIcon;
  21483. var icons = [];
  21484. if ($scopedSlots.prefix) {
  21485. icons.push(h('span', {
  21486. class: 'vxe-input--prefix-icon'
  21487. }, $scopedSlots.prefix.call(this, {}, h)));
  21488. } else if (prefixIcon) {
  21489. icons.push(h('i', {
  21490. class: ['vxe-input--prefix-icon', prefixIcon]
  21491. }));
  21492. }
  21493. return icons.length ? h('span', {
  21494. class: 'vxe-input--prefix',
  21495. on: {
  21496. click: _vm.clickPrefixEvent
  21497. }
  21498. }, icons) : null;
  21499. }
  21500. function renderSuffixIcon(h, _vm) {
  21501. var $scopedSlots = _vm.$scopedSlots,
  21502. inputValue = _vm.inputValue,
  21503. isClearable = _vm.isClearable,
  21504. disabled = _vm.disabled,
  21505. suffixIcon = _vm.suffixIcon;
  21506. var icons = [];
  21507. if ($scopedSlots.suffix) {
  21508. icons.push(h('span', {
  21509. class: 'vxe-input--suffix-icon'
  21510. }, $scopedSlots.suffix.call(this, {}, h)));
  21511. } else if (suffixIcon) {
  21512. icons.push(h('i', {
  21513. class: ['vxe-input--suffix-icon', suffixIcon]
  21514. }));
  21515. }
  21516. if (isClearable) {
  21517. icons.push(h('i', {
  21518. class: ['vxe-input--clear-icon', src_conf.icon.INPUT_CLEAR]
  21519. }));
  21520. }
  21521. return icons.length ? h('span', {
  21522. class: ['vxe-input--suffix', {
  21523. 'is--clear': isClearable && !disabled && !(inputValue === '' || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eqNull(inputValue))
  21524. }],
  21525. on: {
  21526. click: _vm.clickSuffixEvent
  21527. }
  21528. }, icons) : null;
  21529. }
  21530. function renderExtraSuffixIcon(h, _vm) {
  21531. var controls = _vm.controls,
  21532. isPawdType = _vm.isPawdType,
  21533. isNumType = _vm.isNumType,
  21534. isDatePickerType = _vm.isDatePickerType,
  21535. isSearch = _vm.isSearch;
  21536. var icons;
  21537. if (isPawdType) {
  21538. icons = renderPasswordIcon(h, _vm);
  21539. } else if (isNumType) {
  21540. if (controls) {
  21541. icons = renderNumberIcon(h, _vm);
  21542. }
  21543. } else if (isDatePickerType) {
  21544. icons = renderDatePickerIcon(h, _vm);
  21545. } else if (isSearch) {
  21546. icons = renderSearchIcon(h, _vm);
  21547. }
  21548. return icons ? h('span', {
  21549. class: 'vxe-input--extra-suffix'
  21550. }, [icons]) : null;
  21551. }
  21552. /* harmony default export */ var input = ({
  21553. name: 'VxeInput',
  21554. mixins: [size],
  21555. model: {
  21556. prop: 'value',
  21557. event: 'modelValue'
  21558. },
  21559. props: {
  21560. value: [String, Number, Date],
  21561. immediate: {
  21562. type: Boolean,
  21563. default: true
  21564. },
  21565. name: String,
  21566. type: {
  21567. type: String,
  21568. default: 'text'
  21569. },
  21570. clearable: {
  21571. type: Boolean,
  21572. default: function _default() {
  21573. return src_conf.input.clearable;
  21574. }
  21575. },
  21576. readonly: Boolean,
  21577. disabled: Boolean,
  21578. placeholder: String,
  21579. maxlength: [String, Number],
  21580. autocomplete: {
  21581. type: String,
  21582. default: 'off'
  21583. },
  21584. align: String,
  21585. form: String,
  21586. className: String,
  21587. size: {
  21588. type: String,
  21589. default: function _default() {
  21590. return src_conf.input.size || src_conf.size;
  21591. }
  21592. },
  21593. multiple: Boolean,
  21594. // number、integer、float
  21595. min: {
  21596. type: [String, Number],
  21597. default: null
  21598. },
  21599. max: {
  21600. type: [String, Number],
  21601. default: null
  21602. },
  21603. step: [String, Number],
  21604. exponential: {
  21605. type: Boolean,
  21606. default: function _default() {
  21607. return src_conf.input.exponential;
  21608. }
  21609. },
  21610. // number、integer、float、password
  21611. controls: {
  21612. type: Boolean,
  21613. default: function _default() {
  21614. return src_conf.input.controls;
  21615. }
  21616. },
  21617. // float
  21618. digits: {
  21619. type: [String, Number],
  21620. default: function _default() {
  21621. return src_conf.input.digits;
  21622. }
  21623. },
  21624. // date、week、month、year
  21625. dateConfig: Object,
  21626. startDate: {
  21627. type: [String, Number, Date],
  21628. default: function _default() {
  21629. return src_conf.input.startDate;
  21630. }
  21631. },
  21632. endDate: {
  21633. type: [String, Number, Date],
  21634. default: function _default() {
  21635. return src_conf.input.endDate;
  21636. }
  21637. },
  21638. minDate: [String, Number, Date],
  21639. maxDate: [String, Number, Date],
  21640. // 已废弃 startWeek,被 startDay 替换
  21641. startWeek: Number,
  21642. startDay: {
  21643. type: [String, Number],
  21644. default: function _default() {
  21645. return src_conf.input.startDay;
  21646. }
  21647. },
  21648. labelFormat: {
  21649. type: String,
  21650. default: function _default() {
  21651. return src_conf.input.labelFormat;
  21652. }
  21653. },
  21654. valueFormat: {
  21655. type: String,
  21656. default: function _default() {
  21657. return src_conf.input.valueFormat;
  21658. }
  21659. },
  21660. editable: {
  21661. type: Boolean,
  21662. default: true
  21663. },
  21664. festivalMethod: {
  21665. type: Function,
  21666. default: function _default() {
  21667. return src_conf.input.festivalMethod;
  21668. }
  21669. },
  21670. disabledMethod: {
  21671. type: Function,
  21672. default: function _default() {
  21673. return src_conf.input.disabledMethod;
  21674. }
  21675. },
  21676. // week
  21677. selectDay: {
  21678. type: Number,
  21679. default: function _default() {
  21680. return src_conf.input.selectDay;
  21681. }
  21682. },
  21683. prefixIcon: String,
  21684. suffixIcon: String,
  21685. placement: String,
  21686. transfer: {
  21687. type: Boolean,
  21688. default: function _default() {
  21689. return src_conf.input.transfer;
  21690. }
  21691. }
  21692. },
  21693. inject: {
  21694. $xeform: {
  21695. default: null
  21696. },
  21697. $xeformiteminfo: {
  21698. default: null
  21699. }
  21700. },
  21701. data: function data() {
  21702. return {
  21703. panelIndex: 0,
  21704. showPwd: false,
  21705. visiblePanel: false,
  21706. animatVisible: false,
  21707. panelStyle: null,
  21708. panelPlacement: null,
  21709. isActivated: false,
  21710. inputValue: this.value,
  21711. datetimePanelValue: null,
  21712. datePanelValue: null,
  21713. datePanelLabel: '',
  21714. datePanelType: 'day',
  21715. selectMonth: null,
  21716. currentDate: null
  21717. };
  21718. },
  21719. computed: {
  21720. isNumType: function isNumType() {
  21721. return ['number', 'integer', 'float'].indexOf(this.type) > -1;
  21722. },
  21723. isDatePickerType: function isDatePickerType() {
  21724. return this.isDateTimeType || ['date', 'week', 'month', 'quarter', 'year'].indexOf(this.type) > -1;
  21725. },
  21726. isDateTimeType: function isDateTimeType() {
  21727. var type = this.type;
  21728. return type === 'time' || type === 'datetime';
  21729. },
  21730. isPawdType: function isPawdType() {
  21731. return this.type === 'password';
  21732. },
  21733. isSearch: function isSearch() {
  21734. return this.type === 'search';
  21735. },
  21736. stepValue: function stepValue() {
  21737. var type = this.type,
  21738. step = this.step;
  21739. if (type === 'integer') {
  21740. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toInteger(step) || 1;
  21741. } else if (type === 'float') {
  21742. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(step) || 1 / Math.pow(10, this.digitsValue);
  21743. }
  21744. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(step) || 1;
  21745. },
  21746. digitsValue: function digitsValue() {
  21747. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toInteger(this.digits) || 1;
  21748. },
  21749. isClearable: function isClearable() {
  21750. return this.clearable && (this.isPawdType || this.isNumType || this.isDatePickerType || this.type === 'text' || this.type === 'search');
  21751. },
  21752. isDisabledPrevDateBtn: function isDisabledPrevDateBtn() {
  21753. var selectMonth = this.selectMonth,
  21754. dateStartTime = this.dateStartTime;
  21755. if (selectMonth) {
  21756. return selectMonth <= dateStartTime;
  21757. }
  21758. return false;
  21759. },
  21760. isDisabledNextDateBtn: function isDisabledNextDateBtn() {
  21761. var selectMonth = this.selectMonth,
  21762. dateEndTime = this.dateEndTime;
  21763. if (selectMonth) {
  21764. return selectMonth >= dateEndTime;
  21765. }
  21766. return false;
  21767. },
  21768. dateStartTime: function dateStartTime() {
  21769. return this.startDate ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toStringDate(this.startDate) : null;
  21770. },
  21771. dateEndTime: function dateEndTime() {
  21772. return this.endDate ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toStringDate(this.endDate) : null;
  21773. },
  21774. supportMultiples: function supportMultiples() {
  21775. return ['date', 'week', 'month', 'quarter', 'year'].includes(this.type);
  21776. },
  21777. dateListValue: function dateListValue() {
  21778. var _this = this;
  21779. var value = this.value,
  21780. multiple = this.multiple,
  21781. isDatePickerType = this.isDatePickerType,
  21782. dateValueFormat = this.dateValueFormat;
  21783. if (multiple && value && isDatePickerType) {
  21784. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toValueString(value).split(',').map(function (item) {
  21785. var date = _this.parseDate(item, dateValueFormat);
  21786. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isValidDate(date)) {
  21787. return date;
  21788. }
  21789. return null;
  21790. });
  21791. }
  21792. return [];
  21793. },
  21794. dateMultipleValue: function dateMultipleValue() {
  21795. var dateListValue = this.dateListValue,
  21796. dateValueFormat = this.dateValueFormat;
  21797. return dateListValue.map(function (date) {
  21798. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toDateString(date, dateValueFormat);
  21799. });
  21800. },
  21801. dateMultipleLabel: function dateMultipleLabel() {
  21802. var dateListValue = this.dateListValue,
  21803. dateLabelFormat = this.dateLabelFormat;
  21804. return dateListValue.map(function (date) {
  21805. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toDateString(date, dateLabelFormat);
  21806. }).join(', ');
  21807. },
  21808. dateValue: function dateValue() {
  21809. var value = this.value,
  21810. isDatePickerType = this.isDatePickerType,
  21811. dateValueFormat = this.dateValueFormat;
  21812. var val = null;
  21813. if (value && isDatePickerType) {
  21814. var date = this.parseDate(value, dateValueFormat);
  21815. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isValidDate(date)) {
  21816. val = date;
  21817. }
  21818. }
  21819. return val;
  21820. },
  21821. dateTimeLabel: function dateTimeLabel() {
  21822. var datetimePanelValue = this.datetimePanelValue;
  21823. if (datetimePanelValue) {
  21824. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toDateString(datetimePanelValue, 'HH:mm:ss');
  21825. }
  21826. return '';
  21827. },
  21828. hmsTime: function hmsTime() {
  21829. var dateValue = this.dateValue;
  21830. return dateValue && this.isDateTimeType ? (dateValue.getHours() * 3600 + dateValue.getMinutes() * 60 + dateValue.getSeconds()) * 1000 : 0;
  21831. },
  21832. dateLabelFormat: function dateLabelFormat() {
  21833. if (this.isDatePickerType) {
  21834. return this.labelFormat || src_conf.i18n("vxe.input.date.labelFormat.".concat(this.type));
  21835. }
  21836. return null;
  21837. },
  21838. dateValueFormat: function dateValueFormat() {
  21839. var type = this.type;
  21840. return type === 'time' ? 'HH:mm:ss' : this.valueFormat || (type === 'datetime' ? 'yyyy-MM-dd HH:mm:ss' : 'yyyy-MM-dd');
  21841. },
  21842. selectDatePanelLabel: function selectDatePanelLabel() {
  21843. if (this.isDatePickerType) {
  21844. var datePanelType = this.datePanelType,
  21845. selectMonth = this.selectMonth,
  21846. yearList = this.yearList;
  21847. var year = '';
  21848. var month;
  21849. if (selectMonth) {
  21850. year = selectMonth.getFullYear();
  21851. month = selectMonth.getMonth() + 1;
  21852. }
  21853. if (datePanelType === 'quarter') {
  21854. return src_conf.i18n('vxe.input.date.quarterLabel', [year]);
  21855. } else if (datePanelType === 'month') {
  21856. return src_conf.i18n('vxe.input.date.monthLabel', [year]);
  21857. } else if (datePanelType === 'year') {
  21858. return yearList.length ? "".concat(yearList[0].year, " - ").concat(yearList[yearList.length - 1].year) : '';
  21859. }
  21860. return src_conf.i18n('vxe.input.date.dayLabel', [year, month ? src_conf.i18n("vxe.input.date.m".concat(month)) : '-']);
  21861. }
  21862. return '';
  21863. },
  21864. firstDayOfWeek: function firstDayOfWeek() {
  21865. var startDay = this.startDay,
  21866. startWeek = this.startWeek;
  21867. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNumber(startDay) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isString(startDay) ? startDay : startWeek);
  21868. },
  21869. weekDatas: function weekDatas() {
  21870. var weeks = [];
  21871. if (this.isDatePickerType) {
  21872. var sWeek = this.firstDayOfWeek;
  21873. weeks.push(sWeek);
  21874. for (var index = 0; index < 6; index++) {
  21875. if (sWeek >= 6) {
  21876. sWeek = 0;
  21877. } else {
  21878. sWeek++;
  21879. }
  21880. weeks.push(sWeek);
  21881. }
  21882. }
  21883. return weeks;
  21884. },
  21885. dateHeaders: function dateHeaders() {
  21886. if (this.isDatePickerType) {
  21887. return this.weekDatas.map(function (day) {
  21888. return {
  21889. value: day,
  21890. label: src_conf.i18n("vxe.input.date.weeks.w".concat(day))
  21891. };
  21892. });
  21893. }
  21894. return [];
  21895. },
  21896. weekHeaders: function weekHeaders() {
  21897. if (this.isDatePickerType) {
  21898. return [{
  21899. label: src_conf.i18n('vxe.input.date.weeks.w')
  21900. }].concat(this.dateHeaders);
  21901. }
  21902. return [];
  21903. },
  21904. yearList: function yearList() {
  21905. var selectMonth = this.selectMonth,
  21906. currentDate = this.currentDate;
  21907. var months = [];
  21908. if (selectMonth && currentDate) {
  21909. var currFullYear = currentDate.getFullYear();
  21910. var selectFullYear = selectMonth.getFullYear();
  21911. var startYearDate = new Date(selectFullYear - selectFullYear % yearSize, 0, 1);
  21912. for (var index = -4; index < yearSize + 4; index++) {
  21913. var date = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatYear(startYearDate, index, 'first');
  21914. var itemFullYear = date.getFullYear();
  21915. months.push({
  21916. date: date,
  21917. isCurrent: true,
  21918. isPrev: index < 0,
  21919. isNow: currFullYear === itemFullYear,
  21920. isNext: index >= yearSize,
  21921. year: itemFullYear
  21922. });
  21923. }
  21924. }
  21925. return months;
  21926. },
  21927. yearDatas: function yearDatas() {
  21928. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.chunk(this.yearList, 4);
  21929. },
  21930. quarterList: function quarterList() {
  21931. var selectMonth = this.selectMonth,
  21932. currentDate = this.currentDate;
  21933. var quarters = [];
  21934. if (selectMonth && currentDate) {
  21935. var currFullYear = currentDate.getFullYear();
  21936. var currQuarter = getDateQuarter(currentDate);
  21937. var firstYear = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatYear(selectMonth, 0, 'first');
  21938. var selFullYear = firstYear.getFullYear();
  21939. for (var index = -2; index < quarterSize - 2; index++) {
  21940. var date = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatQuarter(firstYear, index);
  21941. var itemFullYear = date.getFullYear();
  21942. var itemQuarter = getDateQuarter(date);
  21943. var isPrev = itemFullYear < selFullYear;
  21944. quarters.push({
  21945. date: date,
  21946. isPrev: isPrev,
  21947. isCurrent: itemFullYear === selFullYear,
  21948. isNow: itemFullYear === currFullYear && itemQuarter === currQuarter,
  21949. isNext: !isPrev && itemFullYear > selFullYear,
  21950. quarter: itemQuarter
  21951. });
  21952. }
  21953. }
  21954. return quarters;
  21955. },
  21956. quarterDatas: function quarterDatas() {
  21957. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.chunk(this.quarterList, 2);
  21958. },
  21959. monthList: function monthList() {
  21960. var selectMonth = this.selectMonth,
  21961. currentDate = this.currentDate;
  21962. var months = [];
  21963. if (selectMonth && currentDate) {
  21964. var currFullYear = currentDate.getFullYear();
  21965. var currMonth = currentDate.getMonth();
  21966. var selFullYear = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatYear(selectMonth, 0, 'first').getFullYear();
  21967. for (var index = -4; index < monthSize - 4; index++) {
  21968. var date = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatYear(selectMonth, 0, index);
  21969. var itemFullYear = date.getFullYear();
  21970. var itemMonth = date.getMonth();
  21971. var isPrev = itemFullYear < selFullYear;
  21972. months.push({
  21973. date: date,
  21974. isPrev: isPrev,
  21975. isCurrent: itemFullYear === selFullYear,
  21976. isNow: itemFullYear === currFullYear && itemMonth === currMonth,
  21977. isNext: !isPrev && itemFullYear > selFullYear,
  21978. month: itemMonth
  21979. });
  21980. }
  21981. }
  21982. return months;
  21983. },
  21984. monthDatas: function monthDatas() {
  21985. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.chunk(this.monthList, 4);
  21986. },
  21987. dayList: function dayList() {
  21988. var weekDatas = this.weekDatas,
  21989. selectMonth = this.selectMonth,
  21990. currentDate = this.currentDate,
  21991. hmsTime = this.hmsTime;
  21992. var days = [];
  21993. if (selectMonth && currentDate) {
  21994. var currFullYear = currentDate.getFullYear();
  21995. var currMonth = currentDate.getMonth();
  21996. var currDate = currentDate.getDate();
  21997. var selFullYear = selectMonth.getFullYear();
  21998. var selMonth = selectMonth.getMonth();
  21999. var selDay = selectMonth.getDay();
  22000. var prevOffsetDate = -weekDatas.indexOf(selDay);
  22001. var startDayDate = new Date(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatDay(selectMonth, prevOffsetDate).getTime() + hmsTime);
  22002. for (var index = 0; index < 42; index++) {
  22003. var date = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatDay(startDayDate, index);
  22004. var itemFullYear = date.getFullYear();
  22005. var itemMonth = date.getMonth();
  22006. var itemDate = date.getDate();
  22007. var isPrev = date < selectMonth;
  22008. days.push({
  22009. date: date,
  22010. isPrev: isPrev,
  22011. isCurrent: itemFullYear === selFullYear && itemMonth === selMonth,
  22012. isNow: itemFullYear === currFullYear && itemMonth === currMonth && itemDate === currDate,
  22013. isNext: !isPrev && selMonth !== itemMonth,
  22014. label: itemDate
  22015. });
  22016. }
  22017. }
  22018. return days;
  22019. },
  22020. dayDatas: function dayDatas() {
  22021. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.chunk(this.dayList, 7);
  22022. },
  22023. weekDates: function weekDates() {
  22024. var dayDatas = this.dayDatas,
  22025. firstDayOfWeek = this.firstDayOfWeek;
  22026. return dayDatas.map(function (list) {
  22027. var firstItem = list[0];
  22028. var item = {
  22029. date: firstItem.date,
  22030. isWeekNumber: true,
  22031. isPrev: false,
  22032. isCurrent: false,
  22033. isNow: false,
  22034. isNext: false,
  22035. label: external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getYearWeek(firstItem.date, firstDayOfWeek)
  22036. };
  22037. return [item].concat(list);
  22038. });
  22039. },
  22040. hourList: function hourList() {
  22041. var list = [];
  22042. if (this.isDateTimeType) {
  22043. for (var index = 0; index < 24; index++) {
  22044. list.push({
  22045. value: index,
  22046. label: ('' + index).padStart(2, 0)
  22047. });
  22048. }
  22049. }
  22050. return list;
  22051. },
  22052. minuteList: function minuteList() {
  22053. var list = [];
  22054. if (this.isDateTimeType) {
  22055. for (var index = 0; index < 60; index++) {
  22056. list.push({
  22057. value: index,
  22058. label: ('' + index).padStart(2, 0)
  22059. });
  22060. }
  22061. }
  22062. return list;
  22063. },
  22064. secondList: function secondList() {
  22065. return this.minuteList;
  22066. },
  22067. inpImmediate: function inpImmediate() {
  22068. var type = this.type,
  22069. immediate = this.immediate;
  22070. return immediate || !(type === 'text' || type === 'number' || type === 'integer' || type === 'float');
  22071. },
  22072. inpPlaceholder: function inpPlaceholder() {
  22073. var placeholder = this.placeholder;
  22074. if (placeholder) {
  22075. return getFuncText(placeholder);
  22076. }
  22077. return '';
  22078. },
  22079. inputType: function inputType() {
  22080. var isDatePickerType = this.isDatePickerType,
  22081. isNumType = this.isNumType,
  22082. isPawdType = this.isPawdType,
  22083. type = this.type,
  22084. showPwd = this.showPwd;
  22085. if (isDatePickerType || isNumType || isPawdType && showPwd || type === 'number') {
  22086. return 'text';
  22087. }
  22088. return type;
  22089. },
  22090. inpMaxlength: function inpMaxlength() {
  22091. var isNumType = this.isNumType,
  22092. maxlength = this.maxlength; // 数值最大长度限制 16 位,包含小数
  22093. return isNumType && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(maxlength) ? 16 : maxlength;
  22094. },
  22095. inpReadonly: function inpReadonly() {
  22096. var type = this.type,
  22097. readonly = this.readonly,
  22098. editable = this.editable,
  22099. multiple = this.multiple;
  22100. return readonly || multiple || !editable || type === 'week' || type === 'quarter';
  22101. },
  22102. numValue: function numValue() {
  22103. var type = this.type,
  22104. isNumType = this.isNumType,
  22105. inputValue = this.inputValue;
  22106. if (isNumType) {
  22107. return type === 'integer' ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toInteger(handleNumber(inputValue)) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(handleNumber(inputValue));
  22108. }
  22109. return 0;
  22110. },
  22111. isDisabledSubtractNumber: function isDisabledSubtractNumber() {
  22112. var min = this.min,
  22113. isNumType = this.isNumType,
  22114. inputValue = this.inputValue,
  22115. numValue = this.numValue; // 当有值时再进行判断
  22116. if ((inputValue || inputValue === 0) && isNumType && min !== null) {
  22117. return numValue <= external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(min);
  22118. }
  22119. return false;
  22120. },
  22121. isDisabledAddNumber: function isDisabledAddNumber() {
  22122. var max = this.max,
  22123. isNumType = this.isNumType,
  22124. inputValue = this.inputValue,
  22125. numValue = this.numValue; // 当有值时再进行判断
  22126. if ((inputValue || inputValue === 0) && isNumType && max !== null) {
  22127. return numValue >= external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(max);
  22128. }
  22129. return false;
  22130. }
  22131. },
  22132. watch: {
  22133. value: function value(val) {
  22134. this.inputValue = val;
  22135. this.changeValue();
  22136. },
  22137. type: function type() {
  22138. // 切换类型是重置内置变量
  22139. Object.assign(this, {
  22140. inputValue: this.value,
  22141. datetimePanelValue: null,
  22142. datePanelValue: null,
  22143. datePanelLabel: '',
  22144. datePanelType: 'day',
  22145. selectMonth: null,
  22146. currentDate: null
  22147. });
  22148. this.initValue();
  22149. },
  22150. dateLabelFormat: function dateLabelFormat() {
  22151. if (this.isDatePickerType) {
  22152. this.dateParseValue(this.datePanelValue);
  22153. this.inputValue = this.multiple ? this.dateMultipleLabel : this.datePanelLabel;
  22154. }
  22155. }
  22156. },
  22157. created: function created() {
  22158. this.initValue();
  22159. GlobalEvent.on(this, 'mousewheel', this.handleGlobalMousewheelEvent);
  22160. GlobalEvent.on(this, 'mousedown', this.handleGlobalMousedownEvent);
  22161. GlobalEvent.on(this, 'keydown', this.handleGlobalKeydownEvent);
  22162. GlobalEvent.on(this, 'blur', this.handleGlobalBlurEvent);
  22163. },
  22164. mounted: function mounted() {
  22165. if (this.dateConfig) {
  22166. warnLog('vxe.error.removeProp', ['date-config']);
  22167. }
  22168. if (this.isDatePickerType) {
  22169. if (this.transfer) {
  22170. document.body.appendChild(this.$refs.panel);
  22171. }
  22172. }
  22173. },
  22174. beforeDestroy: function beforeDestroy() {
  22175. var panelElem = this.$refs.panel;
  22176. if (panelElem && panelElem.parentNode) {
  22177. panelElem.parentNode.removeChild(panelElem);
  22178. }
  22179. },
  22180. destroyed: function destroyed() {
  22181. this.numberStopDown();
  22182. GlobalEvent.off(this, 'mousewheel');
  22183. GlobalEvent.off(this, 'mousedown');
  22184. GlobalEvent.off(this, 'keydown');
  22185. GlobalEvent.off(this, 'blur');
  22186. },
  22187. render: function render(h) {
  22188. var _ref2;
  22189. var name = this.name,
  22190. form = this.form,
  22191. inputType = this.inputType,
  22192. inpPlaceholder = this.inpPlaceholder,
  22193. inpMaxlength = this.inpMaxlength,
  22194. inpReadonly = this.inpReadonly,
  22195. className = this.className,
  22196. controls = this.controls,
  22197. inputValue = this.inputValue,
  22198. isDatePickerType = this.isDatePickerType,
  22199. visiblePanel = this.visiblePanel,
  22200. isActivated = this.isActivated,
  22201. vSize = this.vSize,
  22202. type = this.type,
  22203. align = this.align,
  22204. readonly = this.readonly,
  22205. disabled = this.disabled,
  22206. autocomplete = this.autocomplete;
  22207. var childs = [];
  22208. var prefix = rendePrefixIcon(h, this);
  22209. var suffix = renderSuffixIcon(h, this); // 前缀图标
  22210. if (prefix) {
  22211. childs.push(prefix);
  22212. } // 输入框
  22213. childs.push(h('input', {
  22214. ref: 'input',
  22215. class: 'vxe-input--inner',
  22216. domProps: {
  22217. value: inputValue
  22218. },
  22219. attrs: {
  22220. name: name,
  22221. form: form,
  22222. type: inputType,
  22223. placeholder: inpPlaceholder,
  22224. maxlength: inpMaxlength,
  22225. readonly: inpReadonly,
  22226. disabled: disabled,
  22227. autocomplete: autocomplete
  22228. },
  22229. on: {
  22230. keydown: this.keydownEvent,
  22231. keyup: this.triggerEvent,
  22232. wheel: this.wheelEvent,
  22233. click: this.clickEvent,
  22234. input: this.inputEvent,
  22235. change: this.changeEvent,
  22236. focus: this.focusEvent,
  22237. blur: this.blurEvent
  22238. }
  22239. })); // 后缀图标
  22240. if (suffix) {
  22241. childs.push(suffix);
  22242. } // 特殊功能图标
  22243. childs.push(renderExtraSuffixIcon(h, this)); // 面板容器
  22244. if (isDatePickerType) {
  22245. childs.push(renderPanel(h, this));
  22246. }
  22247. return h('div', {
  22248. class: ['vxe-input', "type--".concat(type), className, (_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)]
  22249. }, childs);
  22250. },
  22251. methods: {
  22252. focus: function focus() {
  22253. this.isActivated = true;
  22254. this.$refs.input.focus();
  22255. return this.$nextTick();
  22256. },
  22257. blur: function blur() {
  22258. this.$refs.input.blur();
  22259. this.isActivated = false;
  22260. return this.$nextTick();
  22261. },
  22262. triggerEvent: function triggerEvent(evnt) {
  22263. var $refs = this.$refs,
  22264. inputValue = this.inputValue;
  22265. this.$emit(evnt.type, {
  22266. $panel: $refs.panel,
  22267. value: inputValue,
  22268. $event: evnt
  22269. });
  22270. },
  22271. emitModel: function emitModel(value, evnt) {
  22272. this.inputValue = value;
  22273. this.$emit('modelValue', value);
  22274. this.$emit('input', {
  22275. value: value,
  22276. $event: evnt
  22277. });
  22278. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toValueString(this.value) !== value) {
  22279. this.$emit('change', {
  22280. value: value,
  22281. $event: evnt
  22282. }); // 自动更新校验状态
  22283. if (this.$xeform && this.$xeformiteminfo) {
  22284. this.$xeform.triggerItemEvent(evnt, this.$xeformiteminfo.itemConfig.field, value);
  22285. }
  22286. }
  22287. },
  22288. emitInputEvent: function emitInputEvent(value, evnt) {
  22289. var inpImmediate = this.inpImmediate,
  22290. isDatePickerType = this.isDatePickerType;
  22291. this.inputValue = value;
  22292. if (!isDatePickerType) {
  22293. if (inpImmediate) {
  22294. this.emitModel(value, evnt);
  22295. } else {
  22296. this.$emit('input', {
  22297. value: value,
  22298. $event: evnt
  22299. });
  22300. }
  22301. }
  22302. },
  22303. inputEvent: function inputEvent(evnt) {
  22304. var value = evnt.target.value;
  22305. this.emitInputEvent(value, evnt);
  22306. },
  22307. changeEvent: function changeEvent(evnt) {
  22308. var inpImmediate = this.inpImmediate;
  22309. if (!inpImmediate) {
  22310. this.triggerEvent(evnt);
  22311. }
  22312. },
  22313. focusEvent: function focusEvent(evnt) {
  22314. this.isActivated = true;
  22315. this.triggerEvent(evnt);
  22316. },
  22317. blurEvent: function blurEvent(evnt) {
  22318. var inputValue = this.inputValue,
  22319. inpImmediate = this.inpImmediate;
  22320. var value = inputValue;
  22321. if (!inpImmediate) {
  22322. this.emitModel(value, evnt);
  22323. }
  22324. this.afterCheckValue();
  22325. if (!this.visiblePanel) {
  22326. this.isActivated = false;
  22327. }
  22328. this.$emit('blur', {
  22329. value: value,
  22330. $event: evnt
  22331. });
  22332. },
  22333. keydownEvent: function keydownEvent(evnt) {
  22334. var exponential = this.exponential,
  22335. controls = this.controls,
  22336. isNumType = this.isNumType;
  22337. if (isNumType) {
  22338. var isCtrlKey = evnt.ctrlKey;
  22339. var isShiftKey = evnt.shiftKey;
  22340. var isAltKey = evnt.altKey;
  22341. var keyCode = evnt.keyCode;
  22342. if (!isCtrlKey && !isShiftKey && !isAltKey && (keyCode === 32 || (!exponential || keyCode !== 69) && keyCode >= 65 && keyCode <= 90 || keyCode >= 186 && keyCode <= 188 || keyCode >= 191)) {
  22343. evnt.preventDefault();
  22344. }
  22345. if (controls) {
  22346. this.numberKeydownEvent(evnt);
  22347. }
  22348. }
  22349. this.triggerEvent(evnt);
  22350. },
  22351. wheelEvent: function wheelEvent(evnt) {
  22352. if (this.isNumType && this.controls) {
  22353. if (this.isActivated) {
  22354. var delta = evnt.deltaY;
  22355. if (delta > 0) {
  22356. this.numberNextEvent(evnt);
  22357. } else if (delta < 0) {
  22358. this.numberPrevEvent(evnt);
  22359. }
  22360. evnt.preventDefault();
  22361. }
  22362. }
  22363. this.triggerEvent(evnt);
  22364. },
  22365. clickEvent: function clickEvent(evnt) {
  22366. var isDatePickerType = this.isDatePickerType;
  22367. if (isDatePickerType) {
  22368. this.datePickerOpenEvent(evnt);
  22369. }
  22370. this.triggerEvent(evnt);
  22371. },
  22372. clickPrefixEvent: function clickPrefixEvent(evnt) {
  22373. var $refs = this.$refs,
  22374. disabled = this.disabled,
  22375. inputValue = this.inputValue;
  22376. if (!disabled) {
  22377. this.$emit('prefix-click', {
  22378. $panel: $refs.panel,
  22379. value: inputValue,
  22380. $event: evnt
  22381. });
  22382. }
  22383. },
  22384. clickSuffixEvent: function clickSuffixEvent(evnt) {
  22385. var $refs = this.$refs,
  22386. disabled = this.disabled,
  22387. inputValue = this.inputValue;
  22388. if (!disabled) {
  22389. if (dom.hasClass(evnt.currentTarget, 'is--clear')) {
  22390. this.emitModel('', evnt);
  22391. this.clearValueEvent(evnt, '');
  22392. } else {
  22393. this.$emit('suffix-click', {
  22394. $panel: $refs.panel,
  22395. value: inputValue,
  22396. $event: evnt
  22397. });
  22398. }
  22399. }
  22400. },
  22401. clearValueEvent: function clearValueEvent(evnt, value) {
  22402. var $refs = this.$refs,
  22403. type = this.type,
  22404. isNumType = this.isNumType;
  22405. if (this.isDatePickerType) {
  22406. this.hidePanel();
  22407. }
  22408. if (isNumType || ['text', 'search', 'password'].indexOf(type) > -1) {
  22409. this.focus();
  22410. }
  22411. this.$emit('clear', {
  22412. $panel: $refs.panel,
  22413. value: value,
  22414. $event: evnt
  22415. });
  22416. },
  22417. parseDate: function parseDate(value, format) {
  22418. var type = this.type;
  22419. if (type === 'time') {
  22420. return toStringTimeDate(value);
  22421. }
  22422. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toStringDate(value, format);
  22423. },
  22424. /**
  22425. * 检查初始值
  22426. */
  22427. initValue: function initValue() {
  22428. var type = this.type,
  22429. isDatePickerType = this.isDatePickerType,
  22430. inputValue = this.inputValue,
  22431. digitsValue = this.digitsValue;
  22432. if (isDatePickerType) {
  22433. this.changeValue();
  22434. } else if (type === 'float') {
  22435. if (inputValue) {
  22436. var validValue = toFloatValueFixed(inputValue, digitsValue);
  22437. if (inputValue !== validValue) {
  22438. this.emitModel(validValue, {
  22439. type: 'init'
  22440. });
  22441. }
  22442. }
  22443. }
  22444. },
  22445. /**
  22446. * 值变化时处理
  22447. */
  22448. changeValue: function changeValue() {
  22449. if (this.isDatePickerType) {
  22450. this.dateParseValue(this.inputValue);
  22451. this.inputValue = this.multiple ? this.dateMultipleLabel : this.datePanelLabel;
  22452. }
  22453. },
  22454. afterCheckValue: function afterCheckValue() {
  22455. var type = this.type,
  22456. exponential = this.exponential,
  22457. inpReadonly = this.inpReadonly,
  22458. inputValue = this.inputValue,
  22459. isDatePickerType = this.isDatePickerType,
  22460. isNumType = this.isNumType,
  22461. datetimePanelValue = this.datetimePanelValue,
  22462. dateLabelFormat = this.dateLabelFormat,
  22463. min = this.min,
  22464. max = this.max,
  22465. firstDayOfWeek = this.firstDayOfWeek;
  22466. if (!inpReadonly) {
  22467. if (isNumType) {
  22468. if (inputValue) {
  22469. var inpNumVal = type === 'integer' ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toInteger(handleNumber(inputValue)) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(handleNumber(inputValue));
  22470. if (!this.vaildMinNum(inpNumVal)) {
  22471. inpNumVal = min;
  22472. } else if (!this.vaildMaxNum(inpNumVal)) {
  22473. inpNumVal = max;
  22474. }
  22475. if (exponential) {
  22476. var inpStringVal = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toValueString(inputValue).toLowerCase();
  22477. if (inpStringVal === external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(inpNumVal).toExponential()) {
  22478. inpNumVal = inpStringVal;
  22479. }
  22480. }
  22481. this.emitModel(getNumberValue(this, inpNumVal), {
  22482. type: 'check'
  22483. });
  22484. }
  22485. } else if (isDatePickerType) {
  22486. if (inputValue) {
  22487. if (type === 'week' || type === 'quarter') {// 周和季度选择器不支持解析,无需处理
  22488. } else {
  22489. var inpDateVal = this.parseDate(inputValue, dateLabelFormat);
  22490. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isValidDate(inpDateVal)) {
  22491. if (type === 'time') {
  22492. inpDateVal = toStringTimeDate(inpDateVal);
  22493. if (inputValue !== inpDateVal) {
  22494. this.emitModel(inpDateVal, {
  22495. type: 'check'
  22496. });
  22497. }
  22498. this.inputValue = inpDateVal;
  22499. } else {
  22500. var isChange = false;
  22501. if (type === 'datetime') {
  22502. if (inputValue !== external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toDateString(this.dateValue, dateLabelFormat) || inputValue !== external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toDateString(inpDateVal, dateLabelFormat)) {
  22503. isChange = true;
  22504. datetimePanelValue.setHours(inpDateVal.getHours());
  22505. datetimePanelValue.setMinutes(inpDateVal.getMinutes());
  22506. datetimePanelValue.setSeconds(inpDateVal.getSeconds());
  22507. }
  22508. } else {
  22509. isChange = true;
  22510. }
  22511. this.inputValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toDateString(inpDateVal, dateLabelFormat, {
  22512. firstDay: firstDayOfWeek
  22513. });
  22514. if (isChange) {
  22515. this.dateChange(inpDateVal);
  22516. }
  22517. }
  22518. } else {
  22519. this.dateRevert();
  22520. }
  22521. }
  22522. } else {
  22523. this.emitModel('', {
  22524. type: 'check'
  22525. });
  22526. }
  22527. }
  22528. }
  22529. },
  22530. // 密码
  22531. passwordToggleEvent: function passwordToggleEvent(evnt) {
  22532. var disabled = this.disabled,
  22533. readonly = this.readonly,
  22534. showPwd = this.showPwd;
  22535. if (!disabled && !readonly) {
  22536. this.showPwd = !showPwd;
  22537. }
  22538. this.$emit('toggle-visible', {
  22539. visible: this.showPwd,
  22540. $event: evnt
  22541. });
  22542. },
  22543. // 密码
  22544. // 搜索
  22545. searchEvent: function searchEvent(evnt) {
  22546. this.$emit('search-click', {
  22547. $event: evnt
  22548. });
  22549. },
  22550. // 搜索
  22551. // 数值
  22552. vaildMinNum: function vaildMinNum(num) {
  22553. return this.min === null || num >= external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(this.min);
  22554. },
  22555. vaildMaxNum: function vaildMaxNum(num) {
  22556. return this.max === null || num <= external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(this.max);
  22557. },
  22558. numberStopDown: function numberStopDown() {
  22559. clearTimeout(this.downbumTimeout);
  22560. },
  22561. numberDownPrevEvent: function numberDownPrevEvent(evnt) {
  22562. var _this2 = this;
  22563. this.downbumTimeout = setTimeout(function () {
  22564. _this2.numberPrevEvent(evnt);
  22565. _this2.numberDownPrevEvent(evnt);
  22566. }, 60);
  22567. },
  22568. numberDownNextEvent: function numberDownNextEvent(evnt) {
  22569. var _this3 = this;
  22570. this.downbumTimeout = setTimeout(function () {
  22571. _this3.numberNextEvent(evnt);
  22572. _this3.numberDownNextEvent(evnt);
  22573. }, 60);
  22574. },
  22575. numberKeydownEvent: function numberKeydownEvent(evnt) {
  22576. var keyCode = evnt.keyCode;
  22577. var isUpArrow = keyCode === 38;
  22578. var isDwArrow = keyCode === 40;
  22579. if (isUpArrow || isDwArrow) {
  22580. evnt.preventDefault();
  22581. if (isUpArrow) {
  22582. this.numberPrevEvent(evnt);
  22583. } else {
  22584. this.numberNextEvent(evnt);
  22585. }
  22586. }
  22587. },
  22588. numberMousedownEvent: function numberMousedownEvent(evnt) {
  22589. var _this4 = this;
  22590. this.numberStopDown();
  22591. if (evnt.button === 0) {
  22592. var isPrevNumber = dom.hasClass(evnt.currentTarget, 'is--prev');
  22593. if (isPrevNumber) {
  22594. this.numberPrevEvent(evnt);
  22595. } else {
  22596. this.numberNextEvent(evnt);
  22597. }
  22598. this.downbumTimeout = setTimeout(function () {
  22599. if (isPrevNumber) {
  22600. _this4.numberDownPrevEvent(evnt);
  22601. } else {
  22602. _this4.numberDownNextEvent(evnt);
  22603. }
  22604. }, 500);
  22605. }
  22606. },
  22607. numberPrevEvent: function numberPrevEvent(evnt) {
  22608. var disabled = this.disabled,
  22609. readonly = this.readonly,
  22610. isDisabledAddNumber = this.isDisabledAddNumber;
  22611. clearTimeout(this.downbumTimeout);
  22612. if (!disabled && !readonly && !isDisabledAddNumber) {
  22613. this.numberChange(true, evnt);
  22614. }
  22615. this.$emit('prev-number', {
  22616. $event: evnt
  22617. });
  22618. },
  22619. numberNextEvent: function numberNextEvent(evnt) {
  22620. var disabled = this.disabled,
  22621. readonly = this.readonly,
  22622. isDisabledSubtractNumber = this.isDisabledSubtractNumber;
  22623. clearTimeout(this.downbumTimeout);
  22624. if (!disabled && !readonly && !isDisabledSubtractNumber) {
  22625. this.numberChange(false, evnt);
  22626. }
  22627. this.$emit('next-number', {
  22628. $event: evnt
  22629. });
  22630. },
  22631. numberChange: function numberChange(isPlus, evnt) {
  22632. var min = this.min,
  22633. max = this.max,
  22634. type = this.type,
  22635. inputValue = this.inputValue,
  22636. stepValue = this.stepValue;
  22637. var numValue = type === 'integer' ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toInteger(handleNumber(inputValue)) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(handleNumber(inputValue));
  22638. 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);
  22639. var restNum;
  22640. if (!this.vaildMinNum(newValue)) {
  22641. restNum = min;
  22642. } else if (!this.vaildMaxNum(newValue)) {
  22643. restNum = max;
  22644. } else {
  22645. restNum = newValue;
  22646. }
  22647. this.emitInputEvent(getNumberValue(this, restNum), evnt);
  22648. },
  22649. // 数值
  22650. // 日期
  22651. datePickerOpenEvent: function datePickerOpenEvent(evnt) {
  22652. var readonly = this.readonly;
  22653. if (!readonly) {
  22654. evnt.preventDefault();
  22655. this.showPanel();
  22656. }
  22657. },
  22658. dateMonthHandle: function dateMonthHandle(date, offsetMonth) {
  22659. this.selectMonth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatMonth(date, offsetMonth, 'first');
  22660. },
  22661. dateNowHandle: function dateNowHandle() {
  22662. var currentDate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatDay(Date.now(), 0, 'first');
  22663. this.currentDate = currentDate;
  22664. this.dateMonthHandle(currentDate, 0);
  22665. },
  22666. dateToggleTypeEvent: function dateToggleTypeEvent() {
  22667. var datePanelType = this.datePanelType;
  22668. if (datePanelType === 'month' || datePanelType === 'quarter') {
  22669. datePanelType = 'year';
  22670. } else {
  22671. datePanelType = 'month';
  22672. }
  22673. this.datePanelType = datePanelType;
  22674. },
  22675. datePrevEvent: function datePrevEvent(evnt) {
  22676. var isDisabledPrevDateBtn = this.isDisabledPrevDateBtn,
  22677. type = this.type,
  22678. datePanelType = this.datePanelType;
  22679. if (!isDisabledPrevDateBtn) {
  22680. if (type === 'year') {
  22681. this.selectMonth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatYear(this.selectMonth, -yearSize, 'first');
  22682. } else if (type === 'month' || type === 'quarter') {
  22683. if (datePanelType === 'year') {
  22684. this.selectMonth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatYear(this.selectMonth, -yearSize, 'first');
  22685. } else {
  22686. this.selectMonth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatYear(this.selectMonth, -1, 'first');
  22687. }
  22688. } else {
  22689. if (datePanelType === 'year') {
  22690. this.selectMonth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatYear(this.selectMonth, -yearSize, 'first');
  22691. } else if (datePanelType === 'month') {
  22692. this.selectMonth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatYear(this.selectMonth, -1, 'first');
  22693. } else {
  22694. this.selectMonth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatMonth(this.selectMonth, -1, 'first');
  22695. }
  22696. }
  22697. this.$emit('date-prev', {
  22698. type: type,
  22699. $event: evnt
  22700. });
  22701. }
  22702. },
  22703. dateTodayMonthEvent: function dateTodayMonthEvent(evnt) {
  22704. this.dateNowHandle();
  22705. if (!this.multiple) {
  22706. this.dateChange(this.currentDate);
  22707. this.hidePanel();
  22708. }
  22709. this.$emit('date-today', {
  22710. type: this.type,
  22711. $event: evnt
  22712. });
  22713. },
  22714. dateNextEvent: function dateNextEvent(evnt) {
  22715. var isDisabledNextDateBtn = this.isDisabledNextDateBtn,
  22716. type = this.type,
  22717. datePanelType = this.datePanelType;
  22718. if (!isDisabledNextDateBtn) {
  22719. if (type === 'year') {
  22720. this.selectMonth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatYear(this.selectMonth, yearSize, 'first');
  22721. } else if (type === 'month' || type === 'quarter') {
  22722. if (datePanelType === 'year') {
  22723. this.selectMonth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatYear(this.selectMonth, yearSize, 'first');
  22724. } else {
  22725. this.selectMonth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatYear(this.selectMonth, 1, 'first');
  22726. }
  22727. } else {
  22728. if (datePanelType === 'year') {
  22729. this.selectMonth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatYear(this.selectMonth, yearSize, 'first');
  22730. } else if (datePanelType === 'month') {
  22731. this.selectMonth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatYear(this.selectMonth, 1, 'first');
  22732. } else {
  22733. this.selectMonth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatMonth(this.selectMonth, 1, 'first');
  22734. }
  22735. }
  22736. this.$emit('date-next', {
  22737. type: type,
  22738. $event: evnt
  22739. });
  22740. }
  22741. },
  22742. dateSelectEvent: function dateSelectEvent(item) {
  22743. if (!isDateDisabled(this, item)) {
  22744. this.dateSelectItem(item.date);
  22745. }
  22746. },
  22747. dateSelectItem: function dateSelectItem(date) {
  22748. var type = this.type,
  22749. datePanelType = this.datePanelType,
  22750. multiple = this.multiple;
  22751. var isWeekType = type === 'week';
  22752. if (type === 'month') {
  22753. if (datePanelType === 'year') {
  22754. this.datePanelType = 'month';
  22755. this.dateCheckMonth(date);
  22756. } else {
  22757. this.dateChange(date);
  22758. if (!multiple) {
  22759. this.hidePanel();
  22760. }
  22761. }
  22762. } else if (type === 'year') {
  22763. this.dateChange(date);
  22764. if (!multiple) {
  22765. this.hidePanel();
  22766. }
  22767. } else if (type === 'quarter') {
  22768. if (datePanelType === 'year') {
  22769. this.datePanelType = 'quarter';
  22770. this.dateCheckMonth(date);
  22771. } else {
  22772. this.dateChange(date);
  22773. if (!multiple) {
  22774. this.hidePanel();
  22775. }
  22776. }
  22777. } else {
  22778. if (datePanelType === 'month') {
  22779. this.datePanelType = type === 'week' ? type : 'day';
  22780. this.dateCheckMonth(date);
  22781. } else if (datePanelType === 'year') {
  22782. this.datePanelType = 'month';
  22783. this.dateCheckMonth(date);
  22784. } else {
  22785. this.dateChange(date);
  22786. if (!multiple) {
  22787. this.hidePanel();
  22788. }
  22789. }
  22790. }
  22791. if (isWeekType) {
  22792. this.changeValue();
  22793. }
  22794. },
  22795. dateMouseenterEvent: function dateMouseenterEvent(item) {
  22796. if (!isDateDisabled(this, item)) {
  22797. var datePanelType = this.datePanelType;
  22798. if (datePanelType === 'month') {
  22799. this.dateMoveMonth(item.date);
  22800. } else if (datePanelType === 'quarter') {
  22801. this.dateMoveQuarter(item.date);
  22802. } else if (datePanelType === 'year') {
  22803. this.dateMoveYear(item.date);
  22804. } else {
  22805. this.dateMoveDay(item.date);
  22806. }
  22807. }
  22808. },
  22809. dateHourEvent: function dateHourEvent(evnt, item) {
  22810. this.datetimePanelValue.setHours(item.value);
  22811. this.dateTimeChangeEvent(evnt);
  22812. },
  22813. dateConfirmEvent: function dateConfirmEvent() {
  22814. if (this.isDateTimeType || this.multiple) {
  22815. this.dateChange(this.dateValue || this.currentDate);
  22816. }
  22817. this.hidePanel();
  22818. },
  22819. dateMinuteEvent: function dateMinuteEvent(evnt, item) {
  22820. this.datetimePanelValue.setMinutes(item.value);
  22821. this.dateTimeChangeEvent(evnt);
  22822. },
  22823. dateSecondEvent: function dateSecondEvent(evnt, item) {
  22824. this.datetimePanelValue.setSeconds(item.value);
  22825. this.dateTimeChangeEvent(evnt);
  22826. },
  22827. dateTimeChangeEvent: function dateTimeChangeEvent(evnt) {
  22828. this.datetimePanelValue = new Date(this.datetimePanelValue.getTime());
  22829. this.updateTimePos(evnt.currentTarget);
  22830. },
  22831. updateTimePos: function updateTimePos(liElem) {
  22832. if (liElem) {
  22833. var height = liElem.offsetHeight;
  22834. liElem.parentNode.scrollTop = liElem.offsetTop - height * 4;
  22835. }
  22836. },
  22837. dateMoveDay: function dateMoveDay(offsetDay) {
  22838. if (!isDateDisabled(this, {
  22839. date: offsetDay
  22840. })) {
  22841. if (!this.dayList.some(function (item) {
  22842. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isDateSame(item.date, offsetDay, 'yyyyMMdd');
  22843. })) {
  22844. this.dateCheckMonth(offsetDay);
  22845. }
  22846. this.dateParseValue(offsetDay);
  22847. }
  22848. },
  22849. dateMoveMonth: function dateMoveMonth(offsetMonth) {
  22850. if (!isDateDisabled(this, {
  22851. date: offsetMonth
  22852. })) {
  22853. if (!this.monthList.some(function (item) {
  22854. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isDateSame(item.date, offsetMonth, 'yyyyMM');
  22855. })) {
  22856. this.dateCheckMonth(offsetMonth);
  22857. }
  22858. this.dateParseValue(offsetMonth);
  22859. }
  22860. },
  22861. dateMoveQuarter: function dateMoveQuarter(offsetQuarter) {
  22862. if (!isDateDisabled(this, {
  22863. date: offsetQuarter
  22864. })) {
  22865. if (!this.quarterList.some(function (item) {
  22866. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isDateSame(item.date, offsetQuarter, 'yyyyq');
  22867. })) {
  22868. this.dateCheckMonth(offsetQuarter);
  22869. }
  22870. this.dateParseValue(offsetQuarter);
  22871. }
  22872. },
  22873. dateMoveYear: function dateMoveYear(offsetYear) {
  22874. if (!isDateDisabled(this, {
  22875. date: offsetYear
  22876. })) {
  22877. if (!this.yearList.some(function (item) {
  22878. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isDateSame(item.date, offsetYear, 'yyyy');
  22879. })) {
  22880. this.dateCheckMonth(offsetYear);
  22881. }
  22882. this.dateParseValue(offsetYear);
  22883. }
  22884. },
  22885. dateParseValue: function dateParseValue(date) {
  22886. var type = this.type,
  22887. dateLabelFormat = this.dateLabelFormat,
  22888. valueFormat = this.valueFormat,
  22889. firstDayOfWeek = this.firstDayOfWeek;
  22890. var dValue = null;
  22891. var dLabel = '';
  22892. if (date) {
  22893. dValue = this.parseDate(date, valueFormat);
  22894. }
  22895. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isValidDate(dValue)) {
  22896. dLabel = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toDateString(dValue, dateLabelFormat, {
  22897. firstDay: firstDayOfWeek
  22898. }); // 由于年份和第几周是冲突的行为,所以需要特殊处理,判断是否跨年
  22899. if (dateLabelFormat && type === 'week') {
  22900. var firstWeekDate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatWeek(dValue, 0, firstDayOfWeek, firstDayOfWeek);
  22901. if (firstWeekDate.getFullYear() < dValue.getFullYear()) {
  22902. var yyIndex = dateLabelFormat.indexOf('yyyy');
  22903. if (yyIndex > -1) {
  22904. var yyNum = Number(dLabel.substring(yyIndex, yyIndex + 4));
  22905. if (yyNum && !isNaN(yyNum)) {
  22906. dLabel = dLabel.replace("".concat(yyNum), "".concat(yyNum - 1));
  22907. }
  22908. }
  22909. }
  22910. }
  22911. } else {
  22912. dValue = null;
  22913. }
  22914. this.datePanelValue = dValue;
  22915. this.datePanelLabel = dLabel;
  22916. },
  22917. dateOffsetEvent: function dateOffsetEvent(evnt) {
  22918. var isActivated = this.isActivated,
  22919. datePanelValue = this.datePanelValue,
  22920. datePanelType = this.datePanelType,
  22921. firstDayOfWeek = this.firstDayOfWeek;
  22922. if (isActivated) {
  22923. evnt.preventDefault();
  22924. var keyCode = evnt.keyCode;
  22925. var isLeftArrow = keyCode === 37;
  22926. var isUpArrow = keyCode === 38;
  22927. var isRightArrow = keyCode === 39;
  22928. var isDwArrow = keyCode === 40;
  22929. if (datePanelType === 'year') {
  22930. var offsetYear = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatYear(datePanelValue || Date.now(), 0, 'first');
  22931. if (isLeftArrow) {
  22932. offsetYear = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatYear(offsetYear, -1);
  22933. } else if (isUpArrow) {
  22934. offsetYear = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatYear(offsetYear, -4);
  22935. } else if (isRightArrow) {
  22936. offsetYear = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatYear(offsetYear, 1);
  22937. } else if (isDwArrow) {
  22938. offsetYear = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatYear(offsetYear, 4);
  22939. }
  22940. this.dateMoveYear(offsetYear);
  22941. } else if (datePanelType === 'quarter') {
  22942. var offsetQuarter = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatQuarter(datePanelValue || Date.now(), 0, 'first');
  22943. if (isLeftArrow) {
  22944. offsetQuarter = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatQuarter(offsetQuarter, -1);
  22945. } else if (isUpArrow) {
  22946. offsetQuarter = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatQuarter(offsetQuarter, -2);
  22947. } else if (isRightArrow) {
  22948. offsetQuarter = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatQuarter(offsetQuarter, 1);
  22949. } else if (isDwArrow) {
  22950. offsetQuarter = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatQuarter(offsetQuarter, 2);
  22951. }
  22952. this.dateMoveQuarter(offsetQuarter);
  22953. } else if (datePanelType === 'month') {
  22954. var offsetMonth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatMonth(datePanelValue || Date.now(), 0, 'first');
  22955. if (isLeftArrow) {
  22956. offsetMonth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatMonth(offsetMonth, -1);
  22957. } else if (isUpArrow) {
  22958. offsetMonth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatMonth(offsetMonth, -4);
  22959. } else if (isRightArrow) {
  22960. offsetMonth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatMonth(offsetMonth, 1);
  22961. } else if (isDwArrow) {
  22962. offsetMonth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatMonth(offsetMonth, 4);
  22963. }
  22964. this.dateMoveMonth(offsetMonth);
  22965. } else {
  22966. var offsetDay = datePanelValue || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatDay(Date.now(), 0, 'first');
  22967. if (isLeftArrow) {
  22968. offsetDay = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatDay(offsetDay, -1);
  22969. } else if (isUpArrow) {
  22970. offsetDay = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatWeek(offsetDay, -1, firstDayOfWeek);
  22971. } else if (isRightArrow) {
  22972. offsetDay = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatDay(offsetDay, 1);
  22973. } else if (isDwArrow) {
  22974. offsetDay = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatWeek(offsetDay, 1, firstDayOfWeek);
  22975. }
  22976. this.dateMoveDay(offsetDay);
  22977. }
  22978. }
  22979. },
  22980. datePgOffsetEvent: function datePgOffsetEvent(evnt) {
  22981. var isActivated = this.isActivated;
  22982. if (isActivated) {
  22983. var isPgUp = evnt.keyCode === 33;
  22984. evnt.preventDefault();
  22985. if (isPgUp) {
  22986. this.datePrevEvent(evnt);
  22987. } else {
  22988. this.dateNextEvent(evnt);
  22989. }
  22990. }
  22991. },
  22992. dateChange: function dateChange(date) {
  22993. var value = this.value,
  22994. datetimePanelValue = this.datetimePanelValue,
  22995. dateValueFormat = this.dateValueFormat,
  22996. firstDayOfWeek = this.firstDayOfWeek,
  22997. isDateTimeType = this.isDateTimeType,
  22998. multiple = this.multiple;
  22999. if (this.type === 'week') {
  23000. var sWeek = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(this.selectDay);
  23001. date = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatWeek(date, 0, sWeek, firstDayOfWeek);
  23002. } else if (isDateTimeType) {
  23003. date.setHours(datetimePanelValue.getHours());
  23004. date.setMinutes(datetimePanelValue.getMinutes());
  23005. date.setSeconds(datetimePanelValue.getSeconds());
  23006. }
  23007. var inpVal = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toDateString(date, dateValueFormat, {
  23008. firstDay: firstDayOfWeek
  23009. });
  23010. this.dateCheckMonth(date);
  23011. if (multiple) {
  23012. // 如果为多选
  23013. var dateMultipleValue = this.dateMultipleValue;
  23014. if (isDateTimeType) {
  23015. // 如果是datetime特殊类型
  23016. var dateListValue = this.dateListValue;
  23017. var datetimeRest = [];
  23018. dateListValue.forEach(function (item) {
  23019. if (item && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isDateSame(date, item, 'yyyyMMdd')) {
  23020. item.setHours(datetimePanelValue.getHours());
  23021. item.setMinutes(datetimePanelValue.getMinutes());
  23022. item.setSeconds(datetimePanelValue.getSeconds());
  23023. datetimeRest.push(item);
  23024. }
  23025. });
  23026. datetimeRest.push(date);
  23027. this.emitModel(datetimeRest.map(function (date) {
  23028. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toDateString(date, dateValueFormat);
  23029. }).join(','), {
  23030. type: 'update'
  23031. });
  23032. } else {
  23033. // 如果是日期类型
  23034. if (dateMultipleValue.some(function (val) {
  23035. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isEqual(val, inpVal);
  23036. })) {
  23037. this.emitModel(dateMultipleValue.filter(function (val) {
  23038. return !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isEqual(val, inpVal);
  23039. }).join(','), {
  23040. type: 'update'
  23041. });
  23042. } else {
  23043. this.emitModel(dateMultipleValue.concat([inpVal]).join(','), {
  23044. type: 'update'
  23045. });
  23046. }
  23047. }
  23048. } else {
  23049. // 如果为单选
  23050. if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isEqual(value, inpVal)) {
  23051. this.emitModel(inpVal, {
  23052. type: 'update'
  23053. });
  23054. }
  23055. }
  23056. },
  23057. dateCheckMonth: function dateCheckMonth(date) {
  23058. var month = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatMonth(date, 0, 'first');
  23059. if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isEqual(month, this.selectMonth)) {
  23060. this.selectMonth = month;
  23061. }
  23062. },
  23063. dateOpenPanel: function dateOpenPanel() {
  23064. var _this5 = this;
  23065. var type = this.type,
  23066. dateValue = this.dateValue;
  23067. if (['year', 'quarter', 'month', 'week'].indexOf(type) > -1) {
  23068. this.datePanelType = type;
  23069. } else {
  23070. this.datePanelType = 'day';
  23071. }
  23072. this.currentDate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatDay(Date.now(), 0, 'first');
  23073. if (dateValue) {
  23074. this.dateMonthHandle(dateValue, 0);
  23075. this.dateParseValue(dateValue);
  23076. } else {
  23077. this.dateNowHandle();
  23078. }
  23079. if (this.isDateTimeType) {
  23080. this.datetimePanelValue = this.datePanelValue || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatDay(Date.now(), 0, 'first');
  23081. this.$nextTick(function () {
  23082. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.arrayEach(_this5.$refs.timeBody.querySelectorAll('li.is--selected'), _this5.updateTimePos);
  23083. });
  23084. }
  23085. },
  23086. dateRevert: function dateRevert() {
  23087. this.inputValue = this.multiple ? this.dateMultipleLabel : this.datePanelLabel;
  23088. },
  23089. // 日期
  23090. // 弹出面板
  23091. updateZindex: function updateZindex() {
  23092. if (this.panelIndex < utils.getLastZIndex()) {
  23093. this.panelIndex = utils.nextZIndex();
  23094. }
  23095. },
  23096. showPanel: function showPanel() {
  23097. var _this6 = this;
  23098. var disabled = this.disabled,
  23099. visiblePanel = this.visiblePanel,
  23100. isDatePickerType = this.isDatePickerType;
  23101. if (!disabled && !visiblePanel) {
  23102. clearTimeout(this.hidePanelTimeout);
  23103. this.isActivated = true;
  23104. this.animatVisible = true;
  23105. if (isDatePickerType) {
  23106. this.dateOpenPanel();
  23107. }
  23108. setTimeout(function () {
  23109. _this6.visiblePanel = true;
  23110. }, 10);
  23111. this.updateZindex();
  23112. return this.updatePlacement();
  23113. }
  23114. return this.$nextTick();
  23115. },
  23116. hidePanel: function hidePanel() {
  23117. var _this7 = this;
  23118. return new Promise(function (resolve) {
  23119. _this7.visiblePanel = false;
  23120. _this7.hidePanelTimeout = setTimeout(function () {
  23121. _this7.animatVisible = false;
  23122. resolve();
  23123. }, 350);
  23124. });
  23125. },
  23126. updatePlacement: function updatePlacement() {
  23127. var _this8 = this;
  23128. return this.$nextTick().then(function () {
  23129. var $refs = _this8.$refs,
  23130. transfer = _this8.transfer,
  23131. placement = _this8.placement,
  23132. panelIndex = _this8.panelIndex;
  23133. var targetElem = $refs.input;
  23134. var panelElem = $refs.panel;
  23135. if (targetElem && panelElem) {
  23136. var targetHeight = targetElem.offsetHeight;
  23137. var targetWidth = targetElem.offsetWidth;
  23138. var panelHeight = panelElem.offsetHeight;
  23139. var panelWidth = panelElem.offsetWidth;
  23140. var marginSize = 5;
  23141. var panelStyle = {
  23142. zIndex: panelIndex
  23143. };
  23144. var _DomTools$getAbsolute = dom.getAbsolutePos(targetElem),
  23145. boundingTop = _DomTools$getAbsolute.boundingTop,
  23146. boundingLeft = _DomTools$getAbsolute.boundingLeft,
  23147. visibleHeight = _DomTools$getAbsolute.visibleHeight,
  23148. visibleWidth = _DomTools$getAbsolute.visibleWidth;
  23149. var panelPlacement = 'bottom';
  23150. if (transfer) {
  23151. var left = boundingLeft;
  23152. var top = boundingTop + targetHeight;
  23153. if (placement === 'top') {
  23154. panelPlacement = 'top';
  23155. top = boundingTop - panelHeight;
  23156. } else if (!placement) {
  23157. // 如果下面不够放,则向上
  23158. if (top + panelHeight + marginSize > visibleHeight) {
  23159. panelPlacement = 'top';
  23160. top = boundingTop - panelHeight;
  23161. } // 如果上面不够放,则向下(优先)
  23162. if (top < marginSize) {
  23163. panelPlacement = 'bottom';
  23164. top = boundingTop + targetHeight;
  23165. }
  23166. } // 如果溢出右边
  23167. if (left + panelWidth + marginSize > visibleWidth) {
  23168. left -= left + panelWidth + marginSize - visibleWidth;
  23169. } // 如果溢出左边
  23170. if (left < marginSize) {
  23171. left = marginSize;
  23172. }
  23173. Object.assign(panelStyle, {
  23174. left: "".concat(left, "px"),
  23175. top: "".concat(top, "px"),
  23176. minWidth: "".concat(targetWidth, "px")
  23177. });
  23178. } else {
  23179. if (placement === 'top') {
  23180. panelPlacement = 'top';
  23181. panelStyle.bottom = "".concat(targetHeight, "px");
  23182. } else if (!placement) {
  23183. // 如果下面不够放,则向上
  23184. if (boundingTop + targetHeight + panelHeight > visibleHeight) {
  23185. // 如果上面不够放,则向下(优先)
  23186. if (boundingTop - targetHeight - panelHeight > marginSize) {
  23187. panelPlacement = 'top';
  23188. panelStyle.bottom = "".concat(targetHeight, "px");
  23189. }
  23190. }
  23191. }
  23192. }
  23193. _this8.panelStyle = panelStyle;
  23194. _this8.panelPlacement = panelPlacement;
  23195. return _this8.$nextTick();
  23196. }
  23197. });
  23198. },
  23199. // 弹出面板
  23200. // 全局事件
  23201. handleGlobalMousedownEvent: function handleGlobalMousedownEvent(evnt) {
  23202. var $refs = this.$refs,
  23203. $el = this.$el,
  23204. disabled = this.disabled,
  23205. visiblePanel = this.visiblePanel,
  23206. isActivated = this.isActivated;
  23207. if (!disabled && isActivated) {
  23208. this.isActivated = dom.getEventTargetNode(evnt, $el).flag || dom.getEventTargetNode(evnt, $refs.panel).flag;
  23209. if (!this.isActivated) {
  23210. // 如果是日期类型
  23211. if (this.isDatePickerType) {
  23212. if (visiblePanel) {
  23213. this.hidePanel();
  23214. this.afterCheckValue();
  23215. }
  23216. } else {
  23217. this.afterCheckValue();
  23218. }
  23219. }
  23220. }
  23221. },
  23222. handleGlobalKeydownEvent: function handleGlobalKeydownEvent(evnt) {
  23223. var isDatePickerType = this.isDatePickerType,
  23224. visiblePanel = this.visiblePanel,
  23225. clearable = this.clearable,
  23226. disabled = this.disabled;
  23227. if (!disabled) {
  23228. var keyCode = evnt.keyCode;
  23229. var isTab = keyCode === 9;
  23230. var isDel = keyCode === 46;
  23231. var isEsc = keyCode === 27;
  23232. var isEnter = keyCode === 13;
  23233. var isLeftArrow = keyCode === 37;
  23234. var isUpArrow = keyCode === 38;
  23235. var isRightArrow = keyCode === 39;
  23236. var isDwArrow = keyCode === 40;
  23237. var isPgUp = keyCode === 33;
  23238. var isPgDn = keyCode === 34;
  23239. var operArrow = isLeftArrow || isUpArrow || isRightArrow || isDwArrow;
  23240. var isActivated = this.isActivated;
  23241. if (isTab) {
  23242. if (isActivated) {
  23243. this.afterCheckValue();
  23244. }
  23245. isActivated = false;
  23246. this.isActivated = isActivated;
  23247. } else if (operArrow) {
  23248. if (isDatePickerType) {
  23249. if (isActivated) {
  23250. if (visiblePanel) {
  23251. this.dateOffsetEvent(evnt);
  23252. } else if (isUpArrow || isDwArrow) {
  23253. this.datePickerOpenEvent(evnt);
  23254. }
  23255. }
  23256. }
  23257. } else if (isEnter) {
  23258. if (isDatePickerType) {
  23259. if (visiblePanel) {
  23260. if (this.datePanelValue) {
  23261. this.dateSelectItem(this.datePanelValue);
  23262. } else {
  23263. this.hidePanel();
  23264. }
  23265. } else if (isActivated) {
  23266. this.datePickerOpenEvent(evnt);
  23267. }
  23268. }
  23269. } else if (isPgUp || isPgDn) {
  23270. if (isDatePickerType) {
  23271. if (isActivated) {
  23272. this.datePgOffsetEvent(evnt);
  23273. }
  23274. }
  23275. }
  23276. if (isTab || isEsc) {
  23277. if (visiblePanel) {
  23278. this.hidePanel();
  23279. }
  23280. } else if (isDel && clearable) {
  23281. if (isActivated) {
  23282. this.clearValueEvent(evnt, null);
  23283. }
  23284. }
  23285. }
  23286. },
  23287. handleGlobalMousewheelEvent: function handleGlobalMousewheelEvent(evnt) {
  23288. var $refs = this.$refs,
  23289. disabled = this.disabled,
  23290. visiblePanel = this.visiblePanel;
  23291. if (!disabled) {
  23292. if (visiblePanel) {
  23293. if (dom.getEventTargetNode(evnt, $refs.panel).flag) {
  23294. this.updatePlacement();
  23295. } else {
  23296. this.hidePanel();
  23297. this.afterCheckValue();
  23298. }
  23299. }
  23300. }
  23301. },
  23302. handleGlobalBlurEvent: function handleGlobalBlurEvent() {
  23303. var isActivated = this.isActivated,
  23304. visiblePanel = this.visiblePanel;
  23305. if (visiblePanel) {
  23306. this.hidePanel();
  23307. this.afterCheckValue();
  23308. } else if (isActivated) {
  23309. this.afterCheckValue();
  23310. }
  23311. } // 全局事件
  23312. }
  23313. });
  23314. // CONCATENATED MODULE: ./packages/checkbox/src/checkbox.js
  23315. /* harmony default export */ var src_checkbox = ({
  23316. name: 'VxeCheckbox',
  23317. mixins: [size],
  23318. props: {
  23319. value: [String, Number, Boolean],
  23320. label: [String, Number],
  23321. indeterminate: Boolean,
  23322. title: [String, Number],
  23323. content: [String, Number],
  23324. checkedValue: {
  23325. type: [String, Number, Boolean],
  23326. default: true
  23327. },
  23328. uncheckedValue: {
  23329. type: [String, Number, Boolean],
  23330. default: false
  23331. },
  23332. disabled: Boolean,
  23333. size: {
  23334. type: String,
  23335. default: function _default() {
  23336. return src_conf.checkbox.size || src_conf.size;
  23337. }
  23338. }
  23339. },
  23340. inject: {
  23341. $xecheckboxgroup: {
  23342. default: null
  23343. },
  23344. $xeform: {
  23345. default: null
  23346. },
  23347. $xeformiteminfo: {
  23348. default: null
  23349. }
  23350. },
  23351. computed: {
  23352. isGroup: function isGroup() {
  23353. return this.$xecheckboxgroup;
  23354. },
  23355. isMaximize: function isMaximize() {
  23356. return this.isGroup && this.$xecheckboxgroup.props.isMaximize;
  23357. },
  23358. isDisabled: function isDisabled() {
  23359. if (this.disabled) {
  23360. return true;
  23361. }
  23362. if (this.isGroup) {
  23363. var _this$$xecheckboxgrou = this.$xecheckboxgroup,
  23364. disabled = _this$$xecheckboxgrou.disabled,
  23365. isMaximize = _this$$xecheckboxgrou.isMaximize;
  23366. return disabled || isMaximize && !this.isChecked;
  23367. }
  23368. return false;
  23369. },
  23370. isChecked: function isChecked() {
  23371. return this.isGroup ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.includes(this.$xecheckboxgroup.value, this.label) : this.value === this.checkedValue;
  23372. }
  23373. },
  23374. render: function render(h) {
  23375. var _ref;
  23376. var $scopedSlots = this.$scopedSlots,
  23377. isDisabled = this.isDisabled,
  23378. title = this.title,
  23379. vSize = this.vSize,
  23380. indeterminate = this.indeterminate,
  23381. content = this.content,
  23382. isChecked = this.isChecked;
  23383. var attrs = {};
  23384. if (title) {
  23385. attrs.title = title;
  23386. }
  23387. return h('label', {
  23388. class: ['vxe-checkbox', (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, 'is--indeterminate', indeterminate), _defineProperty(_ref, 'is--disabled', isDisabled), _defineProperty(_ref, 'is--checked', isChecked), _ref)],
  23389. attrs: attrs
  23390. }, [h('input', {
  23391. class: 'vxe-checkbox--input',
  23392. attrs: {
  23393. type: 'checkbox',
  23394. disabled: isDisabled
  23395. },
  23396. domProps: {
  23397. checked: isChecked
  23398. },
  23399. on: {
  23400. change: this.changeEvent
  23401. }
  23402. }), h('span', {
  23403. class: ['vxe-checkbox--icon', indeterminate ? 'vxe-icon-checkbox-indeterminate' : isChecked ? 'vxe-icon-checkbox-checked' : 'vxe-icon-checkbox-unchecked']
  23404. }), h('span', {
  23405. class: 'vxe-checkbox--label'
  23406. }, $scopedSlots.default ? $scopedSlots.default.call(this, {}) : [getFuncText(content)])]);
  23407. },
  23408. methods: {
  23409. changeEvent: function changeEvent(evnt) {
  23410. var $xecheckboxgroup = this.$xecheckboxgroup,
  23411. isGroup = this.isGroup,
  23412. isDisabled = this.isDisabled,
  23413. label = this.label,
  23414. checkedValue = this.checkedValue,
  23415. uncheckedValue = this.uncheckedValue;
  23416. if (!isDisabled) {
  23417. var checked = evnt.target.checked;
  23418. var value = checked ? checkedValue : uncheckedValue;
  23419. var params = {
  23420. checked: checked,
  23421. value: value,
  23422. label: label,
  23423. $event: evnt
  23424. };
  23425. if (isGroup) {
  23426. $xecheckboxgroup.handleChecked(params, evnt);
  23427. } else {
  23428. this.$emit('input', value);
  23429. this.$emit('change', params); // 自动更新校验状态
  23430. if (this.$xeform && this.$xeformiteminfo) {
  23431. this.$xeform.triggerItemEvent(evnt, this.$xeformiteminfo.itemConfig.field, value);
  23432. }
  23433. }
  23434. }
  23435. }
  23436. }
  23437. });
  23438. // CONCATENATED MODULE: ./packages/select/src/select.js
  23439. function isOptionVisible(option) {
  23440. return option.visible !== false;
  23441. }
  23442. function getOptUniqueId() {
  23443. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.uniqueId('opt_');
  23444. }
  23445. function getOptkey(_vm) {
  23446. var optionOpts = _vm.optionOpts;
  23447. return optionOpts.keyField || _vm.optionId || '_X_OPTION_KEY';
  23448. }
  23449. function getOptid(_vm, option) {
  23450. var optid = option[getOptkey(_vm)];
  23451. return optid ? encodeURIComponent(optid) : '';
  23452. }
  23453. function findOffsetOption(_vm, optionValue, isUpArrow) {
  23454. var isGroup = _vm.isGroup,
  23455. visibleOptionList = _vm.visibleOptionList,
  23456. visibleGroupList = _vm.visibleGroupList,
  23457. valueField = _vm.valueField,
  23458. groupOptionsField = _vm.groupOptionsField;
  23459. var firstOption;
  23460. var prevOption;
  23461. var nextOption;
  23462. var currOption;
  23463. if (isGroup) {
  23464. for (var gIndex = 0; gIndex < visibleGroupList.length; gIndex++) {
  23465. var group = visibleGroupList[gIndex];
  23466. var groupOptionList = group[groupOptionsField];
  23467. var isGroupDisabled = group.disabled;
  23468. if (groupOptionList) {
  23469. for (var index = 0; index < groupOptionList.length; index++) {
  23470. var option = groupOptionList[index];
  23471. var isVisible = isOptionVisible(option);
  23472. var isDisabled = isGroupDisabled || option.disabled;
  23473. if (!firstOption && !isDisabled) {
  23474. firstOption = option;
  23475. }
  23476. if (currOption) {
  23477. if (isVisible && !isDisabled) {
  23478. nextOption = option;
  23479. if (!isUpArrow) {
  23480. return {
  23481. offsetOption: nextOption
  23482. };
  23483. }
  23484. }
  23485. }
  23486. if (optionValue === option[valueField]) {
  23487. currOption = option;
  23488. if (isUpArrow) {
  23489. return {
  23490. offsetOption: prevOption
  23491. };
  23492. }
  23493. } else {
  23494. if (isVisible && !isDisabled) {
  23495. prevOption = option;
  23496. }
  23497. }
  23498. }
  23499. }
  23500. }
  23501. } else {
  23502. for (var _index = 0; _index < visibleOptionList.length; _index++) {
  23503. var _option = visibleOptionList[_index];
  23504. var _isDisabled = _option.disabled;
  23505. if (!firstOption && !_isDisabled) {
  23506. firstOption = _option;
  23507. }
  23508. if (currOption) {
  23509. if (!_isDisabled) {
  23510. nextOption = _option;
  23511. if (!isUpArrow) {
  23512. return {
  23513. offsetOption: nextOption
  23514. };
  23515. }
  23516. }
  23517. }
  23518. if (optionValue === _option[valueField]) {
  23519. currOption = _option;
  23520. if (isUpArrow) {
  23521. return {
  23522. offsetOption: prevOption
  23523. };
  23524. }
  23525. } else {
  23526. if (!_isDisabled) {
  23527. prevOption = _option;
  23528. }
  23529. }
  23530. }
  23531. }
  23532. return {
  23533. firstOption: firstOption
  23534. };
  23535. }
  23536. function findOption(_vm, optionValue) {
  23537. var isGroup = _vm.isGroup,
  23538. fullOptionList = _vm.fullOptionList,
  23539. fullGroupList = _vm.fullGroupList,
  23540. valueField = _vm.valueField;
  23541. if (isGroup) {
  23542. for (var gIndex = 0; gIndex < fullGroupList.length; gIndex++) {
  23543. var group = fullGroupList[gIndex];
  23544. if (group.options) {
  23545. for (var index = 0; index < group.options.length; index++) {
  23546. var option = group.options[index];
  23547. if (optionValue === option[valueField]) {
  23548. return option;
  23549. }
  23550. }
  23551. }
  23552. }
  23553. }
  23554. return fullOptionList.find(function (item) {
  23555. return optionValue === item[valueField];
  23556. });
  23557. }
  23558. function getRemoteSelectLabel(_vm, value) {
  23559. var remoteValueList = _vm.remoteValueList;
  23560. var remoteItem = remoteValueList.find(function (item) {
  23561. return value === item.key;
  23562. });
  23563. var item = remoteItem ? remoteItem.result : null;
  23564. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toValueString(item ? item[_vm.labelField] : value);
  23565. }
  23566. function getSelectLabel(_vm, value) {
  23567. var item = findOption(_vm, value);
  23568. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toValueString(item ? item[_vm.labelField] : value);
  23569. }
  23570. function checkOptionDisabled(_vm, isSelected, option, group) {
  23571. if (option.disabled) {
  23572. return true;
  23573. }
  23574. if (group && group.disabled) {
  23575. return true;
  23576. }
  23577. if (_vm.isMaximize && !isSelected) {
  23578. return true;
  23579. }
  23580. return false;
  23581. }
  23582. function renderOption(h, _vm, list, group) {
  23583. var isGroup = _vm.isGroup,
  23584. labelField = _vm.labelField,
  23585. valueField = _vm.valueField,
  23586. optionKey = _vm.optionKey,
  23587. value = _vm.value,
  23588. multiple = _vm.multiple,
  23589. currentValue = _vm.currentValue,
  23590. optionOpts = _vm.optionOpts;
  23591. var useKey = optionOpts.useKey;
  23592. return list.map(function (option, cIndex) {
  23593. var slots = option.slots;
  23594. var optionValue = option[valueField];
  23595. var isSelected = multiple ? value && value.indexOf(optionValue) > -1 : value === optionValue;
  23596. var isVisible = !isGroup || isOptionVisible(option);
  23597. var isDisabled = checkOptionDisabled(_vm, isSelected, option, group);
  23598. var optid = getOptid(_vm, option);
  23599. var defaultSlot = slots ? slots.default : null;
  23600. return isVisible ? h('div', {
  23601. key: useKey || optionKey ? optid : cIndex,
  23602. class: ['vxe-select-option', option.className, {
  23603. 'is--disabled': isDisabled,
  23604. 'is--selected': isSelected,
  23605. 'is--hover': currentValue === optionValue
  23606. }],
  23607. attrs: {
  23608. optid: optid
  23609. },
  23610. on: {
  23611. mousedown: _vm.mousedownOptionEvent,
  23612. click: function click(evnt) {
  23613. if (!isDisabled) {
  23614. _vm.changeOptionEvent(evnt, optionValue, option);
  23615. }
  23616. },
  23617. mouseenter: function mouseenter() {
  23618. if (!isDisabled) {
  23619. _vm.setCurrentOption(option);
  23620. }
  23621. }
  23622. }
  23623. }, defaultSlot ? _vm.callSlot(defaultSlot, {
  23624. option: option,
  23625. $select: _vm
  23626. }, h) : utils.formatText(getFuncText(option[labelField]))) : null;
  23627. });
  23628. }
  23629. function renderOptgroup(h, _vm) {
  23630. var optionKey = _vm.optionKey,
  23631. visibleGroupList = _vm.visibleGroupList,
  23632. groupLabelField = _vm.groupLabelField,
  23633. groupOptionsField = _vm.groupOptionsField,
  23634. optionOpts = _vm.optionOpts;
  23635. var useKey = optionOpts.useKey;
  23636. return visibleGroupList.map(function (group, gIndex) {
  23637. var slots = group.slots;
  23638. var optid = getOptid(_vm, group);
  23639. var isGroupDisabled = group.disabled;
  23640. var defaultSlot = slots ? slots.default : null;
  23641. return h('div', {
  23642. key: useKey || optionKey ? optid : gIndex,
  23643. class: ['vxe-optgroup', group.className, {
  23644. 'is--disabled': isGroupDisabled
  23645. }],
  23646. attrs: {
  23647. optid: optid
  23648. }
  23649. }, [h('div', {
  23650. class: 'vxe-optgroup--title'
  23651. }, defaultSlot ? _vm.callSlot(defaultSlot, {
  23652. option: group,
  23653. $select: _vm
  23654. }, h) : getFuncText(group[groupLabelField])), h('div', {
  23655. class: 'vxe-optgroup--wrapper'
  23656. }, renderOption(h, _vm, group[groupOptionsField], group))]);
  23657. });
  23658. }
  23659. function select_renderOpts(h, _vm) {
  23660. var isGroup = _vm.isGroup,
  23661. visibleGroupList = _vm.visibleGroupList,
  23662. visibleOptionList = _vm.visibleOptionList,
  23663. searchLoading = _vm.searchLoading;
  23664. if (searchLoading) {
  23665. return [h('div', {
  23666. class: 'vxe-select--search-loading'
  23667. }, [h('i', {
  23668. class: ['vxe-select--search-icon', src_conf.icon.SELECT_LOADED]
  23669. }), h('span', {
  23670. class: 'vxe-select--search-text'
  23671. }, src_conf.i18n('vxe.select.loadingText'))])];
  23672. }
  23673. if (isGroup) {
  23674. if (visibleGroupList.length) {
  23675. return renderOptgroup(h, _vm);
  23676. }
  23677. } else {
  23678. if (visibleOptionList.length) {
  23679. return renderOption(h, _vm, visibleOptionList);
  23680. }
  23681. }
  23682. return [h('div', {
  23683. class: 'vxe-select--empty-placeholder'
  23684. }, _vm.emptyText || src_conf.i18n('vxe.select.emptyText'))];
  23685. }
  23686. /* harmony default export */ var src_select = ({
  23687. name: 'VxeSelect',
  23688. mixins: [size],
  23689. props: {
  23690. value: null,
  23691. clearable: Boolean,
  23692. placeholder: String,
  23693. loading: Boolean,
  23694. disabled: Boolean,
  23695. multiple: Boolean,
  23696. multiCharOverflow: {
  23697. type: [Number, String],
  23698. default: function _default() {
  23699. return src_conf.select.multiCharOverflow;
  23700. }
  23701. },
  23702. prefixIcon: String,
  23703. placement: String,
  23704. options: Array,
  23705. optionProps: Object,
  23706. optionGroups: Array,
  23707. optionGroupProps: Object,
  23708. optionConfig: Object,
  23709. className: [String, Function],
  23710. max: [String, Number],
  23711. size: {
  23712. type: String,
  23713. default: function _default() {
  23714. return src_conf.select.size || src_conf.size;
  23715. }
  23716. },
  23717. filterable: Boolean,
  23718. filterMethod: Function,
  23719. remote: Boolean,
  23720. remoteMethod: Function,
  23721. emptyText: String,
  23722. // 已废弃,被 option-config.keyField 替换
  23723. optionId: {
  23724. type: String,
  23725. default: function _default() {
  23726. return src_conf.select.optionId;
  23727. }
  23728. },
  23729. // 已废弃,被 option-config.useKey 替换
  23730. optionKey: Boolean,
  23731. transfer: {
  23732. type: Boolean,
  23733. default: function _default() {
  23734. return src_conf.select.transfer;
  23735. }
  23736. }
  23737. },
  23738. components: {
  23739. VxeInput: input
  23740. },
  23741. inject: {
  23742. $xeform: {
  23743. default: null
  23744. },
  23745. $xeformiteminfo: {
  23746. default: null
  23747. }
  23748. },
  23749. provide: function provide() {
  23750. return {
  23751. $xeselect: this
  23752. };
  23753. },
  23754. data: function data() {
  23755. return {
  23756. inited: false,
  23757. collectOption: [],
  23758. fullGroupList: [],
  23759. fullOptionList: [],
  23760. visibleGroupList: [],
  23761. visibleOptionList: [],
  23762. remoteValueList: [],
  23763. panelIndex: 0,
  23764. panelStyle: null,
  23765. panelPlacement: null,
  23766. currentOption: null,
  23767. currentValue: null,
  23768. visiblePanel: false,
  23769. animatVisible: false,
  23770. isActivated: false,
  23771. searchValue: '',
  23772. searchLoading: false
  23773. };
  23774. },
  23775. computed: {
  23776. propsOpts: function propsOpts() {
  23777. return this.optionProps || {};
  23778. },
  23779. groupPropsOpts: function groupPropsOpts() {
  23780. return this.optionGroupProps || {};
  23781. },
  23782. labelField: function labelField() {
  23783. return this.propsOpts.label || 'label';
  23784. },
  23785. valueField: function valueField() {
  23786. return this.propsOpts.value || 'value';
  23787. },
  23788. groupLabelField: function groupLabelField() {
  23789. return this.groupPropsOpts.label || 'label';
  23790. },
  23791. groupOptionsField: function groupOptionsField() {
  23792. return this.groupPropsOpts.options || 'options';
  23793. },
  23794. optionOpts: function optionOpts() {
  23795. return Object.assign({}, src_conf.select.optionConfig, this.optionConfig);
  23796. },
  23797. isGroup: function isGroup() {
  23798. return this.fullGroupList.some(function (item) {
  23799. return item.options && item.options.length;
  23800. });
  23801. },
  23802. multiMaxCharNum: function multiMaxCharNum() {
  23803. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(this.multiCharOverflow);
  23804. },
  23805. selectLabel: function selectLabel() {
  23806. var _this = this;
  23807. var value = this.value,
  23808. multiple = this.multiple,
  23809. remote = this.remote,
  23810. multiMaxCharNum = this.multiMaxCharNum;
  23811. if (value && multiple) {
  23812. var vals = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(value) ? value : [value];
  23813. if (remote) {
  23814. return vals.map(function (val) {
  23815. return getRemoteSelectLabel(_this, val);
  23816. }).join(', ');
  23817. }
  23818. return vals.map(function (val) {
  23819. var label = getSelectLabel(_this, val);
  23820. if (multiMaxCharNum > 0 && label.length > multiMaxCharNum) {
  23821. return "".concat(label.substring(0, multiMaxCharNum), "...");
  23822. }
  23823. return label;
  23824. }).join(', ');
  23825. }
  23826. if (remote) {
  23827. return getRemoteSelectLabel(this, value);
  23828. }
  23829. return getSelectLabel(this, value);
  23830. },
  23831. isMaximize: function isMaximize() {
  23832. var value = this.value,
  23833. multiple = this.multiple,
  23834. max = this.max;
  23835. if (multiple && max) {
  23836. return (value ? value.length : 0) >= external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(max);
  23837. }
  23838. return false;
  23839. }
  23840. },
  23841. watch: {
  23842. collectOption: function collectOption(value) {
  23843. if (value.some(function (item) {
  23844. return item.options && item.options.length;
  23845. })) {
  23846. this.fullOptionList = [];
  23847. this.fullGroupList = value;
  23848. } else {
  23849. this.fullGroupList = [];
  23850. this.fullOptionList = value;
  23851. }
  23852. this.cacheItemMap();
  23853. },
  23854. options: function options(value) {
  23855. this.fullGroupList = [];
  23856. this.fullOptionList = value;
  23857. this.cacheItemMap();
  23858. },
  23859. optionGroups: function optionGroups(value) {
  23860. this.fullOptionList = [];
  23861. this.fullGroupList = value;
  23862. this.cacheItemMap();
  23863. }
  23864. },
  23865. created: function created() {
  23866. var options = this.options,
  23867. optionGroups = this.optionGroups;
  23868. if (optionGroups) {
  23869. this.fullGroupList = optionGroups;
  23870. } else if (options) {
  23871. this.fullOptionList = options;
  23872. }
  23873. this.cacheItemMap();
  23874. GlobalEvent.on(this, 'mousewheel', this.handleGlobalMousewheelEvent);
  23875. GlobalEvent.on(this, 'mousedown', this.handleGlobalMousedownEvent);
  23876. GlobalEvent.on(this, 'keydown', this.handleGlobalKeydownEvent);
  23877. GlobalEvent.on(this, 'blur', this.handleGlobalBlurEvent);
  23878. },
  23879. beforeDestroy: function beforeDestroy() {
  23880. var panelElem = this.$refs.panel;
  23881. if (panelElem && panelElem.parentNode) {
  23882. panelElem.parentNode.removeChild(panelElem);
  23883. }
  23884. },
  23885. destroyed: function destroyed() {
  23886. GlobalEvent.off(this, 'mousewheel');
  23887. GlobalEvent.off(this, 'mousedown');
  23888. GlobalEvent.off(this, 'keydown');
  23889. GlobalEvent.off(this, 'blur');
  23890. },
  23891. render: function render(h) {
  23892. var _ref, _ref2;
  23893. var _e = this._e,
  23894. $scopedSlots = this.$scopedSlots,
  23895. vSize = this.vSize,
  23896. className = this.className,
  23897. inited = this.inited,
  23898. isActivated = this.isActivated,
  23899. loading = this.loading,
  23900. disabled = this.disabled,
  23901. visiblePanel = this.visiblePanel,
  23902. filterable = this.filterable;
  23903. var prefixSlot = $scopedSlots.prefix;
  23904. return h('div', {
  23905. class: ['vxe-select', className ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(className) ? className({
  23906. $select: this
  23907. }) : className : '', (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, 'is--visivle', visiblePanel), _defineProperty(_ref, 'is--disabled', disabled), _defineProperty(_ref, 'is--filter', filterable), _defineProperty(_ref, 'is--loading', loading), _defineProperty(_ref, 'is--active', isActivated), _ref)]
  23908. }, [h('div', {
  23909. class: 'vxe-select-slots',
  23910. ref: 'hideOption'
  23911. }, this.$slots.default), h('vxe-input', {
  23912. ref: 'input',
  23913. props: {
  23914. clearable: this.clearable,
  23915. placeholder: this.placeholder,
  23916. readonly: true,
  23917. disabled: disabled,
  23918. type: 'text',
  23919. prefixIcon: this.prefixIcon,
  23920. suffixIcon: loading ? src_conf.icon.SELECT_LOADED : visiblePanel ? src_conf.icon.SELECT_OPEN : src_conf.icon.SELECT_CLOSE,
  23921. value: this.selectLabel
  23922. },
  23923. on: {
  23924. clear: this.clearEvent,
  23925. click: this.togglePanelEvent,
  23926. focus: this.focusEvent,
  23927. blur: this.blurEvent,
  23928. 'suffix-click': this.togglePanelEvent
  23929. },
  23930. scopedSlots: prefixSlot ? {
  23931. prefix: function prefix() {
  23932. return prefixSlot({});
  23933. }
  23934. } : {}
  23935. }), h('div', {
  23936. ref: 'panel',
  23937. 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', !loading && this.animatVisible), _defineProperty(_ref2, 'animat--enter', !loading && visiblePanel), _ref2)],
  23938. attrs: {
  23939. placement: this.panelPlacement
  23940. },
  23941. style: this.panelStyle
  23942. }, inited ? [filterable ? h('div', {
  23943. class: 'vxe-select-filter--wrapper'
  23944. }, [h('vxe-input', {
  23945. ref: 'inpSearch',
  23946. class: 'vxe-select-filter--input',
  23947. props: {
  23948. value: this.searchValue,
  23949. type: 'text',
  23950. clearable: true,
  23951. placeholder: src_conf.i18n('vxe.select.search'),
  23952. prefixIcon: src_conf.icon.INPUT_SEARCH
  23953. },
  23954. on: {
  23955. modelValue: this.modelSearchEvent,
  23956. focus: this.focusSearchEvent,
  23957. keydown: this.keydownSearchEvent,
  23958. change: this.triggerSearchEvent,
  23959. search: this.triggerSearchEvent
  23960. }
  23961. })]) : _e(), h('div', {
  23962. ref: 'optWrapper',
  23963. class: 'vxe-select-option--wrapper'
  23964. }, select_renderOpts(h, this))] : null)]);
  23965. },
  23966. methods: {
  23967. callSlot: function callSlot(slotFunc, params, h) {
  23968. if (slotFunc) {
  23969. var $scopedSlots = this.$scopedSlots;
  23970. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isString(slotFunc)) {
  23971. slotFunc = $scopedSlots[slotFunc] || null;
  23972. }
  23973. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(slotFunc)) {
  23974. return getSlotVNs(slotFunc.call(this, params, h));
  23975. }
  23976. }
  23977. return [];
  23978. },
  23979. cacheItemMap: function cacheItemMap() {
  23980. var _this2 = this;
  23981. var fullOptionList = this.fullOptionList,
  23982. fullGroupList = this.fullGroupList,
  23983. groupOptionsField = this.groupOptionsField;
  23984. var optkey = getOptkey(this);
  23985. var handleOptis = function handleOptis(item) {
  23986. if (!getOptid(_this2, item)) {
  23987. item[optkey] = getOptUniqueId();
  23988. }
  23989. };
  23990. if (fullGroupList.length) {
  23991. fullGroupList.forEach(function (group) {
  23992. handleOptis(group);
  23993. if (group[groupOptionsField]) {
  23994. group[groupOptionsField].forEach(handleOptis);
  23995. }
  23996. });
  23997. } else if (fullOptionList.length) {
  23998. fullOptionList.forEach(handleOptis);
  23999. }
  24000. this.refreshOption();
  24001. },
  24002. /**
  24003. * 刷新选项,当选项被搜索、动态显示/隐藏时可能会用到
  24004. */
  24005. refreshOption: function refreshOption() {
  24006. var isGroup = this.isGroup,
  24007. fullOptionList = this.fullOptionList,
  24008. fullGroupList = this.fullGroupList,
  24009. filterable = this.filterable,
  24010. filterMethod = this.filterMethod,
  24011. searchValue = this.searchValue,
  24012. labelField = this.labelField,
  24013. groupLabelField = this.groupLabelField;
  24014. if (isGroup) {
  24015. if (filterable && filterMethod) {
  24016. this.visibleGroupList = fullGroupList.filter(function (group) {
  24017. return isOptionVisible(group) && filterMethod({
  24018. group: group,
  24019. option: null,
  24020. searchValue: searchValue
  24021. });
  24022. });
  24023. } else if (filterable) {
  24024. this.visibleGroupList = fullGroupList.filter(function (group) {
  24025. return isOptionVisible(group) && (!searchValue || "".concat(group[groupLabelField]).indexOf(searchValue) > -1);
  24026. });
  24027. } else {
  24028. this.visibleGroupList = fullGroupList.filter(isOptionVisible);
  24029. }
  24030. } else {
  24031. if (filterable && filterMethod) {
  24032. this.visibleOptionList = fullOptionList.filter(function (option) {
  24033. return isOptionVisible(option) && filterMethod({
  24034. group: null,
  24035. option: option,
  24036. searchValue: searchValue
  24037. });
  24038. });
  24039. } else if (filterable) {
  24040. this.visibleOptionList = fullOptionList.filter(function (option) {
  24041. return isOptionVisible(option) && (!searchValue || "".concat(option[labelField]).indexOf(searchValue) > -1);
  24042. });
  24043. } else {
  24044. this.visibleOptionList = fullOptionList.filter(isOptionVisible);
  24045. }
  24046. }
  24047. return this.$nextTick();
  24048. },
  24049. setCurrentOption: function setCurrentOption(option) {
  24050. if (option) {
  24051. this.currentOption = option;
  24052. this.currentValue = option[this.valueField];
  24053. }
  24054. },
  24055. scrollToOption: function scrollToOption(option, isAlignBottom) {
  24056. var _this3 = this;
  24057. return this.$nextTick().then(function () {
  24058. if (option) {
  24059. var $refs = _this3.$refs;
  24060. var optWrapperElem = $refs.optWrapper;
  24061. var optElem = $refs.panel.querySelector("[optid='".concat(getOptid(_this3, option), "']"));
  24062. if (optWrapperElem && optElem) {
  24063. var wrapperHeight = optWrapperElem.offsetHeight;
  24064. var offsetPadding = 5;
  24065. if (isAlignBottom) {
  24066. if (optElem.offsetTop + optElem.offsetHeight - optWrapperElem.scrollTop > wrapperHeight) {
  24067. optWrapperElem.scrollTop = optElem.offsetTop + optElem.offsetHeight - wrapperHeight;
  24068. }
  24069. } else {
  24070. if (optElem.offsetTop + offsetPadding < optWrapperElem.scrollTop || optElem.offsetTop + offsetPadding > optWrapperElem.scrollTop + optWrapperElem.clientHeight) {
  24071. optWrapperElem.scrollTop = optElem.offsetTop - offsetPadding;
  24072. }
  24073. }
  24074. }
  24075. }
  24076. });
  24077. },
  24078. clearEvent: function clearEvent(params, evnt) {
  24079. this.clearValueEvent(evnt, null);
  24080. this.hideOptionPanel();
  24081. },
  24082. clearValueEvent: function clearValueEvent(evnt, selectValue) {
  24083. this.remoteValueList = [];
  24084. this.changeEvent(evnt, selectValue);
  24085. this.$emit('clear', {
  24086. value: selectValue,
  24087. $event: evnt
  24088. });
  24089. },
  24090. changeEvent: function changeEvent(evnt, selectValue) {
  24091. if (selectValue !== this.value) {
  24092. this.$emit('input', selectValue);
  24093. this.$emit('change', {
  24094. value: selectValue,
  24095. $event: evnt
  24096. }); // 自动更新校验状态
  24097. if (this.$xeform && this.$xeformiteminfo) {
  24098. this.$xeform.triggerItemEvent(evnt, this.$xeformiteminfo.itemConfig.field, selectValue);
  24099. }
  24100. }
  24101. },
  24102. mousedownOptionEvent: function mousedownOptionEvent(evnt) {
  24103. var isLeftBtn = evnt.button === 0;
  24104. if (isLeftBtn) {
  24105. evnt.stopPropagation();
  24106. }
  24107. },
  24108. changeOptionEvent: function changeOptionEvent(evnt, selectValue, option) {
  24109. var value = this.value,
  24110. multiple = this.multiple,
  24111. remoteValueList = this.remoteValueList;
  24112. if (multiple) {
  24113. var multipleValue;
  24114. if (value) {
  24115. if (value.indexOf(selectValue) === -1) {
  24116. multipleValue = value.concat([selectValue]);
  24117. } else {
  24118. multipleValue = value.filter(function (val) {
  24119. return val !== selectValue;
  24120. });
  24121. }
  24122. } else {
  24123. multipleValue = [selectValue];
  24124. }
  24125. var remoteItem = remoteValueList.find(function (item) {
  24126. return item.key === selectValue;
  24127. });
  24128. if (remoteItem) {
  24129. remoteItem.result = option;
  24130. } else {
  24131. remoteValueList.push({
  24132. key: selectValue,
  24133. result: option
  24134. });
  24135. }
  24136. this.changeEvent(evnt, multipleValue);
  24137. } else {
  24138. this.remoteValueList = [{
  24139. key: selectValue,
  24140. result: option
  24141. }];
  24142. this.changeEvent(evnt, selectValue);
  24143. this.hideOptionPanel();
  24144. }
  24145. },
  24146. handleGlobalMousewheelEvent: function handleGlobalMousewheelEvent(evnt) {
  24147. var $refs = this.$refs,
  24148. disabled = this.disabled,
  24149. visiblePanel = this.visiblePanel;
  24150. if (!disabled) {
  24151. if (visiblePanel) {
  24152. if (dom.getEventTargetNode(evnt, $refs.panel).flag) {
  24153. this.updatePlacement();
  24154. } else {
  24155. this.hideOptionPanel();
  24156. }
  24157. }
  24158. }
  24159. },
  24160. handleGlobalMousedownEvent: function handleGlobalMousedownEvent(evnt) {
  24161. var $refs = this.$refs,
  24162. $el = this.$el,
  24163. disabled = this.disabled,
  24164. visiblePanel = this.visiblePanel;
  24165. if (!disabled) {
  24166. this.isActivated = dom.getEventTargetNode(evnt, $el).flag || dom.getEventTargetNode(evnt, $refs.panel).flag;
  24167. if (visiblePanel && !this.isActivated) {
  24168. this.hideOptionPanel();
  24169. }
  24170. }
  24171. },
  24172. handleGlobalKeydownEvent: function handleGlobalKeydownEvent(evnt) {
  24173. var visiblePanel = this.visiblePanel,
  24174. currentValue = this.currentValue,
  24175. currentOption = this.currentOption,
  24176. clearable = this.clearable,
  24177. disabled = this.disabled;
  24178. if (!disabled) {
  24179. var keyCode = evnt.keyCode;
  24180. var isTab = keyCode === 9;
  24181. var isEnter = keyCode === 13;
  24182. var isEsc = keyCode === 27;
  24183. var isUpArrow = keyCode === 38;
  24184. var isDwArrow = keyCode === 40;
  24185. var isDel = keyCode === 46;
  24186. var isSpacebar = keyCode === 32;
  24187. if (isTab) {
  24188. this.isActivated = false;
  24189. }
  24190. if (visiblePanel) {
  24191. if (isEsc || isTab) {
  24192. this.hideOptionPanel();
  24193. } else if (isEnter) {
  24194. evnt.preventDefault();
  24195. evnt.stopPropagation();
  24196. this.changeOptionEvent(evnt, currentValue, currentOption);
  24197. } else if (isUpArrow || isDwArrow) {
  24198. evnt.preventDefault();
  24199. var _findOffsetOption = findOffsetOption(this, currentValue, isUpArrow),
  24200. firstOption = _findOffsetOption.firstOption,
  24201. offsetOption = _findOffsetOption.offsetOption;
  24202. if (!offsetOption && !findOption(this, currentValue)) {
  24203. offsetOption = firstOption;
  24204. }
  24205. this.setCurrentOption(offsetOption);
  24206. this.scrollToOption(offsetOption, isDwArrow);
  24207. } else if (isSpacebar) {
  24208. evnt.preventDefault();
  24209. }
  24210. } else if ((isUpArrow || isDwArrow || isEnter || isSpacebar) && this.isActivated) {
  24211. evnt.preventDefault();
  24212. this.showOptionPanel();
  24213. }
  24214. if (this.isActivated) {
  24215. if (isDel && clearable) {
  24216. this.clearValueEvent(evnt, null);
  24217. }
  24218. }
  24219. }
  24220. },
  24221. handleGlobalBlurEvent: function handleGlobalBlurEvent() {
  24222. this.hideOptionPanel();
  24223. },
  24224. updateZindex: function updateZindex() {
  24225. if (this.panelIndex < utils.getLastZIndex()) {
  24226. this.panelIndex = utils.nextZIndex();
  24227. }
  24228. },
  24229. handleFocusSearch: function handleFocusSearch() {
  24230. var _this4 = this;
  24231. if (this.filterable) {
  24232. this.$nextTick(function () {
  24233. if (_this4.$refs.inpSearch) {
  24234. _this4.$refs.inpSearch.focus();
  24235. }
  24236. });
  24237. }
  24238. },
  24239. focusEvent: function focusEvent() {
  24240. if (!this.disabled) {
  24241. this.isActivated = true;
  24242. }
  24243. },
  24244. blurEvent: function blurEvent() {
  24245. this.isActivated = false;
  24246. },
  24247. modelSearchEvent: function modelSearchEvent(value) {
  24248. this.searchValue = value;
  24249. },
  24250. focusSearchEvent: function focusSearchEvent() {
  24251. this.isActivated = true;
  24252. },
  24253. keydownSearchEvent: function keydownSearchEvent(params) {
  24254. var $event = params.$event;
  24255. var isEnter = hasEventKey($event, EVENT_KEYS.ENTER);
  24256. if (isEnter) {
  24257. $event.preventDefault();
  24258. $event.stopPropagation();
  24259. }
  24260. },
  24261. triggerSearchEvent: external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.debounce(function () {
  24262. var _this5 = this;
  24263. var remote = this.remote,
  24264. remoteMethod = this.remoteMethod,
  24265. searchValue = this.searchValue;
  24266. if (remote && remoteMethod) {
  24267. this.searchLoading = true;
  24268. Promise.resolve(remoteMethod({
  24269. searchValue: searchValue
  24270. })).then(function () {
  24271. return _this5.$nextTick();
  24272. }).catch(function () {
  24273. return _this5.$nextTick();
  24274. }).finally(function () {
  24275. _this5.searchLoading = false;
  24276. _this5.refreshOption();
  24277. });
  24278. } else {
  24279. this.refreshOption();
  24280. }
  24281. }, 350, {
  24282. trailing: true
  24283. }),
  24284. isPanelVisible: function isPanelVisible() {
  24285. return this.visiblePanel;
  24286. },
  24287. togglePanel: function togglePanel() {
  24288. if (this.visiblePanel) {
  24289. this.hideOptionPanel();
  24290. } else {
  24291. this.showOptionPanel();
  24292. }
  24293. this.$nextTick();
  24294. },
  24295. hidePanel: function hidePanel() {
  24296. if (this.visiblePanel) {
  24297. this.hideOptionPanel();
  24298. }
  24299. this.$nextTick();
  24300. },
  24301. showPanel: function showPanel() {
  24302. if (!this.visiblePanel) {
  24303. this.showOptionPanel();
  24304. }
  24305. this.$nextTick();
  24306. },
  24307. togglePanelEvent: function togglePanelEvent(params) {
  24308. var $event = params.$event;
  24309. $event.preventDefault();
  24310. if (this.visiblePanel) {
  24311. this.hideOptionPanel();
  24312. } else {
  24313. this.showOptionPanel();
  24314. }
  24315. },
  24316. showOptionPanel: function showOptionPanel() {
  24317. var _this6 = this;
  24318. var loading = this.loading,
  24319. disabled = this.disabled,
  24320. filterable = this.filterable;
  24321. if (!loading && !disabled) {
  24322. this.searchList = this.option;
  24323. clearTimeout(this.hidePanelTimeout);
  24324. if (!this.inited) {
  24325. this.inited = true;
  24326. if (this.transfer) {
  24327. document.body.appendChild(this.$refs.panel);
  24328. }
  24329. }
  24330. this.isActivated = true;
  24331. this.animatVisible = true;
  24332. if (filterable) {
  24333. this.refreshOption();
  24334. }
  24335. setTimeout(function () {
  24336. var value = _this6.value,
  24337. multiple = _this6.multiple;
  24338. var currOption = findOption(_this6, multiple && value ? value[0] : value);
  24339. _this6.visiblePanel = true;
  24340. if (currOption) {
  24341. _this6.setCurrentOption(currOption);
  24342. _this6.scrollToOption(currOption);
  24343. }
  24344. _this6.handleFocusSearch();
  24345. }, 10);
  24346. this.updateZindex();
  24347. this.updatePlacement();
  24348. }
  24349. },
  24350. hideOptionPanel: function hideOptionPanel() {
  24351. var _this7 = this;
  24352. this.searchValue = '';
  24353. this.searchLoading = false;
  24354. this.visiblePanel = false;
  24355. this.hidePanelTimeout = setTimeout(function () {
  24356. _this7.animatVisible = false;
  24357. _this7.searchValue = '';
  24358. }, 350);
  24359. },
  24360. updatePlacement: function updatePlacement() {
  24361. var _this8 = this;
  24362. return this.$nextTick().then(function () {
  24363. var $refs = _this8.$refs,
  24364. transfer = _this8.transfer,
  24365. placement = _this8.placement,
  24366. panelIndex = _this8.panelIndex;
  24367. var targetElem = $refs.input.$el;
  24368. var panelElem = $refs.panel;
  24369. if (panelElem && targetElem) {
  24370. var targetHeight = targetElem.offsetHeight;
  24371. var targetWidth = targetElem.offsetWidth;
  24372. var panelHeight = panelElem.offsetHeight;
  24373. var panelWidth = panelElem.offsetWidth;
  24374. var marginSize = 5;
  24375. var panelStyle = {
  24376. zIndex: panelIndex
  24377. };
  24378. var _DomTools$getAbsolute = dom.getAbsolutePos(targetElem),
  24379. boundingTop = _DomTools$getAbsolute.boundingTop,
  24380. boundingLeft = _DomTools$getAbsolute.boundingLeft,
  24381. visibleHeight = _DomTools$getAbsolute.visibleHeight,
  24382. visibleWidth = _DomTools$getAbsolute.visibleWidth;
  24383. var panelPlacement = 'bottom';
  24384. if (transfer) {
  24385. var left = boundingLeft;
  24386. var top = boundingTop + targetHeight;
  24387. if (placement === 'top') {
  24388. panelPlacement = 'top';
  24389. top = boundingTop - panelHeight;
  24390. } else if (!placement) {
  24391. // 如果下面不够放,则向上
  24392. if (top + panelHeight + marginSize > visibleHeight) {
  24393. panelPlacement = 'top';
  24394. top = boundingTop - panelHeight;
  24395. } // 如果上面不够放,则向下(优先)
  24396. if (top < marginSize) {
  24397. panelPlacement = 'bottom';
  24398. top = boundingTop + targetHeight;
  24399. }
  24400. } // 如果溢出右边
  24401. if (left + panelWidth + marginSize > visibleWidth) {
  24402. left -= left + panelWidth + marginSize - visibleWidth;
  24403. } // 如果溢出左边
  24404. if (left < marginSize) {
  24405. left = marginSize;
  24406. }
  24407. Object.assign(panelStyle, {
  24408. left: "".concat(left, "px"),
  24409. top: "".concat(top, "px"),
  24410. minWidth: "".concat(targetWidth, "px")
  24411. });
  24412. } else {
  24413. if (placement === 'top') {
  24414. panelPlacement = 'top';
  24415. panelStyle.bottom = "".concat(targetHeight, "px");
  24416. } else if (!placement) {
  24417. // 如果下面不够放,则向上
  24418. if (boundingTop + targetHeight + panelHeight > visibleHeight) {
  24419. // 如果上面不够放,则向下(优先)
  24420. if (boundingTop - targetHeight - panelHeight > marginSize) {
  24421. panelPlacement = 'top';
  24422. panelStyle.bottom = "".concat(targetHeight, "px");
  24423. }
  24424. }
  24425. }
  24426. }
  24427. _this8.panelStyle = panelStyle;
  24428. _this8.panelPlacement = panelPlacement;
  24429. return _this8.$nextTick();
  24430. }
  24431. });
  24432. },
  24433. focus: function focus() {
  24434. this.isActivated = true;
  24435. this.$refs.input.focus();
  24436. return this.$nextTick();
  24437. },
  24438. blur: function blur() {
  24439. this.hideOptionPanel();
  24440. this.$refs.input.blur();
  24441. return this.$nextTick();
  24442. }
  24443. }
  24444. });
  24445. // CONCATENATED MODULE: ./packages/select/src/util.js
  24446. var util_OptionConfig = /*#__PURE__*/function () {
  24447. function OptionConfig($xeselect, _vm) {
  24448. _classCallCheck(this, OptionConfig);
  24449. Object.assign(this, {
  24450. value: _vm.value,
  24451. label: _vm.label,
  24452. visible: _vm.visible,
  24453. className: _vm.className,
  24454. disabled: _vm.disabled
  24455. });
  24456. }
  24457. _createClass(OptionConfig, [{
  24458. key: "update",
  24459. value: function update(name, value) {
  24460. this[name] = value;
  24461. }
  24462. }]);
  24463. return OptionConfig;
  24464. }();
  24465. function isOption(option) {
  24466. return option instanceof util_OptionConfig;
  24467. }
  24468. function getOptionConfig($xeselect, _vm, options) {
  24469. return isOption(_vm) ? _vm : new util_OptionConfig($xeselect, _vm, options);
  24470. }
  24471. function createOption($xeselect, _vm) {
  24472. return getOptionConfig($xeselect, _vm);
  24473. }
  24474. function destroyOption(_vm) {
  24475. var $xeselect = _vm.$xeselect,
  24476. optionConfig = _vm.optionConfig;
  24477. var matchObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.findTree($xeselect.collectOption, function (option) {
  24478. return option === optionConfig;
  24479. }, {
  24480. children: 'options'
  24481. });
  24482. if (matchObj) {
  24483. matchObj.items.splice(matchObj.index, 1);
  24484. }
  24485. }
  24486. function assemOption(_vm) {
  24487. var $el = _vm.$el,
  24488. $xeselect = _vm.$xeselect,
  24489. $xeoptgroup = _vm.$xeoptgroup,
  24490. optionConfig = _vm.optionConfig;
  24491. var groupConfig = $xeoptgroup ? $xeoptgroup.optionConfig : null;
  24492. if (groupConfig) {
  24493. // 子选项才允许自定义插槽
  24494. optionConfig.slots = _vm.$slots;
  24495. if (!groupConfig.options) {
  24496. groupConfig.options = [];
  24497. }
  24498. groupConfig.options.splice([].indexOf.call($xeoptgroup.$el.children, $el), 0, optionConfig);
  24499. } else {
  24500. $xeselect.collectOption.splice([].indexOf.call($xeselect.$refs.hideOption.children, $el), 0, optionConfig);
  24501. }
  24502. }
  24503. // CONCATENATED MODULE: ./packages/select/src/option.js
  24504. var option_props = {
  24505. value: null,
  24506. label: {
  24507. type: [String, Number, Boolean],
  24508. default: ''
  24509. },
  24510. visible: {
  24511. type: Boolean,
  24512. default: null
  24513. },
  24514. className: [String, Function],
  24515. disabled: Boolean
  24516. };
  24517. var watch = {};
  24518. Object.keys(option_props).forEach(function (name) {
  24519. watch[name] = function (value) {
  24520. this.optionConfig.update(name, value);
  24521. };
  24522. });
  24523. /* harmony default export */ var src_option = ({
  24524. name: 'VxeOption',
  24525. props: option_props,
  24526. inject: {
  24527. $xeselect: {
  24528. default: null
  24529. },
  24530. $xeoptgroup: {
  24531. default: null
  24532. }
  24533. },
  24534. watch: watch,
  24535. mounted: function mounted() {
  24536. assemOption(this);
  24537. },
  24538. created: function created() {
  24539. this.optionConfig = createOption(this.$xeselect, this);
  24540. },
  24541. destroyed: function destroyed() {
  24542. destroyOption(this);
  24543. },
  24544. render: function render(h) {
  24545. return h('div');
  24546. }
  24547. });
  24548. // CONCATENATED MODULE: ./packages/export/src/export-panel.js
  24549. /* harmony default export */ var export_panel = ({
  24550. name: 'VxeExportPanel',
  24551. props: {
  24552. defaultOptions: Object,
  24553. storeData: Object
  24554. },
  24555. components: {
  24556. VxeModal: modal,
  24557. VxeInput: input,
  24558. VxeCheckbox: src_checkbox,
  24559. VxeSelect: src_select,
  24560. VxeOption: src_option
  24561. },
  24562. data: function data() {
  24563. return {
  24564. isAll: false,
  24565. isIndeterminate: false,
  24566. loading: false
  24567. };
  24568. },
  24569. computed: {
  24570. vSize: function vSize() {
  24571. return this.size || this.$parent.size || this.$parent.vSize;
  24572. },
  24573. checkedAll: function checkedAll() {
  24574. return this.storeData.columns.every(function (column) {
  24575. return column.checked;
  24576. });
  24577. },
  24578. showSheet: function showSheet() {
  24579. return ['html', 'xml', 'xlsx', 'pdf'].indexOf(this.defaultOptions.type) > -1;
  24580. },
  24581. supportMerge: function supportMerge() {
  24582. var storeData = this.storeData,
  24583. defaultOptions = this.defaultOptions;
  24584. return !defaultOptions.original && defaultOptions.mode === 'current' && (storeData.isPrint || ['html', 'xlsx'].indexOf(defaultOptions.type) > -1);
  24585. },
  24586. supportStyle: function supportStyle() {
  24587. var defaultOptions = this.defaultOptions;
  24588. return !defaultOptions.original && ['xlsx'].indexOf(defaultOptions.type) > -1;
  24589. }
  24590. },
  24591. render: function render(h) {
  24592. var _this = this;
  24593. var _e = this._e,
  24594. checkedAll = this.checkedAll,
  24595. isAllChecked = this.isAll,
  24596. isAllIndeterminate = this.isIndeterminate,
  24597. showSheet = this.showSheet,
  24598. supportMerge = this.supportMerge,
  24599. supportStyle = this.supportStyle,
  24600. defaultOptions = this.defaultOptions,
  24601. storeData = this.storeData;
  24602. var hasTree = storeData.hasTree,
  24603. hasMerge = storeData.hasMerge,
  24604. isPrint = storeData.isPrint,
  24605. hasColgroup = storeData.hasColgroup;
  24606. var isHeader = defaultOptions.isHeader;
  24607. var cols = [];
  24608. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(storeData.columns, function (column) {
  24609. var colTitle = utils.formatText(column.getTitle(), 1);
  24610. var isColGroup = column.children && column.children.length;
  24611. var isChecked = column.checked;
  24612. var indeterminate = column.halfChecked;
  24613. cols.push(h('li', {
  24614. class: ['vxe-export--panel-column-option', "level--".concat(column.level), {
  24615. 'is--group': isColGroup,
  24616. 'is--checked': isChecked,
  24617. 'is--indeterminate': indeterminate,
  24618. 'is--disabled': column.disabled
  24619. }],
  24620. attrs: {
  24621. title: colTitle
  24622. },
  24623. on: {
  24624. click: function click() {
  24625. if (!column.disabled) {
  24626. _this.changeOption(column);
  24627. }
  24628. }
  24629. }
  24630. }, [h('span', {
  24631. class: ['vxe-checkbox--icon', indeterminate ? src_conf.icon.TABLE_CHECKBOX_INDETERMINATE : isChecked ? src_conf.icon.TABLE_CHECKBOX_CHECKED : src_conf.icon.TABLE_CHECKBOX_UNCHECKED]
  24632. }), h('span', {
  24633. class: 'vxe-checkbox--label'
  24634. }, colTitle)]));
  24635. });
  24636. return h('vxe-modal', {
  24637. res: 'modal',
  24638. props: {
  24639. value: storeData.visible,
  24640. title: src_conf.i18n(isPrint ? 'vxe.export.printTitle' : 'vxe.export.expTitle'),
  24641. width: 660,
  24642. mask: true,
  24643. lockView: true,
  24644. showFooter: false,
  24645. escClosable: true,
  24646. maskClosable: true,
  24647. loading: this.loading
  24648. },
  24649. on: {
  24650. input: function input(value) {
  24651. storeData.visible = value;
  24652. },
  24653. show: this.showEvent
  24654. }
  24655. }, [h('div', {
  24656. class: 'vxe-export--panel'
  24657. }, [h('table', {
  24658. attrs: {
  24659. cellspacing: 0,
  24660. cellpadding: 0,
  24661. border: 0
  24662. }
  24663. }, [h('tbody', [[isPrint ? _e() : h('tr', [h('td', src_conf.i18n('vxe.export.expName')), h('td', [h('vxe-input', {
  24664. ref: 'filename',
  24665. props: {
  24666. value: defaultOptions.filename,
  24667. type: 'text',
  24668. clearable: true,
  24669. placeholder: src_conf.i18n('vxe.export.expNamePlaceholder')
  24670. },
  24671. on: {
  24672. modelValue: function modelValue(value) {
  24673. defaultOptions.filename = value;
  24674. }
  24675. }
  24676. })])]), isPrint ? _e() : h('tr', [h('td', src_conf.i18n('vxe.export.expType')), h('td', [h('vxe-select', {
  24677. props: {
  24678. value: defaultOptions.type
  24679. },
  24680. on: {
  24681. input: function input(value) {
  24682. defaultOptions.type = value;
  24683. }
  24684. }
  24685. }, storeData.typeList.map(function (item) {
  24686. return h('vxe-option', {
  24687. props: {
  24688. value: item.value,
  24689. label: src_conf.i18n(item.label)
  24690. }
  24691. });
  24692. }))])]), isPrint || showSheet ? h('tr', [h('td', src_conf.i18n('vxe.export.expSheetName')), h('td', [h('vxe-input', {
  24693. ref: 'sheetname',
  24694. props: {
  24695. value: defaultOptions.sheetName,
  24696. type: 'text',
  24697. clearable: true,
  24698. placeholder: src_conf.i18n('vxe.export.expSheetNamePlaceholder')
  24699. },
  24700. on: {
  24701. modelValue: function modelValue(value) {
  24702. defaultOptions.sheetName = value;
  24703. }
  24704. }
  24705. })])]) : _e(), h('tr', [h('td', src_conf.i18n('vxe.export.expMode')), h('td', [h('vxe-select', {
  24706. props: {
  24707. value: defaultOptions.mode
  24708. },
  24709. on: {
  24710. input: function input(value) {
  24711. defaultOptions.mode = value;
  24712. }
  24713. }
  24714. }, storeData.modeList.map(function (item) {
  24715. return h('vxe-option', {
  24716. props: {
  24717. value: item.value,
  24718. label: src_conf.i18n(item.label)
  24719. }
  24720. });
  24721. }))])]), h('tr', [h('td', [src_conf.i18n('vxe.export.expColumn')]), h('td', [h('div', {
  24722. class: 'vxe-export--panel-column'
  24723. }, [h('ul', {
  24724. class: 'vxe-export--panel-column-header'
  24725. }, [h('li', {
  24726. class: ['vxe-export--panel-column-option', {
  24727. 'is--checked': isAllChecked,
  24728. 'is--indeterminate': isAllIndeterminate
  24729. }],
  24730. attrs: {
  24731. title: src_conf.i18n('vxe.table.allTitle')
  24732. },
  24733. on: {
  24734. click: this.allColumnEvent
  24735. }
  24736. }, [h('span', {
  24737. class: ['vxe-checkbox--icon', isAllIndeterminate ? src_conf.icon.TABLE_CHECKBOX_INDETERMINATE : isAllChecked ? src_conf.icon.TABLE_CHECKBOX_CHECKED : src_conf.icon.TABLE_CHECKBOX_UNCHECKED]
  24738. }), h('span', {
  24739. class: 'vxe-checkbox--label'
  24740. }, src_conf.i18n('vxe.export.expCurrentColumn'))])]), h('ul', {
  24741. class: 'vxe-export--panel-column-body'
  24742. }, cols)])])]), h('tr', [h('td', src_conf.i18n('vxe.export.expOpts')), h('td', [h('div', {
  24743. class: 'vxe-export--panel-option-row'
  24744. }, [h('vxe-checkbox', {
  24745. props: {
  24746. value: isHeader,
  24747. title: src_conf.i18n('vxe.export.expHeaderTitle'),
  24748. content: src_conf.i18n('vxe.export.expOptHeader')
  24749. },
  24750. on: {
  24751. input: function input(value) {
  24752. defaultOptions.isHeader = value;
  24753. }
  24754. }
  24755. }), h('vxe-checkbox', {
  24756. props: {
  24757. value: defaultOptions.isFooter,
  24758. disabled: !storeData.hasFooter,
  24759. title: src_conf.i18n('vxe.export.expFooterTitle'),
  24760. content: src_conf.i18n('vxe.export.expOptFooter')
  24761. },
  24762. on: {
  24763. input: function input(value) {
  24764. defaultOptions.isFooter = value;
  24765. }
  24766. }
  24767. }), h('vxe-checkbox', {
  24768. props: {
  24769. value: defaultOptions.original,
  24770. title: src_conf.i18n('vxe.export.expOriginalTitle'),
  24771. content: src_conf.i18n('vxe.export.expOptOriginal')
  24772. },
  24773. on: {
  24774. input: function input(value) {
  24775. defaultOptions.original = value;
  24776. }
  24777. }
  24778. })]), h('div', {
  24779. class: 'vxe-export--panel-option-row'
  24780. }, [h('vxe-checkbox', {
  24781. props: {
  24782. value: isHeader && hasColgroup && supportMerge ? defaultOptions.isColgroup : false,
  24783. disabled: !isHeader || !hasColgroup || !supportMerge,
  24784. title: src_conf.i18n('vxe.export.expColgroupTitle'),
  24785. content: src_conf.i18n('vxe.export.expOptColgroup')
  24786. },
  24787. on: {
  24788. input: function input(value) {
  24789. defaultOptions.isColgroup = value;
  24790. }
  24791. }
  24792. }), h('vxe-checkbox', {
  24793. props: {
  24794. value: hasMerge && supportMerge && checkedAll ? defaultOptions.isMerge : false,
  24795. disabled: !hasMerge || !supportMerge || !checkedAll,
  24796. title: src_conf.i18n('vxe.export.expMergeTitle'),
  24797. content: src_conf.i18n('vxe.export.expOptMerge')
  24798. },
  24799. on: {
  24800. input: function input(value) {
  24801. defaultOptions.isMerge = value;
  24802. }
  24803. }
  24804. }), isPrint ? _e() : h('vxe-checkbox', {
  24805. props: {
  24806. value: supportStyle ? defaultOptions.useStyle : false,
  24807. disabled: !supportStyle,
  24808. title: src_conf.i18n('vxe.export.expUseStyleTitle'),
  24809. content: src_conf.i18n('vxe.export.expOptUseStyle')
  24810. },
  24811. on: {
  24812. input: function input(value) {
  24813. defaultOptions.useStyle = value;
  24814. }
  24815. }
  24816. }), h('vxe-checkbox', {
  24817. props: {
  24818. value: hasTree ? defaultOptions.isAllExpand : false,
  24819. disabled: !hasTree,
  24820. title: src_conf.i18n('vxe.export.expAllExpandTitle'),
  24821. content: src_conf.i18n('vxe.export.expOptAllExpand')
  24822. },
  24823. on: {
  24824. input: function input(value) {
  24825. defaultOptions.isAllExpand = value;
  24826. }
  24827. }
  24828. })])])])]])]), h('div', {
  24829. class: 'vxe-export--panel-btns'
  24830. }, [h('vxe-button', {
  24831. props: {
  24832. content: src_conf.i18n('vxe.export.expCancel')
  24833. },
  24834. on: {
  24835. click: this.cancelEvent
  24836. }
  24837. }), h('vxe-button', {
  24838. ref: 'confirmBtn',
  24839. props: {
  24840. status: 'primary',
  24841. content: src_conf.i18n(isPrint ? 'vxe.export.expPrint' : 'vxe.export.expConfirm')
  24842. },
  24843. on: {
  24844. click: this.confirmEvent
  24845. }
  24846. })])])]);
  24847. },
  24848. methods: {
  24849. changeOption: function changeOption(column) {
  24850. var isChecked = !column.checked;
  24851. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree([column], function (item) {
  24852. item.checked = isChecked;
  24853. item.halfChecked = false;
  24854. });
  24855. this.handleOptionCheck(column);
  24856. this.checkStatus();
  24857. },
  24858. handleOptionCheck: function handleOptionCheck(column) {
  24859. var matchObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.findTree(this.storeData.columns, function (item) {
  24860. return item === column;
  24861. });
  24862. if (matchObj && matchObj.parent) {
  24863. var parent = matchObj.parent;
  24864. if (parent.children && parent.children.length) {
  24865. parent.checked = parent.children.every(function (column) {
  24866. return column.checked;
  24867. });
  24868. parent.halfChecked = !parent.checked && parent.children.some(function (column) {
  24869. return column.checked || column.halfChecked;
  24870. });
  24871. this.handleOptionCheck(parent);
  24872. }
  24873. }
  24874. },
  24875. checkStatus: function checkStatus() {
  24876. var columns = this.storeData.columns;
  24877. this.isAll = columns.every(function (column) {
  24878. return column.disabled || column.checked;
  24879. });
  24880. this.isIndeterminate = !this.isAll && columns.some(function (column) {
  24881. return !column.disabled && (column.checked || column.halfChecked);
  24882. });
  24883. },
  24884. allColumnEvent: function allColumnEvent() {
  24885. var isAll = !this.isAll;
  24886. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(this.storeData.columns, function (column) {
  24887. if (!column.disabled) {
  24888. column.checked = isAll;
  24889. column.halfChecked = false;
  24890. }
  24891. });
  24892. this.isAll = isAll;
  24893. this.checkStatus();
  24894. },
  24895. showEvent: function showEvent() {
  24896. var _this2 = this;
  24897. this.$nextTick(function () {
  24898. var $refs = _this2.$refs;
  24899. var targetElem = $refs.filename || $refs.sheetname || $refs.confirmBtn;
  24900. if (targetElem) {
  24901. targetElem.focus();
  24902. }
  24903. });
  24904. this.checkStatus();
  24905. },
  24906. getExportOption: function getExportOption() {
  24907. var checkedAll = this.checkedAll,
  24908. storeData = this.storeData,
  24909. defaultOptions = this.defaultOptions,
  24910. supportMerge = this.supportMerge;
  24911. var hasMerge = storeData.hasMerge,
  24912. columns = storeData.columns;
  24913. var expColumns = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.searchTree(columns, function (column) {
  24914. return column.checked;
  24915. }, {
  24916. children: 'children',
  24917. mapChildren: 'childNodes',
  24918. original: true
  24919. });
  24920. return Object.assign({}, defaultOptions, {
  24921. columns: expColumns,
  24922. isMerge: hasMerge && supportMerge && checkedAll ? defaultOptions.isMerge : false
  24923. });
  24924. },
  24925. cancelEvent: function cancelEvent() {
  24926. this.storeData.visible = false;
  24927. },
  24928. confirmEvent: function confirmEvent(evnt) {
  24929. if (this.storeData.isPrint) {
  24930. this.printEvent(evnt);
  24931. } else {
  24932. this.exportEvent(evnt);
  24933. }
  24934. },
  24935. printEvent: function printEvent() {
  24936. var $xetable = this.$parent;
  24937. this.storeData.visible = false;
  24938. $xetable.print(Object.assign({}, $xetable.printOpts, this.getExportOption()));
  24939. },
  24940. exportEvent: function exportEvent() {
  24941. var _this3 = this;
  24942. var $xetable = this.$parent;
  24943. this.loading = true;
  24944. $xetable.exportData(Object.assign({}, $xetable.exportOpts, this.getExportOption())).then(function () {
  24945. _this3.loading = false;
  24946. _this3.storeData.visible = false;
  24947. }).catch(function () {
  24948. _this3.loading = false;
  24949. });
  24950. }
  24951. }
  24952. });
  24953. // CONCATENATED MODULE: ./packages/radio/src/radio.js
  24954. /* harmony default export */ var src_radio = ({
  24955. name: 'VxeRadio',
  24956. mixins: [size],
  24957. props: {
  24958. value: [String, Number, Boolean],
  24959. label: [String, Number, Boolean],
  24960. title: [String, Number],
  24961. content: [String, Number],
  24962. disabled: Boolean,
  24963. name: String,
  24964. strict: {
  24965. type: Boolean,
  24966. default: function _default() {
  24967. return src_conf.radio.strict;
  24968. }
  24969. },
  24970. size: {
  24971. type: String,
  24972. default: function _default() {
  24973. return src_conf.radio.size || src_conf.size;
  24974. }
  24975. }
  24976. },
  24977. inject: {
  24978. $xeradiogroup: {
  24979. default: null
  24980. },
  24981. $xeform: {
  24982. default: null
  24983. },
  24984. $xeformiteminfo: {
  24985. default: null
  24986. }
  24987. },
  24988. computed: {
  24989. isDisabled: function isDisabled() {
  24990. var $xeradiogroup = this.$xeradiogroup;
  24991. return this.disabled || $xeradiogroup && $xeradiogroup.disabled;
  24992. },
  24993. isStrict: function isStrict() {
  24994. var $xeradiogroup = this.$xeradiogroup;
  24995. return $xeradiogroup ? $xeradiogroup.strict : this.strict;
  24996. },
  24997. isChecked: function isChecked() {
  24998. return this.$xeradiogroup ? this.$xeradiogroup.value === this.label : this.value === this.label;
  24999. }
  25000. },
  25001. render: function render(h) {
  25002. var _ref;
  25003. var $scopedSlots = this.$scopedSlots,
  25004. $xeradiogroup = this.$xeradiogroup,
  25005. isDisabled = this.isDisabled,
  25006. isChecked = this.isChecked,
  25007. title = this.title,
  25008. vSize = this.vSize,
  25009. name = this.name,
  25010. content = this.content;
  25011. var attrs = {};
  25012. if (title) {
  25013. attrs.title = title;
  25014. }
  25015. return h('label', {
  25016. class: ['vxe-radio', (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, 'is--checked', isChecked), _defineProperty(_ref, 'is--disabled', isDisabled), _ref)],
  25017. attrs: attrs
  25018. }, [h('input', {
  25019. class: 'vxe-radio--input',
  25020. attrs: {
  25021. type: 'radio',
  25022. name: $xeradiogroup ? $xeradiogroup.name : name,
  25023. disabled: isDisabled
  25024. },
  25025. domProps: {
  25026. checked: isChecked
  25027. },
  25028. on: {
  25029. change: this.changeEvent,
  25030. click: this.clickEvent
  25031. }
  25032. }), h('span', {
  25033. class: ['vxe-radio--icon', isChecked ? 'vxe-icon-radio-checked' : 'vxe-icon-radio-unchecked']
  25034. }), h('span', {
  25035. class: 'vxe-radio--label'
  25036. }, $scopedSlots.default ? $scopedSlots.default.call(this, {}) : [getFuncText(content)])]);
  25037. },
  25038. methods: {
  25039. handleValue: function handleValue(label, evnt) {
  25040. var $xeradiogroup = this.$xeradiogroup;
  25041. var params = {
  25042. label: label,
  25043. $event: evnt
  25044. };
  25045. if ($xeradiogroup) {
  25046. $xeradiogroup.handleChecked(params, evnt);
  25047. } else {
  25048. this.$emit('input', label);
  25049. this.$emit('change', params); // 自动更新校验状态
  25050. if (this.$xeform && this.$xeformiteminfo) {
  25051. this.$xeform.triggerItemEvent(evnt, this.$xeformiteminfo.itemConfig.field, label);
  25052. }
  25053. }
  25054. },
  25055. changeEvent: function changeEvent(evnt) {
  25056. var isDisabled = this.isDisabled;
  25057. if (!isDisabled) {
  25058. this.handleValue(this.label, evnt);
  25059. }
  25060. },
  25061. clickEvent: function clickEvent(evnt) {
  25062. var $xeradiogroup = this.$xeradiogroup,
  25063. isDisabled = this.isDisabled,
  25064. isStrict = this.isStrict;
  25065. if (!isDisabled && !isStrict) {
  25066. if (this.label === ($xeradiogroup ? $xeradiogroup.value : this.value)) {
  25067. this.handleValue(null, evnt);
  25068. }
  25069. }
  25070. }
  25071. }
  25072. });
  25073. // CONCATENATED MODULE: ./packages/export/src/import-panel.js
  25074. /* harmony default export */ var import_panel = ({
  25075. name: 'VxeImportPanel',
  25076. props: {
  25077. defaultOptions: Object,
  25078. storeData: Object
  25079. },
  25080. components: {
  25081. VxeModal: modal,
  25082. VxeRadio: src_radio
  25083. },
  25084. data: function data() {
  25085. return {
  25086. loading: false
  25087. };
  25088. },
  25089. computed: {
  25090. vSize: function vSize() {
  25091. return this.size || this.$parent.size || this.$parent.vSize;
  25092. },
  25093. selectName: function selectName() {
  25094. return "".concat(this.storeData.filename, ".").concat(this.storeData.type);
  25095. },
  25096. hasFile: function hasFile() {
  25097. return this.storeData.file && this.storeData.type;
  25098. },
  25099. parseTypeLabel: function parseTypeLabel() {
  25100. var storeData = this.storeData;
  25101. var type = storeData.type,
  25102. typeList = storeData.typeList;
  25103. if (type) {
  25104. var selectItem = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.find(typeList, function (item) {
  25105. return type === item.value;
  25106. });
  25107. return selectItem ? src_conf.i18n(selectItem.label) : '*.*';
  25108. }
  25109. return "*.".concat(typeList.map(function (item) {
  25110. return item.value;
  25111. }).join(', *.'));
  25112. }
  25113. },
  25114. render: function render(h) {
  25115. var hasFile = this.hasFile,
  25116. parseTypeLabel = this.parseTypeLabel,
  25117. defaultOptions = this.defaultOptions,
  25118. storeData = this.storeData,
  25119. selectName = this.selectName;
  25120. return h('vxe-modal', {
  25121. res: 'modal',
  25122. props: {
  25123. value: storeData.visible,
  25124. title: src_conf.i18n('vxe.import.impTitle'),
  25125. width: 440,
  25126. mask: true,
  25127. lockView: true,
  25128. showFooter: false,
  25129. escClosable: true,
  25130. maskClosable: true,
  25131. loading: this.loading
  25132. },
  25133. on: {
  25134. input: function input(value) {
  25135. storeData.visible = value;
  25136. },
  25137. show: this.showEvent
  25138. }
  25139. }, [h('div', {
  25140. class: 'vxe-export--panel'
  25141. }, [h('table', {
  25142. attrs: {
  25143. cellspacing: 0,
  25144. cellpadding: 0,
  25145. border: 0
  25146. }
  25147. }, [h('tbody', [h('tr', [h('td', src_conf.i18n('vxe.import.impFile')), h('td', [hasFile ? h('div', {
  25148. class: 'vxe-import-selected--file',
  25149. attrs: {
  25150. title: selectName
  25151. }
  25152. }, [h('span', selectName), h('i', {
  25153. class: src_conf.icon.INPUT_CLEAR,
  25154. on: {
  25155. click: this.clearFileEvent
  25156. }
  25157. })]) : h('button', {
  25158. ref: 'fileBtn',
  25159. class: 'vxe-import-select--file',
  25160. attrs: {
  25161. type: 'button'
  25162. },
  25163. on: {
  25164. click: this.selectFileEvent
  25165. }
  25166. }, src_conf.i18n('vxe.import.impSelect'))])]), h('tr', [h('td', src_conf.i18n('vxe.import.impType')), h('td', parseTypeLabel)]), h('tr', [h('td', src_conf.i18n('vxe.import.impOpts')), h('td', [h('vxe-radio-group', {
  25167. props: {
  25168. value: defaultOptions.mode
  25169. },
  25170. on: {
  25171. input: function input(value) {
  25172. defaultOptions.mode = value;
  25173. }
  25174. }
  25175. }, storeData.modeList.map(function (item) {
  25176. return h('vxe-radio', {
  25177. props: {
  25178. label: item.value
  25179. }
  25180. }, src_conf.i18n(item.label));
  25181. }))])])])]), h('div', {
  25182. class: 'vxe-export--panel-btns'
  25183. }, [h('vxe-button', {
  25184. on: {
  25185. click: this.cancelEvent
  25186. }
  25187. }, src_conf.i18n('vxe.import.impCancel')), h('vxe-button', {
  25188. props: {
  25189. status: 'primary',
  25190. disabled: !hasFile
  25191. },
  25192. on: {
  25193. click: this.importEvent
  25194. }
  25195. }, src_conf.i18n('vxe.import.impConfirm'))])])]);
  25196. },
  25197. methods: {
  25198. clearFileEvent: function clearFileEvent() {
  25199. Object.assign(this.storeData, {
  25200. filename: '',
  25201. sheetName: '',
  25202. type: ''
  25203. });
  25204. },
  25205. selectFileEvent: function selectFileEvent() {
  25206. var _this = this;
  25207. var $xetable = this.$parent;
  25208. $xetable.readFile(this.defaultOptions).then(function (params) {
  25209. var file = params.file;
  25210. Object.assign(_this.storeData, utils.parseFile(file), {
  25211. file: file
  25212. });
  25213. }).catch(function (e) {
  25214. return e;
  25215. });
  25216. },
  25217. showEvent: function showEvent() {
  25218. var _this2 = this;
  25219. this.$nextTick(function () {
  25220. var $refs = _this2.$refs;
  25221. var targetElem = $refs.fileBtn;
  25222. if (targetElem) {
  25223. targetElem.focus();
  25224. }
  25225. });
  25226. },
  25227. cancelEvent: function cancelEvent() {
  25228. this.storeData.visible = false;
  25229. },
  25230. importEvent: function importEvent() {
  25231. var _this3 = this;
  25232. var $xetable = this.$parent;
  25233. this.loading = true;
  25234. $xetable.importByFile(this.storeData.file, Object.assign({}, $xetable.importOpts, this.defaultOptions)).then(function () {
  25235. _this3.loading = false;
  25236. _this3.storeData.visible = false;
  25237. }).catch(function () {
  25238. _this3.loading = false;
  25239. });
  25240. }
  25241. }
  25242. });
  25243. // EXTERNAL MODULE: ./node_modules/core-js/modules/web.url.js
  25244. var web_url = __webpack_require__("2b3d");
  25245. // EXTERNAL MODULE: ./node_modules/core-js/modules/web.url-search-params.js
  25246. var web_url_search_params = __webpack_require__("9861");
  25247. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.repeat.js
  25248. var es_string_repeat = __webpack_require__("38cf");
  25249. // CONCATENATED MODULE: ./packages/export/src/mixin.js
  25250. var mixin_formatText = utils.formatText; // 默认导出或打印的 HTML 样式
  25251. 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}';
  25252. var htmlCellElem; // 导入
  25253. var fileForm;
  25254. var fileInput; // 打印
  25255. var printFrame;
  25256. var csvBOM = "\uFEFF";
  25257. var enterSymbol = '\r\n';
  25258. function createFrame() {
  25259. var frame = document.createElement('iframe');
  25260. frame.className = 'vxe-table--print-frame';
  25261. return frame;
  25262. }
  25263. function getExportBlobByContent(content, options) {
  25264. if (window.Blob) {
  25265. return new Blob([content], {
  25266. type: "text/".concat(options.type, ";charset=utf-8;")
  25267. });
  25268. }
  25269. return null;
  25270. }
  25271. function hasTreeChildren($xetable, row) {
  25272. var treeOpts = $xetable.treeOpts;
  25273. return row[treeOpts.children] && row[treeOpts.children].length > 0;
  25274. }
  25275. function getSeq($xetable, row, $rowIndex, column, $columnIndex) {
  25276. var seqOpts = $xetable.seqOpts;
  25277. var seqMethod = seqOpts.seqMethod || column.seqMethod;
  25278. if (seqMethod) {
  25279. return seqMethod({
  25280. row: row,
  25281. rowIndex: $xetable.getRowIndex(row),
  25282. $rowIndex: $rowIndex,
  25283. column: column,
  25284. columnIndex: $xetable.getColumnIndex(column),
  25285. $columnIndex: $columnIndex
  25286. });
  25287. }
  25288. return $xetable.getRowSeq(row);
  25289. }
  25290. function defaultFilterExportColumn(column) {
  25291. return column.property || ['seq', 'checkbox', 'radio'].indexOf(column.type) > -1;
  25292. }
  25293. function toTableBorder(border) {
  25294. if (border === true) {
  25295. return 'full';
  25296. }
  25297. if (border) {
  25298. return border;
  25299. }
  25300. return 'default';
  25301. }
  25302. function toBooleanValue(cellValue) {
  25303. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isBoolean(cellValue) ? cellValue ? 'TRUE' : 'FALSE' : cellValue;
  25304. }
  25305. function getLabelData($xetable, opts, columns, datas) {
  25306. var isAllExpand = opts.isAllExpand,
  25307. mode = opts.mode;
  25308. var treeConfig = $xetable.treeConfig,
  25309. treeOpts = $xetable.treeOpts,
  25310. radioOpts = $xetable.radioOpts,
  25311. checkboxOpts = $xetable.checkboxOpts;
  25312. if (!htmlCellElem) {
  25313. htmlCellElem = document.createElement('div');
  25314. }
  25315. if (treeConfig) {
  25316. // 如果是树表格只允许导出数据源
  25317. var rest = [];
  25318. var expandMaps = new Map();
  25319. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(datas, function (item, $rowIndex, items, path, parent, nodes) {
  25320. var row = item._row || item;
  25321. var parentRow = parent && parent._row ? parent._row : parent;
  25322. if (isAllExpand || !parentRow || expandMaps.has(parentRow) && $xetable.isTreeExpandByRow(parentRow)) {
  25323. var hasRowChild = hasTreeChildren($xetable, row);
  25324. var _item = {
  25325. _row: row,
  25326. _level: nodes.length - 1,
  25327. _hasChild: hasRowChild,
  25328. _expand: hasRowChild && $xetable.isTreeExpandByRow(row)
  25329. };
  25330. columns.forEach(function (column, $columnIndex) {
  25331. var cellValue = '';
  25332. var renderOpts = column.editRender || column.cellRender;
  25333. var exportLabelMethod = column.exportMethod;
  25334. if (!exportLabelMethod && renderOpts && renderOpts.name) {
  25335. var compConf = v_x_e_table.renderer.get(renderOpts.name);
  25336. if (compConf) {
  25337. exportLabelMethod = compConf.exportMethod || compConf.cellExportMethod;
  25338. }
  25339. }
  25340. if (exportLabelMethod) {
  25341. cellValue = exportLabelMethod({
  25342. $table: $xetable,
  25343. row: row,
  25344. column: column,
  25345. options: opts
  25346. });
  25347. } else {
  25348. switch (column.type) {
  25349. case 'seq':
  25350. cellValue = mode === 'all' ? path.map(function (num, i) {
  25351. return i % 2 === 0 ? Number(num) + 1 : '.';
  25352. }).join('') : getSeq($xetable, row, $rowIndex, column, $columnIndex);
  25353. break;
  25354. case 'checkbox':
  25355. cellValue = toBooleanValue($xetable.isCheckedByCheckboxRow(row));
  25356. _item._checkboxLabel = checkboxOpts.labelField ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, checkboxOpts.labelField) : '';
  25357. _item._checkboxDisabled = checkboxOpts.checkMethod && !checkboxOpts.checkMethod({
  25358. row: row
  25359. });
  25360. break;
  25361. case 'radio':
  25362. cellValue = toBooleanValue($xetable.isCheckedByRadioRow(row));
  25363. _item._radioLabel = radioOpts.labelField ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, radioOpts.labelField) : '';
  25364. _item._radioDisabled = radioOpts.checkMethod && !radioOpts.checkMethod({
  25365. row: row
  25366. });
  25367. break;
  25368. default:
  25369. if (opts.original) {
  25370. cellValue = utils.getCellValue(row, column);
  25371. } else {
  25372. cellValue = $xetable.getCellLabel(row, column);
  25373. if (column.type === 'html') {
  25374. htmlCellElem.innerHTML = cellValue;
  25375. cellValue = htmlCellElem.innerText.trim();
  25376. } else {
  25377. var cell = $xetable.getCell(row, column);
  25378. if (cell) {
  25379. cellValue = cell.innerText.trim();
  25380. }
  25381. }
  25382. }
  25383. }
  25384. }
  25385. _item[column.id] = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toValueString(cellValue);
  25386. });
  25387. expandMaps.set(row, 1);
  25388. rest.push(Object.assign(_item, row));
  25389. }
  25390. }, treeOpts);
  25391. return rest;
  25392. }
  25393. return datas.map(function (row, $rowIndex) {
  25394. var item = {
  25395. _row: row
  25396. };
  25397. columns.forEach(function (column, $columnIndex) {
  25398. var cellValue = '';
  25399. var renderOpts = column.editRender || column.cellRender;
  25400. var exportLabelMethod = column.exportMethod;
  25401. if (!exportLabelMethod && renderOpts && renderOpts.name) {
  25402. var compConf = v_x_e_table.renderer.get(renderOpts.name);
  25403. if (compConf) {
  25404. exportLabelMethod = compConf.exportMethod || compConf.cellExportMethod;
  25405. }
  25406. }
  25407. if (exportLabelMethod) {
  25408. cellValue = exportLabelMethod({
  25409. $table: $xetable,
  25410. row: row,
  25411. column: column,
  25412. options: opts
  25413. });
  25414. } else {
  25415. switch (column.type) {
  25416. case 'seq':
  25417. cellValue = mode === 'all' ? $rowIndex + 1 : getSeq($xetable, row, $rowIndex, column, $columnIndex);
  25418. break;
  25419. case 'checkbox':
  25420. cellValue = toBooleanValue($xetable.isCheckedByCheckboxRow(row));
  25421. item._checkboxLabel = checkboxOpts.labelField ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, checkboxOpts.labelField) : '';
  25422. item._checkboxDisabled = checkboxOpts.checkMethod && !checkboxOpts.checkMethod({
  25423. row: row
  25424. });
  25425. break;
  25426. case 'radio':
  25427. cellValue = toBooleanValue($xetable.isCheckedByRadioRow(row));
  25428. item._radioLabel = radioOpts.labelField ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, radioOpts.labelField) : '';
  25429. item._radioDisabled = radioOpts.checkMethod && !radioOpts.checkMethod({
  25430. row: row
  25431. });
  25432. break;
  25433. default:
  25434. if (opts.original) {
  25435. cellValue = utils.getCellValue(row, column);
  25436. } else {
  25437. cellValue = $xetable.getCellLabel(row, column);
  25438. if (column.type === 'html') {
  25439. htmlCellElem.innerHTML = cellValue;
  25440. cellValue = htmlCellElem.innerText.trim();
  25441. } else {
  25442. var cell = $xetable.getCell(row, column);
  25443. if (cell) {
  25444. cellValue = cell.innerText.trim();
  25445. }
  25446. }
  25447. }
  25448. }
  25449. }
  25450. item[column.id] = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toValueString(cellValue);
  25451. });
  25452. return item;
  25453. });
  25454. }
  25455. function getExportData($xetable, opts) {
  25456. var columns = opts.columns,
  25457. dataFilterMethod = opts.dataFilterMethod;
  25458. var datas = opts.data;
  25459. if (dataFilterMethod) {
  25460. datas = datas.filter(function (row, index) {
  25461. return dataFilterMethod({
  25462. row: row,
  25463. $rowIndex: index
  25464. });
  25465. });
  25466. }
  25467. return getLabelData($xetable, opts, columns, datas);
  25468. }
  25469. function getBooleanValue(cellValue) {
  25470. return cellValue === 'TRUE' || cellValue === 'true' || cellValue === true;
  25471. }
  25472. function getHeaderTitle(opts, column) {
  25473. return (opts.original ? column.property : column.getTitle()) || '';
  25474. }
  25475. function getFooterCellValue($xetable, opts, items, column) {
  25476. var renderOpts = column.editRender || column.cellRender;
  25477. var exportLabelMethod = column.footerExportMethod;
  25478. if (!exportLabelMethod && renderOpts && renderOpts.name) {
  25479. var compConf = v_x_e_table.renderer.get(renderOpts.name);
  25480. if (compConf) {
  25481. exportLabelMethod = compConf.footerExportMethod || compConf.footerCellExportMethod;
  25482. }
  25483. }
  25484. var _columnIndex = $xetable.getVTColumnIndex(column);
  25485. var cellValue = exportLabelMethod ? exportLabelMethod({
  25486. $table: $xetable,
  25487. items: items,
  25488. itemIndex: _columnIndex,
  25489. _columnIndex: _columnIndex,
  25490. column: column,
  25491. options: opts
  25492. }) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toValueString(items[_columnIndex]);
  25493. return cellValue;
  25494. }
  25495. function getFooterData(opts, footerTableData) {
  25496. var footerFilterMethod = opts.footerFilterMethod;
  25497. return footerFilterMethod ? footerTableData.filter(function (items, index) {
  25498. return footerFilterMethod({
  25499. items: items,
  25500. $rowIndex: index
  25501. });
  25502. }) : footerTableData;
  25503. }
  25504. function getCsvCellTypeLabel(column, cellValue) {
  25505. if (cellValue) {
  25506. if (column.type === 'seq') {
  25507. return "\t".concat(cellValue);
  25508. }
  25509. switch (column.cellType) {
  25510. case 'string':
  25511. if (!isNaN(cellValue)) {
  25512. return "\t".concat(cellValue);
  25513. }
  25514. break;
  25515. case 'number':
  25516. break;
  25517. default:
  25518. if (cellValue.length >= 12 && !isNaN(cellValue)) {
  25519. return "\t".concat(cellValue);
  25520. }
  25521. break;
  25522. }
  25523. }
  25524. return cellValue;
  25525. }
  25526. function toTxtCellLabel(val) {
  25527. if (/[",\s\n]/.test(val)) {
  25528. return "\"".concat(val.replace(/"/g, '""'), "\"");
  25529. }
  25530. return val;
  25531. }
  25532. function toCsv($xetable, opts, columns, datas) {
  25533. var content = csvBOM;
  25534. if (opts.isHeader) {
  25535. content += columns.map(function (column) {
  25536. return toTxtCellLabel(getHeaderTitle(opts, column));
  25537. }).join(',') + enterSymbol;
  25538. }
  25539. datas.forEach(function (row) {
  25540. content += columns.map(function (column) {
  25541. return toTxtCellLabel(getCsvCellTypeLabel(column, row[column.id]));
  25542. }).join(',') + enterSymbol;
  25543. });
  25544. if (opts.isFooter) {
  25545. var footerTableData = $xetable.footerTableData;
  25546. var footers = getFooterData(opts, footerTableData);
  25547. footers.forEach(function (rows) {
  25548. content += columns.map(function (column) {
  25549. return toTxtCellLabel(getFooterCellValue($xetable, opts, rows, column));
  25550. }).join(',') + enterSymbol;
  25551. });
  25552. }
  25553. return content;
  25554. }
  25555. function toTxt($xetable, opts, columns, datas) {
  25556. var content = '';
  25557. if (opts.isHeader) {
  25558. content += columns.map(function (column) {
  25559. return toTxtCellLabel(getHeaderTitle(opts, column));
  25560. }).join('\t') + enterSymbol;
  25561. }
  25562. datas.forEach(function (row) {
  25563. content += columns.map(function (column) {
  25564. return toTxtCellLabel(row[column.id]);
  25565. }).join('\t') + enterSymbol;
  25566. });
  25567. if (opts.isFooter) {
  25568. var footerTableData = $xetable.footerTableData;
  25569. var footers = getFooterData(opts, footerTableData);
  25570. footers.forEach(function (rows) {
  25571. content += columns.map(function (column) {
  25572. return toTxtCellLabel(getFooterCellValue($xetable, opts, rows, column));
  25573. }).join(',') + enterSymbol;
  25574. });
  25575. }
  25576. return content;
  25577. }
  25578. function mixin_hasEllipsis($xetable, column, property, allColumnOverflow) {
  25579. var columnOverflow = column[property];
  25580. 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;
  25581. var showEllipsis = headOverflow === 'ellipsis';
  25582. var showTitle = headOverflow === 'title';
  25583. var showTooltip = headOverflow === true || headOverflow === 'tooltip';
  25584. var isEllipsis = showTitle || showTooltip || showEllipsis; // 虚拟滚动不支持动态高度
  25585. if (($xetable.scrollXLoad || $xetable.scrollYLoad) && !isEllipsis) {
  25586. isEllipsis = true;
  25587. }
  25588. return isEllipsis;
  25589. }
  25590. function createHtmlPage(opts, content) {
  25591. var style = opts.style;
  25592. 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('');
  25593. }
  25594. function toHtml($xetable, opts, columns, datas) {
  25595. var id = $xetable.id,
  25596. border = $xetable.border,
  25597. treeConfig = $xetable.treeConfig,
  25598. treeOpts = $xetable.treeOpts,
  25599. isAllSelected = $xetable.isAllSelected,
  25600. isIndeterminate = $xetable.isIndeterminate,
  25601. allHeaderAlign = $xetable.headerAlign,
  25602. allAlign = $xetable.align,
  25603. allFooterAlign = $xetable.footerAlign,
  25604. allColumnOverflow = $xetable.showOverflow,
  25605. allColumnHeaderOverflow = $xetable.showHeaderOverflow,
  25606. mergeList = $xetable.mergeList;
  25607. var isPrint = opts.print,
  25608. isHeader = opts.isHeader,
  25609. isFooter = opts.isFooter,
  25610. isColgroup = opts.isColgroup,
  25611. isMerge = opts.isMerge,
  25612. colgroups = opts.colgroups,
  25613. original = opts.original;
  25614. var allCls = 'check-all';
  25615. var clss = ['vxe-table', "border--".concat(toTableBorder(border)), isPrint ? 'is--print' : '', isHeader ? 'is--header' : ''].filter(function (cls) {
  25616. return cls;
  25617. });
  25618. var tables = ["<table class=\"".concat(clss.join(' '), "\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"), "<colgroup>".concat(columns.map(function (column) {
  25619. return "<col style=\"width:".concat(column.renderWidth, "px\">");
  25620. }).join(''), "</colgroup>")];
  25621. if (isHeader) {
  25622. tables.push('<thead>');
  25623. if (isColgroup && !original) {
  25624. colgroups.forEach(function (cols) {
  25625. tables.push("<tr>".concat(cols.map(function (column) {
  25626. var headAlign = column.headerAlign || column.align || allHeaderAlign || allAlign;
  25627. var classNames = mixin_hasEllipsis($xetable, column, 'showHeaderOverflow', allColumnHeaderOverflow) ? ['col--ellipsis'] : [];
  25628. var cellTitle = getHeaderTitle(opts, column);
  25629. var childWidth = 0;
  25630. var countChild = 0;
  25631. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree([column], function (item) {
  25632. if (!item.childNodes || !column.childNodes.length) {
  25633. countChild++;
  25634. }
  25635. childWidth += item.renderWidth;
  25636. }, {
  25637. children: 'childNodes'
  25638. });
  25639. var cellWidth = childWidth - countChild;
  25640. if (headAlign) {
  25641. classNames.push("col--".concat(headAlign));
  25642. }
  25643. if (column.type === 'checkbox') {
  25644. 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>");
  25645. }
  25646. 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>");
  25647. }).join(''), "</tr>"));
  25648. });
  25649. } else {
  25650. tables.push("<tr>".concat(columns.map(function (column) {
  25651. var headAlign = column.headerAlign || column.align || allHeaderAlign || allAlign;
  25652. var classNames = mixin_hasEllipsis($xetable, column, 'showHeaderOverflow', allColumnHeaderOverflow) ? ['col--ellipsis'] : [];
  25653. var cellTitle = getHeaderTitle(opts, column);
  25654. if (headAlign) {
  25655. classNames.push("col--".concat(headAlign));
  25656. }
  25657. if (column.type === 'checkbox') {
  25658. 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>");
  25659. }
  25660. 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>");
  25661. }).join(''), "</tr>"));
  25662. }
  25663. tables.push('</thead>');
  25664. }
  25665. if (datas.length) {
  25666. tables.push('<tbody>');
  25667. if (treeConfig) {
  25668. datas.forEach(function (item) {
  25669. tables.push('<tr>' + columns.map(function (column) {
  25670. var cellAlign = column.align || allAlign;
  25671. var classNames = mixin_hasEllipsis($xetable, column, 'showOverflow', allColumnOverflow) ? ['col--ellipsis'] : [];
  25672. var cellValue = item[column.id];
  25673. if (cellAlign) {
  25674. classNames.push("col--".concat(cellAlign));
  25675. }
  25676. if (column.treeNode) {
  25677. var treeIcon = '';
  25678. if (item._hasChild) {
  25679. treeIcon = "<i class=\"".concat(item._expand ? 'vxe-table--tree-fold-icon' : 'vxe-table--tree-unfold-icon', "\"></i>");
  25680. }
  25681. classNames.push('vxe-table--tree-node');
  25682. if (column.type === 'radio') {
  25683. 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>");
  25684. } else if (column.type === 'checkbox') {
  25685. 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>");
  25686. }
  25687. 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>");
  25688. }
  25689. if (column.type === 'radio') {
  25690. 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>");
  25691. } else if (column.type === 'checkbox') {
  25692. 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>");
  25693. }
  25694. 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>");
  25695. }).join('') + '</tr>');
  25696. });
  25697. } else {
  25698. datas.forEach(function (item) {
  25699. tables.push('<tr>' + columns.map(function (column) {
  25700. var cellAlign = column.align || allAlign;
  25701. var classNames = mixin_hasEllipsis($xetable, column, 'showOverflow', allColumnOverflow) ? ['col--ellipsis'] : [];
  25702. var cellValue = item[column.id];
  25703. var rowSpan = 1;
  25704. var colSpan = 1;
  25705. if (isMerge && mergeList.length) {
  25706. var _rowIndex = $xetable.getVTRowIndex(item._row);
  25707. var _columnIndex = $xetable.getVTColumnIndex(column);
  25708. var spanRest = mergeBodyMethod(mergeList, _rowIndex, _columnIndex);
  25709. if (spanRest) {
  25710. var rowspan = spanRest.rowspan,
  25711. colspan = spanRest.colspan;
  25712. if (!rowspan || !colspan) {
  25713. return '';
  25714. }
  25715. if (rowspan > 1) {
  25716. rowSpan = rowspan;
  25717. }
  25718. if (colspan > 1) {
  25719. colSpan = colspan;
  25720. }
  25721. }
  25722. }
  25723. if (cellAlign) {
  25724. classNames.push("col--".concat(cellAlign));
  25725. }
  25726. if (column.type === 'radio') {
  25727. 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>");
  25728. } else if (column.type === 'checkbox') {
  25729. 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>");
  25730. }
  25731. 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>");
  25732. }).join('') + '</tr>');
  25733. });
  25734. }
  25735. tables.push('</tbody>');
  25736. }
  25737. if (isFooter) {
  25738. var footerTableData = $xetable.footerTableData;
  25739. var footers = getFooterData(opts, footerTableData);
  25740. if (footers.length) {
  25741. tables.push('<tfoot>');
  25742. footers.forEach(function (rows) {
  25743. tables.push("<tr>".concat(columns.map(function (column) {
  25744. var footAlign = column.footerAlign || column.align || allFooterAlign || allAlign;
  25745. var classNames = mixin_hasEllipsis($xetable, column, 'showOverflow', allColumnOverflow) ? ['col--ellipsis'] : [];
  25746. var cellValue = getFooterCellValue($xetable, opts, rows, column);
  25747. if (footAlign) {
  25748. classNames.push("col--".concat(footAlign));
  25749. }
  25750. 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>");
  25751. }).join(''), "</tr>"));
  25752. });
  25753. tables.push('</tfoot>');
  25754. }
  25755. } // 是否半选状态
  25756. var script = !isAllSelected && isIndeterminate ? "<script>(function(){var a=document.querySelector(\".".concat(allCls, "\");if(a){a.indeterminate=true}})()</script>") : '';
  25757. tables.push('</table>', script);
  25758. return isPrint ? tables.join('') : createHtmlPage(opts, tables.join(''));
  25759. }
  25760. function toXML($xetable, opts, columns, datas) {
  25761. 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) {
  25762. return "<Column ss:Width=\"".concat(column.renderWidth, "\"/>");
  25763. }).join('')].join('');
  25764. if (opts.isHeader) {
  25765. xml += "<Row>".concat(columns.map(function (column) {
  25766. return "<Cell><Data ss:Type=\"String\">".concat(getHeaderTitle(opts, column), "</Data></Cell>");
  25767. }).join(''), "</Row>");
  25768. }
  25769. datas.forEach(function (row) {
  25770. xml += '<Row>' + columns.map(function (column) {
  25771. return "<Cell><Data ss:Type=\"String\">".concat(row[column.id], "</Data></Cell>");
  25772. }).join('') + '</Row>';
  25773. });
  25774. if (opts.isFooter) {
  25775. var footerTableData = $xetable.footerTableData;
  25776. var footers = getFooterData(opts, footerTableData);
  25777. footers.forEach(function (rows) {
  25778. xml += "<Row>".concat(columns.map(function (column) {
  25779. return "<Cell><Data ss:Type=\"String\">".concat(getFooterCellValue($xetable, opts, rows, column), "</Data></Cell>");
  25780. }).join(''), "</Row>");
  25781. });
  25782. }
  25783. return "".concat(xml, "</Table></Worksheet></Workbook>");
  25784. }
  25785. function getContent($xetable, opts, columns, datas) {
  25786. if (columns.length) {
  25787. switch (opts.type) {
  25788. case 'csv':
  25789. return toCsv($xetable, opts, columns, datas);
  25790. case 'txt':
  25791. return toTxt($xetable, opts, columns, datas);
  25792. case 'html':
  25793. return toHtml($xetable, opts, columns, datas);
  25794. case 'xml':
  25795. return toXML($xetable, opts, columns, datas);
  25796. }
  25797. }
  25798. return '';
  25799. }
  25800. /**
  25801. * 保存文件到本地
  25802. * @param {*} options 参数
  25803. */
  25804. function saveLocalFile(options) {
  25805. var filename = options.filename,
  25806. type = options.type,
  25807. content = options.content;
  25808. var name = "".concat(filename, ".").concat(type);
  25809. if (window.Blob) {
  25810. var blob = content instanceof Blob ? content : getExportBlobByContent(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toValueString(content), options);
  25811. if (navigator.msSaveBlob) {
  25812. navigator.msSaveBlob(blob, name);
  25813. } else {
  25814. var url = URL.createObjectURL(blob);
  25815. var linkElem = document.createElement('a');
  25816. linkElem.target = '_blank';
  25817. linkElem.download = name;
  25818. linkElem.href = url;
  25819. document.body.appendChild(linkElem);
  25820. linkElem.click();
  25821. document.body.removeChild(linkElem);
  25822. requestAnimationFrame(function () {
  25823. if (linkElem.parentNode) {
  25824. linkElem.parentNode.removeChild(linkElem);
  25825. }
  25826. URL.revokeObjectURL(url);
  25827. });
  25828. }
  25829. return Promise.resolve();
  25830. }
  25831. return Promise.reject(new Error(getLog('vxe.error.notExp')));
  25832. }
  25833. function downloadFile($xetable, opts, content) {
  25834. var filename = opts.filename,
  25835. type = opts.type,
  25836. download = opts.download;
  25837. if (!download) {
  25838. var blob = getExportBlobByContent(content, opts);
  25839. return Promise.resolve({
  25840. type: type,
  25841. content: content,
  25842. blob: blob
  25843. });
  25844. }
  25845. saveLocalFile({
  25846. filename: filename,
  25847. type: type,
  25848. content: content
  25849. }).then(function () {
  25850. if (opts.message !== false) {
  25851. // 检测弹窗模块
  25852. if (false) {}
  25853. v_x_e_table.modal.message({
  25854. content: src_conf.i18n('vxe.table.expSuccess'),
  25855. status: 'success'
  25856. });
  25857. }
  25858. });
  25859. }
  25860. function clearColumnConvert(columns) {
  25861. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(columns, function (column) {
  25862. delete column._level;
  25863. delete column._colSpan;
  25864. delete column._rowSpan;
  25865. delete column._children;
  25866. delete column.childNodes;
  25867. }, {
  25868. children: 'children'
  25869. });
  25870. }
  25871. function handleExport($xetable, opts) {
  25872. var remote = opts.remote,
  25873. columns = opts.columns,
  25874. colgroups = opts.colgroups,
  25875. exportMethod = opts.exportMethod,
  25876. afterExportMethod = opts.afterExportMethod;
  25877. return new Promise(function (resolve) {
  25878. if (remote) {
  25879. var params = {
  25880. options: opts,
  25881. $table: $xetable,
  25882. $grid: $xetable.$xegrid
  25883. };
  25884. resolve(exportMethod ? exportMethod(params) : params);
  25885. } else {
  25886. var datas = getExportData($xetable, opts);
  25887. resolve($xetable.preventEvent(null, 'event.export', {
  25888. options: opts,
  25889. columns: columns,
  25890. colgroups: colgroups,
  25891. datas: datas
  25892. }, function () {
  25893. return downloadFile($xetable, opts, getContent($xetable, opts, columns, datas));
  25894. }));
  25895. }
  25896. }).then(function (params) {
  25897. clearColumnConvert(columns);
  25898. if (!opts.print) {
  25899. if (afterExportMethod) {
  25900. afterExportMethod({
  25901. status: true,
  25902. options: opts,
  25903. $table: $xetable,
  25904. $grid: $xetable.$xegrid
  25905. });
  25906. }
  25907. }
  25908. return Object.assign({
  25909. status: true
  25910. }, params);
  25911. }).catch(function () {
  25912. clearColumnConvert(columns);
  25913. if (!opts.print) {
  25914. if (afterExportMethod) {
  25915. afterExportMethod({
  25916. status: false,
  25917. options: opts,
  25918. $table: $xetable,
  25919. $grid: $xetable.$xegrid
  25920. });
  25921. }
  25922. }
  25923. var params = {
  25924. status: false
  25925. };
  25926. return Promise.reject(params);
  25927. });
  25928. }
  25929. function getElementsByTagName(elem, qualifiedName) {
  25930. return elem.getElementsByTagName(qualifiedName);
  25931. }
  25932. function getTxtCellKey(now) {
  25933. return "#".concat(now, "@").concat(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.uniqueId());
  25934. }
  25935. function replaceTxtCell(cell, vMaps) {
  25936. return cell.replace(/#\d+@\d+/g, function (key) {
  25937. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.hasOwnProp(vMaps, key) ? vMaps[key] : key;
  25938. });
  25939. }
  25940. function getTxtCellValue(val, vMaps) {
  25941. var rest = replaceTxtCell(val, vMaps);
  25942. return rest.replace(/^"+$/g, function (qVal) {
  25943. return '"'.repeat(Math.ceil(qVal.length / 2));
  25944. });
  25945. }
  25946. function parseCsvAndTxt(columns, content, cellSeparator) {
  25947. var list = content.split(enterSymbol);
  25948. var rows = [];
  25949. var fields = [];
  25950. if (list.length) {
  25951. var vMaps = {};
  25952. var now = Date.now();
  25953. list.forEach(function (rVal) {
  25954. if (rVal) {
  25955. var item = {};
  25956. rVal = rVal.replace(/("")|(\n)/g, function (text, dVal) {
  25957. var key = getTxtCellKey(now);
  25958. vMaps[key] = dVal ? '"' : '\n';
  25959. return key;
  25960. }).replace(/"(.*?)"/g, function (text, cVal) {
  25961. var key = getTxtCellKey(now);
  25962. vMaps[key] = replaceTxtCell(cVal, vMaps);
  25963. return key;
  25964. });
  25965. var cells = rVal.split(cellSeparator);
  25966. if (!fields.length) {
  25967. fields = cells.map(function (val) {
  25968. return getTxtCellValue(val.trim(), vMaps);
  25969. });
  25970. } else {
  25971. cells.forEach(function (val, colIndex) {
  25972. if (colIndex < fields.length) {
  25973. item[fields[colIndex]] = getTxtCellValue(val, vMaps);
  25974. }
  25975. });
  25976. rows.push(item);
  25977. }
  25978. }
  25979. });
  25980. }
  25981. return {
  25982. fields: fields,
  25983. rows: rows
  25984. };
  25985. }
  25986. function parseCsv(columns, content) {
  25987. return parseCsvAndTxt(columns, content, ',');
  25988. }
  25989. function parseTxt(columns, content) {
  25990. return parseCsvAndTxt(columns, content, '\t');
  25991. }
  25992. function parseHTML(columns, content) {
  25993. var domParser = new DOMParser();
  25994. var xmlDoc = domParser.parseFromString(content, 'text/html');
  25995. var bodyNodes = getElementsByTagName(xmlDoc, 'body');
  25996. var rows = [];
  25997. var fields = [];
  25998. if (bodyNodes.length) {
  25999. var tableNodes = getElementsByTagName(bodyNodes[0], 'table');
  26000. if (tableNodes.length) {
  26001. var theadNodes = getElementsByTagName(tableNodes[0], 'thead');
  26002. if (theadNodes.length) {
  26003. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.arrayEach(getElementsByTagName(theadNodes[0], 'tr'), function (rowNode) {
  26004. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.arrayEach(getElementsByTagName(rowNode, 'th'), function (cellNode) {
  26005. fields.push(cellNode.textContent);
  26006. });
  26007. });
  26008. var tbodyNodes = getElementsByTagName(tableNodes[0], 'tbody');
  26009. if (tbodyNodes.length) {
  26010. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.arrayEach(getElementsByTagName(tbodyNodes[0], 'tr'), function (rowNode) {
  26011. var item = {};
  26012. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.arrayEach(getElementsByTagName(rowNode, 'td'), function (cellNode, colIndex) {
  26013. if (fields[colIndex]) {
  26014. item[fields[colIndex]] = cellNode.textContent || '';
  26015. }
  26016. });
  26017. rows.push(item);
  26018. });
  26019. }
  26020. }
  26021. }
  26022. }
  26023. return {
  26024. fields: fields,
  26025. rows: rows
  26026. };
  26027. }
  26028. function parseXML(columns, content) {
  26029. var domParser = new DOMParser();
  26030. var xmlDoc = domParser.parseFromString(content, 'application/xml');
  26031. var sheetNodes = getElementsByTagName(xmlDoc, 'Worksheet');
  26032. var rows = [];
  26033. var fields = [];
  26034. if (sheetNodes.length) {
  26035. var tableNodes = getElementsByTagName(sheetNodes[0], 'Table');
  26036. if (tableNodes.length) {
  26037. var rowNodes = getElementsByTagName(tableNodes[0], 'Row');
  26038. if (rowNodes.length) {
  26039. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.arrayEach(getElementsByTagName(rowNodes[0], 'Cell'), function (cellNode) {
  26040. fields.push(cellNode.textContent);
  26041. });
  26042. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.arrayEach(rowNodes, function (rowNode, index) {
  26043. if (index) {
  26044. var item = {};
  26045. var cellNodes = getElementsByTagName(rowNode, 'Cell');
  26046. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.arrayEach(cellNodes, function (cellNode, colIndex) {
  26047. if (fields[colIndex]) {
  26048. item[fields[colIndex]] = cellNode.textContent;
  26049. }
  26050. });
  26051. rows.push(item);
  26052. }
  26053. });
  26054. }
  26055. }
  26056. }
  26057. return {
  26058. fields: fields,
  26059. rows: rows
  26060. };
  26061. }
  26062. /**
  26063. * 检查导入的列是否完整
  26064. * @param {Array} fields 字段名列表
  26065. * @param {Array} rows 数据列表
  26066. */
  26067. function checkImportData(columns, fields) {
  26068. var tableFields = [];
  26069. columns.forEach(function (column) {
  26070. var field = column.property;
  26071. if (field) {
  26072. tableFields.push(field);
  26073. }
  26074. });
  26075. return fields.some(function (field) {
  26076. return tableFields.indexOf(field) > -1;
  26077. });
  26078. }
  26079. function handleImport($xetable, content, opts) {
  26080. var tableFullColumn = $xetable.tableFullColumn,
  26081. _importResolve = $xetable._importResolve,
  26082. _importReject = $xetable._importReject;
  26083. var rest = {
  26084. fields: [],
  26085. rows: []
  26086. };
  26087. switch (opts.type) {
  26088. case 'csv':
  26089. rest = parseCsv(tableFullColumn, content);
  26090. break;
  26091. case 'txt':
  26092. rest = parseTxt(tableFullColumn, content);
  26093. break;
  26094. case 'html':
  26095. rest = parseHTML(tableFullColumn, content);
  26096. break;
  26097. case 'xml':
  26098. rest = parseXML(tableFullColumn, content);
  26099. break;
  26100. }
  26101. var _rest = rest,
  26102. fields = _rest.fields,
  26103. rows = _rest.rows;
  26104. var status = checkImportData(tableFullColumn, fields);
  26105. if (status) {
  26106. $xetable.createData(rows).then(function (data) {
  26107. var loadRest;
  26108. if (opts.mode === 'insert') {
  26109. loadRest = $xetable.insert(data);
  26110. } else {
  26111. loadRest = $xetable.reloadData(data);
  26112. }
  26113. if (opts.message !== false) {
  26114. // 检测弹窗模块
  26115. if (false) {}
  26116. v_x_e_table.modal.message({
  26117. content: src_conf.i18n('vxe.table.impSuccess', [rows.length]),
  26118. status: 'success'
  26119. });
  26120. }
  26121. return loadRest.then(function () {
  26122. if (_importResolve) {
  26123. _importResolve({
  26124. status: true
  26125. });
  26126. }
  26127. });
  26128. });
  26129. } else if (opts.message !== false) {
  26130. // 检测弹窗模块
  26131. if (false) {}
  26132. v_x_e_table.modal.message({
  26133. content: src_conf.i18n('vxe.error.impFields'),
  26134. status: 'error'
  26135. });
  26136. if (_importReject) {
  26137. _importReject({
  26138. status: false
  26139. });
  26140. }
  26141. }
  26142. }
  26143. function handleFileImport($xetable, file, opts) {
  26144. var importMethod = opts.importMethod,
  26145. afterImportMethod = opts.afterImportMethod;
  26146. var _UtilTools$parseFile = utils.parseFile(file),
  26147. type = _UtilTools$parseFile.type,
  26148. filename = _UtilTools$parseFile.filename; // 检查类型,如果为自定义导出,则不需要校验类型
  26149. if (!importMethod && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.includes(v_x_e_table.config.importTypes, type)) {
  26150. if (opts.message !== false) {
  26151. // 检测弹窗模块
  26152. if (false) {}
  26153. v_x_e_table.modal.message({
  26154. content: src_conf.i18n('vxe.error.notType', [type]),
  26155. status: 'error'
  26156. });
  26157. }
  26158. var params = {
  26159. status: false
  26160. };
  26161. return Promise.reject(params);
  26162. }
  26163. var rest = new Promise(function (resolve, reject) {
  26164. var _importResolve = function _importResolve(params) {
  26165. resolve(params);
  26166. $xetable._importResolve = null;
  26167. $xetable._importReject = null;
  26168. };
  26169. var _importReject = function _importReject(params) {
  26170. reject(params);
  26171. $xetable._importResolve = null;
  26172. $xetable._importReject = null;
  26173. };
  26174. $xetable._importResolve = _importResolve;
  26175. $xetable._importReject = _importReject;
  26176. if (window.FileReader) {
  26177. var options = Object.assign({
  26178. mode: 'insert'
  26179. }, opts, {
  26180. type: type,
  26181. filename: filename
  26182. });
  26183. if (options.remote) {
  26184. if (importMethod) {
  26185. Promise.resolve(importMethod({
  26186. file: file,
  26187. options: options,
  26188. $table: $xetable
  26189. })).then(function () {
  26190. _importResolve({
  26191. status: true
  26192. });
  26193. }).catch(function () {
  26194. _importResolve({
  26195. status: true
  26196. });
  26197. });
  26198. } else {
  26199. _importResolve({
  26200. status: true
  26201. });
  26202. }
  26203. } else {
  26204. $xetable.preventEvent(null, 'event.import', {
  26205. file: file,
  26206. options: options,
  26207. columns: $xetable.tableFullColumn
  26208. }, function () {
  26209. var reader = new FileReader();
  26210. reader.onerror = function () {
  26211. errLog('vxe.error.notType', [type]);
  26212. _importReject({
  26213. status: false
  26214. });
  26215. };
  26216. reader.onload = function (e) {
  26217. handleImport($xetable, e.target.result, options);
  26218. };
  26219. reader.readAsText(file, options.encoding || 'UTF-8');
  26220. });
  26221. }
  26222. } else {
  26223. // 不支持的浏览器
  26224. if (false) {}
  26225. _importResolve({
  26226. status: true
  26227. });
  26228. }
  26229. });
  26230. return rest.then(function () {
  26231. if (afterImportMethod) {
  26232. afterImportMethod({
  26233. status: true,
  26234. options: opts,
  26235. $table: $xetable
  26236. });
  26237. }
  26238. }).catch(function (e) {
  26239. if (afterImportMethod) {
  26240. afterImportMethod({
  26241. status: false,
  26242. options: opts,
  26243. $table: $xetable
  26244. });
  26245. }
  26246. return Promise.reject(e);
  26247. });
  26248. }
  26249. /**
  26250. * 读取本地文件
  26251. * @param {*} options 参数
  26252. */
  26253. function readLocalFile() {
  26254. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  26255. if (!fileForm) {
  26256. fileForm = document.createElement('form');
  26257. fileInput = document.createElement('input');
  26258. fileForm.className = 'vxe-table--file-form';
  26259. fileInput.name = 'file';
  26260. fileInput.type = 'file';
  26261. fileForm.appendChild(fileInput);
  26262. document.body.appendChild(fileForm);
  26263. }
  26264. return new Promise(function (resolve, reject) {
  26265. var types = options.types || [];
  26266. var isAllType = !types.length || types.some(function (type) {
  26267. return type === '*';
  26268. });
  26269. fileInput.multiple = !!options.multiple;
  26270. fileInput.accept = isAllType ? '' : ".".concat(types.join(', .'));
  26271. fileInput.onchange = function (evnt) {
  26272. var files = evnt.target.files;
  26273. var file = files[0];
  26274. var errType; // 校验类型
  26275. if (!isAllType) {
  26276. for (var fIndex = 0; fIndex < files.length; fIndex++) {
  26277. var _UtilTools$parseFile2 = utils.parseFile(files[fIndex]),
  26278. type = _UtilTools$parseFile2.type;
  26279. if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.includes(types, type)) {
  26280. errType = type;
  26281. break;
  26282. }
  26283. }
  26284. }
  26285. if (!errType) {
  26286. resolve({
  26287. status: true,
  26288. files: files,
  26289. file: file
  26290. });
  26291. } else {
  26292. if (options.message !== false) {
  26293. // 检测弹窗模块
  26294. if (false) {}
  26295. v_x_e_table.modal.message({
  26296. content: src_conf.i18n('vxe.error.notType', [errType]),
  26297. status: 'error'
  26298. });
  26299. }
  26300. var params = {
  26301. status: false,
  26302. files: files,
  26303. file: file
  26304. };
  26305. reject(params);
  26306. }
  26307. };
  26308. fileForm.reset();
  26309. fileInput.click();
  26310. });
  26311. }
  26312. function removePrintFrame() {
  26313. if (printFrame) {
  26314. if (printFrame.parentNode) {
  26315. try {
  26316. printFrame.contentDocument.write('');
  26317. } catch (e) {}
  26318. printFrame.parentNode.removeChild(printFrame);
  26319. }
  26320. printFrame = null;
  26321. }
  26322. }
  26323. function appendPrintFrame() {
  26324. if (!printFrame.parentNode) {
  26325. document.body.appendChild(printFrame);
  26326. }
  26327. }
  26328. function afterPrintEvent() {
  26329. requestAnimationFrame(removePrintFrame);
  26330. }
  26331. function handlePrint($xetable, opts, content) {
  26332. var beforePrintMethod = opts.beforePrintMethod;
  26333. if (beforePrintMethod) {
  26334. content = beforePrintMethod({
  26335. content: content,
  26336. options: opts,
  26337. $table: $xetable
  26338. }) || '';
  26339. }
  26340. content = createHtmlPage(opts, content);
  26341. var blob = getExportBlobByContent(content, opts);
  26342. if (browse.msie) {
  26343. removePrintFrame();
  26344. printFrame = createFrame();
  26345. appendPrintFrame();
  26346. printFrame.contentDocument.write(content);
  26347. printFrame.contentDocument.execCommand('print');
  26348. } else {
  26349. if (!printFrame) {
  26350. printFrame = createFrame();
  26351. printFrame.onload = function (evnt) {
  26352. if (evnt.target.src) {
  26353. evnt.target.contentWindow.onafterprint = afterPrintEvent;
  26354. evnt.target.contentWindow.print();
  26355. }
  26356. };
  26357. }
  26358. appendPrintFrame();
  26359. printFrame.src = URL.createObjectURL(blob);
  26360. }
  26361. }
  26362. function handleExportAndPrint($xetable, options, isPrint) {
  26363. var initStore = $xetable.initStore,
  26364. customOpts = $xetable.customOpts,
  26365. collectColumn = $xetable.collectColumn,
  26366. footerTableData = $xetable.footerTableData,
  26367. treeConfig = $xetable.treeConfig,
  26368. mergeList = $xetable.mergeList,
  26369. isGroup = $xetable.isGroup,
  26370. exportParams = $xetable.exportParams;
  26371. var selectRecords = $xetable.getCheckboxRecords();
  26372. var hasFooter = !!footerTableData.length;
  26373. var hasTree = treeConfig;
  26374. var hasMerge = !hasTree && mergeList.length;
  26375. var defOpts = Object.assign({
  26376. message: true,
  26377. isHeader: true
  26378. }, options);
  26379. var types = defOpts.types || v_x_e_table.config.exportTypes;
  26380. var modes = defOpts.modes;
  26381. var checkMethod = customOpts.checkMethod;
  26382. var exportColumns = collectColumn.slice(0);
  26383. var columns = defOpts.columns; // 处理类型
  26384. var typeList = types.map(function (value) {
  26385. return {
  26386. value: value,
  26387. label: "vxe.export.types.".concat(value)
  26388. };
  26389. });
  26390. var modeList = modes.map(function (value) {
  26391. return {
  26392. value: value,
  26393. label: "vxe.export.modes.".concat(value)
  26394. };
  26395. }); // 默认选中
  26396. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(exportColumns, function (column, index, items, path, parent) {
  26397. var isColGroup = column.children && column.children.length;
  26398. if (isColGroup || defaultFilterExportColumn(column)) {
  26399. column.checked = columns ? columns.some(function (item) {
  26400. if (isColumnInfo(item)) {
  26401. return column === item;
  26402. } else if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isString(item)) {
  26403. return column.field === item;
  26404. } else {
  26405. var colid = item.id || item.colId;
  26406. var type = item.type;
  26407. var field = item.property || item.field;
  26408. if (colid) {
  26409. return column.id === colid;
  26410. } else if (field && type) {
  26411. return column.property === field && column.type === type;
  26412. } else if (field) {
  26413. return column.property === field;
  26414. } else if (type) {
  26415. return column.type === type;
  26416. }
  26417. }
  26418. }) : column.visible;
  26419. column.halfChecked = false;
  26420. column.disabled = parent && parent.disabled || (checkMethod ? !checkMethod({
  26421. column: column
  26422. }) : false);
  26423. }
  26424. }); // 更新条件
  26425. Object.assign($xetable.exportStore, {
  26426. columns: exportColumns,
  26427. typeList: typeList,
  26428. modeList: modeList,
  26429. hasFooter: hasFooter,
  26430. hasMerge: hasMerge,
  26431. hasTree: hasTree,
  26432. isPrint: isPrint,
  26433. hasColgroup: isGroup,
  26434. visible: true
  26435. }); // 默认参数
  26436. if (!initStore.export) {
  26437. Object.assign(exportParams, {
  26438. mode: selectRecords.length ? 'selected' : 'current'
  26439. }, defOpts);
  26440. }
  26441. if (modes.indexOf(exportParams.mode) === -1) {
  26442. exportParams.mode = modes[0];
  26443. }
  26444. if (types.indexOf(exportParams.type) === -1) {
  26445. exportParams.type = types[0];
  26446. }
  26447. initStore.export = true;
  26448. return $xetable.$nextTick();
  26449. }
  26450. var mixin_getConvertColumns = function getConvertColumns(columns) {
  26451. var result = [];
  26452. columns.forEach(function (column) {
  26453. if (column.childNodes && column.childNodes.length) {
  26454. result.push(column);
  26455. result.push.apply(result, _toConsumableArray(getConvertColumns(column.childNodes)));
  26456. } else {
  26457. result.push(column);
  26458. }
  26459. });
  26460. return result;
  26461. };
  26462. var mixin_convertToRows = function convertToRows(originColumns) {
  26463. var maxLevel = 1;
  26464. var traverse = function traverse(column, parent) {
  26465. if (parent) {
  26466. column._level = parent._level + 1;
  26467. if (maxLevel < column._level) {
  26468. maxLevel = column._level;
  26469. }
  26470. }
  26471. if (column.childNodes && column.childNodes.length) {
  26472. var colSpan = 0;
  26473. column.childNodes.forEach(function (subColumn) {
  26474. traverse(subColumn, column);
  26475. colSpan += subColumn._colSpan;
  26476. });
  26477. column._colSpan = colSpan;
  26478. } else {
  26479. column._colSpan = 1;
  26480. }
  26481. };
  26482. originColumns.forEach(function (column) {
  26483. column._level = 1;
  26484. traverse(column);
  26485. });
  26486. var rows = [];
  26487. for (var i = 0; i < maxLevel; i++) {
  26488. rows.push([]);
  26489. }
  26490. var allColumns = mixin_getConvertColumns(originColumns);
  26491. allColumns.forEach(function (column) {
  26492. if (column.childNodes && column.childNodes.length) {
  26493. column._rowSpan = 1;
  26494. } else {
  26495. column._rowSpan = maxLevel - column._level + 1;
  26496. }
  26497. rows[column._level - 1].push(column);
  26498. });
  26499. return rows;
  26500. };
  26501. /* harmony default export */ var export_src_mixin = ({
  26502. methods: {
  26503. /**
  26504. * 导出文件,支持 csv/html/xml/txt
  26505. * 如果是树表格,则默认是导出所有节点
  26506. * 如果是启用了虚拟滚动,则只能导出数据源,可以配合 dataFilterMethod 函数自行转换数据
  26507. * @param {Object} options 参数
  26508. */
  26509. _exportData: function _exportData(options) {
  26510. var _this = this;
  26511. var $xegrid = this.$xegrid,
  26512. isGroup = this.isGroup,
  26513. tableGroupColumn = this.tableGroupColumn,
  26514. tableFullColumn = this.tableFullColumn,
  26515. afterFullData = this.afterFullData,
  26516. treeConfig = this.treeConfig,
  26517. treeOpts = this.treeOpts,
  26518. exportOpts = this.exportOpts;
  26519. var opts = Object.assign({
  26520. // filename: '',
  26521. // sheetName: '',
  26522. // original: false,
  26523. // message: false,
  26524. isHeader: true,
  26525. isFooter: true,
  26526. isColgroup: true,
  26527. isMerge: false,
  26528. isAllExpand: false,
  26529. download: true,
  26530. type: 'csv',
  26531. mode: 'current' // data: null,
  26532. // remote: false,
  26533. // dataFilterMethod: null,
  26534. // footerFilterMethod: null,
  26535. // exportMethod: null,
  26536. // columnFilterMethod: null,
  26537. // beforeExportMethod: null,
  26538. // afterExportMethod: null
  26539. }, exportOpts, {
  26540. print: false
  26541. }, options);
  26542. var type = opts.type,
  26543. mode = opts.mode,
  26544. columns = opts.columns,
  26545. original = opts.original,
  26546. beforeExportMethod = opts.beforeExportMethod;
  26547. var groups = [];
  26548. var customCols = columns && columns.length ? columns : null; // 如果设置源数据,则默认导出设置了字段的列
  26549. var columnFilterMethod = opts.columnFilterMethod;
  26550. if (!customCols && !columnFilterMethod) {
  26551. columnFilterMethod = original ? function (_ref) {
  26552. var column = _ref.column;
  26553. return column.property;
  26554. } : function (_ref2) {
  26555. var column = _ref2.column;
  26556. return defaultFilterExportColumn(column);
  26557. };
  26558. }
  26559. if (customCols) {
  26560. 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) {
  26561. var targetColumn;
  26562. if (item) {
  26563. if (isColumnInfo(item)) {
  26564. targetColumn = item;
  26565. } else if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isString(item)) {
  26566. targetColumn = _this.getColumnByField(item);
  26567. } else {
  26568. var colid = item.id || item.colId;
  26569. var _type = item.type;
  26570. var field = item.property || item.field;
  26571. if (colid) {
  26572. targetColumn = _this.getColumnById(colid);
  26573. } else if (field && _type) {
  26574. targetColumn = tableFullColumn.find(function (column) {
  26575. return column.property === field && column.type === _type;
  26576. });
  26577. } else if (field) {
  26578. targetColumn = _this.getColumnByField(field);
  26579. } else if (_type) {
  26580. targetColumn = tableFullColumn.find(function (column) {
  26581. return column.type === _type;
  26582. });
  26583. }
  26584. }
  26585. return targetColumn || {};
  26586. }
  26587. }, {
  26588. children: 'childNodes',
  26589. mapChildren: '_children'
  26590. }), function (column, index) {
  26591. return isColumnInfo(column) && (!columnFilterMethod || columnFilterMethod({
  26592. column: column,
  26593. $columnIndex: index
  26594. }));
  26595. }, {
  26596. children: '_children',
  26597. mapChildren: 'childNodes',
  26598. original: true
  26599. });
  26600. } else {
  26601. groups = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.searchTree(isGroup ? tableGroupColumn : tableFullColumn, function (column, index) {
  26602. return column.visible && (!columnFilterMethod || columnFilterMethod({
  26603. column: column,
  26604. $columnIndex: index
  26605. }));
  26606. }, {
  26607. children: 'children',
  26608. mapChildren: 'childNodes',
  26609. original: true
  26610. });
  26611. } // 获取所有列
  26612. var cols = [];
  26613. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(groups, function (column) {
  26614. var isColGroup = column.children && column.children.length;
  26615. if (!isColGroup) {
  26616. cols.push(column);
  26617. }
  26618. }, {
  26619. children: 'childNodes'
  26620. }); // 构建分组层级
  26621. opts.columns = cols;
  26622. opts.colgroups = mixin_convertToRows(groups);
  26623. if (!opts.filename) {
  26624. opts.filename = src_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')]);
  26625. }
  26626. if (!opts.sheetName) {
  26627. opts.sheetName = document.title;
  26628. } // 检查类型,如果为自定义导出,则不需要校验类型
  26629. 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)) {
  26630. if (false) {}
  26631. var params = {
  26632. status: false
  26633. };
  26634. return Promise.reject(params);
  26635. }
  26636. if (!opts.print) {
  26637. if (beforeExportMethod) {
  26638. beforeExportMethod({
  26639. options: opts,
  26640. $table: this,
  26641. $grid: $xegrid
  26642. });
  26643. }
  26644. }
  26645. if (!opts.data) {
  26646. opts.data = afterFullData;
  26647. if (mode === 'selected') {
  26648. var selectRecords = this.getCheckboxRecords();
  26649. if (['html', 'pdf'].indexOf(type) > -1 && treeConfig) {
  26650. opts.data = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.searchTree(this.getTableData().fullData, function (item) {
  26651. return selectRecords.indexOf(item) > -1;
  26652. }, Object.assign({}, treeOpts, {
  26653. data: '_row'
  26654. }));
  26655. } else {
  26656. opts.data = selectRecords;
  26657. }
  26658. } else if (mode === 'all') {
  26659. if (false) {}
  26660. if ($xegrid && !opts.remote) {
  26661. var _$xegrid$proxyOpts = $xegrid.proxyOpts,
  26662. beforeQueryAll = _$xegrid$proxyOpts.beforeQueryAll,
  26663. afterQueryAll = _$xegrid$proxyOpts.afterQueryAll,
  26664. _$xegrid$proxyOpts$aj = _$xegrid$proxyOpts.ajax,
  26665. ajax = _$xegrid$proxyOpts$aj === void 0 ? {} : _$xegrid$proxyOpts$aj,
  26666. _$xegrid$proxyOpts$pr = _$xegrid$proxyOpts.props,
  26667. props = _$xegrid$proxyOpts$pr === void 0 ? {} : _$xegrid$proxyOpts$pr;
  26668. var ajaxMethods = ajax.queryAll;
  26669. if (false) {}
  26670. if (ajaxMethods) {
  26671. var _params = {
  26672. $table: this,
  26673. $grid: $xegrid,
  26674. sort: $xegrid.sortData,
  26675. filters: $xegrid.filterData,
  26676. form: $xegrid.formData,
  26677. target: ajaxMethods,
  26678. options: opts
  26679. };
  26680. return Promise.resolve((beforeQueryAll || ajaxMethods)(_params)).catch(function (e) {
  26681. return e;
  26682. }).then(function (rest) {
  26683. opts.data = (props.list ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(rest, props.list) : rest) || [];
  26684. if (afterQueryAll) {
  26685. afterQueryAll(_params);
  26686. }
  26687. return handleExport(_this, opts);
  26688. });
  26689. }
  26690. }
  26691. }
  26692. }
  26693. return handleExport(this, opts);
  26694. },
  26695. _importByFile: function _importByFile(file, options) {
  26696. var opts = Object.assign({}, options);
  26697. var beforeImportMethod = opts.beforeImportMethod;
  26698. if (beforeImportMethod) {
  26699. beforeImportMethod({
  26700. options: opts,
  26701. $table: this
  26702. });
  26703. }
  26704. return handleFileImport(this, file, opts);
  26705. },
  26706. _importData: function _importData(options) {
  26707. var _this2 = this;
  26708. var opts = Object.assign({
  26709. types: v_x_e_table.config.importTypes // beforeImportMethod: null,
  26710. // afterImportMethod: null
  26711. }, this.importOpts, options);
  26712. var beforeImportMethod = opts.beforeImportMethod,
  26713. afterImportMethod = opts.afterImportMethod;
  26714. if (beforeImportMethod) {
  26715. beforeImportMethod({
  26716. options: opts,
  26717. $table: this
  26718. });
  26719. }
  26720. return readLocalFile(opts).catch(function (e) {
  26721. if (afterImportMethod) {
  26722. afterImportMethod({
  26723. status: false,
  26724. options: opts,
  26725. $table: _this2
  26726. });
  26727. }
  26728. return Promise.reject(e);
  26729. }).then(function (params) {
  26730. var file = params.file;
  26731. return handleFileImport(_this2, file, opts);
  26732. });
  26733. },
  26734. _saveFile: function _saveFile(options) {
  26735. return saveLocalFile(options);
  26736. },
  26737. _readFile: function _readFile(options) {
  26738. return readLocalFile(options);
  26739. },
  26740. _print: function _print(options) {
  26741. var _this3 = this;
  26742. var opts = Object.assign({
  26743. original: false // beforePrintMethod
  26744. }, this.printOpts, options, {
  26745. type: 'html',
  26746. download: false,
  26747. remote: false,
  26748. print: true
  26749. });
  26750. if (!opts.sheetName) {
  26751. opts.sheetName = document.title;
  26752. }
  26753. return new Promise(function (resolve) {
  26754. if (opts.content) {
  26755. resolve(handlePrint(_this3, opts, opts.content));
  26756. } else {
  26757. resolve(_this3.exportData(opts).then(function (_ref3) {
  26758. var content = _ref3.content;
  26759. return handlePrint(_this3, opts, content);
  26760. }));
  26761. }
  26762. });
  26763. },
  26764. _openImport: function _openImport(options) {
  26765. var defOpts = Object.assign({
  26766. mode: 'insert',
  26767. message: true,
  26768. types: v_x_e_table.config.importTypes
  26769. }, options, this.importOpts);
  26770. var types = defOpts.types;
  26771. var isTree = !!this.getTreeStatus();
  26772. if (isTree) {
  26773. if (defOpts.message) {
  26774. v_x_e_table.modal.message({
  26775. content: src_conf.i18n('vxe.error.treeNotImp'),
  26776. status: 'error'
  26777. });
  26778. }
  26779. return;
  26780. }
  26781. if (!this.importConfig) {
  26782. errLog('vxe.error.reqProp', ['import-config']);
  26783. } // 处理类型
  26784. var typeList = types.map(function (value) {
  26785. return {
  26786. value: value,
  26787. label: "vxe.export.types.".concat(value)
  26788. };
  26789. });
  26790. var modeList = defOpts.modes.map(function (value) {
  26791. return {
  26792. value: value,
  26793. label: "vxe.import.modes.".concat(value)
  26794. };
  26795. });
  26796. Object.assign(this.importStore, {
  26797. file: null,
  26798. type: '',
  26799. filename: '',
  26800. modeList: modeList,
  26801. typeList: typeList,
  26802. visible: true
  26803. });
  26804. Object.assign(this.importParams, defOpts);
  26805. this.initStore.import = true;
  26806. },
  26807. _openExport: function _openExport(options) {
  26808. var exportOpts = this.exportOpts;
  26809. if (false) {}
  26810. return handleExportAndPrint(this, Object.assign({}, exportOpts, options));
  26811. },
  26812. _openPrint: function _openPrint(options) {
  26813. var printOpts = this.printOpts;
  26814. if (false) {}
  26815. return handleExportAndPrint(this, Object.assign({}, printOpts, options), true);
  26816. }
  26817. }
  26818. });
  26819. // CONCATENATED MODULE: ./packages/export/index.js
  26820. function print(options) {
  26821. var opts = Object.assign({}, options, {
  26822. type: 'html'
  26823. });
  26824. handlePrint(null, opts, opts.content);
  26825. }
  26826. var Export = {
  26827. ExportPanel: export_panel,
  26828. ImportPanel: import_panel,
  26829. install: function install(Vue) {
  26830. v_x_e_table.reg('export');
  26831. v_x_e_table.saveFile = saveLocalFile;
  26832. v_x_e_table.readFile = readLocalFile;
  26833. v_x_e_table.print = print;
  26834. v_x_e_table.setup({
  26835. export: {
  26836. types: {
  26837. csv: 0,
  26838. html: 0,
  26839. xml: 0,
  26840. txt: 0
  26841. }
  26842. }
  26843. });
  26844. packages_table.mixins.push(export_src_mixin);
  26845. Vue.component(export_panel.name, export_panel);
  26846. Vue.component(import_panel.name, import_panel);
  26847. }
  26848. };
  26849. /* harmony default export */ var packages_export = (Export);
  26850. // CONCATENATED MODULE: ./packages/keyboard/src/mixin.js
  26851. function getTargetOffset(target, container) {
  26852. var offsetTop = 0;
  26853. var offsetLeft = 0;
  26854. var triggerCheckboxLabel = !browse.firefox && dom.hasClass(target, 'vxe-checkbox--label');
  26855. if (triggerCheckboxLabel) {
  26856. var checkboxLabelStyle = getComputedStyle(target);
  26857. offsetTop -= external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(checkboxLabelStyle.paddingTop);
  26858. offsetLeft -= external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(checkboxLabelStyle.paddingLeft);
  26859. }
  26860. while (target && target !== container) {
  26861. offsetTop += target.offsetTop;
  26862. offsetLeft += target.offsetLeft;
  26863. target = target.offsetParent;
  26864. if (triggerCheckboxLabel) {
  26865. var checkboxStyle = getComputedStyle(target);
  26866. offsetTop -= external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(checkboxStyle.paddingTop);
  26867. offsetLeft -= external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(checkboxStyle.paddingLeft);
  26868. }
  26869. }
  26870. return {
  26871. offsetTop: offsetTop,
  26872. offsetLeft: offsetLeft
  26873. };
  26874. }
  26875. function getCheckboxRangeRows(_vm, params, targetTrElem, moveRange) {
  26876. var countHeight = 0;
  26877. var rangeRows = [];
  26878. var isDown = moveRange > 0;
  26879. var moveSize = moveRange > 0 ? moveRange : Math.abs(moveRange) + targetTrElem.offsetHeight;
  26880. var afterFullData = _vm.afterFullData,
  26881. scrollYStore = _vm.scrollYStore,
  26882. scrollYLoad = _vm.scrollYLoad;
  26883. if (scrollYLoad) {
  26884. var _rowIndex = _vm.getVTRowIndex(params.row);
  26885. if (isDown) {
  26886. rangeRows = afterFullData.slice(_rowIndex, _rowIndex + Math.ceil(moveSize / scrollYStore.rowHeight));
  26887. } else {
  26888. rangeRows = afterFullData.slice(_rowIndex - Math.floor(moveSize / scrollYStore.rowHeight) + 1, _rowIndex + 1);
  26889. }
  26890. } else {
  26891. var siblingProp = isDown ? 'next' : 'previous';
  26892. while (targetTrElem && countHeight < moveSize) {
  26893. rangeRows.push(_vm.getRowNode(targetTrElem).item);
  26894. countHeight += targetTrElem.offsetHeight;
  26895. targetTrElem = targetTrElem["".concat(siblingProp, "ElementSibling")];
  26896. }
  26897. }
  26898. return rangeRows;
  26899. }
  26900. /* harmony default export */ var keyboard_src_mixin = ({
  26901. methods: {
  26902. // 处理 Tab 键移动
  26903. moveTabSelected: function moveTabSelected(args, isLeft, evnt) {
  26904. var _this = this;
  26905. var afterFullData = this.afterFullData,
  26906. visibleColumn = this.visibleColumn,
  26907. editConfig = this.editConfig,
  26908. editOpts = this.editOpts;
  26909. var targetRow;
  26910. var targetRowIndex;
  26911. var targetColumnIndex;
  26912. var params = Object.assign({}, args);
  26913. var _rowIndex = this.getVTRowIndex(params.row);
  26914. var _columnIndex = this.getVTColumnIndex(params.column);
  26915. evnt.preventDefault();
  26916. if (isLeft) {
  26917. // 向左
  26918. if (_columnIndex <= 0) {
  26919. // 如果已经是第一列,则移动到上一行
  26920. if (_rowIndex > 0) {
  26921. targetRowIndex = _rowIndex - 1;
  26922. targetRow = afterFullData[targetRowIndex];
  26923. targetColumnIndex = visibleColumn.length - 1;
  26924. }
  26925. } else {
  26926. targetColumnIndex = _columnIndex - 1;
  26927. }
  26928. } else {
  26929. if (_columnIndex >= visibleColumn.length - 1) {
  26930. // 如果已经是第一列,则移动到上一行
  26931. if (_rowIndex < afterFullData.length - 1) {
  26932. targetRowIndex = _rowIndex + 1;
  26933. targetRow = afterFullData[targetRowIndex];
  26934. targetColumnIndex = 0;
  26935. }
  26936. } else {
  26937. targetColumnIndex = _columnIndex + 1;
  26938. }
  26939. }
  26940. var targetColumn = visibleColumn[targetColumnIndex];
  26941. if (targetColumn) {
  26942. if (targetRow) {
  26943. params.rowIndex = targetRowIndex;
  26944. params.row = targetRow;
  26945. } else {
  26946. params.rowIndex = _rowIndex;
  26947. }
  26948. params.columnIndex = targetColumnIndex;
  26949. params.column = targetColumn;
  26950. params.cell = this.getCell(params.row, params.column);
  26951. if (editConfig) {
  26952. if (editOpts.trigger === 'click' || editOpts.trigger === 'dblclick') {
  26953. if (editOpts.mode === 'row') {
  26954. this.handleActived(params, evnt);
  26955. } else {
  26956. this.scrollToRow(params.row, params.column).then(function () {
  26957. return _this.handleSelected(params, evnt);
  26958. });
  26959. }
  26960. }
  26961. } else {
  26962. this.scrollToRow(params.row, params.column).then(function () {
  26963. return _this.handleSelected(params, evnt);
  26964. });
  26965. }
  26966. }
  26967. },
  26968. // 处理当前行方向键移动
  26969. moveCurrentRow: function moveCurrentRow(isUpArrow, isDwArrow, evnt) {
  26970. var _this2 = this;
  26971. var currentRow = this.currentRow,
  26972. treeConfig = this.treeConfig,
  26973. treeOpts = this.treeOpts,
  26974. afterFullData = this.afterFullData;
  26975. var targetRow;
  26976. evnt.preventDefault();
  26977. if (currentRow) {
  26978. if (treeConfig) {
  26979. var _XEUtils$findTree = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.findTree(afterFullData, function (item) {
  26980. return item === currentRow;
  26981. }, treeOpts),
  26982. index = _XEUtils$findTree.index,
  26983. items = _XEUtils$findTree.items;
  26984. if (isUpArrow && index > 0) {
  26985. targetRow = items[index - 1];
  26986. } else if (isDwArrow && index < items.length - 1) {
  26987. targetRow = items[index + 1];
  26988. }
  26989. } else {
  26990. var _rowIndex = this.getVTRowIndex(currentRow);
  26991. if (isUpArrow && _rowIndex > 0) {
  26992. targetRow = afterFullData[_rowIndex - 1];
  26993. } else if (isDwArrow && _rowIndex < afterFullData.length - 1) {
  26994. targetRow = afterFullData[_rowIndex + 1];
  26995. }
  26996. }
  26997. } else {
  26998. targetRow = afterFullData[0];
  26999. }
  27000. if (targetRow) {
  27001. var params = {
  27002. $table: this,
  27003. row: targetRow
  27004. };
  27005. this.scrollToRow(targetRow).then(function () {
  27006. return _this2.triggerCurrentRowEvent(evnt, params);
  27007. });
  27008. }
  27009. },
  27010. // 处理可编辑方向键移动
  27011. moveSelected: function moveSelected(args, isLeftArrow, isUpArrow, isRightArrow, isDwArrow, evnt) {
  27012. var _this3 = this;
  27013. var afterFullData = this.afterFullData,
  27014. visibleColumn = this.visibleColumn;
  27015. var params = Object.assign({}, args);
  27016. var _rowIndex = this.getVTRowIndex(params.row);
  27017. var _columnIndex = this.getVTColumnIndex(params.column);
  27018. evnt.preventDefault();
  27019. if (isUpArrow && _rowIndex > 0) {
  27020. // 移动到上一行
  27021. params.rowIndex = _rowIndex - 1;
  27022. params.row = afterFullData[params.rowIndex];
  27023. } else if (isDwArrow && _rowIndex < afterFullData.length - 1) {
  27024. // 移动到下一行
  27025. params.rowIndex = _rowIndex + 1;
  27026. params.row = afterFullData[params.rowIndex];
  27027. } else if (isLeftArrow && _columnIndex) {
  27028. // 移动到左侧单元格
  27029. params.columnIndex = _columnIndex - 1;
  27030. params.column = visibleColumn[params.columnIndex];
  27031. } else if (isRightArrow && _columnIndex < visibleColumn.length - 1) {
  27032. // 移动到右侧单元格
  27033. params.columnIndex = _columnIndex + 1;
  27034. params.column = visibleColumn[params.columnIndex];
  27035. }
  27036. this.scrollToRow(params.row, params.column).then(function () {
  27037. params.cell = _this3.getCell(params.row, params.column);
  27038. _this3.handleSelected(params, evnt);
  27039. });
  27040. },
  27041. /**
  27042. * 表头单元格按下事件
  27043. */
  27044. triggerHeaderCellMousedownEvent: function triggerHeaderCellMousedownEvent(evnt, params) {
  27045. var mouseConfig = this.mouseConfig,
  27046. mouseOpts = this.mouseOpts;
  27047. if (mouseConfig && mouseOpts.area && this.handleHeaderCellAreaEvent) {
  27048. var cell = evnt.currentTarget;
  27049. var triggerSort = dom.getEventTargetNode(evnt, cell, 'vxe-cell--sort').flag;
  27050. var triggerFilter = dom.getEventTargetNode(evnt, cell, 'vxe-cell--filter').flag;
  27051. this.handleHeaderCellAreaEvent(evnt, Object.assign({
  27052. cell: cell,
  27053. triggerSort: triggerSort,
  27054. triggerFilter: triggerFilter
  27055. }, params));
  27056. }
  27057. this.focus();
  27058. this.closeMenu();
  27059. },
  27060. /**
  27061. * 单元格按下事件
  27062. */
  27063. triggerCellMousedownEvent: function triggerCellMousedownEvent(evnt, params) {
  27064. var cell = evnt.currentTarget;
  27065. params.cell = cell;
  27066. this.handleCellMousedownEvent(evnt, params);
  27067. this.focus();
  27068. this.closeFilter();
  27069. this.closeMenu();
  27070. },
  27071. handleCellMousedownEvent: function handleCellMousedownEvent(evnt, params) {
  27072. var editConfig = this.editConfig,
  27073. editOpts = this.editOpts,
  27074. handleSelected = this.handleSelected,
  27075. checkboxConfig = this.checkboxConfig,
  27076. checkboxOpts = this.checkboxOpts,
  27077. mouseConfig = this.mouseConfig,
  27078. mouseOpts = this.mouseOpts;
  27079. if (mouseConfig && mouseOpts.area && this.handleCellAreaEvent) {
  27080. return this.handleCellAreaEvent(evnt, params);
  27081. } else {
  27082. if (checkboxConfig && checkboxOpts.range) {
  27083. this.handleCheckboxRangeEvent(evnt, params);
  27084. }
  27085. if (mouseConfig && mouseOpts.selected) {
  27086. if (!editConfig || editOpts.mode === 'cell') {
  27087. handleSelected(params, evnt);
  27088. }
  27089. }
  27090. }
  27091. },
  27092. handleCheckboxRangeEvent: function handleCheckboxRangeEvent(evnt, params) {
  27093. var _this4 = this;
  27094. var column = params.column,
  27095. cell = params.cell;
  27096. if (column.type === 'checkbox') {
  27097. var $el = this.$el,
  27098. elemStore = this.elemStore;
  27099. var disX = evnt.clientX;
  27100. var disY = evnt.clientY;
  27101. var bodyWrapperElem = elemStore["".concat(column.fixed || 'main', "-body-wrapper")] || elemStore['main-body-wrapper'];
  27102. var checkboxRangeElem = bodyWrapperElem.querySelector('.vxe-table--checkbox-range');
  27103. var domMousemove = document.onmousemove;
  27104. var domMouseup = document.onmouseup;
  27105. var trElem = cell.parentNode;
  27106. var selectRecords = this.getCheckboxRecords();
  27107. var lastRangeRows = [];
  27108. var marginSize = 1;
  27109. var offsetRest = getTargetOffset(evnt.target, bodyWrapperElem);
  27110. var startTop = offsetRest.offsetTop + evnt.offsetY;
  27111. var startLeft = offsetRest.offsetLeft + evnt.offsetX;
  27112. var startScrollTop = bodyWrapperElem.scrollTop;
  27113. var rowHeight = trElem.offsetHeight;
  27114. var mouseScrollTimeout = null;
  27115. var isMouseScrollDown = false;
  27116. var mouseScrollSpaceSize = 1;
  27117. var triggerEvent = function triggerEvent(type, evnt) {
  27118. _this4.emitEvent("checkbox-range-".concat(type), {
  27119. records: _this4.getCheckboxRecords(),
  27120. reserves: _this4.getCheckboxReserveRecords()
  27121. }, evnt);
  27122. };
  27123. var handleChecked = function handleChecked(evnt) {
  27124. var clientX = evnt.clientX,
  27125. clientY = evnt.clientY;
  27126. var offsetLeft = clientX - disX;
  27127. var offsetTop = clientY - disY + (bodyWrapperElem.scrollTop - startScrollTop);
  27128. var rangeHeight = Math.abs(offsetTop);
  27129. var rangeWidth = Math.abs(offsetLeft);
  27130. var rangeTop = startTop;
  27131. var rangeLeft = startLeft;
  27132. if (offsetTop < marginSize) {
  27133. // 向上
  27134. rangeTop += offsetTop;
  27135. if (rangeTop < marginSize) {
  27136. rangeTop = marginSize;
  27137. rangeHeight = startTop;
  27138. }
  27139. } else {
  27140. // 向下
  27141. rangeHeight = Math.min(rangeHeight, bodyWrapperElem.scrollHeight - startTop - marginSize);
  27142. }
  27143. if (offsetLeft < marginSize) {
  27144. // 向左
  27145. rangeLeft += offsetLeft;
  27146. if (rangeWidth > startLeft) {
  27147. rangeLeft = marginSize;
  27148. rangeWidth = startLeft;
  27149. }
  27150. } else {
  27151. // 向右
  27152. rangeWidth = Math.min(rangeWidth, bodyWrapperElem.clientWidth - startLeft - marginSize);
  27153. }
  27154. checkboxRangeElem.style.height = "".concat(rangeHeight, "px");
  27155. checkboxRangeElem.style.width = "".concat(rangeWidth, "px");
  27156. checkboxRangeElem.style.left = "".concat(rangeLeft, "px");
  27157. checkboxRangeElem.style.top = "".concat(rangeTop, "px");
  27158. checkboxRangeElem.style.display = 'block';
  27159. var rangeRows = getCheckboxRangeRows(_this4, params, trElem, offsetTop < marginSize ? -rangeHeight : rangeHeight); // 至少滑动 10px 才能有效匹配
  27160. if (rangeHeight > 10 && rangeRows.length !== lastRangeRows.length) {
  27161. lastRangeRows = rangeRows;
  27162. if (evnt.ctrlKey) {
  27163. rangeRows.forEach(function (row) {
  27164. _this4.handleSelectRow({
  27165. row: row
  27166. }, selectRecords.indexOf(row) === -1);
  27167. });
  27168. } else {
  27169. _this4.setAllCheckboxRow(false);
  27170. _this4.setCheckboxRow(rangeRows, true);
  27171. }
  27172. triggerEvent('change', evnt);
  27173. }
  27174. }; // 停止鼠标滚动
  27175. var stopMouseScroll = function stopMouseScroll() {
  27176. clearTimeout(mouseScrollTimeout);
  27177. mouseScrollTimeout = null;
  27178. }; // 开始鼠标滚动
  27179. var startMouseScroll = function startMouseScroll(evnt) {
  27180. stopMouseScroll();
  27181. mouseScrollTimeout = setTimeout(function () {
  27182. if (mouseScrollTimeout) {
  27183. var scrollLeft = bodyWrapperElem.scrollLeft,
  27184. scrollTop = bodyWrapperElem.scrollTop,
  27185. clientHeight = bodyWrapperElem.clientHeight,
  27186. scrollHeight = bodyWrapperElem.scrollHeight;
  27187. var topSize = Math.ceil(mouseScrollSpaceSize * 50 / rowHeight);
  27188. if (isMouseScrollDown) {
  27189. if (scrollTop + clientHeight < scrollHeight) {
  27190. _this4.scrollTo(scrollLeft, scrollTop + topSize);
  27191. startMouseScroll(evnt);
  27192. handleChecked(evnt);
  27193. } else {
  27194. stopMouseScroll();
  27195. }
  27196. } else {
  27197. if (scrollTop) {
  27198. _this4.scrollTo(scrollLeft, scrollTop - topSize);
  27199. startMouseScroll(evnt);
  27200. handleChecked(evnt);
  27201. } else {
  27202. stopMouseScroll();
  27203. }
  27204. }
  27205. }
  27206. }, 50);
  27207. };
  27208. dom.addClass($el, 'drag--range');
  27209. document.onmousemove = function (evnt) {
  27210. evnt.preventDefault();
  27211. evnt.stopPropagation();
  27212. var clientY = evnt.clientY;
  27213. var _DomTools$getAbsolute = dom.getAbsolutePos(bodyWrapperElem),
  27214. boundingTop = _DomTools$getAbsolute.boundingTop; // 如果超过可视区,触发滚动
  27215. if (clientY < boundingTop) {
  27216. isMouseScrollDown = false;
  27217. mouseScrollSpaceSize = boundingTop - clientY;
  27218. if (!mouseScrollTimeout) {
  27219. startMouseScroll(evnt);
  27220. }
  27221. } else if (clientY > boundingTop + bodyWrapperElem.clientHeight) {
  27222. isMouseScrollDown = true;
  27223. mouseScrollSpaceSize = clientY - boundingTop - bodyWrapperElem.clientHeight;
  27224. if (!mouseScrollTimeout) {
  27225. startMouseScroll(evnt);
  27226. }
  27227. } else if (mouseScrollTimeout) {
  27228. stopMouseScroll();
  27229. }
  27230. handleChecked(evnt);
  27231. };
  27232. document.onmouseup = function (evnt) {
  27233. stopMouseScroll();
  27234. dom.removeClass($el, 'drag--range');
  27235. checkboxRangeElem.removeAttribute('style');
  27236. document.onmousemove = domMousemove;
  27237. document.onmouseup = domMouseup;
  27238. triggerEvent('end', evnt);
  27239. };
  27240. triggerEvent('start', evnt);
  27241. }
  27242. }
  27243. }
  27244. });
  27245. // CONCATENATED MODULE: ./packages/keyboard/index.js
  27246. var Keyboard = {
  27247. install: function install() {
  27248. v_x_e_table.reg('keyboard');
  27249. packages_table.mixins.push(keyboard_src_mixin);
  27250. }
  27251. };
  27252. /* harmony default export */ var packages_keyboard = (Keyboard);
  27253. // CONCATENATED MODULE: ./packages/validator/src/mixin.js
  27254. /**
  27255. * 校验规则
  27256. */
  27257. var mixin_Rule = /*#__PURE__*/function () {
  27258. function Rule(rule) {
  27259. _classCallCheck(this, Rule);
  27260. Object.assign(this, {
  27261. $options: rule,
  27262. required: rule.required,
  27263. min: rule.min,
  27264. max: rule.max,
  27265. type: rule.type,
  27266. pattern: rule.pattern,
  27267. validator: rule.validator,
  27268. trigger: rule.trigger,
  27269. maxWidth: rule.maxWidth
  27270. });
  27271. }
  27272. /**
  27273. * 获取校验不通过的消息
  27274. * 支持国际化翻译
  27275. */
  27276. _createClass(Rule, [{
  27277. key: "content",
  27278. get: function get() {
  27279. return getFuncText(this.$options.content || this.$options.message);
  27280. }
  27281. }, {
  27282. key: "message",
  27283. get: function get() {
  27284. return this.content;
  27285. }
  27286. }]);
  27287. return Rule;
  27288. }();
  27289. function validErrorRuleValue(rule, val) {
  27290. var type = rule.type,
  27291. min = rule.min,
  27292. max = rule.max,
  27293. pattern = rule.pattern;
  27294. var isNumType = type === 'number';
  27295. var numVal = isNumType ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(val) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getSize(val); // 判断数值
  27296. if (isNumType && isNaN(val)) {
  27297. return true;
  27298. } // 如果存在 min,判断最小值
  27299. if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eqNull(min) && numVal < external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(min)) {
  27300. return true;
  27301. } // 如果存在 max,判断最大值
  27302. if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eqNull(max) && numVal > external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(max)) {
  27303. return true;
  27304. } // 如果存在 pattern,正则校验
  27305. if (pattern && !(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isRegExp(pattern) ? pattern : new RegExp(pattern)).test(val)) {
  27306. return true;
  27307. }
  27308. return false;
  27309. }
  27310. /* harmony default export */ var validator_src_mixin = ({
  27311. methods: {
  27312. /**
  27313. * 完整校验,和 validate 的区别就是会给有效数据中的每一行进行校验
  27314. */
  27315. _fullValidate: function _fullValidate(rows, cb) {
  27316. return this.beginValidate(rows, cb, true);
  27317. },
  27318. /**
  27319. * 快速校验,如果存在记录不通过的记录,则返回不再继续校验(异步校验除外)
  27320. */
  27321. _validate: function _validate(rows, cb) {
  27322. return this.beginValidate(rows, cb);
  27323. },
  27324. /**
  27325. * 聚焦到校验通过的单元格并弹出校验错误提示
  27326. */
  27327. handleValidError: function handleValidError(params) {
  27328. var _this = this;
  27329. return new Promise(function (resolve) {
  27330. if (_this.validOpts.autoPos === false) {
  27331. _this.emitEvent('valid-error', params);
  27332. resolve();
  27333. } else {
  27334. _this.handleActived(params, {
  27335. type: 'valid-error',
  27336. trigger: 'call'
  27337. }).then(function () {
  27338. setTimeout(function () {
  27339. resolve(_this.showValidTooltip(params));
  27340. }, 10);
  27341. });
  27342. }
  27343. });
  27344. },
  27345. /**
  27346. * 对表格数据进行校验
  27347. * 如果不指定数据,则默认只校验临时变动的数据,例如新增或修改
  27348. * 如果传 true 则校验当前表格数据
  27349. * 如果传 row 指定行记录,则只验证传入的行
  27350. * 如果传 rows 为多行记录,则只验证传入的行
  27351. * 如果只传 callback 否则默认验证整个表格数据
  27352. * 返回 Promise 对象,或者使用回调方式
  27353. */
  27354. beginValidate: function beginValidate(rows, cb, isFull) {
  27355. var _this2 = this;
  27356. var validRest = {};
  27357. var editRules = this.editRules,
  27358. afterFullData = this.afterFullData,
  27359. treeConfig = this.treeConfig,
  27360. treeOpts = this.treeOpts;
  27361. var vaildDatas;
  27362. if (rows === true) {
  27363. vaildDatas = afterFullData;
  27364. } else if (rows) {
  27365. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(rows)) {
  27366. cb = rows;
  27367. } else {
  27368. vaildDatas = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(rows) ? rows : [rows];
  27369. }
  27370. }
  27371. if (!vaildDatas) {
  27372. vaildDatas = this.getInsertRecords().concat(this.getUpdateRecords());
  27373. }
  27374. var rowValids = [];
  27375. this.lastCallTime = Date.now();
  27376. this.validRuleErr = false; // 如果为快速校验,当存在某列校验不通过时将终止执行
  27377. this.clearValidate();
  27378. if (editRules) {
  27379. var columns = this.getColumns();
  27380. var handleVaild = function handleVaild(row) {
  27381. if (isFull || !_this2.validRuleErr) {
  27382. var colVailds = [];
  27383. columns.forEach(function (column) {
  27384. if ((isFull || !_this2.validRuleErr) && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.has(editRules, column.property)) {
  27385. colVailds.push(_this2.validCellRules('all', row, column).catch(function (_ref) {
  27386. var rule = _ref.rule,
  27387. rules = _ref.rules;
  27388. var rest = {
  27389. rule: rule,
  27390. rules: rules,
  27391. rowIndex: _this2.getRowIndex(row),
  27392. row: row,
  27393. columnIndex: _this2.getColumnIndex(column),
  27394. column: column,
  27395. field: column.property,
  27396. $table: _this2
  27397. };
  27398. if (!validRest[column.property]) {
  27399. validRest[column.property] = [];
  27400. }
  27401. validRest[column.property].push(rest);
  27402. if (!isFull) {
  27403. _this2.validRuleErr = true;
  27404. return Promise.reject(rest);
  27405. }
  27406. }));
  27407. }
  27408. });
  27409. rowValids.push(Promise.all(colVailds));
  27410. }
  27411. };
  27412. if (treeConfig) {
  27413. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(vaildDatas, handleVaild, treeOpts);
  27414. } else {
  27415. vaildDatas.forEach(handleVaild);
  27416. }
  27417. return Promise.all(rowValids).then(function () {
  27418. var ruleProps = Object.keys(validRest);
  27419. return _this2.$nextTick().then(function () {
  27420. if (ruleProps.length) {
  27421. return Promise.reject(validRest[ruleProps[0]][0]);
  27422. }
  27423. if (cb) {
  27424. cb();
  27425. }
  27426. });
  27427. }).catch(function (firstErrParams) {
  27428. return new Promise(function (resolve, reject) {
  27429. var finish = function finish() {
  27430. _this2.$nextTick(function () {
  27431. if (cb) {
  27432. cb(validRest);
  27433. resolve();
  27434. } else {
  27435. if (src_conf.validToReject === 'obsolete') {
  27436. // 已废弃,校验失败将不会执行catch
  27437. reject(validRest);
  27438. } else {
  27439. resolve(validRest);
  27440. }
  27441. }
  27442. });
  27443. };
  27444. var posAndFinish = function posAndFinish() {
  27445. firstErrParams.cell = _this2.getCell(firstErrParams.row, firstErrParams.column);
  27446. dom.scrollToView(firstErrParams.cell);
  27447. _this2.handleValidError(firstErrParams).then(finish);
  27448. };
  27449. /**
  27450. * 当校验不通过时
  27451. * 将表格滚动到可视区
  27452. * 由于提示信息至少需要占一行,定位向上偏移一行
  27453. */
  27454. var row = firstErrParams.row;
  27455. var rowIndex = afterFullData.indexOf(row);
  27456. var locatRow = rowIndex > 0 ? afterFullData[rowIndex - 1] : row;
  27457. if (_this2.validOpts.autoPos === false) {
  27458. finish();
  27459. } else {
  27460. if (treeConfig) {
  27461. _this2.scrollToTreeRow(locatRow).then(posAndFinish);
  27462. } else {
  27463. _this2.scrollToRow(locatRow).then(posAndFinish);
  27464. }
  27465. }
  27466. });
  27467. });
  27468. }
  27469. return this.$nextTick().then(function () {
  27470. if (cb) {
  27471. cb();
  27472. }
  27473. });
  27474. },
  27475. hasCellRules: function hasCellRules(type, row, column) {
  27476. var editRules = this.editRules;
  27477. var property = column.property;
  27478. if (property && editRules) {
  27479. var rules = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(editRules, property);
  27480. return rules && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.find(rules, function (rule) {
  27481. return type === 'all' || !rule.trigger || type === rule.trigger;
  27482. });
  27483. }
  27484. return false;
  27485. },
  27486. /**
  27487. * 校验数据
  27488. * 按表格行、列顺序依次校验(同步或异步)
  27489. * 校验规则根据索引顺序依次校验,如果是异步则会等待校验完成才会继续校验下一列
  27490. * 如果校验失败则,触发回调或者Promise<不通过列的错误消息>
  27491. * 如果是传回调方式这返回一个校验不通过列的错误消息
  27492. *
  27493. * rule 配置:
  27494. * required=Boolean 是否必填
  27495. * min=Number 最小长度
  27496. * max=Number 最大长度
  27497. * validator=Function({ cellValue, rule, rules, row, column, rowIndex, columnIndex }) 自定义校验,接收一个 Promise
  27498. * trigger=blur|change 触发方式(除非特殊场景,否则默认为空就行)
  27499. */
  27500. validCellRules: function validCellRules(validType, row, column, val) {
  27501. var _this3 = this;
  27502. var editRules = this.editRules;
  27503. var property = column.property;
  27504. var errorRules = [];
  27505. var syncVailds = [];
  27506. if (property && editRules) {
  27507. var rules = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(editRules, property);
  27508. if (rules) {
  27509. 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;
  27510. rules.forEach(function (rule) {
  27511. var type = rule.type,
  27512. trigger = rule.trigger,
  27513. required = rule.required;
  27514. if (validType === 'all' || !trigger || validType === trigger) {
  27515. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(rule.validator)) {
  27516. var customValid = rule.validator({
  27517. cellValue: cellValue,
  27518. rule: rule,
  27519. rules: rules,
  27520. row: row,
  27521. rowIndex: _this3.getRowIndex(row),
  27522. column: column,
  27523. columnIndex: _this3.getColumnIndex(column),
  27524. field: column.property,
  27525. $table: _this3
  27526. });
  27527. if (customValid) {
  27528. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isError(customValid)) {
  27529. _this3.validRuleErr = true;
  27530. errorRules.push(new mixin_Rule({
  27531. type: 'custom',
  27532. trigger: trigger,
  27533. content: customValid.message,
  27534. rule: new mixin_Rule(rule)
  27535. }));
  27536. } else if (customValid.catch) {
  27537. // 如果为异步校验(注:异步校验是并发无序的)
  27538. syncVailds.push(customValid.catch(function (e) {
  27539. _this3.validRuleErr = true;
  27540. errorRules.push(new mixin_Rule({
  27541. type: 'custom',
  27542. trigger: trigger,
  27543. content: e && e.message ? e.message : rule.content || rule.message,
  27544. rule: new mixin_Rule(rule)
  27545. }));
  27546. }));
  27547. }
  27548. }
  27549. } else {
  27550. var isArrType = type === 'array';
  27551. var hasEmpty = isArrType || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(cellValue) ? !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(cellValue) || !cellValue.length : eqEmptyValue(cellValue);
  27552. if (required ? hasEmpty || validErrorRuleValue(rule, cellValue) : !hasEmpty && validErrorRuleValue(rule, cellValue)) {
  27553. _this3.validRuleErr = true;
  27554. errorRules.push(new mixin_Rule(rule));
  27555. }
  27556. }
  27557. }
  27558. });
  27559. }
  27560. }
  27561. return Promise.all(syncVailds).then(function () {
  27562. if (errorRules.length) {
  27563. var rest = {
  27564. rules: errorRules,
  27565. rule: errorRules[0]
  27566. };
  27567. return Promise.reject(rest);
  27568. }
  27569. });
  27570. },
  27571. _clearValidate: function _clearValidate() {
  27572. var validTip = this.$refs.validTip;
  27573. Object.assign(this.validStore, {
  27574. visible: false,
  27575. row: null,
  27576. column: null,
  27577. content: '',
  27578. rule: null
  27579. });
  27580. if (validTip && validTip.visible) {
  27581. validTip.close();
  27582. }
  27583. return this.$nextTick();
  27584. },
  27585. /**
  27586. * 触发校验
  27587. */
  27588. triggerValidate: function triggerValidate(type) {
  27589. var _this4 = this;
  27590. var editConfig = this.editConfig,
  27591. editStore = this.editStore,
  27592. editRules = this.editRules,
  27593. validStore = this.validStore;
  27594. var actived = editStore.actived;
  27595. if (actived.row && editRules) {
  27596. var _actived$args = actived.args,
  27597. row = _actived$args.row,
  27598. column = _actived$args.column,
  27599. cell = _actived$args.cell;
  27600. if (this.hasCellRules(type, row, column)) {
  27601. return this.validCellRules(type, row, column).then(function () {
  27602. if (editConfig.mode === 'row') {
  27603. if (validStore.visible && validStore.row === row && validStore.column === column) {
  27604. _this4.clearValidate();
  27605. }
  27606. }
  27607. }).catch(function (_ref2) {
  27608. var rule = _ref2.rule;
  27609. // 如果校验不通过与触发方式一致,则聚焦提示错误,否则跳过并不作任何处理
  27610. if (!rule.trigger || type === rule.trigger) {
  27611. var rest = {
  27612. rule: rule,
  27613. row: row,
  27614. column: column,
  27615. cell: cell
  27616. };
  27617. _this4.showValidTooltip(rest);
  27618. return Promise.reject(rest);
  27619. }
  27620. return Promise.resolve();
  27621. });
  27622. }
  27623. }
  27624. return Promise.resolve();
  27625. },
  27626. /**
  27627. * 弹出校验错误提示
  27628. */
  27629. showValidTooltip: function showValidTooltip(params) {
  27630. var _this5 = this;
  27631. var $refs = this.$refs,
  27632. height = this.height,
  27633. tableData = this.tableData,
  27634. validOpts = this.validOpts;
  27635. var rule = params.rule,
  27636. row = params.row,
  27637. column = params.column,
  27638. cell = params.cell;
  27639. var validTip = $refs.validTip;
  27640. var content = rule.content;
  27641. return this.$nextTick(function () {
  27642. Object.assign(_this5.validStore, {
  27643. row: row,
  27644. column: column,
  27645. rule: rule,
  27646. content: content,
  27647. visible: true
  27648. });
  27649. _this5.emitEvent('valid-error', params);
  27650. if (validTip && (validOpts.message === 'tooltip' || validOpts.message === 'default' && !height && tableData.length < 2)) {
  27651. return validTip.open(cell, content);
  27652. }
  27653. });
  27654. }
  27655. }
  27656. });
  27657. // CONCATENATED MODULE: ./packages/validator/index.js
  27658. var Validator = {
  27659. install: function install() {
  27660. v_x_e_table.reg('valid');
  27661. packages_table.mixins.push(validator_src_mixin);
  27662. }
  27663. };
  27664. /* harmony default export */ var validator = (Validator);
  27665. // CONCATENATED MODULE: ./packages/footer/src/footer.js
  27666. var footer_cellType = 'footer';
  27667. function mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex) {
  27668. for (var mIndex = 0; mIndex < mergeFooterList.length; mIndex++) {
  27669. var _mergeFooterList$mInd = mergeFooterList[mIndex],
  27670. mergeRowIndex = _mergeFooterList$mInd.row,
  27671. mergeColIndex = _mergeFooterList$mInd.col,
  27672. mergeRowspan = _mergeFooterList$mInd.rowspan,
  27673. mergeColspan = _mergeFooterList$mInd.colspan;
  27674. if (mergeColIndex > -1 && mergeRowIndex > -1 && mergeRowspan && mergeColspan) {
  27675. if (mergeRowIndex === _rowIndex && mergeColIndex === _columnIndex) {
  27676. return {
  27677. rowspan: mergeRowspan,
  27678. colspan: mergeColspan
  27679. };
  27680. }
  27681. if (_rowIndex >= mergeRowIndex && _rowIndex < mergeRowIndex + mergeRowspan && _columnIndex >= mergeColIndex && _columnIndex < mergeColIndex + mergeColspan) {
  27682. return {
  27683. rowspan: 0,
  27684. colspan: 0
  27685. };
  27686. }
  27687. }
  27688. }
  27689. }
  27690. /* harmony default export */ var footer = ({
  27691. name: 'VxeTableFooter',
  27692. props: {
  27693. footerTableData: Array,
  27694. tableColumn: Array,
  27695. fixedColumn: Array,
  27696. fixedType: String,
  27697. size: String
  27698. },
  27699. mounted: function mounted() {
  27700. var $xetable = this.$parent,
  27701. $el = this.$el,
  27702. $refs = this.$refs,
  27703. fixedType = this.fixedType;
  27704. var elemStore = $xetable.elemStore;
  27705. var prefix = "".concat(fixedType || 'main', "-footer-");
  27706. elemStore["".concat(prefix, "wrapper")] = $el;
  27707. elemStore["".concat(prefix, "table")] = $refs.table;
  27708. elemStore["".concat(prefix, "colgroup")] = $refs.colgroup;
  27709. elemStore["".concat(prefix, "list")] = $refs.tfoot;
  27710. elemStore["".concat(prefix, "xSpace")] = $refs.xSpace;
  27711. },
  27712. destroyed: function destroyed() {
  27713. var $xetable = this.$parent,
  27714. fixedType = this.fixedType;
  27715. var elemStore = $xetable.elemStore;
  27716. var prefix = "".concat(fixedType || 'main', "-footer-");
  27717. elemStore["".concat(prefix, "wrapper")] = null;
  27718. elemStore["".concat(prefix, "table")] = null;
  27719. elemStore["".concat(prefix, "colgroup")] = null;
  27720. elemStore["".concat(prefix, "list")] = null;
  27721. elemStore["".concat(prefix, "xSpace")] = null;
  27722. },
  27723. render: function render(h) {
  27724. var _e = this._e,
  27725. $xetable = this.$parent,
  27726. fixedType = this.fixedType,
  27727. fixedColumn = this.fixedColumn,
  27728. tableColumn = this.tableColumn,
  27729. footerTableData = this.footerTableData;
  27730. var tableListeners = $xetable.$listeners,
  27731. tId = $xetable.tId,
  27732. footerRowClassName = $xetable.footerRowClassName,
  27733. footerCellClassName = $xetable.footerCellClassName,
  27734. footerRowStyle = $xetable.footerRowStyle,
  27735. footerCellStyle = $xetable.footerCellStyle,
  27736. allFooterAlign = $xetable.footerAlign,
  27737. mergeFooterList = $xetable.mergeFooterList,
  27738. footerSpanMethod = $xetable.footerSpanMethod,
  27739. allAlign = $xetable.align,
  27740. scrollXLoad = $xetable.scrollXLoad,
  27741. columnKey = $xetable.columnKey,
  27742. columnOpts = $xetable.columnOpts,
  27743. allColumnFooterOverflow = $xetable.showFooterOverflow,
  27744. currentColumn = $xetable.currentColumn,
  27745. overflowX = $xetable.overflowX,
  27746. scrollbarWidth = $xetable.scrollbarWidth,
  27747. tooltipOpts = $xetable.tooltipOpts,
  27748. visibleColumn = $xetable.visibleColumn; // 如果是使用优化模式
  27749. if (fixedType) {
  27750. if (scrollXLoad || allColumnFooterOverflow) {
  27751. if (!mergeFooterList.length || !footerSpanMethod) {
  27752. tableColumn = fixedColumn;
  27753. } else {
  27754. tableColumn = visibleColumn;
  27755. }
  27756. } else {
  27757. tableColumn = visibleColumn;
  27758. }
  27759. }
  27760. return h('div', {
  27761. class: ['vxe-table--footer-wrapper', fixedType ? "fixed-".concat(fixedType, "--wrapper") : 'body--wrapper'],
  27762. attrs: {
  27763. xid: tId
  27764. },
  27765. on: {
  27766. scroll: this.scrollEvent
  27767. }
  27768. }, [fixedType ? _e() : h('div', {
  27769. class: 'vxe-body--x-space',
  27770. ref: 'xSpace'
  27771. }), h('table', {
  27772. class: 'vxe-table--footer',
  27773. attrs: {
  27774. xid: tId,
  27775. cellspacing: 0,
  27776. cellpadding: 0,
  27777. border: 0
  27778. },
  27779. ref: 'table'
  27780. }, [
  27781. /**
  27782. * 列宽
  27783. */
  27784. h('colgroup', {
  27785. ref: 'colgroup'
  27786. }, tableColumn.map(function (column, $columnIndex) {
  27787. return h('col', {
  27788. attrs: {
  27789. name: column.id
  27790. },
  27791. key: $columnIndex
  27792. });
  27793. }).concat(scrollbarWidth ? [h('col', {
  27794. attrs: {
  27795. name: 'col_gutter'
  27796. }
  27797. })] : [])),
  27798. /**
  27799. * 底部
  27800. */
  27801. h('tfoot', {
  27802. ref: 'tfoot'
  27803. }, footerTableData.map(function (list, _rowIndex) {
  27804. var $rowIndex = _rowIndex;
  27805. return h('tr', {
  27806. class: ['vxe-footer--row', footerRowClassName ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(footerRowClassName) ? footerRowClassName({
  27807. $table: $xetable,
  27808. _rowIndex: _rowIndex,
  27809. $rowIndex: $rowIndex,
  27810. fixed: fixedType,
  27811. type: footer_cellType
  27812. }) : footerRowClassName : ''],
  27813. style: footerRowStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(footerRowStyle) ? footerRowStyle({
  27814. $table: $xetable,
  27815. _rowIndex: _rowIndex,
  27816. $rowIndex: $rowIndex,
  27817. fixed: fixedType,
  27818. type: footer_cellType
  27819. }) : footerRowStyle : null
  27820. }, tableColumn.map(function (column, $columnIndex) {
  27821. var _ref2;
  27822. var type = column.type,
  27823. showFooterOverflow = column.showFooterOverflow,
  27824. footerAlign = column.footerAlign,
  27825. align = column.align,
  27826. footerClassName = column.footerClassName;
  27827. var showAllTip = tooltipOpts.showAll || tooltipOpts.enabled;
  27828. var isColGroup = column.children && column.children.length;
  27829. var fixedHiddenColumn = fixedType ? column.fixed !== fixedType && !isColGroup : column.fixed && overflowX;
  27830. 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;
  27831. var footAlign = footerAlign || align || allFooterAlign || allAlign;
  27832. var showEllipsis = footOverflow === 'ellipsis';
  27833. var showTitle = footOverflow === 'title';
  27834. var showTooltip = footOverflow === true || footOverflow === 'tooltip';
  27835. var hasEllipsis = showTitle || showTooltip || showEllipsis;
  27836. var attrs = {
  27837. colid: column.id
  27838. };
  27839. var tfOns = {};
  27840. var columnIndex = $xetable.getColumnIndex(column);
  27841. var _columnIndex = $xetable.getVTColumnIndex(column);
  27842. var itemIndex = _columnIndex;
  27843. var params = {
  27844. $table: $xetable,
  27845. _rowIndex: _rowIndex,
  27846. $rowIndex: $rowIndex,
  27847. column: column,
  27848. columnIndex: columnIndex,
  27849. $columnIndex: $columnIndex,
  27850. _columnIndex: _columnIndex,
  27851. itemIndex: itemIndex,
  27852. items: list,
  27853. fixed: fixedType,
  27854. type: footer_cellType,
  27855. data: footerTableData
  27856. }; // 虚拟滚动不支持动态高度
  27857. if (scrollXLoad && !hasEllipsis) {
  27858. showEllipsis = hasEllipsis = true;
  27859. }
  27860. if (showTitle || showTooltip || showAllTip) {
  27861. tfOns.mouseenter = function (evnt) {
  27862. if (showTitle) {
  27863. dom.updateCellTitle(evnt.currentTarget, column);
  27864. } else if (showTooltip || showAllTip) {
  27865. $xetable.triggerFooterTooltipEvent(evnt, params);
  27866. }
  27867. };
  27868. }
  27869. if (showTooltip || showAllTip) {
  27870. tfOns.mouseleave = function (evnt) {
  27871. if (showTooltip || showAllTip) {
  27872. $xetable.handleTargetLeaveEvent(evnt);
  27873. }
  27874. };
  27875. }
  27876. if (tableListeners['footer-cell-click']) {
  27877. tfOns.click = function (evnt) {
  27878. $xetable.emitEvent('footer-cell-click', Object.assign({
  27879. cell: evnt.currentTarget
  27880. }, params), evnt);
  27881. };
  27882. }
  27883. if (tableListeners['footer-cell-dblclick']) {
  27884. tfOns.dblclick = function (evnt) {
  27885. $xetable.emitEvent('footer-cell-dblclick', Object.assign({
  27886. cell: evnt.currentTarget
  27887. }, params), evnt);
  27888. };
  27889. } // 合并行或列
  27890. if (mergeFooterList.length) {
  27891. var spanRest = mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex);
  27892. if (spanRest) {
  27893. var rowspan = spanRest.rowspan,
  27894. colspan = spanRest.colspan;
  27895. if (!rowspan || !colspan) {
  27896. return null;
  27897. }
  27898. if (rowspan > 1) {
  27899. attrs.rowspan = rowspan;
  27900. }
  27901. if (colspan > 1) {
  27902. attrs.colspan = colspan;
  27903. }
  27904. }
  27905. } else if (footerSpanMethod) {
  27906. // 自定义合并方法
  27907. var _ref = footerSpanMethod(params) || {},
  27908. _ref$rowspan = _ref.rowspan,
  27909. _rowspan = _ref$rowspan === void 0 ? 1 : _ref$rowspan,
  27910. _ref$colspan = _ref.colspan,
  27911. _colspan = _ref$colspan === void 0 ? 1 : _ref$colspan;
  27912. if (!_rowspan || !_colspan) {
  27913. return null;
  27914. }
  27915. if (_rowspan > 1) {
  27916. attrs.rowspan = _rowspan;
  27917. }
  27918. if (_colspan > 1) {
  27919. attrs.colspan = _colspan;
  27920. }
  27921. }
  27922. return h('td', {
  27923. 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), utils.getClass(footerClassName, params), utils.getClass(footerCellClassName, params)],
  27924. attrs: attrs,
  27925. style: footerCellStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(footerCellStyle) ? footerCellStyle(params) : footerCellStyle : null,
  27926. on: tfOns,
  27927. key: columnKey || columnOpts.useKey ? column.id : $columnIndex
  27928. }, [h('div', {
  27929. class: ['vxe-cell', {
  27930. 'c--title': showTitle,
  27931. 'c--tooltip': showTooltip,
  27932. 'c--ellipsis': showEllipsis
  27933. }]
  27934. }, column.renderFooter(h, params))]);
  27935. }).concat(scrollbarWidth ? [h('td', {
  27936. class: 'vxe-footer--gutter col--gutter'
  27937. })] : []));
  27938. }))])]);
  27939. },
  27940. methods: {
  27941. /**
  27942. * 滚动处理
  27943. * 如果存在列固定左侧,同步更新滚动状态
  27944. * 如果存在列固定右侧,同步更新滚动状态
  27945. */
  27946. scrollEvent: function scrollEvent(evnt) {
  27947. var $xetable = this.$parent,
  27948. fixedType = this.fixedType;
  27949. var $refs = $xetable.$refs,
  27950. scrollXLoad = $xetable.scrollXLoad,
  27951. triggerScrollXEvent = $xetable.triggerScrollXEvent,
  27952. lastScrollLeft = $xetable.lastScrollLeft;
  27953. var tableHeader = $refs.tableHeader,
  27954. tableBody = $refs.tableBody,
  27955. tableFooter = $refs.tableFooter,
  27956. validTip = $refs.validTip;
  27957. var headerElem = tableHeader ? tableHeader.$el : null;
  27958. var footerElem = tableFooter ? tableFooter.$el : null;
  27959. var bodyElem = tableBody.$el;
  27960. var scrollLeft = footerElem ? footerElem.scrollLeft : 0;
  27961. var isX = scrollLeft !== lastScrollLeft;
  27962. $xetable.lastScrollLeft = scrollLeft;
  27963. $xetable.lastScrollTime = Date.now();
  27964. if (headerElem) {
  27965. headerElem.scrollLeft = scrollLeft;
  27966. }
  27967. if (bodyElem) {
  27968. bodyElem.scrollLeft = scrollLeft;
  27969. }
  27970. if (scrollXLoad && isX) {
  27971. triggerScrollXEvent(evnt);
  27972. }
  27973. if (isX && validTip && validTip.visible) {
  27974. validTip.updatePlacement();
  27975. }
  27976. $xetable.emitEvent('scroll', {
  27977. type: footer_cellType,
  27978. fixed: fixedType,
  27979. scrollTop: bodyElem.scrollTop,
  27980. scrollLeft: scrollLeft,
  27981. isX: isX,
  27982. isY: false
  27983. }, evnt);
  27984. }
  27985. }
  27986. });
  27987. // CONCATENATED MODULE: ./packages/footer/index.js
  27988. var Footer = Object.assign(footer, {
  27989. install: function install(Vue) {
  27990. Vue.component(footer.name, footer);
  27991. }
  27992. });
  27993. /* harmony default export */ var packages_footer = (Footer);
  27994. // CONCATENATED MODULE: ./packages/table/src/column.js
  27995. var column_props = {
  27996. // 列唯一主键
  27997. colId: [String, Number],
  27998. // 渲染类型 seq,radio,checkbox,expand,html
  27999. type: String,
  28000. // 列字段名
  28001. field: String,
  28002. // 列标题
  28003. title: String,
  28004. // 列宽度
  28005. width: [Number, String],
  28006. // 列最小宽度,把剩余宽度按比例分配
  28007. minWidth: [Number, String],
  28008. // 是否允许拖动列宽调整大小
  28009. resizable: {
  28010. type: Boolean,
  28011. default: null
  28012. },
  28013. // 将列固定在左侧或者右侧
  28014. fixed: String,
  28015. // 列对其方式
  28016. align: String,
  28017. // 表头对齐方式
  28018. headerAlign: String,
  28019. // 表尾列的对齐方式
  28020. footerAlign: String,
  28021. // 当内容过长时显示为省略号
  28022. showOverflow: {
  28023. type: [Boolean, String],
  28024. default: null
  28025. },
  28026. // 当表头内容过长时显示为省略号
  28027. showHeaderOverflow: {
  28028. type: [Boolean, String],
  28029. default: null
  28030. },
  28031. // 当表尾内容过长时显示为省略号
  28032. showFooterOverflow: {
  28033. type: [Boolean, String],
  28034. default: null
  28035. },
  28036. // 给单元格附加 className
  28037. className: [String, Function],
  28038. // 给表头单元格附加 className
  28039. headerClassName: [String, Function],
  28040. // 给表尾单元格附加 className
  28041. footerClassName: [String, Function],
  28042. // 格式化显示内容
  28043. formatter: [Function, Array, String],
  28044. // 是否允许排序
  28045. sortable: Boolean,
  28046. // 在 v3 中废弃
  28047. remoteSort: {
  28048. type: Boolean,
  28049. default: null
  28050. },
  28051. // 在 v3 中只支持字符串类型
  28052. sortBy: [String, Function],
  28053. // 排序的字段类型,比如字符串转数值等
  28054. sortType: String,
  28055. // 在 v3 中废弃
  28056. sortMethod: Function,
  28057. // 配置筛选条件数组
  28058. filters: {
  28059. type: Array,
  28060. default: null
  28061. },
  28062. // 筛选是否允许多选
  28063. filterMultiple: {
  28064. type: Boolean,
  28065. default: true
  28066. },
  28067. // 自定义筛选方法
  28068. filterMethod: Function,
  28069. // 筛选重置方法
  28070. filterResetMethod: Function,
  28071. // 筛选复原方法
  28072. filterRecoverMethod: Function,
  28073. // 筛选模板配置项
  28074. filterRender: Object,
  28075. // 指定为树节点
  28076. treeNode: Boolean,
  28077. // 是否可视
  28078. visible: {
  28079. type: Boolean,
  28080. default: null
  28081. },
  28082. // 单元格数据导出方法
  28083. exportMethod: Function,
  28084. // 表尾单元格数据导出方法
  28085. footerExportMethod: Function,
  28086. // 已废弃,被 titlePrefix 替换
  28087. titleHelp: Object,
  28088. // 标题帮助图标配置项
  28089. titlePrefix: Object,
  28090. // 单元格值类型
  28091. cellType: String,
  28092. // 单元格渲染配置项
  28093. cellRender: Object,
  28094. // 单元格编辑渲染配置项
  28095. editRender: Object,
  28096. // 内容渲染配置项
  28097. contentRender: Object,
  28098. // 额外的参数
  28099. params: Object
  28100. };
  28101. var column_watch = {};
  28102. Object.keys(column_props).forEach(function (name) {
  28103. column_watch[name] = function (value) {
  28104. this.columnConfig.update(name, value);
  28105. };
  28106. });
  28107. /* harmony default export */ var src_column = ({
  28108. name: 'VxeColumn',
  28109. props: column_props,
  28110. provide: function provide() {
  28111. return {
  28112. $xecolumn: this,
  28113. $xegrid: null
  28114. };
  28115. },
  28116. inject: {
  28117. $xetable: {
  28118. default: null
  28119. },
  28120. $xecolumn: {
  28121. default: null
  28122. }
  28123. },
  28124. watch: column_watch,
  28125. created: function created() {
  28126. this.columnConfig = this.createColumn(this.$xetable, this);
  28127. },
  28128. mounted: function mounted() {
  28129. utils.assemColumn(this);
  28130. },
  28131. destroyed: function destroyed() {
  28132. utils.destroyColumn(this);
  28133. },
  28134. render: function render(h) {
  28135. return h('div', this.$slots.default);
  28136. },
  28137. methods: src_cell
  28138. });
  28139. // CONCATENATED MODULE: ./packages/column/index.js
  28140. var Column = Object.assign(src_column, {
  28141. install: function install(Vue) {
  28142. Vue.component(src_column.name, src_column); // 兼容旧用法
  28143. Vue.component('VxeTableColumn', src_column);
  28144. }
  28145. });
  28146. /* harmony default export */ var packages_column = (Column);
  28147. // CONCATENATED MODULE: ./packages/table/src/group.js
  28148. /* harmony default export */ var src_group = ({
  28149. name: 'VxeColgroup',
  28150. extends: src_column,
  28151. provide: function provide() {
  28152. return {
  28153. xecolgroup: this,
  28154. $xegrid: null
  28155. };
  28156. }
  28157. });
  28158. // CONCATENATED MODULE: ./packages/colgroup/index.js
  28159. var Colgroup = Object.assign(src_group, {
  28160. install: function install(Vue) {
  28161. Vue.component(src_group.name, src_group); // 兼容旧用法
  28162. Vue.component('VxeTableColgroup', src_group);
  28163. }
  28164. });
  28165. /* harmony default export */ var colgroup = (Colgroup);
  28166. // CONCATENATED MODULE: ./packages/grid/src/grid.js
  28167. var grid_methods = {};
  28168. var propKeys = Object.keys(packages_table.props);
  28169. function renderDefaultForm(h, _vm) {
  28170. var $scopedSlots = _vm.$scopedSlots,
  28171. proxyConfig = _vm.proxyConfig,
  28172. proxyOpts = _vm.proxyOpts,
  28173. formData = _vm.formData,
  28174. formConfig = _vm.formConfig,
  28175. formOpts = _vm.formOpts;
  28176. if (isEnableConf(formConfig) && formOpts.items && formOpts.items.length) {
  28177. var formSlots = {};
  28178. if (!formOpts.inited) {
  28179. formOpts.inited = true;
  28180. var beforeItem = proxyOpts.beforeItem;
  28181. if (proxyOpts && beforeItem) {
  28182. formOpts.items.forEach(function (item) {
  28183. beforeItem.call(_vm, {
  28184. $grid: _vm,
  28185. item: item
  28186. });
  28187. });
  28188. }
  28189. } // 处理插槽
  28190. formOpts.items.forEach(function (item) {
  28191. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.each(item.slots, function (func) {
  28192. if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(func)) {
  28193. if ($scopedSlots[func]) {
  28194. formSlots[func] = $scopedSlots[func];
  28195. }
  28196. }
  28197. });
  28198. });
  28199. return [h('vxe-form', {
  28200. props: Object.assign({}, formOpts, {
  28201. data: proxyConfig && proxyOpts.form ? formData : formOpts.data
  28202. }),
  28203. on: {
  28204. submit: _vm.submitEvent,
  28205. reset: _vm.resetEvent,
  28206. collapse: _vm.collapseEvent,
  28207. 'submit-invalid': _vm.submitInvalidEvent
  28208. },
  28209. scopedSlots: formSlots
  28210. })];
  28211. }
  28212. return [];
  28213. }
  28214. function getFuncSlot(_vm, optSlots, slotKey) {
  28215. var $scopedSlots = _vm.$scopedSlots;
  28216. var funcSlot = optSlots[slotKey];
  28217. if (funcSlot) {
  28218. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isString(funcSlot)) {
  28219. if ($scopedSlots[funcSlot]) {
  28220. return $scopedSlots[funcSlot];
  28221. } else {
  28222. if (false) {}
  28223. }
  28224. } else {
  28225. return funcSlot;
  28226. }
  28227. }
  28228. return null;
  28229. }
  28230. function getToolbarSlots(_vm) {
  28231. var $scopedSlots = _vm.$scopedSlots,
  28232. toolbarOpts = _vm.toolbarOpts;
  28233. var toolbarOptSlots = toolbarOpts.slots;
  28234. var buttonsSlot;
  28235. var toolsSlot;
  28236. var slots = {};
  28237. if (false) {}
  28238. if (toolbarOptSlots) {
  28239. buttonsSlot = getFuncSlot(_vm, toolbarOptSlots, 'buttons');
  28240. toolsSlot = getFuncSlot(_vm, toolbarOptSlots, 'tools');
  28241. if (buttonsSlot) {
  28242. slots.buttons = buttonsSlot;
  28243. }
  28244. if (toolsSlot) {
  28245. slots.tools = toolsSlot;
  28246. }
  28247. }
  28248. return slots;
  28249. }
  28250. function getPagerSlots(_vm) {
  28251. var pagerOpts = _vm.pagerOpts;
  28252. var pagerOptSlots = pagerOpts.slots;
  28253. var slots = {};
  28254. var leftSlot;
  28255. var rightSlot;
  28256. if (pagerOptSlots) {
  28257. leftSlot = getFuncSlot(_vm, pagerOptSlots, 'left');
  28258. rightSlot = getFuncSlot(_vm, pagerOptSlots, 'right');
  28259. if (leftSlot) {
  28260. slots.left = leftSlot;
  28261. }
  28262. if (rightSlot) {
  28263. slots.right = rightSlot;
  28264. }
  28265. }
  28266. return slots;
  28267. }
  28268. function getTableOns(_vm) {
  28269. var $listeners = _vm.$listeners,
  28270. proxyConfig = _vm.proxyConfig,
  28271. proxyOpts = _vm.proxyOpts;
  28272. var ons = {};
  28273. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.each($listeners, function (cb, type) {
  28274. ons[type] = function () {
  28275. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  28276. args[_key] = arguments[_key];
  28277. }
  28278. _vm.$emit.apply(_vm, [type].concat(args));
  28279. };
  28280. });
  28281. if (proxyConfig) {
  28282. if (proxyOpts.sort) {
  28283. ons['sort-change'] = _vm.sortChangeEvent;
  28284. }
  28285. if (proxyOpts.filter) {
  28286. ons['filter-change'] = _vm.filterChangeEvent;
  28287. }
  28288. }
  28289. return ons;
  28290. }
  28291. Object.keys(packages_table.methods).forEach(function (name) {
  28292. grid_methods[name] = function () {
  28293. var _this$$refs$xTable;
  28294. return this.$refs.xTable && (_this$$refs$xTable = this.$refs.xTable)[name].apply(_this$$refs$xTable, arguments);
  28295. };
  28296. });
  28297. /* harmony default export */ var grid = ({
  28298. name: 'VxeGrid',
  28299. mixins: [size],
  28300. props: _objectSpread2(_objectSpread2({}, packages_table.props), {}, {
  28301. columns: Array,
  28302. pagerConfig: [Boolean, Object],
  28303. proxyConfig: Object,
  28304. toolbar: [Boolean, Object],
  28305. toolbarConfig: [Boolean, Object],
  28306. formConfig: [Boolean, Object],
  28307. zoomConfig: Object,
  28308. size: {
  28309. type: String,
  28310. default: function _default() {
  28311. return src_conf.grid.size || src_conf.size;
  28312. }
  28313. }
  28314. }),
  28315. provide: function provide() {
  28316. return {
  28317. $xegrid: this
  28318. };
  28319. },
  28320. data: function data() {
  28321. return {
  28322. tableLoading: false,
  28323. isZMax: false,
  28324. tableData: [],
  28325. pendingRecords: [],
  28326. filterData: [],
  28327. formData: {},
  28328. sortData: [],
  28329. tZindex: 0,
  28330. tablePage: {
  28331. total: 0,
  28332. pageSize: src_conf.pager.pageSize || 10,
  28333. currentPage: 1
  28334. }
  28335. };
  28336. },
  28337. computed: {
  28338. isMsg: function isMsg() {
  28339. return this.proxyOpts.message !== false;
  28340. },
  28341. proxyOpts: function proxyOpts() {
  28342. return Object.assign({}, src_conf.grid.proxyConfig, this.proxyConfig);
  28343. },
  28344. pagerOpts: function pagerOpts() {
  28345. return Object.assign({}, src_conf.grid.pagerConfig, this.pagerConfig);
  28346. },
  28347. formOpts: function formOpts() {
  28348. return Object.assign({}, src_conf.grid.formConfig, this.formConfig);
  28349. },
  28350. toolbarOpts: function toolbarOpts() {
  28351. return Object.assign({}, src_conf.grid.toolbarConfig, this.toolbarConfig || this.toolbar);
  28352. },
  28353. zoomOpts: function zoomOpts() {
  28354. return Object.assign({}, src_conf.grid.zoomConfig, this.zoomConfig);
  28355. },
  28356. renderStyle: function renderStyle() {
  28357. return this.isZMax ? {
  28358. zIndex: this.tZindex
  28359. } : null;
  28360. },
  28361. tableExtendProps: function tableExtendProps() {
  28362. var _this = this;
  28363. var rest = {};
  28364. propKeys.forEach(function (key) {
  28365. rest[key] = _this[key];
  28366. });
  28367. return rest;
  28368. },
  28369. tableProps: function tableProps() {
  28370. var isZMax = this.isZMax,
  28371. seqConfig = this.seqConfig,
  28372. pagerConfig = this.pagerConfig,
  28373. loading = this.loading,
  28374. editConfig = this.editConfig,
  28375. proxyConfig = this.proxyConfig,
  28376. proxyOpts = this.proxyOpts,
  28377. tableExtendProps = this.tableExtendProps,
  28378. tableLoading = this.tableLoading,
  28379. tablePage = this.tablePage,
  28380. tableData = this.tableData;
  28381. var tableProps = Object.assign({}, tableExtendProps);
  28382. if (isZMax) {
  28383. if (tableExtendProps.maxHeight) {
  28384. tableProps.maxHeight = 'auto';
  28385. } else {
  28386. tableProps.height = 'auto';
  28387. }
  28388. }
  28389. if (proxyConfig) {
  28390. tableProps.loading = loading || tableLoading;
  28391. tableProps.data = tableData;
  28392. tableProps.rowClassName = this.handleRowClassName;
  28393. if (proxyOpts.seq && isEnableConf(pagerConfig)) {
  28394. tableProps.seqConfig = Object.assign({}, seqConfig, {
  28395. startIndex: (tablePage.currentPage - 1) * tablePage.pageSize
  28396. });
  28397. }
  28398. }
  28399. if (editConfig) {
  28400. tableProps.editConfig = Object.assign({}, editConfig, {
  28401. beforeEditMethod: this.handleBeforeEditMethod
  28402. });
  28403. }
  28404. return tableProps;
  28405. }
  28406. },
  28407. watch: {
  28408. columns: function columns(value) {
  28409. var _this2 = this;
  28410. this.$nextTick(function () {
  28411. return _this2.loadColumn(value);
  28412. });
  28413. },
  28414. toolbar: function toolbar(value) {
  28415. if (value) {
  28416. this.initToolbar();
  28417. }
  28418. },
  28419. toolbarConfig: function toolbarConfig(value) {
  28420. if (value) {
  28421. this.initToolbar();
  28422. }
  28423. },
  28424. proxyConfig: function proxyConfig() {
  28425. this.initProxy();
  28426. },
  28427. pagerConfig: function pagerConfig() {
  28428. this.initPages();
  28429. }
  28430. },
  28431. created: function created() {
  28432. var data = this.data,
  28433. formOpts = this.formOpts,
  28434. proxyOpts = this.proxyOpts,
  28435. proxyConfig = this.proxyConfig;
  28436. if (proxyConfig && (data || proxyOpts.form && formOpts.data)) {
  28437. errLog('vxe.error.errConflicts', ['grid.data', 'grid.proxy-config']);
  28438. }
  28439. if (false) {}
  28440. this.initPages();
  28441. GlobalEvent.on(this, 'keydown', this.handleGlobalKeydownEvent);
  28442. },
  28443. mounted: function mounted() {
  28444. if (this.columns && this.columns.length) {
  28445. this.loadColumn(this.columns);
  28446. }
  28447. this.initToolbar();
  28448. this.initProxy();
  28449. },
  28450. destroyed: function destroyed() {
  28451. GlobalEvent.off(this, 'keydown');
  28452. },
  28453. render: function render(h) {
  28454. var _ref;
  28455. var $scopedSlots = this.$scopedSlots,
  28456. vSize = this.vSize,
  28457. isZMax = this.isZMax;
  28458. var hasForm = !!($scopedSlots.form || isEnableConf(this.formConfig));
  28459. var hasToolbar = !!($scopedSlots.toolbar || isEnableConf(this.toolbarConfig) || this.toolbar);
  28460. var hasPager = !!($scopedSlots.pager || isEnableConf(this.pagerConfig));
  28461. return h('div', {
  28462. 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)],
  28463. style: this.renderStyle
  28464. }, [
  28465. /**
  28466. * 渲染表单
  28467. */
  28468. hasForm ? h('div', {
  28469. ref: 'formWrapper',
  28470. class: 'vxe-grid--form-wrapper'
  28471. }, $scopedSlots.form ? $scopedSlots.form.call(this, {
  28472. $grid: this
  28473. }, h) : renderDefaultForm(h, this)) : null,
  28474. /**
  28475. * 渲染工具栏
  28476. */
  28477. hasToolbar ? h('div', {
  28478. ref: 'toolbarWrapper',
  28479. class: 'vxe-grid--toolbar-wrapper'
  28480. }, $scopedSlots.toolbar ? $scopedSlots.toolbar.call(this, {
  28481. $grid: this
  28482. }, h) : [h('vxe-toolbar', {
  28483. props: this.toolbarOpts,
  28484. ref: 'xToolbar',
  28485. scopedSlots: getToolbarSlots(this)
  28486. })]) : null,
  28487. /**
  28488. * 渲染表格顶部区域
  28489. */
  28490. $scopedSlots.top ? h('div', {
  28491. ref: 'topWrapper',
  28492. class: 'vxe-grid--top-wrapper'
  28493. }, $scopedSlots.top.call(this, {
  28494. $grid: this
  28495. }, h)) : null,
  28496. /**
  28497. * 渲染表格
  28498. */
  28499. h('vxe-table', {
  28500. props: this.tableProps,
  28501. on: getTableOns(this),
  28502. scopedSlots: $scopedSlots,
  28503. ref: 'xTable'
  28504. }),
  28505. /**
  28506. * 渲染表格底部区域
  28507. */
  28508. $scopedSlots.bottom ? h('div', {
  28509. ref: 'bottomWrapper',
  28510. class: 'vxe-grid--bottom-wrapper'
  28511. }, $scopedSlots.bottom.call(this, {
  28512. $grid: this
  28513. }, h)) : null,
  28514. /**
  28515. * 渲染分页
  28516. */
  28517. hasPager ? h('div', {
  28518. ref: 'pagerWrapper',
  28519. class: 'vxe-grid--pager-wrapper'
  28520. }, $scopedSlots.pager ? $scopedSlots.pager.call(this, {
  28521. $grid: this
  28522. }, h) : [h('vxe-pager', {
  28523. props: _objectSpread2(_objectSpread2({}, this.pagerOpts), this.proxyConfig ? this.tablePage : {}),
  28524. on: {
  28525. 'page-change': this.pageChangeEvent
  28526. },
  28527. scopedSlots: getPagerSlots(this)
  28528. })]) : null]);
  28529. },
  28530. methods: _objectSpread2(_objectSpread2({}, grid_methods), {}, {
  28531. callSlot: function callSlot(slotFunc, params, h, vNodes) {
  28532. if (slotFunc) {
  28533. var $scopedSlots = this.$scopedSlots;
  28534. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isString(slotFunc)) {
  28535. slotFunc = $scopedSlots[slotFunc] || null;
  28536. }
  28537. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(slotFunc)) {
  28538. return getSlotVNs(slotFunc.call(this, params, h, vNodes));
  28539. }
  28540. }
  28541. return [];
  28542. },
  28543. getParentHeight: function getParentHeight() {
  28544. var $el = this.$el,
  28545. isZMax = this.isZMax;
  28546. return (isZMax ? dom.getDomNode().visibleHeight : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(getComputedStyle($el.parentNode).height)) - this.getExcludeHeight();
  28547. },
  28548. /**
  28549. * 获取需要排除的高度
  28550. */
  28551. getExcludeHeight: function getExcludeHeight() {
  28552. var $refs = this.$refs,
  28553. $el = this.$el,
  28554. isZMax = this.isZMax,
  28555. height = this.height;
  28556. var formWrapper = $refs.formWrapper,
  28557. toolbarWrapper = $refs.toolbarWrapper,
  28558. topWrapper = $refs.topWrapper,
  28559. bottomWrapper = $refs.bottomWrapper,
  28560. pagerWrapper = $refs.pagerWrapper;
  28561. var parentPaddingSize = isZMax || height !== 'auto' ? 0 : getPaddingTopBottomSize($el.parentNode);
  28562. return parentPaddingSize + getPaddingTopBottomSize($el) + getOffsetHeight(formWrapper) + getOffsetHeight(toolbarWrapper) + getOffsetHeight(topWrapper) + getOffsetHeight(bottomWrapper) + getOffsetHeight(pagerWrapper);
  28563. },
  28564. handleRowClassName: function handleRowClassName(params) {
  28565. var rowClassName = this.rowClassName;
  28566. var clss = [];
  28567. if (this.pendingRecords.some(function (item) {
  28568. return item === params.row;
  28569. })) {
  28570. clss.push('row--pending');
  28571. }
  28572. clss.push(rowClassName ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(rowClassName) ? rowClassName(params) : rowClassName : '');
  28573. return clss;
  28574. },
  28575. handleBeforeEditMethod: function handleBeforeEditMethod(params) {
  28576. var editConfig = this.editConfig;
  28577. var beforeEditMethod = editConfig ? editConfig.beforeEditMethod || editConfig.activeMethod : null;
  28578. if (this.pendingRecords.indexOf(params.row) === -1) {
  28579. return !beforeEditMethod || beforeEditMethod(_objectSpread2(_objectSpread2({}, params), {}, {
  28580. $grid: this
  28581. }));
  28582. }
  28583. return false;
  28584. },
  28585. initToolbar: function initToolbar() {
  28586. var _this3 = this;
  28587. this.$nextTick(function () {
  28588. var _this3$$refs = _this3.$refs,
  28589. xTable = _this3$$refs.xTable,
  28590. xToolbar = _this3$$refs.xToolbar;
  28591. if (xTable && xToolbar) {
  28592. xTable.connect(xToolbar);
  28593. }
  28594. });
  28595. },
  28596. initPages: function initPages() {
  28597. var tablePage = this.tablePage,
  28598. pagerConfig = this.pagerConfig,
  28599. pagerOpts = this.pagerOpts;
  28600. var currentPage = pagerOpts.currentPage,
  28601. pageSize = pagerOpts.pageSize;
  28602. if (pagerConfig) {
  28603. if (currentPage) {
  28604. tablePage.currentPage = currentPage;
  28605. }
  28606. if (pageSize) {
  28607. tablePage.pageSize = pageSize;
  28608. }
  28609. }
  28610. },
  28611. initProxy: function initProxy() {
  28612. var _this4 = this;
  28613. var proxyInited = this.proxyInited,
  28614. proxyConfig = this.proxyConfig,
  28615. proxyOpts = this.proxyOpts,
  28616. formConfig = this.formConfig,
  28617. formOpts = this.formOpts;
  28618. if (proxyConfig) {
  28619. if (isEnableConf(formConfig) && proxyOpts.form && formOpts.items) {
  28620. var formData = {};
  28621. formOpts.items.forEach(function (item) {
  28622. var field = item.field,
  28623. itemRender = item.itemRender;
  28624. if (field) {
  28625. var itemValue = null;
  28626. if (itemRender) {
  28627. var defaultValue = itemRender.defaultValue;
  28628. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(defaultValue)) {
  28629. itemValue = defaultValue({
  28630. item: item
  28631. });
  28632. } else if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isUndefined(defaultValue)) {
  28633. itemValue = defaultValue;
  28634. }
  28635. }
  28636. formData[field] = itemValue;
  28637. }
  28638. });
  28639. this.formData = formData;
  28640. }
  28641. if (!proxyInited && proxyOpts.autoLoad !== false) {
  28642. this.proxyInited = true;
  28643. this.$nextTick(function () {
  28644. return _this4.commitProxy('_init');
  28645. });
  28646. }
  28647. }
  28648. },
  28649. handleGlobalKeydownEvent: function handleGlobalKeydownEvent(evnt) {
  28650. var isEsc = evnt.keyCode === 27;
  28651. if (isEsc && this.isZMax && this.zoomOpts.escRestore !== false) {
  28652. this.triggerZoomEvent(evnt);
  28653. }
  28654. },
  28655. /**
  28656. * 提交指令,支持 code 或 button
  28657. * @param {String/Object} code 字符串或对象
  28658. */
  28659. commitProxy: function commitProxy(proxyTarget) {
  28660. var _this5 = this;
  28661. var $refs = this.$refs,
  28662. toolbar = this.toolbar,
  28663. toolbarConfig = this.toolbarConfig,
  28664. toolbarOpts = this.toolbarOpts,
  28665. proxyOpts = this.proxyOpts,
  28666. tablePage = this.tablePage,
  28667. pagerConfig = this.pagerConfig,
  28668. editRules = this.editRules,
  28669. formData = this.formData,
  28670. isMsg = this.isMsg;
  28671. var beforeQuery = proxyOpts.beforeQuery,
  28672. afterQuery = proxyOpts.afterQuery,
  28673. beforeDelete = proxyOpts.beforeDelete,
  28674. afterDelete = proxyOpts.afterDelete,
  28675. beforeSave = proxyOpts.beforeSave,
  28676. afterSave = proxyOpts.afterSave,
  28677. _proxyOpts$ajax = proxyOpts.ajax,
  28678. ajax = _proxyOpts$ajax === void 0 ? {} : _proxyOpts$ajax,
  28679. _proxyOpts$props = proxyOpts.props,
  28680. proxyProps = _proxyOpts$props === void 0 ? {} : _proxyOpts$props;
  28681. var $xetable = $refs.xTable;
  28682. var button;
  28683. var code;
  28684. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isString(proxyTarget)) {
  28685. var matchObj = toolbarConfig || toolbar ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.findTree(toolbarOpts.buttons, function (item) {
  28686. return item.code === proxyTarget;
  28687. }, {
  28688. children: 'dropdowns'
  28689. }) : null;
  28690. code = proxyTarget;
  28691. button = matchObj ? matchObj.item : null;
  28692. } else {
  28693. button = proxyTarget;
  28694. code = button.code;
  28695. }
  28696. var btnParams = button ? button.params : null;
  28697. for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
  28698. args[_key2 - 1] = arguments[_key2];
  28699. }
  28700. switch (code) {
  28701. case 'insert':
  28702. this.insert();
  28703. break;
  28704. case 'insert_actived':
  28705. this.insert().then(function (_ref2) {
  28706. var row = _ref2.row;
  28707. return _this5.setActiveRow(row);
  28708. });
  28709. break;
  28710. case 'mark_cancel':
  28711. this.triggerPendingEvent(code);
  28712. break;
  28713. case 'remove':
  28714. return this.handleDeleteRow(code, 'vxe.grid.removeSelectRecord', function () {
  28715. return _this5.removeCheckboxRow();
  28716. });
  28717. case 'import':
  28718. this.importData(btnParams);
  28719. break;
  28720. case 'open_import':
  28721. this.openImport(btnParams);
  28722. break;
  28723. case 'export':
  28724. this.exportData(btnParams);
  28725. break;
  28726. case 'open_export':
  28727. this.openExport(btnParams);
  28728. break;
  28729. case 'reset_custom':
  28730. this.resetColumn(true);
  28731. break;
  28732. case '_init':
  28733. case 'reload':
  28734. case 'query':
  28735. {
  28736. var ajaxMethods = ajax.query;
  28737. if (ajaxMethods) {
  28738. var isInited = code === '_init';
  28739. var isReload = code === 'reload';
  28740. var sortList = [];
  28741. var filterList = [];
  28742. var pageParams = {};
  28743. if (pagerConfig) {
  28744. if (isInited || isReload) {
  28745. tablePage.currentPage = 1;
  28746. }
  28747. if (isEnableConf(pagerConfig)) {
  28748. pageParams = _objectSpread2({}, tablePage);
  28749. }
  28750. }
  28751. if (isInited) {
  28752. var sortOpts = $xetable.sortOpts;
  28753. var defaultSort = sortOpts.defaultSort; // 如果使用默认排序
  28754. if (defaultSort) {
  28755. if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(defaultSort)) {
  28756. defaultSort = [defaultSort];
  28757. }
  28758. sortList = defaultSort.map(function (item) {
  28759. return {
  28760. field: item.field,
  28761. property: item.field,
  28762. order: item.order
  28763. };
  28764. });
  28765. }
  28766. filterList = $xetable.getCheckedFilters();
  28767. } else {
  28768. if (isReload) {
  28769. this.pendingRecords = [];
  28770. $xetable.clearAll();
  28771. } else {
  28772. sortList = $xetable.getSortColumns();
  28773. filterList = $xetable.getCheckedFilters();
  28774. }
  28775. }
  28776. var params = {
  28777. code: code,
  28778. button: button,
  28779. $grid: this,
  28780. page: pageParams,
  28781. sort: sortList.length ? sortList[0] : {},
  28782. sorts: sortList,
  28783. filters: filterList,
  28784. form: formData,
  28785. options: ajaxMethods
  28786. };
  28787. this.sortData = sortList;
  28788. this.filterData = filterList;
  28789. this.tableLoading = true;
  28790. var applyArgs = [params].concat(args);
  28791. return Promise.resolve((beforeQuery || ajaxMethods).apply(void 0, _toConsumableArray(applyArgs))).catch(function (e) {
  28792. return e;
  28793. }).then(function (rest) {
  28794. _this5.tableLoading = false;
  28795. if (rest) {
  28796. if (isEnableConf(pagerConfig)) {
  28797. var total = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(rest, proxyProps.total || 'page.total') || 0;
  28798. tablePage.total = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(total);
  28799. _this5.tableData = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(rest, proxyProps.result || 'result') || []; // 检验当前页码,不能超出当前最大页数
  28800. var pageCount = Math.max(Math.ceil(total / tablePage.pageSize), 1);
  28801. if (tablePage.currentPage > pageCount) {
  28802. tablePage.currentPage = pageCount;
  28803. }
  28804. } else {
  28805. _this5.tableData = (proxyProps.list ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(rest, proxyProps.list) : rest) || [];
  28806. }
  28807. } else {
  28808. _this5.tableData = [];
  28809. }
  28810. if (afterQuery) {
  28811. afterQuery.apply(void 0, _toConsumableArray(applyArgs));
  28812. }
  28813. });
  28814. } else {
  28815. if (false) {}
  28816. }
  28817. break;
  28818. }
  28819. case 'delete':
  28820. {
  28821. var _ajaxMethods = ajax.delete;
  28822. if (_ajaxMethods) {
  28823. var selectRecords = $xetable.getCheckboxRecords();
  28824. var removeRecords = selectRecords.filter(function (row) {
  28825. return !$xetable.isInsertByRow(row);
  28826. });
  28827. var body = {
  28828. removeRecords: removeRecords
  28829. };
  28830. var _applyArgs = [{
  28831. $grid: this,
  28832. code: code,
  28833. button: button,
  28834. body: body,
  28835. options: _ajaxMethods
  28836. }].concat(args);
  28837. if (selectRecords.length) {
  28838. return this.handleDeleteRow(code, 'vxe.grid.deleteSelectRecord', function () {
  28839. if (!removeRecords.length) {
  28840. return $xetable.remove(selectRecords);
  28841. }
  28842. _this5.tableLoading = true;
  28843. return Promise.resolve((beforeDelete || _ajaxMethods).apply(void 0, _toConsumableArray(_applyArgs))).then(function (rest) {
  28844. _this5.tableLoading = false;
  28845. _this5.pendingRecords = _this5.pendingRecords.filter(function (row) {
  28846. return removeRecords.indexOf(row) === -1;
  28847. });
  28848. if (isMsg) {
  28849. // 检测弹窗模块
  28850. if (false) {}
  28851. v_x_e_table.modal.message({
  28852. content: _this5.getRespMsg(rest, 'vxe.grid.delSuccess'),
  28853. status: 'success'
  28854. });
  28855. }
  28856. if (afterDelete) {
  28857. afterDelete.apply(void 0, _toConsumableArray(_applyArgs));
  28858. } else {
  28859. _this5.commitProxy('query');
  28860. }
  28861. }).catch(function (rest) {
  28862. _this5.tableLoading = false;
  28863. if (isMsg) {
  28864. // 检测弹窗模块
  28865. if (false) {}
  28866. v_x_e_table.modal.message({
  28867. id: code,
  28868. content: _this5.getRespMsg(rest, 'vxe.grid.operError'),
  28869. status: 'error'
  28870. });
  28871. }
  28872. });
  28873. });
  28874. } else {
  28875. if (isMsg) {
  28876. // 检测弹窗模块
  28877. if (false) {}
  28878. v_x_e_table.modal.message({
  28879. id: code,
  28880. content: src_conf.i18n('vxe.grid.selectOneRecord'),
  28881. status: 'warning'
  28882. });
  28883. }
  28884. }
  28885. } else {
  28886. if (false) {}
  28887. }
  28888. break;
  28889. }
  28890. case 'save':
  28891. {
  28892. var _ajaxMethods2 = ajax.save;
  28893. if (_ajaxMethods2) {
  28894. var _body = Object.assign({
  28895. pendingRecords: this.pendingRecords
  28896. }, this.getRecordset());
  28897. var insertRecords = _body.insertRecords,
  28898. _removeRecords = _body.removeRecords,
  28899. updateRecords = _body.updateRecords,
  28900. pendingRecords = _body.pendingRecords;
  28901. var _applyArgs2 = [{
  28902. $grid: this,
  28903. code: code,
  28904. button: button,
  28905. body: _body,
  28906. options: _ajaxMethods2
  28907. }].concat(args); // 排除掉新增且标记为删除的数据
  28908. if (insertRecords.length) {
  28909. _body.pendingRecords = pendingRecords.filter(function (row) {
  28910. return insertRecords.indexOf(row) === -1;
  28911. });
  28912. } // 排除已标记为删除的数据
  28913. if (pendingRecords.length) {
  28914. _body.insertRecords = insertRecords.filter(function (row) {
  28915. return pendingRecords.indexOf(row) === -1;
  28916. });
  28917. }
  28918. var restPromise = Promise.resolve();
  28919. if (editRules) {
  28920. // 只校验新增和修改的数据
  28921. restPromise = this.validate(_body.insertRecords.concat(updateRecords));
  28922. }
  28923. return restPromise.then(function (errMap) {
  28924. if (errMap) {
  28925. // 如果校验不通过
  28926. return;
  28927. }
  28928. if (_body.insertRecords.length || _removeRecords.length || updateRecords.length || _body.pendingRecords.length) {
  28929. _this5.tableLoading = true;
  28930. return Promise.resolve((beforeSave || _ajaxMethods2).apply(void 0, _toConsumableArray(_applyArgs2))).then(function (rest) {
  28931. _this5.tableLoading = false;
  28932. _this5.pendingRecords = [];
  28933. if (isMsg) {
  28934. // 检测弹窗模块
  28935. if (false) {}
  28936. v_x_e_table.modal.message({
  28937. content: _this5.getRespMsg(rest, 'vxe.grid.saveSuccess'),
  28938. status: 'success'
  28939. });
  28940. }
  28941. if (afterSave) {
  28942. afterSave.apply(void 0, _toConsumableArray(_applyArgs2));
  28943. } else {
  28944. _this5.commitProxy('query');
  28945. }
  28946. }).catch(function (rest) {
  28947. _this5.tableLoading = false;
  28948. if (isMsg) {
  28949. // 检测弹窗模块
  28950. if (false) {}
  28951. v_x_e_table.modal.message({
  28952. id: code,
  28953. content: _this5.getRespMsg(rest, 'vxe.grid.operError'),
  28954. status: 'error'
  28955. });
  28956. }
  28957. });
  28958. } else {
  28959. if (isMsg) {
  28960. // 检测弹窗模块
  28961. if (false) {}
  28962. v_x_e_table.modal.message({
  28963. id: code,
  28964. content: src_conf.i18n('vxe.grid.dataUnchanged'),
  28965. status: 'info'
  28966. });
  28967. }
  28968. }
  28969. });
  28970. } else {
  28971. if (false) {}
  28972. }
  28973. break;
  28974. }
  28975. default:
  28976. {
  28977. var btnMethod = v_x_e_table.commands.get(code);
  28978. if (btnMethod) {
  28979. btnMethod.apply(void 0, [{
  28980. code: code,
  28981. button: button,
  28982. $grid: this,
  28983. $table: $xetable
  28984. }].concat(args));
  28985. }
  28986. }
  28987. }
  28988. return this.$nextTick();
  28989. },
  28990. getRespMsg: function getRespMsg(rest, defaultMsg) {
  28991. var _this$proxyOpts$props = this.proxyOpts.props,
  28992. proxyProps = _this$proxyOpts$props === void 0 ? {} : _this$proxyOpts$props;
  28993. var msg;
  28994. if (rest && proxyProps.message) {
  28995. msg = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(rest, proxyProps.message);
  28996. }
  28997. return msg || src_conf.i18n(defaultMsg);
  28998. },
  28999. handleDeleteRow: function handleDeleteRow(code, alertKey, callback) {
  29000. var selectRecords = this.getCheckboxRecords();
  29001. if (this.isMsg) {
  29002. if (selectRecords.length) {
  29003. return v_x_e_table.modal.confirm({
  29004. id: "cfm_".concat(code),
  29005. content: src_conf.i18n(alertKey),
  29006. escClosable: true
  29007. }).then(function (type) {
  29008. if (type === 'confirm') {
  29009. callback();
  29010. }
  29011. });
  29012. } else {
  29013. // 检测弹窗模块
  29014. if (false) {}
  29015. v_x_e_table.modal.message({
  29016. id: "msg_".concat(code),
  29017. content: src_conf.i18n('vxe.grid.selectOneRecord'),
  29018. status: 'warning'
  29019. });
  29020. }
  29021. } else {
  29022. if (selectRecords.length) {
  29023. callback();
  29024. }
  29025. }
  29026. return Promise.resolve();
  29027. },
  29028. getFormItems: function getFormItems(itemIndex) {
  29029. var formConfig = this.formConfig,
  29030. formOpts = this.formOpts;
  29031. var itemList = [];
  29032. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(isEnableConf(formConfig) && formOpts.items ? formOpts.items : [], function (item) {
  29033. itemList.push(item);
  29034. }, {
  29035. children: 'children'
  29036. });
  29037. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isUndefined(itemIndex) ? itemList : itemList[itemIndex];
  29038. },
  29039. getPendingRecords: function getPendingRecords() {
  29040. return this.pendingRecords;
  29041. },
  29042. triggerToolbarBtnEvent: function triggerToolbarBtnEvent(button, evnt) {
  29043. this.commitProxy(button, evnt);
  29044. this.$emit('toolbar-button-click', {
  29045. code: button.code,
  29046. button: button,
  29047. $grid: this,
  29048. $event: evnt
  29049. });
  29050. },
  29051. triggerToolbarTolEvent: function triggerToolbarTolEvent(tool, evnt) {
  29052. this.commitProxy(tool, evnt);
  29053. this.$emit('toolbar-tool-click', {
  29054. code: tool.code,
  29055. tool: tool,
  29056. $grid: this,
  29057. $event: evnt
  29058. });
  29059. },
  29060. triggerPendingEvent: function triggerPendingEvent(code) {
  29061. var pendingRecords = this.pendingRecords,
  29062. isMsg = this.isMsg;
  29063. var selectRecords = this.getCheckboxRecords();
  29064. if (selectRecords.length) {
  29065. var plus = [];
  29066. var minus = [];
  29067. selectRecords.forEach(function (data) {
  29068. if (pendingRecords.some(function (item) {
  29069. return data === item;
  29070. })) {
  29071. minus.push(data);
  29072. } else {
  29073. plus.push(data);
  29074. }
  29075. });
  29076. if (minus.length) {
  29077. this.pendingRecords = pendingRecords.filter(function (item) {
  29078. return minus.indexOf(item) === -1;
  29079. }).concat(plus);
  29080. } else if (plus.length) {
  29081. this.pendingRecords = pendingRecords.concat(plus);
  29082. }
  29083. this.clearCheckboxRow();
  29084. } else {
  29085. if (isMsg) {
  29086. // 检测弹窗模块
  29087. if (false) {}
  29088. v_x_e_table.modal.message({
  29089. id: code,
  29090. content: src_conf.i18n('vxe.grid.selectOneRecord'),
  29091. status: 'warning'
  29092. });
  29093. }
  29094. }
  29095. },
  29096. pageChangeEvent: function pageChangeEvent(params) {
  29097. var proxyConfig = this.proxyConfig,
  29098. tablePage = this.tablePage;
  29099. var currentPage = params.currentPage,
  29100. pageSize = params.pageSize;
  29101. tablePage.currentPage = currentPage;
  29102. tablePage.pageSize = pageSize;
  29103. this.$emit('page-change', Object.assign({
  29104. $grid: this
  29105. }, params));
  29106. if (proxyConfig) {
  29107. this.commitProxy('query');
  29108. }
  29109. },
  29110. sortChangeEvent: function sortChangeEvent(params) {
  29111. var $table = params.$table,
  29112. column = params.column,
  29113. sortList = params.sortList;
  29114. var isRemote = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isBoolean(column.remoteSort) ? column.remoteSort : $table.sortOpts.remote; // 如果是服务端排序
  29115. if (isRemote) {
  29116. this.sortData = sortList;
  29117. if (this.proxyConfig) {
  29118. this.tablePage.currentPage = 1;
  29119. this.commitProxy('query');
  29120. }
  29121. }
  29122. this.$emit('sort-change', Object.assign({
  29123. $grid: this
  29124. }, params));
  29125. },
  29126. filterChangeEvent: function filterChangeEvent(params) {
  29127. var $table = params.$table,
  29128. filterList = params.filterList; // 如果是服务端过滤
  29129. if ($table.filterOpts.remote) {
  29130. this.filterData = filterList;
  29131. if (this.proxyConfig) {
  29132. this.tablePage.currentPage = 1;
  29133. this.commitProxy('query');
  29134. }
  29135. }
  29136. this.$emit('filter-change', Object.assign({
  29137. $grid: this
  29138. }, params));
  29139. },
  29140. submitEvent: function submitEvent(params) {
  29141. var proxyConfig = this.proxyConfig;
  29142. if (proxyConfig) {
  29143. this.commitProxy('reload');
  29144. }
  29145. this.$emit('form-submit', Object.assign({
  29146. $grid: this
  29147. }, params));
  29148. },
  29149. resetEvent: function resetEvent(params) {
  29150. var proxyConfig = this.proxyConfig;
  29151. if (proxyConfig) {
  29152. this.commitProxy('reload');
  29153. }
  29154. this.$emit('form-reset', Object.assign({
  29155. $grid: this
  29156. }, params));
  29157. },
  29158. submitInvalidEvent: function submitInvalidEvent(params) {
  29159. this.$emit('form-submit-invalid', Object.assign({
  29160. $grid: this
  29161. }, params));
  29162. },
  29163. collapseEvent: function collapseEvent(params) {
  29164. var _this6 = this;
  29165. this.$nextTick(function () {
  29166. return _this6.recalculate(true);
  29167. });
  29168. this.$emit('form-toggle-collapse', Object.assign({
  29169. $grid: this
  29170. }, params));
  29171. this.$emit('form-collapse', Object.assign({
  29172. $grid: this
  29173. }, params));
  29174. },
  29175. triggerZoomEvent: function triggerZoomEvent(evnt) {
  29176. this.zoom();
  29177. this.$emit('zoom', {
  29178. $grid: this,
  29179. type: this.isZMax ? 'max' : 'revert',
  29180. $event: evnt
  29181. });
  29182. },
  29183. zoom: function zoom() {
  29184. return this[this.isZMax ? 'revert' : 'maximize']();
  29185. },
  29186. isMaximized: function isMaximized() {
  29187. return this.isZMax;
  29188. },
  29189. maximize: function maximize() {
  29190. return this.handleZoom(true);
  29191. },
  29192. revert: function revert() {
  29193. return this.handleZoom();
  29194. },
  29195. handleZoom: function handleZoom(isMax) {
  29196. var _this7 = this;
  29197. var isZMax = this.isZMax;
  29198. if (isMax ? !isZMax : isZMax) {
  29199. this.isZMax = !isZMax;
  29200. if (this.tZindex < utils.getLastZIndex()) {
  29201. this.tZindex = utils.nextZIndex();
  29202. }
  29203. }
  29204. return this.$nextTick().then(function () {
  29205. return _this7.recalculate(true);
  29206. }).then(function () {
  29207. return _this7.isZMax;
  29208. });
  29209. },
  29210. getProxyInfo: function getProxyInfo() {
  29211. var sortData = this.sortData,
  29212. proxyConfig = this.proxyConfig;
  29213. if (proxyConfig) {
  29214. return {
  29215. data: this.tableData,
  29216. filter: this.filterData,
  29217. form: this.formData,
  29218. sort: sortData.length ? sortData[0] : {},
  29219. sorts: sortData,
  29220. pager: this.tablePage,
  29221. pendingRecords: this.pendingRecords
  29222. };
  29223. }
  29224. return null;
  29225. }
  29226. }, false ? undefined : null)
  29227. });
  29228. // CONCATENATED MODULE: ./packages/grid/index.js
  29229. var Grid = Object.assign(grid, {
  29230. install: function install(Vue) {
  29231. v_x_e_table.Grid = grid;
  29232. v_x_e_table.GridComponent = grid;
  29233. Vue.component(grid.name, grid);
  29234. }
  29235. });
  29236. /* harmony default export */ var packages_grid = (Grid);
  29237. // CONCATENATED MODULE: ./packages/toolbar/src/toolbar.js
  29238. var renderDropdowns = function renderDropdowns(h, _vm, item, isBtn) {
  29239. var _e = _vm._e;
  29240. var dropdowns = item.dropdowns;
  29241. if (dropdowns) {
  29242. return dropdowns.map(function (child) {
  29243. return child.visible === false ? _e() : h('vxe-button', {
  29244. on: {
  29245. click: function click(evnt) {
  29246. return isBtn ? _vm.btnEvent(evnt, child) : _vm.tolEvent(evnt, child);
  29247. }
  29248. },
  29249. props: {
  29250. disabled: child.disabled,
  29251. loading: child.loading,
  29252. type: child.type,
  29253. icon: child.icon,
  29254. circle: child.circle,
  29255. round: child.round,
  29256. status: child.status,
  29257. content: child.name
  29258. }
  29259. });
  29260. });
  29261. }
  29262. return [];
  29263. };
  29264. /**
  29265. * 渲染按钮
  29266. */
  29267. function renderBtns(h, _vm) {
  29268. var _e = _vm._e,
  29269. $scopedSlots = _vm.$scopedSlots,
  29270. $xegrid = _vm.$xegrid,
  29271. $xetable = _vm.$xetable,
  29272. _vm$buttons = _vm.buttons,
  29273. buttons = _vm$buttons === void 0 ? [] : _vm$buttons;
  29274. var buttonsSlot = $scopedSlots.buttons;
  29275. if (buttonsSlot) {
  29276. return buttonsSlot.call(_vm, {
  29277. $grid: $xegrid,
  29278. $table: $xetable
  29279. }, h);
  29280. }
  29281. return buttons.map(function (item) {
  29282. var dropdowns = item.dropdowns,
  29283. buttonRender = item.buttonRender;
  29284. var compConf = buttonRender ? v_x_e_table.renderer.get(buttonRender.name) : null;
  29285. if (item.visible === false) {
  29286. return _e();
  29287. }
  29288. if (compConf) {
  29289. var renderToolbarButton = compConf.renderToolbarButton || compConf.renderButton;
  29290. if (renderToolbarButton) {
  29291. return h('span', {
  29292. class: 'vxe-button--item'
  29293. }, getSlotVNs(renderToolbarButton.call(_vm, h, buttonRender, {
  29294. $grid: $xegrid,
  29295. $table: $xetable,
  29296. button: item
  29297. })));
  29298. }
  29299. }
  29300. return h('vxe-button', {
  29301. on: {
  29302. click: function click(evnt) {
  29303. return _vm.btnEvent(evnt, item);
  29304. }
  29305. },
  29306. props: {
  29307. disabled: item.disabled,
  29308. loading: item.loading,
  29309. type: item.type,
  29310. icon: item.icon,
  29311. circle: item.circle,
  29312. round: item.round,
  29313. status: item.status,
  29314. content: item.name,
  29315. destroyOnClose: item.destroyOnClose,
  29316. placement: item.placement,
  29317. transfer: item.transfer
  29318. },
  29319. scopedSlots: dropdowns && dropdowns.length ? {
  29320. dropdowns: function dropdowns() {
  29321. return renderDropdowns(h, _vm, item, true);
  29322. }
  29323. } : null
  29324. });
  29325. });
  29326. }
  29327. /**
  29328. * 渲染右侧工具
  29329. */
  29330. function renderRightTools(h, _vm) {
  29331. var _e = _vm._e,
  29332. $scopedSlots = _vm.$scopedSlots,
  29333. $xegrid = _vm.$xegrid,
  29334. $xetable = _vm.$xetable,
  29335. _vm$tools = _vm.tools,
  29336. tools = _vm$tools === void 0 ? [] : _vm$tools;
  29337. var toolsSlot = $scopedSlots.tools;
  29338. if (toolsSlot) {
  29339. return toolsSlot.call(_vm, {
  29340. $grid: $xegrid,
  29341. $table: $xetable
  29342. }, h);
  29343. }
  29344. return tools.map(function (item) {
  29345. var dropdowns = item.dropdowns,
  29346. toolRender = item.toolRender;
  29347. var compConf = toolRender ? v_x_e_table.renderer.get(toolRender.name) : null;
  29348. if (item.visible === false) {
  29349. return _e();
  29350. }
  29351. if (compConf) {
  29352. var renderToolbarTool = compConf.renderToolbarTool;
  29353. if (renderToolbarTool) {
  29354. return h('span', {
  29355. class: 'vxe-tool--item'
  29356. }, getSlotVNs(renderToolbarTool.call(_vm, h, toolRender, {
  29357. $grid: $xegrid,
  29358. $table: $xetable,
  29359. tool: item
  29360. })));
  29361. }
  29362. }
  29363. return h('vxe-button', {
  29364. on: {
  29365. click: function click(evnt) {
  29366. return _vm.tolEvent(evnt, item);
  29367. }
  29368. },
  29369. props: {
  29370. disabled: item.disabled,
  29371. loading: item.loading,
  29372. type: item.type,
  29373. icon: item.icon,
  29374. circle: item.circle,
  29375. round: item.round,
  29376. status: item.status,
  29377. content: item.name,
  29378. destroyOnClose: item.destroyOnClose,
  29379. placement: item.placement,
  29380. transfer: item.transfer
  29381. },
  29382. scopedSlots: dropdowns && dropdowns.length ? {
  29383. dropdowns: function dropdowns() {
  29384. return renderDropdowns(h, _vm, item, false);
  29385. }
  29386. } : null
  29387. });
  29388. });
  29389. }
  29390. function renderCustoms(h, _vm) {
  29391. var $xetable = _vm.$xetable,
  29392. customStore = _vm.customStore,
  29393. customOpts = _vm.customOpts,
  29394. columns = _vm.columns;
  29395. var cols = [];
  29396. var customBtnOns = {};
  29397. var customWrapperOns = {};
  29398. var checkMethod = $xetable ? $xetable.customOpts.checkMethod : null;
  29399. if (customOpts.trigger === 'manual') {// 手动触发
  29400. } else if (customOpts.trigger === 'hover') {
  29401. // hover 触发
  29402. customBtnOns.mouseenter = _vm.handleMouseenterSettingEvent;
  29403. customBtnOns.mouseleave = _vm.handleMouseleaveSettingEvent;
  29404. customWrapperOns.mouseenter = _vm.handleWrapperMouseenterEvent;
  29405. customWrapperOns.mouseleave = _vm.handleWrapperMouseleaveEvent;
  29406. } else {
  29407. // 点击触发
  29408. customBtnOns.click = _vm.handleClickSettingEvent;
  29409. }
  29410. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(columns, function (column) {
  29411. var colTitle = utils.formatText(column.getTitle(), 1);
  29412. var colKey = column.getKey();
  29413. var isColGroup = column.children && column.children.length;
  29414. var isDisabled = checkMethod ? !checkMethod({
  29415. column: column
  29416. }) : false;
  29417. if (isColGroup || colKey) {
  29418. var isChecked = column.visible;
  29419. var isIndeterminate = column.halfVisible;
  29420. cols.push(h('li', {
  29421. class: ['vxe-custom--option', "level--".concat(column.level), {
  29422. 'is--group': isColGroup,
  29423. 'is--checked': isChecked,
  29424. 'is--indeterminate': isIndeterminate,
  29425. 'is--disabled': isDisabled
  29426. }],
  29427. attrs: {
  29428. title: colTitle
  29429. },
  29430. on: {
  29431. click: function click() {
  29432. if (!isDisabled) {
  29433. _vm.changeCustomOption(column);
  29434. }
  29435. }
  29436. }
  29437. }, [h('span', {
  29438. class: ['vxe-checkbox--icon', isIndeterminate ? src_conf.icon.TABLE_CHECKBOX_INDETERMINATE : isChecked ? src_conf.icon.TABLE_CHECKBOX_CHECKED : src_conf.icon.TABLE_CHECKBOX_UNCHECKED]
  29439. }), h('span', {
  29440. class: 'vxe-checkbox--label'
  29441. }, colTitle)]));
  29442. }
  29443. });
  29444. var isAllChecked = customStore.isAll;
  29445. var isAllIndeterminate = customStore.isIndeterminate;
  29446. return h('div', {
  29447. class: ['vxe-custom--wrapper', {
  29448. 'is--active': customStore.visible
  29449. }],
  29450. ref: 'customWrapper'
  29451. }, [h('vxe-button', {
  29452. props: {
  29453. circle: true,
  29454. icon: customOpts.icon || src_conf.icon.TOOLBAR_TOOLS_CUSTOM
  29455. },
  29456. attrs: {
  29457. title: src_conf.i18n('vxe.toolbar.custom')
  29458. },
  29459. on: customBtnOns
  29460. }), h('div', {
  29461. class: 'vxe-custom--option-wrapper'
  29462. }, [h('ul', {
  29463. class: 'vxe-custom--header'
  29464. }, [h('li', {
  29465. class: ['vxe-custom--option', {
  29466. 'is--checked': isAllChecked,
  29467. 'is--indeterminate': isAllIndeterminate
  29468. }],
  29469. attrs: {
  29470. title: src_conf.i18n('vxe.table.allTitle')
  29471. },
  29472. on: {
  29473. click: _vm.allCustomEvent
  29474. }
  29475. }, [h('span', {
  29476. class: ['vxe-checkbox--icon', isAllIndeterminate ? src_conf.icon.TABLE_CHECKBOX_INDETERMINATE : isAllChecked ? src_conf.icon.TABLE_CHECKBOX_CHECKED : src_conf.icon.TABLE_CHECKBOX_UNCHECKED]
  29477. }), h('span', {
  29478. class: 'vxe-checkbox--label'
  29479. }, src_conf.i18n('vxe.toolbar.customAll'))])]), h('ul', {
  29480. class: 'vxe-custom--body',
  29481. on: customWrapperOns
  29482. }, cols), customOpts.isFooter === false ? null : h('div', {
  29483. class: 'vxe-custom--footer'
  29484. }, [h('button', {
  29485. class: 'btn--confirm',
  29486. on: {
  29487. click: _vm.confirmCustomEvent
  29488. }
  29489. }, src_conf.i18n('vxe.toolbar.customConfirm')), h('button', {
  29490. class: 'btn--reset',
  29491. on: {
  29492. click: _vm.resetCustomEvent
  29493. }
  29494. }, src_conf.i18n('vxe.toolbar.customRestore'))])])]);
  29495. }
  29496. /* harmony default export */ var src_toolbar = ({
  29497. name: 'VxeToolbar',
  29498. mixins: [size],
  29499. props: {
  29500. loading: Boolean,
  29501. refresh: [Boolean, Object],
  29502. import: [Boolean, Object],
  29503. export: [Boolean, Object],
  29504. print: [Boolean, Object],
  29505. zoom: [Boolean, Object],
  29506. custom: [Boolean, Object],
  29507. buttons: {
  29508. type: Array,
  29509. default: function _default() {
  29510. return src_conf.toolbar.buttons;
  29511. }
  29512. },
  29513. tools: {
  29514. type: Array,
  29515. default: function _default() {
  29516. return src_conf.toolbar.tools;
  29517. }
  29518. },
  29519. perfect: {
  29520. type: Boolean,
  29521. default: function _default() {
  29522. return src_conf.toolbar.perfect;
  29523. }
  29524. },
  29525. size: {
  29526. type: String,
  29527. default: function _default() {
  29528. return src_conf.toolbar.size || src_conf.size;
  29529. }
  29530. },
  29531. className: [String, Function]
  29532. },
  29533. inject: {
  29534. $xegrid: {
  29535. default: null
  29536. }
  29537. },
  29538. data: function data() {
  29539. return {
  29540. $xetable: null,
  29541. isRefresh: false,
  29542. columns: [],
  29543. customStore: {
  29544. isAll: false,
  29545. isIndeterminate: false,
  29546. visible: false
  29547. }
  29548. };
  29549. },
  29550. computed: {
  29551. refreshOpts: function refreshOpts() {
  29552. return Object.assign({}, src_conf.toolbar.refresh, this.refresh);
  29553. },
  29554. importOpts: function importOpts() {
  29555. return Object.assign({}, src_conf.toolbar.import, this.import);
  29556. },
  29557. exportOpts: function exportOpts() {
  29558. return Object.assign({}, src_conf.toolbar.export, this.export);
  29559. },
  29560. printOpts: function printOpts() {
  29561. return Object.assign({}, src_conf.toolbar.print, this.print);
  29562. },
  29563. zoomOpts: function zoomOpts() {
  29564. return Object.assign({}, src_conf.toolbar.zoom, this.zoom);
  29565. },
  29566. customOpts: function customOpts() {
  29567. return Object.assign({}, src_conf.toolbar.custom, this.custom);
  29568. }
  29569. },
  29570. created: function created() {
  29571. var _this = this;
  29572. var refresh = this.refresh,
  29573. refreshOpts = this.refreshOpts;
  29574. this.$nextTick(function () {
  29575. var $xetable = _this.fintTable();
  29576. var queryMethod = refreshOpts.queryMethod || refreshOpts.query;
  29577. if (refresh && !_this.$xegrid && !queryMethod) {
  29578. warnLog('vxe.error.notFunc', ['queryMethod']);
  29579. }
  29580. if ($xetable) {
  29581. $xetable.connect(_this);
  29582. }
  29583. if (false) {}
  29584. });
  29585. GlobalEvent.on(this, 'mousedown', this.handleGlobalMousedownEvent);
  29586. GlobalEvent.on(this, 'blur', this.handleGlobalBlurEvent);
  29587. },
  29588. destroyed: function destroyed() {
  29589. GlobalEvent.off(this, 'mousedown');
  29590. GlobalEvent.off(this, 'blur');
  29591. },
  29592. render: function render(h) {
  29593. var _ref;
  29594. var _e = this._e,
  29595. $xegrid = this.$xegrid,
  29596. perfect = this.perfect,
  29597. loading = this.loading,
  29598. importOpts = this.importOpts,
  29599. exportOpts = this.exportOpts,
  29600. refresh = this.refresh,
  29601. refreshOpts = this.refreshOpts,
  29602. zoom = this.zoom,
  29603. zoomOpts = this.zoomOpts,
  29604. custom = this.custom,
  29605. vSize = this.vSize,
  29606. className = this.className;
  29607. return h('div', {
  29608. class: ['vxe-toolbar', className ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(className) ? className({
  29609. $toolbar: this
  29610. }) : className : '', (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, 'is--perfect', perfect), _defineProperty(_ref, 'is--loading', loading), _ref)]
  29611. }, [h('div', {
  29612. class: 'vxe-buttons--wrapper'
  29613. }, renderBtns(h, this)), h('div', {
  29614. class: 'vxe-tools--wrapper'
  29615. }, renderRightTools(h, this)), h('div', {
  29616. class: 'vxe-tools--operate'
  29617. }, [this.import ? h('vxe-button', {
  29618. props: {
  29619. circle: true,
  29620. icon: importOpts.icon || src_conf.icon.TOOLBAR_TOOLS_IMPORT
  29621. },
  29622. attrs: {
  29623. title: src_conf.i18n('vxe.toolbar.import')
  29624. },
  29625. on: {
  29626. click: this.importEvent
  29627. }
  29628. }) : _e(), this.export ? h('vxe-button', {
  29629. props: {
  29630. circle: true,
  29631. icon: exportOpts.icon || src_conf.icon.TOOLBAR_TOOLS_EXPORT
  29632. },
  29633. attrs: {
  29634. title: src_conf.i18n('vxe.toolbar.export')
  29635. },
  29636. on: {
  29637. click: this.exportEvent
  29638. }
  29639. }) : _e(), this.print ? h('vxe-button', {
  29640. props: {
  29641. circle: true,
  29642. icon: this.printOpts.icon || src_conf.icon.TOOLBAR_TOOLS_PRINT
  29643. },
  29644. attrs: {
  29645. title: src_conf.i18n('vxe.toolbar.print')
  29646. },
  29647. on: {
  29648. click: this.printEvent
  29649. }
  29650. }) : _e(), refresh ? h('vxe-button', {
  29651. props: {
  29652. circle: true,
  29653. icon: this.isRefresh ? refreshOpts.iconLoading || src_conf.icon.TOOLBAR_TOOLS_REFRESH_LOADING : refreshOpts.icon || src_conf.icon.TOOLBAR_TOOLS_REFRESH
  29654. },
  29655. attrs: {
  29656. title: src_conf.i18n('vxe.toolbar.refresh')
  29657. },
  29658. on: {
  29659. click: this.refreshEvent
  29660. }
  29661. }) : _e(), zoom && $xegrid ? h('vxe-button', {
  29662. props: {
  29663. circle: true,
  29664. icon: $xegrid.isMaximized() ? zoomOpts.iconOut || src_conf.icon.TOOLBAR_TOOLS_MINIMIZE : zoomOpts.iconIn || src_conf.icon.TOOLBAR_TOOLS_FULLSCREEN
  29665. },
  29666. attrs: {
  29667. title: src_conf.i18n("vxe.toolbar.zoom".concat($xegrid.isMaximized() ? 'Out' : 'In'))
  29668. },
  29669. on: {
  29670. click: $xegrid.triggerZoomEvent
  29671. }
  29672. }) : _e(), custom ? renderCustoms(h, this) : _e()])]);
  29673. },
  29674. methods: {
  29675. syncUpdate: function syncUpdate(params) {
  29676. var collectColumn = params.collectColumn,
  29677. $table = params.$table;
  29678. this.$xetable = $table;
  29679. this.columns = collectColumn;
  29680. },
  29681. fintTable: function fintTable() {
  29682. var $children = this.$parent.$children;
  29683. var selfIndex = $children.indexOf(this);
  29684. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.find($children, function (comp, index) {
  29685. return comp && comp.loadData && index > selfIndex && comp.$vnode.componentOptions.tag === 'vxe-table';
  29686. });
  29687. },
  29688. checkTable: function checkTable() {
  29689. if (this.$xetable) {
  29690. return true;
  29691. }
  29692. errLog('vxe.error.barUnableLink');
  29693. },
  29694. showCustom: function showCustom() {
  29695. this.customStore.visible = true;
  29696. this.checkCustomStatus();
  29697. },
  29698. closeCustom: function closeCustom() {
  29699. var custom = this.custom,
  29700. customStore = this.customStore;
  29701. if (customStore.visible) {
  29702. customStore.visible = false;
  29703. if (custom && !customStore.immediate) {
  29704. this.handleTableCustom();
  29705. }
  29706. }
  29707. },
  29708. confirmCustomEvent: function confirmCustomEvent(evnt) {
  29709. this.closeCustom();
  29710. this.emitCustomEvent('confirm', evnt);
  29711. },
  29712. customOpenEvent: function customOpenEvent(evnt) {
  29713. var customStore = this.customStore;
  29714. if (this.checkTable()) {
  29715. if (!customStore.visible) {
  29716. this.showCustom();
  29717. this.emitCustomEvent('open', evnt);
  29718. }
  29719. }
  29720. },
  29721. customColseEvent: function customColseEvent(evnt) {
  29722. var customStore = this.customStore;
  29723. if (customStore.visible) {
  29724. this.closeCustom();
  29725. this.emitCustomEvent('close', evnt);
  29726. }
  29727. },
  29728. resetCustomEvent: function resetCustomEvent(evnt) {
  29729. var $xetable = this.$xetable,
  29730. columns = this.columns;
  29731. var checkMethod = $xetable.customOpts.checkMethod;
  29732. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(columns, function (column) {
  29733. if (!checkMethod || checkMethod({
  29734. column: column
  29735. })) {
  29736. column.visible = column.defaultVisible;
  29737. column.halfVisible = false;
  29738. }
  29739. column.resizeWidth = 0;
  29740. });
  29741. $xetable.saveCustomResizable(true);
  29742. this.closeCustom();
  29743. this.emitCustomEvent('reset', evnt);
  29744. },
  29745. emitCustomEvent: function emitCustomEvent(type, evnt) {
  29746. var $xetable = this.$xetable,
  29747. $xegrid = this.$xegrid;
  29748. var comp = $xegrid || $xetable;
  29749. comp.$emit('custom', {
  29750. type: type,
  29751. $table: $xetable,
  29752. $grid: $xegrid,
  29753. $event: evnt
  29754. });
  29755. },
  29756. changeCustomOption: function changeCustomOption(column) {
  29757. var isChecked = !column.visible;
  29758. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree([column], function (item) {
  29759. item.visible = isChecked;
  29760. item.halfVisible = false;
  29761. });
  29762. this.handleOptionCheck(column);
  29763. if (this.custom && this.customOpts.immediate) {
  29764. this.handleTableCustom();
  29765. }
  29766. this.checkCustomStatus();
  29767. },
  29768. handleOptionCheck: function handleOptionCheck(column) {
  29769. var matchObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.findTree(this.columns, function (item) {
  29770. return item === column;
  29771. });
  29772. if (matchObj && matchObj.parent) {
  29773. var parent = matchObj.parent;
  29774. if (parent.children && parent.children.length) {
  29775. parent.visible = parent.children.every(function (column) {
  29776. return column.visible;
  29777. });
  29778. parent.halfVisible = !parent.visible && parent.children.some(function (column) {
  29779. return column.visible || column.halfVisible;
  29780. });
  29781. this.handleOptionCheck(parent);
  29782. }
  29783. }
  29784. },
  29785. handleTableCustom: function handleTableCustom() {
  29786. var $xetable = this.$xetable;
  29787. $xetable.handleCustom();
  29788. },
  29789. checkCustomStatus: function checkCustomStatus() {
  29790. var $xetable = this.$xetable,
  29791. columns = this.columns;
  29792. var checkMethod = $xetable.customOpts.checkMethod;
  29793. this.customStore.isAll = columns.every(function (column) {
  29794. return (checkMethod ? !checkMethod({
  29795. column: column
  29796. }) : false) || column.visible;
  29797. });
  29798. this.customStore.isIndeterminate = !this.customStore.isAll && columns.some(function (column) {
  29799. return (!checkMethod || checkMethod({
  29800. column: column
  29801. })) && (column.visible || column.halfVisible);
  29802. });
  29803. },
  29804. allCustomEvent: function allCustomEvent() {
  29805. var $xetable = this.$xetable,
  29806. columns = this.columns,
  29807. customStore = this.customStore;
  29808. var checkMethod = $xetable.customOpts.checkMethod;
  29809. var isAll = !customStore.isAll;
  29810. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(columns, function (column) {
  29811. if (!checkMethod || checkMethod({
  29812. column: column
  29813. })) {
  29814. column.visible = isAll;
  29815. column.halfVisible = false;
  29816. }
  29817. });
  29818. customStore.isAll = isAll;
  29819. this.checkCustomStatus();
  29820. },
  29821. handleGlobalMousedownEvent: function handleGlobalMousedownEvent(evnt) {
  29822. if (!dom.getEventTargetNode(evnt, this.$refs.customWrapper).flag) {
  29823. this.customColseEvent(evnt);
  29824. }
  29825. },
  29826. handleGlobalBlurEvent: function handleGlobalBlurEvent(evnt) {
  29827. this.customColseEvent(evnt);
  29828. },
  29829. handleClickSettingEvent: function handleClickSettingEvent(evnt) {
  29830. if (this.customStore.visible) {
  29831. this.customColseEvent(evnt);
  29832. } else {
  29833. this.customOpenEvent(evnt);
  29834. }
  29835. },
  29836. handleMouseenterSettingEvent: function handleMouseenterSettingEvent(evnt) {
  29837. this.customStore.activeBtn = true;
  29838. this.customOpenEvent(evnt);
  29839. },
  29840. handleMouseleaveSettingEvent: function handleMouseleaveSettingEvent(evnt) {
  29841. var _this2 = this;
  29842. var customStore = this.customStore;
  29843. customStore.activeBtn = false;
  29844. setTimeout(function () {
  29845. if (!customStore.activeBtn && !customStore.activeWrapper) {
  29846. _this2.customColseEvent(evnt);
  29847. }
  29848. }, 300);
  29849. },
  29850. handleWrapperMouseenterEvent: function handleWrapperMouseenterEvent(evnt) {
  29851. this.customStore.activeWrapper = true;
  29852. this.customOpenEvent(evnt);
  29853. },
  29854. handleWrapperMouseleaveEvent: function handleWrapperMouseleaveEvent(evnt) {
  29855. var _this3 = this;
  29856. var customStore = this.customStore;
  29857. customStore.activeWrapper = false;
  29858. setTimeout(function () {
  29859. if (!customStore.activeBtn && !customStore.activeWrapper) {
  29860. _this3.customColseEvent(evnt);
  29861. }
  29862. }, 300);
  29863. },
  29864. refreshEvent: function refreshEvent() {
  29865. var _this4 = this;
  29866. var $xegrid = this.$xegrid,
  29867. refreshOpts = this.refreshOpts,
  29868. isRefresh = this.isRefresh;
  29869. if (!isRefresh) {
  29870. var queryMethod = refreshOpts.queryMethod || refreshOpts.query;
  29871. if (queryMethod) {
  29872. this.isRefresh = true;
  29873. try {
  29874. Promise.resolve(queryMethod({})).catch(function (e) {
  29875. return e;
  29876. }).then(function () {
  29877. _this4.isRefresh = false;
  29878. });
  29879. } catch (e) {
  29880. this.isRefresh = false;
  29881. }
  29882. } else if ($xegrid) {
  29883. this.isRefresh = true;
  29884. $xegrid.commitProxy(refreshOpts.code || 'reload').catch(function (e) {
  29885. return e;
  29886. }).then(function () {
  29887. _this4.isRefresh = false;
  29888. });
  29889. }
  29890. }
  29891. },
  29892. btnEvent: function btnEvent(evnt, item) {
  29893. var $xegrid = this.$xegrid,
  29894. $xetable = this.$xetable;
  29895. var code = item.code;
  29896. if (code) {
  29897. if ($xegrid) {
  29898. $xegrid.triggerToolbarBtnEvent(item, evnt);
  29899. } else {
  29900. var commandMethod = v_x_e_table.commands.get(code);
  29901. var params = {
  29902. code: code,
  29903. button: item,
  29904. $xegrid: $xegrid,
  29905. $table: $xetable,
  29906. $event: evnt
  29907. };
  29908. if (commandMethod) {
  29909. commandMethod.call(this, params, evnt);
  29910. }
  29911. this.$emit('button-click', params);
  29912. }
  29913. }
  29914. },
  29915. tolEvent: function tolEvent(evnt, item) {
  29916. var $xegrid = this.$xegrid,
  29917. $xetable = this.$xetable;
  29918. var code = item.code;
  29919. if (code) {
  29920. if ($xegrid) {
  29921. $xegrid.triggerToolbarTolEvent(item, evnt);
  29922. } else {
  29923. var commandMethod = v_x_e_table.commands.get(code);
  29924. var params = {
  29925. code: code,
  29926. tool: item,
  29927. $xegrid: $xegrid,
  29928. $table: $xetable,
  29929. $event: evnt
  29930. };
  29931. if (commandMethod) {
  29932. commandMethod.call(this, params, evnt);
  29933. }
  29934. this.$emit('tool-click', params);
  29935. }
  29936. }
  29937. },
  29938. importEvent: function importEvent() {
  29939. if (this.checkTable()) {
  29940. this.$xetable.openImport(this.importOpts);
  29941. }
  29942. },
  29943. exportEvent: function exportEvent() {
  29944. if (this.checkTable()) {
  29945. this.$xetable.openExport(this.exportOpts);
  29946. }
  29947. },
  29948. printEvent: function printEvent() {
  29949. if (this.checkTable()) {
  29950. this.$xetable.openPrint(this.printOpts);
  29951. }
  29952. }
  29953. }
  29954. });
  29955. // CONCATENATED MODULE: ./packages/toolbar/index.js
  29956. var Toolbar = Object.assign(src_toolbar, {
  29957. install: function install(Vue) {
  29958. Vue.component(src_toolbar.name, src_toolbar);
  29959. }
  29960. });
  29961. /* harmony default export */ var packages_toolbar = (Toolbar);
  29962. // CONCATENATED MODULE: ./packages/pager/src/pager.js
  29963. /* harmony default export */ var pager = ({
  29964. name: 'VxePager',
  29965. mixins: [size],
  29966. props: {
  29967. size: {
  29968. type: String,
  29969. default: function _default() {
  29970. return src_conf.pager.size || src_conf.size;
  29971. }
  29972. },
  29973. // 自定义布局
  29974. layouts: {
  29975. type: Array,
  29976. default: function _default() {
  29977. return src_conf.pager.layouts || ['PrevJump', 'PrevPage', 'Jump', 'PageCount', 'NextPage', 'NextJump', 'Sizes', 'Total'];
  29978. }
  29979. },
  29980. // 当前页
  29981. currentPage: {
  29982. type: Number,
  29983. default: 1
  29984. },
  29985. // 加载中
  29986. loading: Boolean,
  29987. // 每页大小
  29988. pageSize: {
  29989. type: Number,
  29990. default: function _default() {
  29991. return src_conf.pager.pageSize || 10;
  29992. }
  29993. },
  29994. // 总条数
  29995. total: {
  29996. type: Number,
  29997. default: 0
  29998. },
  29999. // 显示页码按钮的数量
  30000. pagerCount: {
  30001. type: Number,
  30002. default: function _default() {
  30003. return src_conf.pager.pagerCount || 7;
  30004. }
  30005. },
  30006. // 每页大小选项列表
  30007. pageSizes: {
  30008. type: Array,
  30009. default: function _default() {
  30010. return src_conf.pager.pageSizes || [10, 15, 20, 50, 100];
  30011. }
  30012. },
  30013. // 列对其方式
  30014. align: {
  30015. type: String,
  30016. default: function _default() {
  30017. return src_conf.pager.align;
  30018. }
  30019. },
  30020. // 带边框
  30021. border: {
  30022. type: Boolean,
  30023. default: function _default() {
  30024. return src_conf.pager.border;
  30025. }
  30026. },
  30027. // 带背景颜色
  30028. background: {
  30029. type: Boolean,
  30030. default: function _default() {
  30031. return src_conf.pager.background;
  30032. }
  30033. },
  30034. // 配套的样式
  30035. perfect: {
  30036. type: Boolean,
  30037. default: function _default() {
  30038. return src_conf.pager.perfect;
  30039. }
  30040. },
  30041. // 当只有一页时隐藏
  30042. autoHidden: {
  30043. type: Boolean,
  30044. default: function _default() {
  30045. return src_conf.pager.autoHidden;
  30046. }
  30047. },
  30048. transfer: {
  30049. type: Boolean,
  30050. default: function _default() {
  30051. return src_conf.pager.transfer;
  30052. }
  30053. },
  30054. className: [String, Function],
  30055. // 自定义图标
  30056. iconPrevPage: String,
  30057. iconJumpPrev: String,
  30058. iconJumpNext: String,
  30059. iconNextPage: String,
  30060. iconJumpMore: String
  30061. },
  30062. inject: {
  30063. $xegrid: {
  30064. default: null
  30065. }
  30066. },
  30067. data: function data() {
  30068. return {
  30069. inpCurrPage: this.currentPage
  30070. };
  30071. },
  30072. computed: {
  30073. isSizes: function isSizes() {
  30074. return this.layouts.some(function (name) {
  30075. return name === 'Sizes';
  30076. });
  30077. },
  30078. pageCount: function pageCount() {
  30079. return this.getPageCount(this.total, this.pageSize);
  30080. },
  30081. numList: function numList() {
  30082. var len = this.pageCount > this.pagerCount ? this.pagerCount - 2 : this.pagerCount;
  30083. var rest = [];
  30084. for (var index = 0; index < len; index++) {
  30085. rest.push(index);
  30086. }
  30087. return rest;
  30088. },
  30089. offsetNumber: function offsetNumber() {
  30090. return Math.floor((this.pagerCount - 2) / 2);
  30091. },
  30092. sizeList: function sizeList() {
  30093. return this.pageSizes.map(function (item) {
  30094. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNumber(item)) {
  30095. return {
  30096. value: item,
  30097. label: "".concat(src_conf.i18n('vxe.pager.pagesize', [item]))
  30098. };
  30099. }
  30100. return _objectSpread2({
  30101. value: '',
  30102. label: ''
  30103. }, item);
  30104. });
  30105. }
  30106. },
  30107. watch: {
  30108. currentPage: function currentPage(value) {
  30109. this.inpCurrPage = value;
  30110. }
  30111. },
  30112. render: function render(h) {
  30113. var _this = this,
  30114. _ref;
  30115. var $scopedSlots = this.$scopedSlots,
  30116. $xegrid = this.$xegrid,
  30117. vSize = this.vSize,
  30118. align = this.align,
  30119. className = this.className;
  30120. var childNodes = [];
  30121. if ($scopedSlots.left) {
  30122. childNodes.push(h('span', {
  30123. class: 'vxe-pager--left-wrapper'
  30124. }, $scopedSlots.left.call(this, {
  30125. $grid: $xegrid
  30126. })));
  30127. }
  30128. this.layouts.forEach(function (name) {
  30129. childNodes.push(_this["render".concat(name)](h));
  30130. });
  30131. if ($scopedSlots.right) {
  30132. childNodes.push(h('span', {
  30133. class: 'vxe-pager--right-wrapper'
  30134. }, $scopedSlots.right.call(this, {
  30135. $grid: $xegrid
  30136. })));
  30137. }
  30138. return h('div', {
  30139. class: ['vxe-pager', className ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(className) ? className({
  30140. $pager: this
  30141. }) : className : '', (_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)]
  30142. }, [h('div', {
  30143. class: 'vxe-pager--wrapper'
  30144. }, childNodes)]);
  30145. },
  30146. methods: {
  30147. // 上一页
  30148. renderPrevPage: function renderPrevPage(h) {
  30149. return h('button', {
  30150. class: ['vxe-pager--prev-btn', {
  30151. 'is--disabled': this.currentPage <= 1
  30152. }],
  30153. attrs: {
  30154. type: 'button',
  30155. title: src_conf.i18n('vxe.pager.prevPage')
  30156. },
  30157. on: {
  30158. click: this.prevPage
  30159. }
  30160. }, [h('i', {
  30161. class: ['vxe-pager--btn-icon', this.iconPrevPage || src_conf.icon.PAGER_PREV_PAGE]
  30162. })]);
  30163. },
  30164. // 向上翻页
  30165. renderPrevJump: function renderPrevJump(h, tagName) {
  30166. return h(tagName || 'button', {
  30167. class: ['vxe-pager--jump-prev', {
  30168. 'is--fixed': !tagName,
  30169. 'is--disabled': this.currentPage <= 1
  30170. }],
  30171. attrs: {
  30172. type: 'button',
  30173. title: src_conf.i18n('vxe.pager.prevJump')
  30174. },
  30175. on: {
  30176. click: this.prevJump
  30177. }
  30178. }, [tagName ? h('i', {
  30179. class: ['vxe-pager--jump-more-icon', this.iconJumpMore || src_conf.icon.PAGER_JUMP_MORE]
  30180. }) : null, h('i', {
  30181. class: ['vxe-pager--jump-icon', this.iconJumpPrev || src_conf.icon.PAGER_JUMP_PREV]
  30182. })]);
  30183. },
  30184. // number
  30185. renderNumber: function renderNumber(h) {
  30186. return h('span', {
  30187. class: 'vxe-pager--btn-wrapper'
  30188. }, this.renderPageBtn(h));
  30189. },
  30190. // jumpNumber
  30191. renderJumpNumber: function renderJumpNumber(h) {
  30192. return h('span', {
  30193. class: 'vxe-pager--btn-wrapper'
  30194. }, this.renderPageBtn(h, true));
  30195. },
  30196. // 向下翻页
  30197. renderNextJump: function renderNextJump(h, tagName) {
  30198. return h(tagName || 'button', {
  30199. class: ['vxe-pager--jump-next', {
  30200. 'is--fixed': !tagName,
  30201. 'is--disabled': this.currentPage >= this.pageCount
  30202. }],
  30203. attrs: {
  30204. type: 'button',
  30205. title: src_conf.i18n('vxe.pager.nextJump')
  30206. },
  30207. on: {
  30208. click: this.nextJump
  30209. }
  30210. }, [tagName ? h('i', {
  30211. class: ['vxe-pager--jump-more-icon', this.iconJumpMore || src_conf.icon.PAGER_JUMP_MORE]
  30212. }) : null, h('i', {
  30213. class: ['vxe-pager--jump-icon', this.iconJumpNext || src_conf.icon.PAGER_JUMP_NEXT]
  30214. })]);
  30215. },
  30216. // 下一页
  30217. renderNextPage: function renderNextPage(h) {
  30218. return h('button', {
  30219. class: ['vxe-pager--next-btn', {
  30220. 'is--disabled': this.currentPage >= this.pageCount
  30221. }],
  30222. attrs: {
  30223. type: 'button',
  30224. title: src_conf.i18n('vxe.pager.nextPage')
  30225. },
  30226. on: {
  30227. click: this.nextPage
  30228. }
  30229. }, [h('i', {
  30230. class: ['vxe-pager--btn-icon', this.iconNextPage || src_conf.icon.PAGER_NEXT_PAGE]
  30231. })]);
  30232. },
  30233. // sizes
  30234. renderSizes: function renderSizes(h) {
  30235. var _this2 = this;
  30236. return h('vxe-select', {
  30237. class: 'vxe-pager--sizes',
  30238. props: {
  30239. value: this.pageSize,
  30240. placement: 'top',
  30241. transfer: this.transfer,
  30242. options: this.sizeList
  30243. },
  30244. on: {
  30245. change: function change(_ref2) {
  30246. var value = _ref2.value;
  30247. _this2.pageSizeEvent(value);
  30248. }
  30249. }
  30250. });
  30251. },
  30252. // FullJump
  30253. renderFullJump: function renderFullJump(h) {
  30254. return this.renderJump(h, true);
  30255. },
  30256. // Jump
  30257. renderJump: function renderJump(h, isFull) {
  30258. return h('span', {
  30259. class: 'vxe-pager--jump'
  30260. }, [isFull ? h('span', {
  30261. class: 'vxe-pager--goto-text'
  30262. }, src_conf.i18n('vxe.pager.goto')) : null, h('input', {
  30263. class: 'vxe-pager--goto',
  30264. domProps: {
  30265. value: this.inpCurrPage
  30266. },
  30267. attrs: {
  30268. type: 'text',
  30269. autocomplete: 'off'
  30270. },
  30271. on: {
  30272. input: this.jumpInputEvent,
  30273. keydown: this.jumpKeydownEvent,
  30274. blur: this.triggerJumpEvent
  30275. }
  30276. }), isFull ? h('span', {
  30277. class: 'vxe-pager--classifier-text'
  30278. }, src_conf.i18n('vxe.pager.pageClassifier')) : null]);
  30279. },
  30280. // PageCount
  30281. renderPageCount: function renderPageCount(h) {
  30282. return h('span', {
  30283. class: 'vxe-pager--count'
  30284. }, [h('span', {
  30285. class: 'vxe-pager--separator'
  30286. }), h('span', this.pageCount)]);
  30287. },
  30288. // total
  30289. renderTotal: function renderTotal(h) {
  30290. return h('span', {
  30291. class: 'vxe-pager--total'
  30292. }, src_conf.i18n('vxe.pager.total', [this.total]));
  30293. },
  30294. // number
  30295. renderPageBtn: function renderPageBtn(h, showJump) {
  30296. var _this3 = this;
  30297. var numList = this.numList,
  30298. currentPage = this.currentPage,
  30299. pageCount = this.pageCount,
  30300. pagerCount = this.pagerCount,
  30301. offsetNumber = this.offsetNumber;
  30302. var nums = [];
  30303. var isOv = pageCount > pagerCount;
  30304. var isLt = isOv && currentPage > offsetNumber + 1;
  30305. var isGt = isOv && currentPage < pageCount - offsetNumber;
  30306. var startNumber = 1;
  30307. if (isOv) {
  30308. if (currentPage >= pageCount - offsetNumber) {
  30309. startNumber = Math.max(pageCount - numList.length + 1, 1);
  30310. } else {
  30311. startNumber = Math.max(currentPage - offsetNumber, 1);
  30312. }
  30313. }
  30314. if (showJump && isLt) {
  30315. nums.push(h('button', {
  30316. class: 'vxe-pager--num-btn',
  30317. attrs: {
  30318. type: 'button'
  30319. },
  30320. on: {
  30321. click: function click() {
  30322. return _this3.jumpPage(1);
  30323. }
  30324. }
  30325. }, 1), this.renderPrevJump(h, 'span'));
  30326. }
  30327. numList.forEach(function (item, index) {
  30328. var number = startNumber + index;
  30329. if (number <= pageCount) {
  30330. nums.push(h('button', {
  30331. class: ['vxe-pager--num-btn', {
  30332. 'is--active': currentPage === number
  30333. }],
  30334. attrs: {
  30335. type: 'button'
  30336. },
  30337. on: {
  30338. click: function click() {
  30339. return _this3.jumpPage(number);
  30340. }
  30341. },
  30342. key: number
  30343. }, number));
  30344. }
  30345. });
  30346. if (showJump && isGt) {
  30347. nums.push(this.renderNextJump(h, 'button'), h('button', {
  30348. class: 'vxe-pager--num-btn',
  30349. attrs: {
  30350. type: 'button'
  30351. },
  30352. on: {
  30353. click: function click() {
  30354. return _this3.jumpPage(pageCount);
  30355. }
  30356. }
  30357. }, pageCount));
  30358. }
  30359. return nums;
  30360. },
  30361. getPageCount: function getPageCount(total, size) {
  30362. return Math.max(Math.ceil(total / size), 1);
  30363. },
  30364. prevPage: function prevPage() {
  30365. var currentPage = this.currentPage,
  30366. pageCount = this.pageCount;
  30367. if (currentPage > 1) {
  30368. this.jumpPage(Math.min(pageCount, Math.max(currentPage - 1, 1)));
  30369. }
  30370. },
  30371. nextPage: function nextPage() {
  30372. var currentPage = this.currentPage,
  30373. pageCount = this.pageCount;
  30374. if (currentPage < pageCount) {
  30375. this.jumpPage(Math.min(pageCount, currentPage + 1));
  30376. }
  30377. },
  30378. prevJump: function prevJump() {
  30379. this.jumpPage(Math.max(this.currentPage - this.numList.length, 1));
  30380. },
  30381. nextJump: function nextJump() {
  30382. this.jumpPage(Math.min(this.currentPage + this.numList.length, this.pageCount));
  30383. },
  30384. jumpPage: function jumpPage(currentPage) {
  30385. if (currentPage !== this.currentPage) {
  30386. this.$emit('update:currentPage', currentPage);
  30387. this.$emit('page-change', {
  30388. type: 'current',
  30389. pageSize: this.pageSize,
  30390. currentPage: currentPage
  30391. });
  30392. }
  30393. },
  30394. pageSizeEvent: function pageSizeEvent(pageSize) {
  30395. this.changePageSize(pageSize);
  30396. },
  30397. changePageSize: function changePageSize(pageSize) {
  30398. if (pageSize !== this.pageSize) {
  30399. this.$emit('update:pageSize', pageSize);
  30400. this.$emit('page-change', {
  30401. type: 'size',
  30402. pageSize: pageSize,
  30403. currentPage: Math.min(this.currentPage, this.getPageCount(this.total, pageSize))
  30404. });
  30405. }
  30406. },
  30407. jumpInputEvent: function jumpInputEvent(evnt) {
  30408. this.inpCurrPage = evnt.target.value;
  30409. },
  30410. jumpKeydownEvent: function jumpKeydownEvent(evnt) {
  30411. if (evnt.keyCode === 13) {
  30412. this.triggerJumpEvent(evnt);
  30413. } else if (evnt.keyCode === 38) {
  30414. evnt.preventDefault();
  30415. this.nextPage();
  30416. } else if (evnt.keyCode === 40) {
  30417. evnt.preventDefault();
  30418. this.prevPage();
  30419. }
  30420. },
  30421. triggerJumpEvent: function triggerJumpEvent(evnt) {
  30422. var value = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(evnt.target.value);
  30423. var current = value <= 0 ? 1 : value >= this.pageCount ? this.pageCount : value;
  30424. evnt.target.value = current;
  30425. this.jumpPage(current);
  30426. }
  30427. }
  30428. });
  30429. // CONCATENATED MODULE: ./packages/pager/index.js
  30430. var Pager = Object.assign(pager, {
  30431. install: function install(Vue) {
  30432. Vue.component(pager.name, pager);
  30433. }
  30434. });
  30435. /* harmony default export */ var packages_pager = (Pager);
  30436. // CONCATENATED MODULE: ./packages/checkbox/index.js
  30437. var Checkbox = Object.assign(src_checkbox, {
  30438. install: function install(Vue) {
  30439. Vue.component(src_checkbox.name, src_checkbox);
  30440. }
  30441. });
  30442. /* harmony default export */ var packages_checkbox = (Checkbox);
  30443. // CONCATENATED MODULE: ./packages/checkbox/src/group.js
  30444. /* harmony default export */ var checkbox_src_group = ({
  30445. name: 'VxeCheckboxGroup',
  30446. props: {
  30447. value: Array,
  30448. disabled: Boolean,
  30449. max: [String, Number],
  30450. size: {
  30451. type: String,
  30452. default: function _default() {
  30453. return src_conf.checkbox.size || src_conf.size;
  30454. }
  30455. }
  30456. },
  30457. inject: {
  30458. $xeform: {
  30459. default: null
  30460. },
  30461. $xeformiteminfo: {
  30462. default: null
  30463. }
  30464. },
  30465. provide: function provide() {
  30466. return {
  30467. $xecheckboxgroup: this
  30468. };
  30469. },
  30470. computed: {
  30471. vSize: function vSize() {
  30472. return this.size || this.$parent.size || this.$parent.vSize;
  30473. },
  30474. isMaximize: function isMaximize() {
  30475. var value = this.value,
  30476. max = this.max;
  30477. if (max) {
  30478. return value.length >= external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(max);
  30479. }
  30480. return false;
  30481. }
  30482. },
  30483. render: function render(h) {
  30484. var $scopedSlots = this.$scopedSlots;
  30485. return h('div', {
  30486. class: 'vxe-checkbox-group'
  30487. }, $scopedSlots.default ? $scopedSlots.default.call(this, {}) : []);
  30488. },
  30489. methods: {
  30490. handleChecked: function handleChecked(params, evnt) {
  30491. var checked = params.checked,
  30492. label = params.label;
  30493. var checklist = this.value || [];
  30494. var checkIndex = checklist.indexOf(label);
  30495. if (checked) {
  30496. if (checkIndex === -1) {
  30497. checklist.push(label);
  30498. }
  30499. } else {
  30500. checklist.splice(checkIndex, 1);
  30501. }
  30502. this.$emit('input', checklist);
  30503. this.$emit('change', Object.assign({
  30504. checklist: checklist
  30505. }, params)); // 自动更新校验状态
  30506. if (this.$xeform && this.$xeformiteminfo) {
  30507. this.$xeform.triggerItemEvent(evnt, this.$xeformiteminfo.itemConfig.field, checklist);
  30508. }
  30509. }
  30510. }
  30511. });
  30512. // CONCATENATED MODULE: ./packages/checkbox-group/index.js
  30513. var CheckboxGroup = Object.assign(checkbox_src_group, {
  30514. install: function install(Vue) {
  30515. Vue.component(checkbox_src_group.name, checkbox_src_group);
  30516. }
  30517. });
  30518. /* harmony default export */ var checkbox_group = (CheckboxGroup);
  30519. // CONCATENATED MODULE: ./packages/radio/index.js
  30520. var Radio = Object.assign(src_radio, {
  30521. install: function install(Vue) {
  30522. Vue.component(src_radio.name, src_radio);
  30523. }
  30524. });
  30525. /* harmony default export */ var packages_radio = (Radio);
  30526. // CONCATENATED MODULE: ./packages/radio/src/group.js
  30527. /* harmony default export */ var radio_src_group = ({
  30528. name: 'VxeRadioGroup',
  30529. props: {
  30530. value: [String, Number, Boolean],
  30531. disabled: Boolean,
  30532. strict: {
  30533. type: Boolean,
  30534. default: function _default() {
  30535. return src_conf.radioGroup.strict;
  30536. }
  30537. },
  30538. size: {
  30539. type: String,
  30540. default: function _default() {
  30541. return src_conf.radioGroup.size || src_conf.size;
  30542. }
  30543. }
  30544. },
  30545. inject: {
  30546. $xeform: {
  30547. default: null
  30548. },
  30549. $xeformiteminfo: {
  30550. default: null
  30551. }
  30552. },
  30553. provide: function provide() {
  30554. return {
  30555. $xeradiogroup: this
  30556. };
  30557. },
  30558. computed: {
  30559. vSize: function vSize() {
  30560. return this.size || this.$parent.size || this.$parent.vSize;
  30561. }
  30562. },
  30563. data: function data() {
  30564. return {
  30565. name: external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.uniqueId('xegroup_')
  30566. };
  30567. },
  30568. render: function render(h) {
  30569. var $scopedSlots = this.$scopedSlots;
  30570. return h('div', {
  30571. class: 'vxe-radio-group'
  30572. }, $scopedSlots.default ? $scopedSlots.default.call(this, {}) : []);
  30573. },
  30574. methods: {
  30575. handleChecked: function handleChecked(params, evnt) {
  30576. this.$emit('input', params.label);
  30577. this.$emit('change', params); // 自动更新校验状态
  30578. if (this.$xeform && this.$xeformiteminfo) {
  30579. this.$xeform.triggerItemEvent(evnt, this.$xeformiteminfo.itemConfig.field, params.label);
  30580. }
  30581. }
  30582. }
  30583. });
  30584. // CONCATENATED MODULE: ./packages/radio-group/index.js
  30585. var RadioGroup = Object.assign(radio_src_group, {
  30586. install: function install(Vue) {
  30587. Vue.component(radio_src_group.name, radio_src_group);
  30588. }
  30589. });
  30590. /* harmony default export */ var radio_group = (RadioGroup);
  30591. // CONCATENATED MODULE: ./packages/radio/src/button.js
  30592. /* harmony default export */ var src_button = ({
  30593. name: 'VxeRadioButton',
  30594. props: {
  30595. value: [String, Number, Boolean],
  30596. label: [String, Number, Boolean],
  30597. title: [String, Number],
  30598. content: [String, Number],
  30599. disabled: Boolean,
  30600. strict: {
  30601. type: Boolean,
  30602. default: function _default() {
  30603. return src_conf.radioButton.strict;
  30604. }
  30605. },
  30606. size: {
  30607. type: String,
  30608. default: function _default() {
  30609. return src_conf.radioButton.size || src_conf.size;
  30610. }
  30611. }
  30612. },
  30613. inject: {
  30614. $xeradiogroup: {
  30615. default: null
  30616. },
  30617. $xeform: {
  30618. default: null
  30619. },
  30620. $xeformiteminfo: {
  30621. default: null
  30622. }
  30623. },
  30624. computed: {
  30625. vSize: function vSize() {
  30626. return this.size || this.$parent.size || this.$parent.vSize;
  30627. },
  30628. isDisabled: function isDisabled() {
  30629. var $xeradiogroup = this.$xeradiogroup;
  30630. return this.disabled || $xeradiogroup && $xeradiogroup.disabled;
  30631. },
  30632. isStrict: function isStrict() {
  30633. var $xeradiogroup = this.$xeradiogroup;
  30634. return $xeradiogroup ? $xeradiogroup.strict : this.strict;
  30635. }
  30636. },
  30637. render: function render(h) {
  30638. var _ref;
  30639. var $scopedSlots = this.$scopedSlots,
  30640. $xeradiogroup = this.$xeradiogroup,
  30641. isDisabled = this.isDisabled,
  30642. title = this.title,
  30643. vSize = this.vSize,
  30644. value = this.value,
  30645. label = this.label,
  30646. content = this.content;
  30647. var attrs = {};
  30648. if (title) {
  30649. attrs.title = title;
  30650. }
  30651. return h('label', {
  30652. class: ['vxe-radio', 'vxe-radio-button', (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, 'is--disabled', isDisabled), _ref)],
  30653. attrs: attrs
  30654. }, [h('input', {
  30655. class: 'vxe-radio--input',
  30656. attrs: {
  30657. type: 'radio',
  30658. name: $xeradiogroup ? $xeradiogroup.name : null,
  30659. disabled: isDisabled
  30660. },
  30661. domProps: {
  30662. checked: $xeradiogroup ? $xeradiogroup.value === label : value === label
  30663. },
  30664. on: {
  30665. change: this.changeEvent,
  30666. click: this.clickEvent
  30667. }
  30668. }), h('span', {
  30669. class: 'vxe-radio--label'
  30670. }, $scopedSlots.default ? $scopedSlots.default.call(this, {}) : [getFuncText(content)])]);
  30671. },
  30672. methods: {
  30673. handleValue: function handleValue(label, evnt) {
  30674. var $xeradiogroup = this.$xeradiogroup;
  30675. var params = {
  30676. label: label,
  30677. $event: evnt
  30678. };
  30679. if ($xeradiogroup) {
  30680. $xeradiogroup.handleChecked(params, evnt);
  30681. } else {
  30682. this.$emit('input', label);
  30683. this.$emit('change', params); // 自动更新校验状态
  30684. if (this.$xeform && this.$xeformiteminfo) {
  30685. this.$xeform.triggerItemEvent(evnt, this.$xeformiteminfo.itemConfig.field, label);
  30686. }
  30687. }
  30688. },
  30689. changeEvent: function changeEvent(evnt) {
  30690. var isDisabled = this.isDisabled;
  30691. if (!isDisabled) {
  30692. this.handleValue(this.label, evnt);
  30693. }
  30694. },
  30695. clickEvent: function clickEvent(evnt) {
  30696. var $xeradiogroup = this.$xeradiogroup,
  30697. isDisabled = this.isDisabled,
  30698. isStrict = this.isStrict;
  30699. if (!isDisabled && !isStrict) {
  30700. if (this.label === ($xeradiogroup ? $xeradiogroup.value : this.value)) {
  30701. this.handleValue(null, evnt);
  30702. }
  30703. }
  30704. }
  30705. }
  30706. });
  30707. // CONCATENATED MODULE: ./packages/radio-button/index.js
  30708. var RadioButton = Object.assign(src_button, {
  30709. install: function install(Vue) {
  30710. Vue.component(src_button.name, src_button);
  30711. }
  30712. });
  30713. /* harmony default export */ var radio_button = (RadioButton);
  30714. // CONCATENATED MODULE: ./packages/input/index.js
  30715. var Input = Object.assign(input, {
  30716. install: function install(Vue) {
  30717. Vue.component(input.name, input);
  30718. }
  30719. });
  30720. /* harmony default export */ var packages_input = (Input);
  30721. // CONCATENATED MODULE: ./packages/textarea/src/textarea.js
  30722. var autoTxtElem;
  30723. /* harmony default export */ var src_textarea = ({
  30724. name: 'VxeTextarea',
  30725. mixins: [size],
  30726. model: {
  30727. prop: 'value',
  30728. event: 'modelValue'
  30729. },
  30730. props: {
  30731. value: [String, Number],
  30732. immediate: {
  30733. type: Boolean,
  30734. default: true
  30735. },
  30736. name: String,
  30737. readonly: Boolean,
  30738. disabled: Boolean,
  30739. placeholder: String,
  30740. maxlength: [String, Number],
  30741. rows: {
  30742. type: [String, Number],
  30743. default: 2
  30744. },
  30745. cols: {
  30746. type: [String, Number],
  30747. default: null
  30748. },
  30749. showWordCount: Boolean,
  30750. countMethod: Function,
  30751. autosize: [Boolean, Object],
  30752. form: String,
  30753. resize: {
  30754. type: String,
  30755. default: function _default() {
  30756. return src_conf.textarea.resize;
  30757. }
  30758. },
  30759. className: String,
  30760. size: {
  30761. type: String,
  30762. default: function _default() {
  30763. return src_conf.textarea.size || src_conf.size;
  30764. }
  30765. }
  30766. },
  30767. inject: {
  30768. $xeform: {
  30769. default: null
  30770. },
  30771. $xeformiteminfo: {
  30772. default: null
  30773. }
  30774. },
  30775. data: function data() {
  30776. return {
  30777. inputValue: this.value
  30778. };
  30779. },
  30780. computed: {
  30781. inputCount: function inputCount() {
  30782. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getSize(this.inputValue);
  30783. },
  30784. isCountError: function isCountError() {
  30785. return this.maxlength && this.inputCount > external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(this.maxlength);
  30786. },
  30787. defaultEvents: function defaultEvents() {
  30788. var _this = this;
  30789. var evnts = {};
  30790. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.each(this.$listeners, function (cb, name) {
  30791. if (['input', 'change', 'blur'].indexOf(name) === -1) {
  30792. evnts[name] = _this.triggerEvent;
  30793. }
  30794. });
  30795. evnts.input = this.inputEvent;
  30796. evnts.change = this.changeEvent;
  30797. evnts.blur = this.blurEvent;
  30798. return evnts;
  30799. },
  30800. sizeOpts: function sizeOpts() {
  30801. return Object.assign({
  30802. minRows: 1,
  30803. maxRows: 10
  30804. }, src_conf.textarea.autosize, this.autosize);
  30805. }
  30806. },
  30807. watch: {
  30808. value: function value(val) {
  30809. this.inputValue = val;
  30810. this.updateAutoTxt();
  30811. }
  30812. },
  30813. mounted: function mounted() {
  30814. var autosize = this.autosize;
  30815. if (autosize) {
  30816. this.updateAutoTxt();
  30817. this.handleResize();
  30818. }
  30819. },
  30820. render: function render(h) {
  30821. var _ref;
  30822. var className = this.className,
  30823. defaultEvents = this.defaultEvents,
  30824. inputValue = this.inputValue,
  30825. vSize = this.vSize,
  30826. name = this.name,
  30827. form = this.form,
  30828. resize = this.resize,
  30829. placeholder = this.placeholder,
  30830. readonly = this.readonly,
  30831. disabled = this.disabled,
  30832. maxlength = this.maxlength,
  30833. autosize = this.autosize,
  30834. showWordCount = this.showWordCount,
  30835. countMethod = this.countMethod,
  30836. rows = this.rows,
  30837. cols = this.cols;
  30838. var attrs = {
  30839. name: name,
  30840. form: form,
  30841. placeholder: placeholder,
  30842. maxlength: maxlength,
  30843. readonly: readonly,
  30844. disabled: disabled,
  30845. rows: rows,
  30846. cols: cols
  30847. };
  30848. if (placeholder) {
  30849. attrs.placeholder = getFuncText(placeholder);
  30850. }
  30851. return h('div', {
  30852. class: ['vxe-textarea', className, (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, 'is--autosize', autosize), _defineProperty(_ref, 'is--disabled', disabled), _defineProperty(_ref, 'def--rows', !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eqNull(rows)), _defineProperty(_ref, 'def--cols', !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eqNull(cols)), _ref)]
  30853. }, [h('textarea', {
  30854. ref: 'textarea',
  30855. class: 'vxe-textarea--inner',
  30856. domProps: {
  30857. value: inputValue
  30858. },
  30859. attrs: attrs,
  30860. style: resize ? {
  30861. resize: resize
  30862. } : null,
  30863. on: defaultEvents
  30864. }), showWordCount ? h('span', {
  30865. class: ['vxe-textarea--count', {
  30866. 'is--error': this.isCountError
  30867. }]
  30868. }, countMethod ? "".concat(countMethod({
  30869. value: inputValue
  30870. })) : "".concat(this.inputCount).concat(maxlength ? "/".concat(maxlength) : '')) : null]);
  30871. },
  30872. methods: {
  30873. focus: function focus() {
  30874. this.$refs.textarea.focus();
  30875. return this.$nextTick();
  30876. },
  30877. blur: function blur() {
  30878. this.$refs.textarea.blur();
  30879. return this.$nextTick();
  30880. },
  30881. triggerEvent: function triggerEvent(evnt) {
  30882. var inputValue = this.inputValue;
  30883. this.$emit(evnt.type, {
  30884. value: inputValue,
  30885. $event: evnt
  30886. });
  30887. },
  30888. emitUpdate: function emitUpdate(value, evnt) {
  30889. this.inputValue = value;
  30890. this.$emit('modelValue', value);
  30891. if (this.value !== value) {
  30892. this.$emit('change', {
  30893. value: value,
  30894. $event: evnt
  30895. }); // 自动更新校验状态
  30896. if (this.$xeform && this.$xeformiteminfo) {
  30897. this.$xeform.triggerItemEvent(evnt, this.$xeformiteminfo.itemConfig.field, value);
  30898. }
  30899. }
  30900. },
  30901. inputEvent: function inputEvent(evnt) {
  30902. var immediate = this.immediate;
  30903. var value = evnt.target.value;
  30904. this.inputValue = value;
  30905. if (immediate) {
  30906. this.emitUpdate(value, evnt);
  30907. }
  30908. this.handleResize();
  30909. this.triggerEvent(evnt);
  30910. },
  30911. changeEvent: function changeEvent(evnt) {
  30912. var immediate = this.immediate;
  30913. if (immediate) {
  30914. this.triggerEvent(evnt);
  30915. } else {
  30916. this.emitUpdate(this.inputValue, evnt);
  30917. }
  30918. },
  30919. blurEvent: function blurEvent(evnt) {
  30920. var inputValue = this.inputValue,
  30921. immediate = this.immediate;
  30922. if (!immediate) {
  30923. this.emitUpdate(inputValue, evnt);
  30924. }
  30925. this.$emit('blur', {
  30926. value: inputValue,
  30927. $event: evnt
  30928. });
  30929. },
  30930. updateAutoTxt: function updateAutoTxt() {
  30931. var $refs = this.$refs,
  30932. inputValue = this.inputValue,
  30933. size = this.size,
  30934. autosize = this.autosize;
  30935. if (autosize) {
  30936. if (!autoTxtElem) {
  30937. autoTxtElem = document.createElement('div');
  30938. }
  30939. if (!autoTxtElem.parentNode) {
  30940. document.body.appendChild(autoTxtElem);
  30941. }
  30942. var textElem = $refs.textarea;
  30943. var textStyle = getComputedStyle(textElem);
  30944. autoTxtElem.className = ['vxe-textarea--autosize', size ? "size--".concat(size) : ''].join(' ');
  30945. autoTxtElem.style.width = "".concat(textElem.clientWidth, "px");
  30946. autoTxtElem.style.padding = textStyle.padding;
  30947. autoTxtElem.innerHTML = ('' + (inputValue || ' ')).replace(/\n$/, '\n ');
  30948. }
  30949. },
  30950. handleResize: function handleResize() {
  30951. var _this2 = this;
  30952. if (this.autosize) {
  30953. this.$nextTick(function () {
  30954. var $refs = _this2.$refs,
  30955. sizeOpts = _this2.sizeOpts;
  30956. var minRows = sizeOpts.minRows,
  30957. maxRows = sizeOpts.maxRows;
  30958. var textElem = $refs.textarea;
  30959. var sizeHeight = autoTxtElem.clientHeight;
  30960. var textStyle = getComputedStyle(textElem);
  30961. var lineHeight = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(textStyle.lineHeight);
  30962. var paddingTop = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(textStyle.paddingTop);
  30963. var paddingBottom = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(textStyle.paddingBottom);
  30964. var borderTopWidth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(textStyle.borderTopWidth);
  30965. var borderBottomWidth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(textStyle.borderBottomWidth);
  30966. var intervalHeight = paddingTop + paddingBottom + borderTopWidth + borderBottomWidth;
  30967. var rowNum = (sizeHeight - intervalHeight) / lineHeight;
  30968. var textRows = rowNum && /[0-9]/.test(rowNum) ? rowNum : Math.floor(rowNum) + 1;
  30969. var vaildRows = textRows;
  30970. if (textRows < minRows) {
  30971. vaildRows = minRows;
  30972. } else if (textRows > maxRows) {
  30973. vaildRows = maxRows;
  30974. }
  30975. textElem.style.height = "".concat(vaildRows * lineHeight + intervalHeight, "px");
  30976. });
  30977. }
  30978. }
  30979. }
  30980. });
  30981. // CONCATENATED MODULE: ./packages/textarea/index.js
  30982. var Textarea = Object.assign(src_textarea, {
  30983. install: function install(Vue) {
  30984. Vue.component(src_textarea.name, src_textarea);
  30985. }
  30986. });
  30987. /* harmony default export */ var packages_textarea = (Textarea);
  30988. // CONCATENATED MODULE: ./packages/button/src/button.js
  30989. /* harmony default export */ var button_src_button = ({
  30990. name: 'VxeButton',
  30991. mixins: [size],
  30992. props: {
  30993. type: String,
  30994. size: {
  30995. type: String,
  30996. default: function _default() {
  30997. return src_conf.button.size || src_conf.size;
  30998. }
  30999. },
  31000. name: [String, Number],
  31001. content: String,
  31002. placement: String,
  31003. status: String,
  31004. icon: String,
  31005. round: Boolean,
  31006. circle: Boolean,
  31007. disabled: Boolean,
  31008. loading: Boolean,
  31009. destroyOnClose: Boolean,
  31010. className: String,
  31011. transfer: {
  31012. type: Boolean,
  31013. default: function _default() {
  31014. return src_conf.button.transfer;
  31015. }
  31016. }
  31017. },
  31018. data: function data() {
  31019. return {
  31020. inited: false,
  31021. showPanel: false,
  31022. animatVisible: false,
  31023. panelIndex: 0,
  31024. panelStyle: null,
  31025. panelPlacement: null
  31026. };
  31027. },
  31028. computed: {
  31029. isText: function isText() {
  31030. return this.type === 'text';
  31031. },
  31032. isFormBtn: function isFormBtn() {
  31033. return ['submit', 'reset', 'button'].indexOf(this.type) > -1;
  31034. },
  31035. btnType: function btnType() {
  31036. return this.isText ? this.type : 'button';
  31037. }
  31038. },
  31039. created: function created() {
  31040. GlobalEvent.on(this, 'mousewheel', this.handleGlobalMousewheelEvent);
  31041. },
  31042. beforeDestroy: function beforeDestroy() {
  31043. var panelElem = this.$refs.panel;
  31044. if (panelElem && panelElem.parentNode) {
  31045. panelElem.parentNode.removeChild(panelElem);
  31046. }
  31047. },
  31048. destroyed: function destroyed() {
  31049. GlobalEvent.off(this, 'mousewheel');
  31050. },
  31051. render: function render(h) {
  31052. var _ref,
  31053. _ref2,
  31054. _this = this,
  31055. _ref3,
  31056. _ref4;
  31057. var $scopedSlots = this.$scopedSlots,
  31058. $listeners = this.$listeners,
  31059. className = this.className,
  31060. inited = this.inited,
  31061. type = this.type,
  31062. destroyOnClose = this.destroyOnClose,
  31063. isFormBtn = this.isFormBtn,
  31064. status = this.status,
  31065. btnType = this.btnType,
  31066. vSize = this.vSize,
  31067. name = this.name,
  31068. disabled = this.disabled,
  31069. loading = this.loading,
  31070. showPanel = this.showPanel,
  31071. animatVisible = this.animatVisible,
  31072. panelPlacement = this.panelPlacement;
  31073. var downsSlot = $scopedSlots.dropdowns;
  31074. return downsSlot ? h('div', {
  31075. class: ['vxe-button--dropdown', className, (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, 'is--active', showPanel), _ref)]
  31076. }, [h('button', {
  31077. ref: 'xBtn',
  31078. 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)],
  31079. attrs: {
  31080. name: name,
  31081. type: isFormBtn ? type : 'button',
  31082. disabled: disabled || loading
  31083. },
  31084. on: Object.assign({
  31085. mouseenter: this.mouseenterTargetEvent,
  31086. mouseleave: this.mouseleaveEvent
  31087. }, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.objectMap($listeners, function (cb, type) {
  31088. return function (evnt) {
  31089. return _this.$emit(type, {
  31090. $event: evnt
  31091. });
  31092. };
  31093. }))
  31094. }, this.renderContent(h).concat([h('i', {
  31095. class: "vxe-button--dropdown-arrow ".concat(src_conf.icon.BUTTON_DROPDOWN)
  31096. })])), h('div', {
  31097. ref: 'panel',
  31098. class: ['vxe-button--dropdown-panel', (_ref3 = {}, _defineProperty(_ref3, "size--".concat(vSize), vSize), _defineProperty(_ref3, 'animat--leave', animatVisible), _defineProperty(_ref3, 'animat--enter', showPanel), _ref3)],
  31099. attrs: {
  31100. placement: panelPlacement
  31101. },
  31102. style: this.panelStyle
  31103. }, inited ? [h('div', {
  31104. class: 'vxe-button--dropdown-wrapper',
  31105. on: {
  31106. mousedown: this.mousedownDropdownEvent,
  31107. click: this.clickDropdownEvent,
  31108. mouseenter: this.mouseenterEvent,
  31109. mouseleave: this.mouseleaveEvent
  31110. }
  31111. }, destroyOnClose && !showPanel ? [] : downsSlot.call(this, {}, h))] : null)]) : h('button', {
  31112. ref: 'xBtn',
  31113. class: ['vxe-button', "type--".concat(btnType), className, (_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)],
  31114. attrs: {
  31115. name: name,
  31116. type: isFormBtn ? type : 'button',
  31117. disabled: disabled || loading
  31118. },
  31119. on: external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.objectMap($listeners, function (cb, type) {
  31120. return function (evnt) {
  31121. return _this.$emit(type, {
  31122. $event: evnt
  31123. });
  31124. };
  31125. })
  31126. }, this.renderContent(h));
  31127. },
  31128. methods: {
  31129. renderContent: function renderContent(h) {
  31130. var $scopedSlots = this.$scopedSlots,
  31131. content = this.content,
  31132. icon = this.icon,
  31133. loading = this.loading;
  31134. var contents = [];
  31135. if (loading) {
  31136. contents.push(h('i', {
  31137. class: ['vxe-button--loading-icon', src_conf.icon.BUTTON_LOADING]
  31138. }));
  31139. } else if ($scopedSlots.icon) {
  31140. contents.push(h('span', {
  31141. class: 'vxe-button--custom-icon'
  31142. }, $scopedSlots.icon.call(this, {})));
  31143. } else if (icon) {
  31144. contents.push(h('i', {
  31145. class: ['vxe-button--icon', icon]
  31146. }));
  31147. }
  31148. if ($scopedSlots.default) {
  31149. contents.push(h('span', {
  31150. class: 'vxe-button--content'
  31151. }, $scopedSlots.default.call(this, {})));
  31152. } else if (content) {
  31153. contents.push(h('span', {
  31154. class: 'vxe-button--content'
  31155. }, [getFuncText(content)]));
  31156. }
  31157. return contents;
  31158. },
  31159. handleGlobalMousewheelEvent: function handleGlobalMousewheelEvent(evnt) {
  31160. if (this.showPanel && !dom.getEventTargetNode(evnt, this.$refs.panel).flag) {
  31161. this.closePanel();
  31162. }
  31163. },
  31164. updateZindex: function updateZindex() {
  31165. if (this.panelIndex < utils.getLastZIndex()) {
  31166. this.panelIndex = utils.nextZIndex();
  31167. }
  31168. },
  31169. mousedownDropdownEvent: function mousedownDropdownEvent(evnt) {
  31170. var isLeftBtn = evnt.button === 0;
  31171. if (isLeftBtn) {
  31172. evnt.stopPropagation();
  31173. }
  31174. },
  31175. clickDropdownEvent: function clickDropdownEvent(evnt) {
  31176. var _this2 = this;
  31177. var dropdownElem = evnt.currentTarget;
  31178. var panelElem = this.$refs.panel;
  31179. var _DomTools$getEventTar = dom.getEventTargetNode(evnt, dropdownElem, 'vxe-button'),
  31180. flag = _DomTools$getEventTar.flag,
  31181. targetElem = _DomTools$getEventTar.targetElem;
  31182. if (flag) {
  31183. if (panelElem) {
  31184. panelElem.dataset.active = 'N';
  31185. }
  31186. this.showPanel = false;
  31187. setTimeout(function () {
  31188. if (!panelElem || panelElem.dataset.active !== 'Y') {
  31189. _this2.animatVisible = false;
  31190. }
  31191. }, 350);
  31192. this.$emit('dropdown-click', {
  31193. name: targetElem.getAttribute('name'),
  31194. $event: evnt
  31195. });
  31196. }
  31197. },
  31198. mouseenterTargetEvent: function mouseenterTargetEvent() {
  31199. var _this3 = this;
  31200. var panelElem = this.$refs.panel;
  31201. panelElem.dataset.active = 'Y';
  31202. if (!this.inited) {
  31203. this.inited = true;
  31204. if (this.transfer) {
  31205. document.body.appendChild(panelElem);
  31206. }
  31207. }
  31208. this.showTime = setTimeout(function () {
  31209. if (panelElem.dataset.active === 'Y') {
  31210. _this3.mouseenterEvent();
  31211. } else {
  31212. _this3.animatVisible = false;
  31213. }
  31214. }, 250);
  31215. },
  31216. mouseenterEvent: function mouseenterEvent() {
  31217. var _this4 = this;
  31218. var panelElem = this.$refs.panel;
  31219. panelElem.dataset.active = 'Y';
  31220. this.animatVisible = true;
  31221. setTimeout(function () {
  31222. if (panelElem.dataset.active === 'Y') {
  31223. _this4.showPanel = true;
  31224. _this4.updateZindex();
  31225. _this4.updatePlacement();
  31226. setTimeout(function () {
  31227. if (_this4.showPanel) {
  31228. _this4.updatePlacement();
  31229. }
  31230. }, 50);
  31231. }
  31232. }, 20);
  31233. },
  31234. mouseleaveEvent: function mouseleaveEvent() {
  31235. this.closePanel();
  31236. },
  31237. closePanel: function closePanel() {
  31238. var _this5 = this;
  31239. var panelElem = this.$refs.panel;
  31240. clearTimeout(this.showTime);
  31241. if (panelElem) {
  31242. panelElem.dataset.active = 'N';
  31243. setTimeout(function () {
  31244. if (panelElem.dataset.active !== 'Y') {
  31245. _this5.showPanel = false;
  31246. setTimeout(function () {
  31247. if (panelElem.dataset.active !== 'Y') {
  31248. _this5.animatVisible = false;
  31249. }
  31250. }, 350);
  31251. }
  31252. }, 100);
  31253. } else {
  31254. this.animatVisible = false;
  31255. this.showPanel = false;
  31256. }
  31257. },
  31258. updatePlacement: function updatePlacement() {
  31259. var _this6 = this;
  31260. return this.$nextTick().then(function () {
  31261. var $refs = _this6.$refs,
  31262. transfer = _this6.transfer,
  31263. placement = _this6.placement,
  31264. panelIndex = _this6.panelIndex;
  31265. var targetElem = $refs.xBtn;
  31266. var panelElem = $refs.panel;
  31267. if (panelElem && targetElem) {
  31268. var targetHeight = targetElem.offsetHeight;
  31269. var targetWidth = targetElem.offsetWidth;
  31270. var panelHeight = panelElem.offsetHeight;
  31271. var panelWidth = panelElem.offsetWidth;
  31272. var marginSize = 5;
  31273. var panelStyle = {
  31274. zIndex: panelIndex
  31275. };
  31276. var _DomTools$getAbsolute = dom.getAbsolutePos(targetElem),
  31277. top = _DomTools$getAbsolute.top,
  31278. left = _DomTools$getAbsolute.left,
  31279. boundingTop = _DomTools$getAbsolute.boundingTop,
  31280. visibleHeight = _DomTools$getAbsolute.visibleHeight,
  31281. visibleWidth = _DomTools$getAbsolute.visibleWidth;
  31282. var panelPlacement = 'bottom';
  31283. if (transfer) {
  31284. var btnLeft = left + targetWidth - panelWidth;
  31285. var btnTop = top + targetHeight;
  31286. if (placement === 'top') {
  31287. panelPlacement = 'top';
  31288. btnTop = top - panelHeight;
  31289. } else if (!placement) {
  31290. // 如果下面不够放,则向上
  31291. if (boundingTop + targetHeight + panelHeight + marginSize > visibleHeight) {
  31292. panelPlacement = 'top';
  31293. btnTop = top - panelHeight;
  31294. } // 如果上面不够放,则向下(优先)
  31295. if (btnTop < marginSize) {
  31296. panelPlacement = 'bottom';
  31297. btnTop = top + targetHeight;
  31298. }
  31299. } // 如果溢出右边
  31300. if (btnLeft + panelWidth + marginSize > visibleWidth) {
  31301. btnLeft -= btnLeft + panelWidth + marginSize - visibleWidth;
  31302. } // 如果溢出左边
  31303. if (btnLeft < marginSize) {
  31304. btnLeft = marginSize;
  31305. }
  31306. Object.assign(panelStyle, {
  31307. left: "".concat(btnLeft, "px"),
  31308. right: 'auto',
  31309. top: "".concat(btnTop, "px"),
  31310. minWidth: "".concat(targetWidth, "px")
  31311. });
  31312. } else {
  31313. if (placement === 'top') {
  31314. panelPlacement = 'top';
  31315. panelStyle.bottom = "".concat(targetHeight, "px");
  31316. } else if (!placement) {
  31317. // 如果下面不够放,则向上
  31318. if (boundingTop + targetHeight + panelHeight > visibleHeight) {
  31319. // 如果上面不够放,则向下(优先)
  31320. if (boundingTop - targetHeight - panelHeight > marginSize) {
  31321. panelPlacement = 'top';
  31322. panelStyle.bottom = "".concat(targetHeight, "px");
  31323. }
  31324. }
  31325. }
  31326. }
  31327. _this6.panelStyle = panelStyle;
  31328. _this6.panelPlacement = panelPlacement;
  31329. return _this6.$nextTick();
  31330. }
  31331. });
  31332. },
  31333. focus: function focus() {
  31334. this.$el.focus();
  31335. return this.$nextTick();
  31336. },
  31337. blur: function blur() {
  31338. this.$el.blur();
  31339. return this.$nextTick();
  31340. }
  31341. }
  31342. });
  31343. // CONCATENATED MODULE: ./packages/button/index.js
  31344. var Button = Object.assign(button_src_button, {
  31345. install: function install(Vue) {
  31346. Vue.component(button_src_button.name, button_src_button);
  31347. }
  31348. });
  31349. /* harmony default export */ var packages_button = (Button);
  31350. // CONCATENATED MODULE: ./packages/modal/index.js
  31351. /* eslint-disable @typescript-eslint/no-use-before-define */
  31352. var ModalClass = null;
  31353. function openModal(opts) {
  31354. var options = Object.assign({}, opts, {
  31355. transfer: true
  31356. });
  31357. return new Promise(function (resolve) {
  31358. if (options && options.id && allActivedModals.some(function (comp) {
  31359. return comp.id === options.id;
  31360. })) {
  31361. resolve('exist');
  31362. } else {
  31363. var events = options.events || {};
  31364. options.events = Object.assign({}, events, {
  31365. hide: function hide(params) {
  31366. if (events.hide) {
  31367. events.hide.call(this, params);
  31368. }
  31369. setTimeout(function () {
  31370. return $modal.$destroy();
  31371. }, $modal.isMsg ? 500 : 100);
  31372. resolve(params.type);
  31373. }
  31374. });
  31375. var $modal = new ModalClass({
  31376. el: document.createElement('div'),
  31377. propsData: options
  31378. });
  31379. setTimeout(function () {
  31380. if ($modal.isDestroy) {
  31381. $modal.close();
  31382. } else {
  31383. $modal.open();
  31384. }
  31385. });
  31386. }
  31387. });
  31388. }
  31389. /**
  31390. * 全局关闭动态的活动窗口(只能用于关闭动态的创建的活动窗口)
  31391. * 如果传 id 则关闭指定的窗口
  31392. * 如果不传则关闭所有窗口
  31393. */
  31394. function closeModal(id) {
  31395. var modals = arguments.length ? [getModal(id)] : allActivedModals;
  31396. modals.forEach(function ($modal) {
  31397. if ($modal) {
  31398. $modal.isDestroy = true;
  31399. $modal.close('close');
  31400. }
  31401. });
  31402. return Promise.resolve();
  31403. }
  31404. function getModal(id) {
  31405. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.find(allActivedModals, function ($modal) {
  31406. return $modal.id === id;
  31407. });
  31408. }
  31409. var ModalController = {
  31410. get: getModal,
  31411. close: closeModal,
  31412. open: openModal
  31413. };
  31414. var modal_modal = ModalController;
  31415. var shortcutTypes = ['alert', 'confirm', 'message'];
  31416. shortcutTypes.forEach(function (type, index) {
  31417. var defOpts = index === 2 ? {
  31418. mask: false,
  31419. lockView: false,
  31420. showHeader: false
  31421. } : {
  31422. showFooter: true
  31423. };
  31424. defOpts.type = type;
  31425. defOpts.dblclickZoom = false;
  31426. if (index === 1) {
  31427. defOpts.status = 'question';
  31428. }
  31429. ModalController[type] = function (content, title, options) {
  31430. var opts = {};
  31431. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isObject(content)) {
  31432. opts = content;
  31433. } else {
  31434. if (title) {
  31435. opts = index === 2 ? {
  31436. status: title
  31437. } : {
  31438. title: title
  31439. };
  31440. }
  31441. opts.content = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toValueString(content);
  31442. }
  31443. return openModal(Object.assign({
  31444. type: type
  31445. }, defOpts, opts, options));
  31446. };
  31447. });
  31448. var Modal = Object.assign(modal, {
  31449. install: function install(Vue) {
  31450. v_x_e_table._modal = 1;
  31451. Vue.component(modal.name, modal);
  31452. ModalClass = Vue.extend(modal);
  31453. v_x_e_table.modal = ModalController;
  31454. if (!Vue.prototype.$vxe) {
  31455. Vue.prototype.$vxe = {
  31456. modal: ModalController
  31457. };
  31458. } else {
  31459. Vue.prototype.$vxe.modal = ModalController;
  31460. }
  31461. }
  31462. });
  31463. /* harmony default export */ var packages_modal = (Modal);
  31464. // CONCATENATED MODULE: ./packages/tooltip/src/tooltip.js
  31465. function updateTipStyle(_vm) {
  31466. var wrapperElem = _vm.$el,
  31467. tipTarget = _vm.tipTarget,
  31468. tipStore = _vm.tipStore;
  31469. if (tipTarget) {
  31470. var _DomTools$getDomNode = dom.getDomNode(),
  31471. scrollTop = _DomTools$getDomNode.scrollTop,
  31472. scrollLeft = _DomTools$getDomNode.scrollLeft,
  31473. visibleWidth = _DomTools$getDomNode.visibleWidth;
  31474. var _DomTools$getAbsolute = dom.getAbsolutePos(tipTarget),
  31475. top = _DomTools$getAbsolute.top,
  31476. left = _DomTools$getAbsolute.left;
  31477. var marginSize = 6;
  31478. var offsetHeight = wrapperElem.offsetHeight;
  31479. var offsetWidth = wrapperElem.offsetWidth;
  31480. var tipTop = top - offsetHeight - marginSize;
  31481. var tipLeft = Math.max(marginSize, left + Math.floor((tipTarget.offsetWidth - offsetWidth) / 2));
  31482. if (tipLeft + offsetWidth + marginSize > scrollLeft + visibleWidth) {
  31483. tipLeft = scrollLeft + visibleWidth - offsetWidth - marginSize;
  31484. }
  31485. if (top - offsetHeight < scrollTop + marginSize) {
  31486. tipStore.placement = 'bottom';
  31487. tipTop = top + tipTarget.offsetHeight + marginSize;
  31488. }
  31489. tipStore.style.top = "".concat(tipTop, "px");
  31490. tipStore.style.left = "".concat(tipLeft, "px");
  31491. tipStore.arrowStyle.left = "".concat(left - tipLeft + tipTarget.offsetWidth / 2, "px");
  31492. }
  31493. }
  31494. function showTip(_vm) {
  31495. var $el = _vm.$el,
  31496. tipStore = _vm.tipStore,
  31497. zIndex = _vm.zIndex;
  31498. var parentNode = $el.parentNode;
  31499. if (!parentNode) {
  31500. document.body.appendChild($el);
  31501. }
  31502. _vm.updateValue(true);
  31503. _vm.updateZindex();
  31504. tipStore.placement = 'top';
  31505. tipStore.style = {
  31506. width: 'auto',
  31507. left: 0,
  31508. top: 0,
  31509. zIndex: zIndex || _vm.tipZindex
  31510. };
  31511. tipStore.arrowStyle = {
  31512. left: '50%'
  31513. };
  31514. return _vm.updatePlacement();
  31515. }
  31516. function tooltip_renderContent(h, _vm) {
  31517. var $scopedSlots = _vm.$scopedSlots,
  31518. useHTML = _vm.useHTML,
  31519. tipContent = _vm.tipContent;
  31520. if ($scopedSlots.content) {
  31521. return h('div', {
  31522. key: 1,
  31523. class: 'vxe-table--tooltip-content'
  31524. }, $scopedSlots.content.call(this, {}));
  31525. }
  31526. if (useHTML) {
  31527. return h('div', {
  31528. key: 2,
  31529. class: 'vxe-table--tooltip-content',
  31530. domProps: {
  31531. innerHTML: tipContent
  31532. }
  31533. });
  31534. }
  31535. return h('div', {
  31536. key: 3,
  31537. class: 'vxe-table--tooltip-content'
  31538. }, utils.formatText(tipContent));
  31539. }
  31540. /* harmony default export */ var tooltip = ({
  31541. name: 'VxeTooltip',
  31542. mixins: [size],
  31543. props: {
  31544. value: Boolean,
  31545. size: {
  31546. type: String,
  31547. default: function _default() {
  31548. return src_conf.tooltip.size || src_conf.size;
  31549. }
  31550. },
  31551. trigger: {
  31552. type: String,
  31553. default: function _default() {
  31554. return src_conf.tooltip.trigger;
  31555. }
  31556. },
  31557. theme: {
  31558. type: String,
  31559. default: function _default() {
  31560. return src_conf.tooltip.theme;
  31561. }
  31562. },
  31563. content: {
  31564. type: [String, Number],
  31565. default: null
  31566. },
  31567. useHTML: Boolean,
  31568. zIndex: [String, Number],
  31569. isArrow: {
  31570. type: Boolean,
  31571. default: true
  31572. },
  31573. enterable: Boolean,
  31574. enterDelay: {
  31575. type: Number,
  31576. default: function _default() {
  31577. return src_conf.tooltip.enterDelay;
  31578. }
  31579. },
  31580. leaveDelay: {
  31581. type: Number,
  31582. default: function _default() {
  31583. return src_conf.tooltip.leaveDelay;
  31584. }
  31585. }
  31586. },
  31587. data: function data() {
  31588. return {
  31589. isUpdate: false,
  31590. visible: false,
  31591. tipContent: '',
  31592. tipActive: false,
  31593. tipTarget: null,
  31594. tipZindex: 0,
  31595. tipStore: {
  31596. style: {},
  31597. placement: '',
  31598. arrowStyle: null
  31599. }
  31600. };
  31601. },
  31602. watch: {
  31603. content: function content(value) {
  31604. this.tipContent = value;
  31605. },
  31606. value: function value(_value) {
  31607. if (!this.isUpdate) {
  31608. this[_value ? 'open' : 'close']();
  31609. }
  31610. this.isUpdate = false;
  31611. }
  31612. },
  31613. created: function created() {
  31614. var _this = this;
  31615. this.showDelayTip = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.debounce(function () {
  31616. if (_this.tipActive) {
  31617. showTip(_this);
  31618. }
  31619. }, this.enterDelay, {
  31620. leading: false,
  31621. trailing: true
  31622. });
  31623. },
  31624. mounted: function mounted() {
  31625. var $el = this.$el,
  31626. trigger = this.trigger,
  31627. content = this.content,
  31628. value = this.value;
  31629. var parentNode = $el.parentNode;
  31630. if (parentNode) {
  31631. var target;
  31632. this.tipContent = content;
  31633. this.tipZindex = utils.nextZIndex();
  31634. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.arrayEach($el.children, function (elem, index) {
  31635. if (index > 1) {
  31636. parentNode.insertBefore(elem, $el);
  31637. if (!target) {
  31638. target = elem;
  31639. }
  31640. }
  31641. });
  31642. parentNode.removeChild($el);
  31643. this.target = target;
  31644. if (target) {
  31645. if (trigger === 'hover') {
  31646. target.onmouseleave = this.targetMouseleaveEvent;
  31647. target.onmouseenter = this.targetMouseenterEvent;
  31648. } else if (trigger === 'click') {
  31649. target.onclick = this.clickEvent;
  31650. }
  31651. }
  31652. if (value) {
  31653. this.open();
  31654. }
  31655. }
  31656. },
  31657. beforeDestroy: function beforeDestroy() {
  31658. var $el = this.$el,
  31659. target = this.target,
  31660. trigger = this.trigger;
  31661. var parentNode = $el.parentNode;
  31662. if (parentNode) {
  31663. parentNode.removeChild($el);
  31664. }
  31665. if (target) {
  31666. if (trigger === 'hover') {
  31667. target.onmouseenter = null;
  31668. target.onmouseleave = null;
  31669. } else if (trigger === 'click') {
  31670. target.onclick = null;
  31671. }
  31672. }
  31673. },
  31674. render: function render(h) {
  31675. var _ref;
  31676. var $scopedSlots = this.$scopedSlots,
  31677. vSize = this.vSize,
  31678. theme = this.theme,
  31679. tipActive = this.tipActive,
  31680. isArrow = this.isArrow,
  31681. visible = this.visible,
  31682. tipStore = this.tipStore,
  31683. enterable = this.enterable;
  31684. var on;
  31685. if (enterable) {
  31686. on = {
  31687. mouseenter: this.wrapperMouseenterEvent,
  31688. mouseleave: this.wrapperMouseleaveEvent
  31689. };
  31690. }
  31691. return h('div', {
  31692. 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--actived', tipActive), _ref)],
  31693. style: tipStore.style,
  31694. ref: 'tipWrapper',
  31695. on: on
  31696. }, [tooltip_renderContent(h, this), h('div', {
  31697. class: 'vxe-table--tooltip-arrow',
  31698. style: tipStore.arrowStyle
  31699. })].concat($scopedSlots.default ? $scopedSlots.default.call(this, {}) : []));
  31700. },
  31701. methods: {
  31702. open: function open(target, content) {
  31703. return this.toVisible(target || this.target, content);
  31704. },
  31705. close: function close() {
  31706. this.tipTarget = null;
  31707. this.tipActive = false;
  31708. Object.assign(this.tipStore, {
  31709. style: {},
  31710. placement: '',
  31711. arrowStyle: null
  31712. });
  31713. this.updateValue(false);
  31714. return this.$nextTick();
  31715. },
  31716. updateValue: function updateValue(value) {
  31717. if (value !== this.visible) {
  31718. this.visible = value;
  31719. this.isUpdate = true;
  31720. if (this.$listeners.input) {
  31721. this.$emit('input', this.visible);
  31722. }
  31723. }
  31724. },
  31725. updateZindex: function updateZindex() {
  31726. if (this.tipZindex < utils.getLastZIndex()) {
  31727. this.tipZindex = utils.nextZIndex();
  31728. }
  31729. },
  31730. toVisible: function toVisible(target, content) {
  31731. if (target) {
  31732. var trigger = this.trigger,
  31733. enterDelay = this.enterDelay;
  31734. this.tipActive = true;
  31735. this.tipTarget = target;
  31736. if (content) {
  31737. this.tipContent = content;
  31738. }
  31739. if (enterDelay && trigger === 'hover') {
  31740. this.showDelayTip();
  31741. } else {
  31742. return showTip(this);
  31743. }
  31744. }
  31745. return this.$nextTick();
  31746. },
  31747. updatePlacement: function updatePlacement() {
  31748. var _this2 = this;
  31749. return this.$nextTick().then(function () {
  31750. var wrapperElem = _this2.$el,
  31751. tipTarget = _this2.tipTarget;
  31752. if (tipTarget && wrapperElem) {
  31753. updateTipStyle(_this2);
  31754. return _this2.$nextTick().then(function () {
  31755. return updateTipStyle(_this2);
  31756. });
  31757. }
  31758. });
  31759. },
  31760. isActived: function isActived() {
  31761. return this.tipActive;
  31762. },
  31763. setActived: function setActived(actived) {
  31764. this.tipActive = !!actived;
  31765. },
  31766. clickEvent: function clickEvent() {
  31767. this[this.visible ? 'close' : 'open']();
  31768. },
  31769. targetMouseenterEvent: function targetMouseenterEvent() {
  31770. this.open();
  31771. },
  31772. targetMouseleaveEvent: function targetMouseleaveEvent() {
  31773. var _this3 = this;
  31774. var trigger = this.trigger,
  31775. enterable = this.enterable,
  31776. leaveDelay = this.leaveDelay;
  31777. this.tipActive = false;
  31778. if (enterable && trigger === 'hover') {
  31779. setTimeout(function () {
  31780. if (!_this3.tipActive) {
  31781. _this3.close();
  31782. }
  31783. }, leaveDelay);
  31784. } else {
  31785. this.close();
  31786. }
  31787. },
  31788. wrapperMouseenterEvent: function wrapperMouseenterEvent() {
  31789. this.tipActive = true;
  31790. },
  31791. wrapperMouseleaveEvent: function wrapperMouseleaveEvent() {
  31792. var _this4 = this;
  31793. var trigger = this.trigger,
  31794. enterable = this.enterable,
  31795. leaveDelay = this.leaveDelay;
  31796. this.tipActive = false;
  31797. if (enterable && trigger === 'hover') {
  31798. setTimeout(function () {
  31799. if (!_this4.tipActive) {
  31800. _this4.close();
  31801. }
  31802. }, leaveDelay);
  31803. }
  31804. }
  31805. }
  31806. });
  31807. // CONCATENATED MODULE: ./packages/tooltip/index.js
  31808. var Tooltip = Object.assign(tooltip, {
  31809. install: function install(Vue) {
  31810. v_x_e_table._tooltip = 1;
  31811. Vue.component(tooltip.name, tooltip);
  31812. }
  31813. });
  31814. /* harmony default export */ var packages_tooltip = (Tooltip);
  31815. // CONCATENATED MODULE: ./packages/form/src/util.js
  31816. var util_ItemConfig = /*#__PURE__*/function () {
  31817. function ItemConfig($xeform, item) {
  31818. _classCallCheck(this, ItemConfig);
  31819. Object.assign(this, {
  31820. id: external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.uniqueId('item_'),
  31821. title: item.title,
  31822. field: item.field,
  31823. span: item.span,
  31824. align: item.align,
  31825. titleAlign: item.titleAlign,
  31826. titleWidth: item.titleWidth,
  31827. titleColon: item.titleColon,
  31828. titleAsterisk: item.titleAsterisk,
  31829. titlePrefix: item.titlePrefix,
  31830. titleSuffix: item.titleSuffix,
  31831. titleOverflow: item.titleOverflow,
  31832. resetValue: item.resetValue,
  31833. visible: item.visible,
  31834. visibleMethod: item.visibleMethod,
  31835. folding: item.folding,
  31836. collapseNode: item.collapseNode,
  31837. className: item.className,
  31838. itemRender: item.itemRender,
  31839. // 渲染属性
  31840. showError: false,
  31841. errRule: null,
  31842. slots: item.slots,
  31843. children: []
  31844. });
  31845. if (false) { var compConf; }
  31846. }
  31847. _createClass(ItemConfig, [{
  31848. key: "update",
  31849. value: function update(name, value) {
  31850. this[name] = value;
  31851. }
  31852. }]);
  31853. return ItemConfig;
  31854. }();
  31855. function isItem(option) {
  31856. return option instanceof util_ItemConfig;
  31857. }
  31858. function getItemConfig($xeform, _vm, options) {
  31859. return isItem(_vm) ? _vm : new util_ItemConfig($xeform, _vm, options);
  31860. }
  31861. var util_handleFieldOrItem = function handleFieldOrItem($xeform, fieldOrItem) {
  31862. if (fieldOrItem) {
  31863. return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isString(fieldOrItem) ? $xeform.getItemByField(fieldOrItem) : fieldOrItem;
  31864. }
  31865. return null;
  31866. };
  31867. function isHiddenItem($xeform, formItem) {
  31868. var collapseAll = $xeform.collapseAll;
  31869. var folding = formItem.folding,
  31870. visible = formItem.visible;
  31871. return visible === false || folding && collapseAll;
  31872. }
  31873. function isActivetem($xeform, formItem) {
  31874. var visibleMethod = formItem.visibleMethod,
  31875. itemRender = formItem.itemRender,
  31876. visible = formItem.visible,
  31877. field = formItem.field;
  31878. if (visible === false) {
  31879. return visible;
  31880. }
  31881. var compConf = isEnableConf(itemRender) ? v_x_e_table.renderer.get(itemRender.name) : null;
  31882. if (!visibleMethod && compConf && compConf.itemVisibleMethod) {
  31883. visibleMethod = compConf.itemVisibleMethod;
  31884. }
  31885. if (!visibleMethod) {
  31886. return true;
  31887. }
  31888. var data = $xeform.data;
  31889. return visibleMethod({
  31890. data: data,
  31891. field: field,
  31892. property: field,
  31893. item: formItem,
  31894. $form: $xeform
  31895. });
  31896. }
  31897. function createItem($xeform, _vm) {
  31898. return getItemConfig($xeform, _vm);
  31899. }
  31900. function destroyItem(_vm) {
  31901. var $xeform = _vm.$xeform,
  31902. itemConfig = _vm.itemConfig;
  31903. var matchObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.findTree($xeform.staticItems, function (option) {
  31904. return option === itemConfig;
  31905. });
  31906. if (matchObj) {
  31907. matchObj.items.splice(matchObj.index, 1);
  31908. }
  31909. }
  31910. function assemItem(_vm) {
  31911. var $el = _vm.$el,
  31912. $xeform = _vm.$xeform,
  31913. $xeformgather = _vm.$xeformgather,
  31914. itemConfig = _vm.itemConfig;
  31915. var itemGather = $xeformgather ? $xeformgather.itemConfig : null;
  31916. itemConfig.slots = _vm.$scopedSlots;
  31917. if (itemGather) {
  31918. if (!itemGather.children) {
  31919. itemGather.children = [];
  31920. }
  31921. itemGather.children.splice([].indexOf.call($xeformgather.$el.children, $el), 0, itemConfig);
  31922. } else {
  31923. $xeform.staticItems.splice([].indexOf.call($xeform.$refs.hideItem.children, $el), 0, itemConfig);
  31924. }
  31925. }
  31926. // CONCATENATED MODULE: ./packages/form/src/render.js
  31927. function renderPrefixIcon(h, titlePrefix) {
  31928. return h('span', {
  31929. class: 'vxe-form--item-title-prefix'
  31930. }, [h('i', {
  31931. class: titlePrefix.icon || src_conf.icon.FORM_PREFIX
  31932. })]);
  31933. }
  31934. function render_renderSuffixIcon(h, titleSuffix) {
  31935. return h('span', {
  31936. class: 'vxe-form--item-title-suffix'
  31937. }, [h('i', {
  31938. class: titleSuffix.icon || src_conf.icon.FORM_SUFFIX
  31939. })]);
  31940. }
  31941. function renderTitle(h, _vm, item) {
  31942. var data = _vm.data,
  31943. tooltipOpts = _vm.tooltipOpts;
  31944. var slots = item.slots,
  31945. field = item.field,
  31946. itemRender = item.itemRender,
  31947. titlePrefix = item.titlePrefix,
  31948. titleSuffix = item.titleSuffix;
  31949. var compConf = isEnableConf(itemRender) ? v_x_e_table.renderer.get(itemRender.name) : null;
  31950. var params = {
  31951. data: data,
  31952. field: field,
  31953. property: field,
  31954. item: item,
  31955. $form: _vm
  31956. };
  31957. var contVNs = [];
  31958. var titVNs = [];
  31959. if (titlePrefix) {
  31960. titVNs.push(titlePrefix.content || titlePrefix.message ? h('vxe-tooltip', {
  31961. props: _objectSpread2(_objectSpread2(_objectSpread2({}, tooltipOpts), titlePrefix), {}, {
  31962. content: getFuncText(titlePrefix.content || titlePrefix.message)
  31963. })
  31964. }, [renderPrefixIcon(h, titlePrefix)]) : renderPrefixIcon(h, titlePrefix));
  31965. }
  31966. titVNs.push(h('span', {
  31967. class: 'vxe-form--item-title-label'
  31968. }, compConf && compConf.renderItemTitle ? getSlotVNs(compConf.renderItemTitle(itemRender, params)) : slots && slots.title ? _vm.callSlot(slots.title, params, h) : getFuncText(item.title)));
  31969. contVNs.push(h('div', {
  31970. class: 'vxe-form--item-title-content'
  31971. }, titVNs));
  31972. var fixVNs = [];
  31973. if (titleSuffix) {
  31974. fixVNs.push(titleSuffix.content || titleSuffix.message ? h('vxe-tooltip', {
  31975. props: _objectSpread2(_objectSpread2(_objectSpread2({}, tooltipOpts), titlePrefix), {}, {
  31976. content: getFuncText(titleSuffix.content || titleSuffix.message)
  31977. })
  31978. }, [render_renderSuffixIcon(h, titleSuffix)]) : render_renderSuffixIcon(h, titleSuffix));
  31979. }
  31980. contVNs.push(h('div', {
  31981. class: 'vxe-form--item-title-postfix'
  31982. }, fixVNs));
  31983. return contVNs;
  31984. }
  31985. // CONCATENATED MODULE: ./packages/form/src/form-config-item.js
  31986. /**
  31987. * 配置式项
  31988. */
  31989. var VxeFormConfigItem = {
  31990. name: 'VxeFormConfigItem',
  31991. props: {
  31992. itemConfig: Object
  31993. },
  31994. inject: {
  31995. $xeform: {
  31996. default: null
  31997. }
  31998. },
  31999. provide: function provide() {
  32000. return {
  32001. $xeformgather: null,
  32002. $xeformiteminfo: this
  32003. };
  32004. },
  32005. render: function render(h) {
  32006. var _e = this._e,
  32007. $xeform = this.$xeform,
  32008. item = this.itemConfig;
  32009. var rules = $xeform.rules,
  32010. data = $xeform.data,
  32011. collapseAll = $xeform.collapseAll,
  32012. validOpts = $xeform.validOpts,
  32013. allTitleAlign = $xeform.titleAlign,
  32014. allTitleWidth = $xeform.titleWidth,
  32015. allTitleColon = $xeform.titleColon,
  32016. allTitleAsterisk = $xeform.titleAsterisk,
  32017. allTitleOverflow = $xeform.titleOverflow;
  32018. var slots = item.slots,
  32019. title = item.title,
  32020. folding = item.folding,
  32021. visible = item.visible,
  32022. field = item.field,
  32023. collapseNode = item.collapseNode,
  32024. itemRender = item.itemRender,
  32025. showError = item.showError,
  32026. errRule = item.errRule,
  32027. className = item.className,
  32028. titleOverflow = item.titleOverflow,
  32029. children = item.children;
  32030. var compConf = isEnableConf(itemRender) ? v_x_e_table.renderer.get(itemRender.name) : null;
  32031. var itemClassName = compConf ? compConf.itemClassName : '';
  32032. var span = item.span || $xeform.span;
  32033. var align = item.align || $xeform.align;
  32034. var titleAlign = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eqNull(item.titleAlign) ? allTitleAlign : item.titleAlign;
  32035. var titleWidth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eqNull(item.titleWidth) ? allTitleWidth : item.titleWidth;
  32036. var titleColon = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eqNull(item.titleColon) ? allTitleColon : item.titleColon;
  32037. var titleAsterisk = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eqNull(item.titleAsterisk) ? allTitleAsterisk : item.titleAsterisk;
  32038. 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;
  32039. var showEllipsis = itemOverflow === 'ellipsis';
  32040. var showTitle = itemOverflow === 'title';
  32041. var showTooltip = itemOverflow === true || itemOverflow === 'tooltip';
  32042. var hasEllipsis = showTitle || showTooltip || showEllipsis;
  32043. var params = {
  32044. data: data,
  32045. field: field,
  32046. property: field,
  32047. item: item,
  32048. $form: $xeform
  32049. };
  32050. var isRequired;
  32051. if (visible === false) {
  32052. return _e();
  32053. } // 如果为项集合
  32054. var isGather = children && children.length > 0;
  32055. if (isGather) {
  32056. var childVNs = item.children.map(function (childItem, index) {
  32057. return h(VxeFormConfigItem, {
  32058. key: index,
  32059. props: {
  32060. itemConfig: childItem
  32061. }
  32062. });
  32063. });
  32064. return childVNs.length ? h('div', {
  32065. 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 : '']
  32066. }, childVNs) : _e();
  32067. }
  32068. if (rules) {
  32069. var itemRules = rules[field];
  32070. if (itemRules) {
  32071. isRequired = itemRules.some(function (rule) {
  32072. return rule.required;
  32073. });
  32074. }
  32075. }
  32076. var contentVNs = [];
  32077. if (slots && slots.default) {
  32078. contentVNs = $xeform.callSlot(slots.default, params, h);
  32079. } else if (compConf && compConf.renderItemContent) {
  32080. contentVNs = getSlotVNs(compConf.renderItemContent.call($xeform, h, itemRender, params));
  32081. } else if (compConf && compConf.renderItem) {
  32082. contentVNs = getSlotVNs(compConf.renderItem.call($xeform, h, itemRender, params));
  32083. } else if (field) {
  32084. contentVNs = [external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toValueString(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(data, field))];
  32085. }
  32086. var ons = showTooltip ? {
  32087. mouseenter: function mouseenter(evnt) {
  32088. $xeform.triggerTitleTipEvent(evnt, params);
  32089. },
  32090. mouseleave: $xeform.handleTitleTipLeaveEvent
  32091. } : {};
  32092. return h('div', {
  32093. 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 : '', itemClassName ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(itemClassName) ? itemClassName(params) : itemClassName : '', {
  32094. 'is--title': title,
  32095. 'is--colon': titleColon,
  32096. 'is--asterisk': titleAsterisk,
  32097. 'is--required': isRequired,
  32098. 'is--hidden': folding && collapseAll,
  32099. 'is--active': isActivetem($xeform, item),
  32100. 'is--error': showError
  32101. }],
  32102. props: {
  32103. itemConfig: item
  32104. },
  32105. key: item.id
  32106. }, [h('div', {
  32107. class: 'vxe-form--item-inner'
  32108. }, [title || slots && slots.title ? h('div', {
  32109. class: ['vxe-form--item-title', titleAlign ? "align--".concat(titleAlign) : null, {
  32110. 'is--ellipsis': hasEllipsis
  32111. }],
  32112. style: titleWidth ? {
  32113. width: isNaN(titleWidth) ? titleWidth : "".concat(titleWidth, "px")
  32114. } : null,
  32115. attrs: {
  32116. title: showTitle ? getFuncText(title) : null
  32117. },
  32118. on: ons
  32119. }, renderTitle(h, $xeform, item)) : null, h('div', {
  32120. class: ['vxe-form--item-content', align ? "align--".concat(align) : null]
  32121. }, contentVNs.concat([collapseNode ? h('div', {
  32122. class: 'vxe-form--item-trigger-node',
  32123. on: {
  32124. click: $xeform.toggleCollapseEvent
  32125. }
  32126. }, [h('span', {
  32127. class: 'vxe-form--item-trigger-text'
  32128. }, collapseAll ? src_conf.i18n('vxe.form.unfolding') : src_conf.i18n('vxe.form.folding')), h('i', {
  32129. class: ['vxe-form--item-trigger-icon', collapseAll ? src_conf.icon.FORM_FOLDING : src_conf.icon.FORM_UNFOLDING]
  32130. })]) : null, errRule && validOpts.showMessage ? h('div', {
  32131. class: 'vxe-form--item-valid',
  32132. style: errRule.maxWidth ? {
  32133. width: "".concat(errRule.maxWidth, "px")
  32134. } : null
  32135. }, errRule.content) : null]))])]);
  32136. }
  32137. };
  32138. /* harmony default export */ var form_config_item = (VxeFormConfigItem);
  32139. // CONCATENATED MODULE: ./packages/form/src/form.js
  32140. var form_Rule = /*#__PURE__*/function () {
  32141. function Rule(rule) {
  32142. _classCallCheck(this, Rule);
  32143. Object.assign(this, {
  32144. $options: rule,
  32145. required: rule.required,
  32146. min: rule.min,
  32147. max: rule.min,
  32148. type: rule.type,
  32149. pattern: rule.pattern,
  32150. validator: rule.validator,
  32151. trigger: rule.trigger,
  32152. maxWidth: rule.maxWidth
  32153. });
  32154. }
  32155. _createClass(Rule, [{
  32156. key: "content",
  32157. get: function get() {
  32158. return getFuncText(this.$options.content || this.$options.message);
  32159. }
  32160. }, {
  32161. key: "message",
  32162. get: function get() {
  32163. return this.content;
  32164. }
  32165. }]);
  32166. return Rule;
  32167. }();
  32168. function form_validErrorRuleValue(rule, val) {
  32169. var type = rule.type,
  32170. min = rule.min,
  32171. max = rule.max,
  32172. pattern = rule.pattern;
  32173. var isNumType = type === 'number';
  32174. var numVal = isNumType ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(val) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getSize(val); // 判断数值
  32175. if (isNumType && isNaN(val)) {
  32176. return true;
  32177. } // 如果存在 min,判断最小值
  32178. if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eqNull(min) && numVal < external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(min)) {
  32179. return true;
  32180. } // 如果存在 max,判断最大值
  32181. if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eqNull(max) && numVal > external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(max)) {
  32182. return true;
  32183. } // 如果存在 pattern,正则校验
  32184. if (pattern && !(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isRegExp(pattern) ? pattern : new RegExp(pattern)).test(val)) {
  32185. return true;
  32186. }
  32187. return false;
  32188. }
  32189. function getResetValue(value, resetValue) {
  32190. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(value)) {
  32191. resetValue = [];
  32192. }
  32193. return resetValue;
  32194. }
  32195. /* harmony default export */ var src_form = ({
  32196. name: 'VxeForm',
  32197. mixins: [size],
  32198. props: {
  32199. collapseStatus: {
  32200. type: Boolean,
  32201. default: true
  32202. },
  32203. loading: Boolean,
  32204. data: Object,
  32205. size: {
  32206. type: String,
  32207. default: function _default() {
  32208. return src_conf.form.size || src_conf.size;
  32209. }
  32210. },
  32211. span: {
  32212. type: [String, Number],
  32213. default: function _default() {
  32214. return src_conf.form.span;
  32215. }
  32216. },
  32217. align: {
  32218. type: String,
  32219. default: function _default() {
  32220. return src_conf.form.align;
  32221. }
  32222. },
  32223. titleAlign: {
  32224. type: String,
  32225. default: function _default() {
  32226. return src_conf.form.titleAlign;
  32227. }
  32228. },
  32229. titleWidth: {
  32230. type: [String, Number],
  32231. default: function _default() {
  32232. return src_conf.form.titleWidth;
  32233. }
  32234. },
  32235. titleColon: {
  32236. type: Boolean,
  32237. default: function _default() {
  32238. return src_conf.form.titleColon;
  32239. }
  32240. },
  32241. titleAsterisk: {
  32242. type: Boolean,
  32243. default: function _default() {
  32244. return src_conf.form.titleAsterisk;
  32245. }
  32246. },
  32247. titleOverflow: {
  32248. type: [Boolean, String],
  32249. default: null
  32250. },
  32251. className: [String, Function],
  32252. readonly: Boolean,
  32253. items: Array,
  32254. rules: Object,
  32255. preventSubmit: {
  32256. type: Boolean,
  32257. default: function _default() {
  32258. return src_conf.form.preventSubmit;
  32259. }
  32260. },
  32261. validConfig: Object,
  32262. tooltipConfig: Object,
  32263. customLayout: {
  32264. type: Boolean,
  32265. default: function _default() {
  32266. return src_conf.form.customLayout;
  32267. }
  32268. }
  32269. },
  32270. data: function data() {
  32271. return {
  32272. collapseAll: this.collapseStatus,
  32273. staticItems: [],
  32274. formItems: [],
  32275. tooltipTimeout: null,
  32276. tooltipStore: {
  32277. item: null,
  32278. visible: false
  32279. }
  32280. };
  32281. },
  32282. provide: function provide() {
  32283. return {
  32284. $xeform: this,
  32285. $xeformgather: null,
  32286. $xeformitem: null,
  32287. $xeformiteminfo: null
  32288. };
  32289. },
  32290. computed: {
  32291. validOpts: function validOpts() {
  32292. return Object.assign({}, src_conf.form.validConfig, this.validConfig);
  32293. },
  32294. tooltipOpts: function tooltipOpts() {
  32295. return Object.assign({}, src_conf.tooltip, src_conf.form.tooltipConfig, this.tooltipConfig);
  32296. }
  32297. },
  32298. watch: {
  32299. staticItems: function staticItems(value) {
  32300. this.formItems = value;
  32301. },
  32302. items: function items(value) {
  32303. this.loadItem(value);
  32304. },
  32305. collapseStatus: function collapseStatus(value) {
  32306. this.collapseAll = !!value;
  32307. }
  32308. },
  32309. created: function created() {
  32310. var _this = this;
  32311. this.$nextTick(function () {
  32312. var items = _this.items;
  32313. if (false) {}
  32314. if (items) {
  32315. _this.loadItem(items);
  32316. }
  32317. });
  32318. },
  32319. render: function render(h) {
  32320. var _ref;
  32321. var _e = this._e,
  32322. loading = this.loading,
  32323. className = this.className,
  32324. data = this.data,
  32325. vSize = this.vSize,
  32326. tooltipOpts = this.tooltipOpts,
  32327. formItems = this.formItems,
  32328. customLayout = this.customLayout;
  32329. var hasUseTooltip = v_x_e_table._tooltip;
  32330. var defaultSlot = this.$scopedSlots.default;
  32331. return h('form', {
  32332. class: ['vxe-form', className ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(className) ? className({
  32333. items: formItems,
  32334. data: data,
  32335. $form: this
  32336. }) : className : '', (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, 'is--loading', loading), _ref)],
  32337. on: {
  32338. submit: this.submitEvent,
  32339. reset: this.resetEvent
  32340. }
  32341. }, [h('div', {
  32342. class: 'vxe-form--wrapper vxe-row'
  32343. }, customLayout ? defaultSlot ? defaultSlot.call(this, h, {}) : [] : formItems.map(function (item, index) {
  32344. return h(form_config_item, {
  32345. key: index,
  32346. props: {
  32347. itemConfig: item
  32348. }
  32349. });
  32350. })), h('div', {
  32351. class: 'vxe-form-slots',
  32352. ref: 'hideItem'
  32353. }, customLayout ? [] : defaultSlot ? defaultSlot.call(this, h, {}) : []),
  32354. /**
  32355. * 加载中
  32356. */
  32357. h(packages_loading, {
  32358. class: 'vxe-form--loading',
  32359. props: {
  32360. value: loading
  32361. }
  32362. }),
  32363. /**
  32364. * 工具提示
  32365. */
  32366. hasUseTooltip ? h('vxe-tooltip', {
  32367. ref: 'tooltip',
  32368. props: tooltipOpts
  32369. }) : _e()]);
  32370. },
  32371. methods: {
  32372. callSlot: function callSlot(slotFunc, params, h) {
  32373. if (slotFunc) {
  32374. var $scopedSlots = this.$scopedSlots;
  32375. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isString(slotFunc)) {
  32376. slotFunc = $scopedSlots[slotFunc] || null;
  32377. }
  32378. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(slotFunc)) {
  32379. return getSlotVNs(slotFunc.call(this, params, h));
  32380. }
  32381. }
  32382. return [];
  32383. },
  32384. loadItem: function loadItem(list) {
  32385. var _this2 = this;
  32386. if (false) { var $scopedSlots; }
  32387. this.staticItems = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.mapTree(list, function (item) {
  32388. return createItem(_this2, item);
  32389. }, {
  32390. children: 'children'
  32391. });
  32392. return this.$nextTick();
  32393. },
  32394. getItems: function getItems() {
  32395. var itemList = [];
  32396. external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(this.formItems, function (item) {
  32397. itemList.push(item);
  32398. }, {
  32399. children: 'children'
  32400. });
  32401. return itemList;
  32402. },
  32403. getItemByField: function getItemByField(field) {
  32404. var rest = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.findTree(this.formItems, function (item) {
  32405. return item.field === field;
  32406. }, {
  32407. children: 'children'
  32408. });
  32409. return rest ? rest.item : null;
  32410. },
  32411. toggleCollapse: function toggleCollapse() {
  32412. var status = !this.collapseAll;
  32413. this.collapseAll = status;
  32414. this.$emit('update:collapseStatus', status);
  32415. return this.$nextTick();
  32416. },
  32417. toggleCollapseEvent: function toggleCollapseEvent(evnt) {
  32418. this.toggleCollapse();
  32419. var status = this.collapseAll;
  32420. this.$emit('toggle-collapse', {
  32421. status: status,
  32422. collapse: status,
  32423. data: this.data,
  32424. $form: this,
  32425. $event: evnt
  32426. }, evnt);
  32427. this.$emit('collapse', {
  32428. status: status,
  32429. collapse: status,
  32430. data: this.data,
  32431. $form: this,
  32432. $event: evnt
  32433. }, evnt);
  32434. },
  32435. submitEvent: function submitEvent(evnt) {
  32436. var _this3 = this;
  32437. evnt.preventDefault();
  32438. if (!this.preventSubmit) {
  32439. this.clearValidate();
  32440. this.beginValidate(this.getItems()).then(function (errMap) {
  32441. if (errMap) {
  32442. _this3.$emit('submit-invalid', {
  32443. data: _this3.data,
  32444. errMap: errMap,
  32445. $form: _this3,
  32446. $event: evnt
  32447. });
  32448. } else {
  32449. _this3.$emit('submit', {
  32450. data: _this3.data,
  32451. $event: evnt
  32452. });
  32453. }
  32454. });
  32455. }
  32456. },
  32457. reset: function reset() {
  32458. var _this4 = this;
  32459. var data = this.data;
  32460. if (data) {
  32461. var itemList = this.getItems();
  32462. itemList.forEach(function (item) {
  32463. var field = item.field,
  32464. resetValue = item.resetValue,
  32465. itemRender = item.itemRender;
  32466. if (isEnableConf(itemRender)) {
  32467. var compConf = v_x_e_table.renderer.get(itemRender.name);
  32468. if (compConf && compConf.itemResetMethod) {
  32469. compConf.itemResetMethod({
  32470. data: data,
  32471. field: field,
  32472. property: field,
  32473. item: item,
  32474. $form: _this4
  32475. });
  32476. } else if (field) {
  32477. 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) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.clone(resetValue, true));
  32478. }
  32479. }
  32480. });
  32481. }
  32482. return this.clearValidate();
  32483. },
  32484. resetEvent: function resetEvent(evnt) {
  32485. evnt.preventDefault();
  32486. this.reset();
  32487. this.$emit('reset', {
  32488. data: this.data,
  32489. $form: this,
  32490. $event: evnt
  32491. });
  32492. },
  32493. closeTooltip: function closeTooltip() {
  32494. var tooltipStore = this.tooltipStore;
  32495. var $tooltip = this.$refs.tooltip;
  32496. if (tooltipStore.visible) {
  32497. Object.assign(tooltipStore, {
  32498. item: null,
  32499. visible: false
  32500. });
  32501. if ($tooltip) {
  32502. $tooltip.close();
  32503. }
  32504. }
  32505. return this.$nextTick();
  32506. },
  32507. triggerTitleTipEvent: function triggerTitleTipEvent(evnt, params) {
  32508. var item = params.item;
  32509. var tooltipStore = this.tooltipStore;
  32510. var $tooltip = this.$refs.tooltip;
  32511. var overflowElem = evnt.currentTarget.children[0];
  32512. var content = (overflowElem.textContent || '').trim();
  32513. var isCellOverflow = overflowElem.scrollWidth > overflowElem.clientWidth;
  32514. clearTimeout(this.tooltipTimeout);
  32515. if (tooltipStore.item !== item) {
  32516. this.closeTooltip();
  32517. }
  32518. if (content && isCellOverflow) {
  32519. Object.assign(tooltipStore, {
  32520. item: item,
  32521. visible: true
  32522. });
  32523. if ($tooltip) {
  32524. $tooltip.open(overflowElem, content);
  32525. }
  32526. }
  32527. },
  32528. handleTitleTipLeaveEvent: function handleTitleTipLeaveEvent() {
  32529. var _this5 = this;
  32530. var tooltipOpts = this.tooltipOpts;
  32531. var $tooltip = this.$refs.tooltip;
  32532. if ($tooltip) {
  32533. $tooltip.setActived(false);
  32534. }
  32535. if (tooltipOpts.enterable) {
  32536. this.tooltipTimeout = setTimeout(function () {
  32537. $tooltip = _this5.$refs.tooltip;
  32538. if ($tooltip && !$tooltip.isActived()) {
  32539. _this5.closeTooltip();
  32540. }
  32541. }, tooltipOpts.leaveDelay);
  32542. } else {
  32543. this.closeTooltip();
  32544. }
  32545. },
  32546. clearValidate: function clearValidate(fieldOrItem) {
  32547. if (fieldOrItem) {
  32548. var item = util_handleFieldOrItem(this, fieldOrItem);
  32549. if (item) {
  32550. item.showError = false;
  32551. }
  32552. } else {
  32553. this.getItems().forEach(function (item) {
  32554. item.showError = false;
  32555. });
  32556. }
  32557. return this.$nextTick();
  32558. },
  32559. validate: function validate(callback) {
  32560. this.clearValidate();
  32561. return this.beginValidate(this.getItems(), '', callback);
  32562. },
  32563. validateField: function validateField(fieldOrItem, callback) {
  32564. var item = util_handleFieldOrItem(this, fieldOrItem);
  32565. return this.beginValidate(item ? [item] : [], '', callback);
  32566. },
  32567. beginValidate: function beginValidate(itemList, type, callback) {
  32568. var _this6 = this;
  32569. var data = this.data,
  32570. formRules = this.rules,
  32571. validOpts = this.validOpts;
  32572. var validRest = {};
  32573. var validFields = [];
  32574. var itemValids = [];
  32575. clearTimeout(this.showErrTime);
  32576. if (data && formRules) {
  32577. itemList.forEach(function (item) {
  32578. var field = item.field;
  32579. if (field && !isHiddenItem(_this6, item) && isActivetem(_this6, item)) {
  32580. itemValids.push(_this6.validItemRules(type || 'all', field).then(function () {
  32581. item.errRule = null;
  32582. }).catch(function (_ref2) {
  32583. var rule = _ref2.rule,
  32584. rules = _ref2.rules;
  32585. var rest = {
  32586. rule: rule,
  32587. rules: rules,
  32588. data: data,
  32589. field: field,
  32590. property: field,
  32591. $form: _this6
  32592. };
  32593. if (!validRest[field]) {
  32594. validRest[field] = [];
  32595. }
  32596. validRest[field].push(rest);
  32597. validFields.push(field);
  32598. item.errRule = rule;
  32599. return Promise.reject(rest);
  32600. }));
  32601. }
  32602. });
  32603. return Promise.all(itemValids).then(function () {
  32604. if (callback) {
  32605. callback();
  32606. }
  32607. }).catch(function () {
  32608. return new Promise(function (resolve) {
  32609. _this6.showErrTime = setTimeout(function () {
  32610. itemList.forEach(function (item) {
  32611. if (item.errRule) {
  32612. item.showError = true;
  32613. }
  32614. });
  32615. }, 20);
  32616. if (validOpts.autoPos) {
  32617. _this6.$nextTick(function () {
  32618. _this6.handleFocus(validFields);
  32619. });
  32620. }
  32621. if (callback) {
  32622. callback(validRest);
  32623. resolve();
  32624. } else {
  32625. resolve(validRest);
  32626. }
  32627. });
  32628. });
  32629. }
  32630. if (callback) {
  32631. callback();
  32632. }
  32633. return Promise.resolve();
  32634. },
  32635. /**
  32636. * 校验数据
  32637. * 按表格行、列顺序依次校验(同步或异步)
  32638. * 校验规则根据索引顺序依次校验,如果是异步则会等待校验完成才会继续校验下一列
  32639. * 如果校验失败则,触发回调或者 Promise<(ErrMap 校验不通过列的信息)>
  32640. * 如果是传回调方式这返回一个 (ErrMap 校验不通过列的信息)
  32641. *
  32642. * rule 配置:
  32643. * required=Boolean 是否必填
  32644. * min=Number 最小长度
  32645. * max=Number 最大长度
  32646. * validator=Function({ itemValue, rule, rules, data, property }) 自定义校验,接收一个 Promise
  32647. * trigger=change 触发方式
  32648. */
  32649. validItemRules: function validItemRules(validType, property, val) {
  32650. var _this7 = this;
  32651. var data = this.data,
  32652. formRules = this.rules;
  32653. var errorRules = [];
  32654. var syncVailds = [];
  32655. if (property && formRules) {
  32656. var rules = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(formRules, property);
  32657. if (rules) {
  32658. 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;
  32659. rules.forEach(function (rule) {
  32660. var type = rule.type,
  32661. trigger = rule.trigger,
  32662. required = rule.required;
  32663. if (validType === 'all' || !trigger || validType === rule.trigger) {
  32664. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(rule.validator)) {
  32665. var customValid = rule.validator({
  32666. itemValue: itemValue,
  32667. rule: rule,
  32668. rules: rules,
  32669. data: data,
  32670. field: property,
  32671. property: property,
  32672. $form: _this7
  32673. });
  32674. if (customValid) {
  32675. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isError(customValid)) {
  32676. errorRules.push(new form_Rule({
  32677. type: 'custom',
  32678. trigger: trigger,
  32679. content: customValid.message,
  32680. rule: new form_Rule(rule)
  32681. }));
  32682. } else if (customValid.catch) {
  32683. // 如果为异步校验(注:异步校验是并发无序的)
  32684. syncVailds.push(customValid.catch(function (e) {
  32685. errorRules.push(new form_Rule({
  32686. type: 'custom',
  32687. trigger: trigger,
  32688. content: e ? e.message : rule.content || rule.message,
  32689. rule: new form_Rule(rule)
  32690. }));
  32691. }));
  32692. }
  32693. }
  32694. } else {
  32695. var isArrType = type === 'array';
  32696. var hasEmpty = isArrType || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(itemValue) ? !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(itemValue) || !itemValue.length : eqEmptyValue(itemValue);
  32697. if (required ? hasEmpty || form_validErrorRuleValue(rule, itemValue) : !hasEmpty && form_validErrorRuleValue(rule, itemValue)) {
  32698. errorRules.push(new form_Rule(rule));
  32699. }
  32700. }
  32701. }
  32702. });
  32703. }
  32704. }
  32705. return Promise.all(syncVailds).then(function () {
  32706. if (errorRules.length) {
  32707. var rest = {
  32708. rules: errorRules,
  32709. rule: errorRules[0]
  32710. };
  32711. return Promise.reject(rest);
  32712. }
  32713. });
  32714. },
  32715. handleFocus: function handleFocus(fields) {
  32716. var _this8 = this;
  32717. var $el = this.$el;
  32718. fields.some(function (property, index) {
  32719. var item = _this8.getItemByField(property);
  32720. if (item && isEnableConf(item.itemRender)) {
  32721. var itemRender = item.itemRender;
  32722. var compConf = v_x_e_table.renderer.get(itemRender.name);
  32723. var inputElem; // 定位到第一个
  32724. if (!index) {
  32725. dom.scrollToView($el.querySelector(".".concat(item.id)));
  32726. } // 如果指定了聚焦 class
  32727. if (itemRender.autofocus) {
  32728. inputElem = $el.querySelector(".".concat(item.id, " ").concat(itemRender.autofocus));
  32729. } // 渲染器的聚焦处理
  32730. if (!inputElem && compConf && compConf.autofocus) {
  32731. inputElem = $el.querySelector(".".concat(item.id, " ").concat(compConf.autofocus));
  32732. }
  32733. if (inputElem) {
  32734. inputElem.focus(); // 保持一致行为,光标移到末端
  32735. if (browse.msie) {
  32736. var textRange = inputElem.createTextRange();
  32737. textRange.collapse(false);
  32738. textRange.select();
  32739. }
  32740. return true;
  32741. }
  32742. }
  32743. });
  32744. },
  32745. triggerItemEvent: function triggerItemEvent(evnt, field, itemValue) {
  32746. var _this9 = this;
  32747. if (field) {
  32748. return this.validItemRules(evnt ? ['blur'].includes(evnt.type) ? 'blur' : 'change' : 'all', field, itemValue).then(function () {
  32749. _this9.clearValidate(field);
  32750. }).catch(function (_ref3) {
  32751. var rule = _ref3.rule;
  32752. var item = _this9.getItemByField(field);
  32753. if (item) {
  32754. item.showError = true;
  32755. item.errRule = rule;
  32756. }
  32757. });
  32758. }
  32759. return this.$nextTick();
  32760. },
  32761. /**
  32762. * 更新项状态
  32763. * 如果组件值 v-model 发生 change 时,调用改函数用于更新某一项编辑状态
  32764. * 如果单元格配置了校验规则,则会进行校验
  32765. */
  32766. updateStatus: function updateStatus(scope, itemValue) {
  32767. var field = scope.field;
  32768. return this.triggerItemEvent(new Event('change'), field, itemValue);
  32769. }
  32770. }
  32771. });
  32772. // CONCATENATED MODULE: ./packages/form/index.js
  32773. var Form = Object.assign(src_form, {
  32774. install: function install(Vue) {
  32775. Vue.component(src_form.name, src_form);
  32776. }
  32777. });
  32778. /* harmony default export */ var packages_form = (Form);
  32779. // CONCATENATED MODULE: ./packages/form/src/form-item.js
  32780. var form_item_props = {
  32781. title: String,
  32782. field: String,
  32783. size: String,
  32784. span: [String, Number],
  32785. align: String,
  32786. titleAlign: {
  32787. type: String,
  32788. default: null
  32789. },
  32790. titleWidth: {
  32791. type: [String, Number],
  32792. default: null
  32793. },
  32794. titleColon: {
  32795. type: Boolean,
  32796. default: null
  32797. },
  32798. titleAsterisk: {
  32799. type: Boolean,
  32800. default: null
  32801. },
  32802. className: [String, Function],
  32803. titleOverflow: {
  32804. type: [Boolean, String],
  32805. default: null
  32806. },
  32807. titlePrefix: Object,
  32808. titleSuffix: Object,
  32809. resetValue: {
  32810. default: null
  32811. },
  32812. visible: {
  32813. type: Boolean,
  32814. default: null
  32815. },
  32816. visibleMethod: Function,
  32817. folding: Boolean,
  32818. collapseNode: Boolean,
  32819. itemRender: Object
  32820. };
  32821. var form_item_watch = {};
  32822. Object.keys(form_item_props).forEach(function (name) {
  32823. form_item_watch[name] = function (value) {
  32824. this.itemConfig.update(name, value);
  32825. };
  32826. });
  32827. var form_item_renderItem = function renderItem(h, _vm, item, slots) {
  32828. var _e = _vm._e,
  32829. rules = _vm.rules,
  32830. data = _vm.data,
  32831. collapseAll = _vm.collapseAll,
  32832. validOpts = _vm.validOpts,
  32833. allTitleAlign = _vm.titleAlign,
  32834. allTitleWidth = _vm.titleWidth,
  32835. allTitleColon = _vm.titleColon,
  32836. allTitleAsterisk = _vm.titleAsterisk,
  32837. allTitleOverflow = _vm.titleOverflow;
  32838. var title = item.title,
  32839. folding = item.folding,
  32840. visible = item.visible,
  32841. field = item.field,
  32842. collapseNode = item.collapseNode,
  32843. itemRender = item.itemRender,
  32844. showError = item.showError,
  32845. errRule = item.errRule,
  32846. className = item.className,
  32847. titleOverflow = item.titleOverflow;
  32848. var compConf = isEnableConf(itemRender) ? v_x_e_table.renderer.get(itemRender.name) : null;
  32849. var itemClassName = compConf ? compConf.itemClassName : '';
  32850. var span = item.span || _vm.span;
  32851. var align = item.align || _vm.align;
  32852. var titleAlign = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eqNull(item.titleAlign) ? allTitleAlign : item.titleAlign;
  32853. var titleWidth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eqNull(item.titleWidth) ? allTitleWidth : item.titleWidth;
  32854. var titleColon = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eqNull(item.titleColon) ? allTitleColon : item.titleColon;
  32855. var titleAsterisk = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eqNull(item.titleAsterisk) ? allTitleAsterisk : item.titleAsterisk;
  32856. 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;
  32857. var showEllipsis = itemOverflow === 'ellipsis';
  32858. var showTitle = itemOverflow === 'title';
  32859. var showTooltip = itemOverflow === true || itemOverflow === 'tooltip';
  32860. var hasEllipsis = showTitle || showTooltip || showEllipsis;
  32861. var params = {
  32862. data: data,
  32863. field: field,
  32864. property: field,
  32865. item: item,
  32866. $form: _vm
  32867. };
  32868. var isRequired;
  32869. if (visible === false) {
  32870. return _e();
  32871. }
  32872. if (rules) {
  32873. var itemRules = rules[field];
  32874. if (itemRules) {
  32875. isRequired = itemRules.some(function (rule) {
  32876. return rule.required;
  32877. });
  32878. }
  32879. }
  32880. var contentVNs = [];
  32881. if (slots && slots.default) {
  32882. contentVNs = _vm.callSlot(slots.default, params, h);
  32883. } else if (compConf && compConf.renderItemContent) {
  32884. contentVNs = getSlotVNs(compConf.renderItemContent.call(_vm, h, itemRender, params));
  32885. } else if (compConf && compConf.renderItem) {
  32886. contentVNs = getSlotVNs(compConf.renderItem.call(_vm, h, itemRender, params));
  32887. } else if (field) {
  32888. contentVNs = ["".concat(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(data, field))];
  32889. }
  32890. var ons = showTooltip ? {
  32891. mouseenter: function mouseenter(evnt) {
  32892. _vm.triggerTitleTipEvent(evnt, params);
  32893. },
  32894. mouseleave: _vm.handleTitleTipLeaveEvent
  32895. } : {};
  32896. return h('div', {
  32897. class: ['vxe-form--item', 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 : '', itemClassName ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(itemClassName) ? itemClassName(params) : itemClassName : '', {
  32898. 'is--title': title,
  32899. 'is--colon': titleColon,
  32900. 'is--asterisk': titleAsterisk,
  32901. 'is--required': isRequired,
  32902. 'is--hidden': folding && collapseAll,
  32903. 'is--active': isActivetem(_vm, item),
  32904. 'is--error': showError
  32905. }]
  32906. }, [h('div', {
  32907. class: 'vxe-form--item-inner'
  32908. }, [title || slots && slots.title ? h('div', {
  32909. class: ['vxe-form--item-title', titleAlign ? "align--".concat(titleAlign) : null, {
  32910. 'is--ellipsis': hasEllipsis
  32911. }],
  32912. style: titleWidth ? {
  32913. width: isNaN(titleWidth) ? titleWidth : "".concat(titleWidth, "px")
  32914. } : null,
  32915. attrs: {
  32916. title: showTitle ? getFuncText(title) : null
  32917. },
  32918. on: ons
  32919. }, renderTitle(h, _vm, item)) : null, h('div', {
  32920. class: ['vxe-form--item-content', align ? "align--".concat(align) : null]
  32921. }, contentVNs.concat([collapseNode ? h('div', {
  32922. class: 'vxe-form--item-trigger-node',
  32923. on: {
  32924. click: _vm.toggleCollapseEvent
  32925. }
  32926. }, [h('span', {
  32927. class: 'vxe-form--item-trigger-text'
  32928. }, collapseAll ? src_conf.i18n('vxe.form.unfolding') : src_conf.i18n('vxe.form.folding')), h('i', {
  32929. class: ['vxe-form--item-trigger-icon', collapseAll ? src_conf.icon.FORM_FOLDING : src_conf.icon.FORM_UNFOLDING]
  32930. })]) : null, errRule && validOpts.showMessage ? h('div', {
  32931. class: 'vxe-form--item-valid',
  32932. style: errRule.maxWidth ? {
  32933. width: "".concat(errRule.maxWidth, "px")
  32934. } : null
  32935. }, errRule.message) : null]))])]);
  32936. };
  32937. /* harmony default export */ var form_item = ({
  32938. name: 'VxeFormItem',
  32939. props: form_item_props,
  32940. inject: {
  32941. $xeform: {
  32942. default: null
  32943. },
  32944. $xeformgather: {
  32945. default: null
  32946. }
  32947. },
  32948. provide: function provide() {
  32949. return {
  32950. $xeformitem: this,
  32951. $xeformiteminfo: this
  32952. };
  32953. },
  32954. data: function data() {
  32955. return {
  32956. itemConfig: null
  32957. };
  32958. },
  32959. watch: form_item_watch,
  32960. mounted: function mounted() {
  32961. assemItem(this);
  32962. },
  32963. created: function created() {
  32964. this.itemConfig = createItem(this.$xeform, this);
  32965. },
  32966. destroyed: function destroyed() {
  32967. destroyItem(this);
  32968. },
  32969. render: function render(h) {
  32970. var $xeform = this.$xeform;
  32971. return $xeform && $xeform.customLayout ? form_item_renderItem(h, $xeform, this.itemConfig, this.$scopedSlots) : h('div');
  32972. }
  32973. });
  32974. // CONCATENATED MODULE: ./packages/form-item/index.js
  32975. var FormItem = Object.assign(form_item, {
  32976. install: function install(Vue) {
  32977. Vue.component(form_item.name, form_item);
  32978. }
  32979. });
  32980. /* harmony default export */ var packages_form_item = (FormItem);
  32981. // CONCATENATED MODULE: ./packages/form/src/form-gather.js
  32982. /* harmony default export */ var form_gather = ({
  32983. name: 'VxeFormGather',
  32984. extends: form_item,
  32985. provide: function provide() {
  32986. return {
  32987. $xeformgather: this,
  32988. xeformitem: null,
  32989. $xeformiteminfo: this
  32990. };
  32991. },
  32992. created: function created() {
  32993. var _this = this;
  32994. if (false) {}
  32995. },
  32996. render: function render(h) {
  32997. return h('div', this.$slots.default);
  32998. }
  32999. });
  33000. // CONCATENATED MODULE: ./packages/form-gather/index.js
  33001. var FormGather = Object.assign(form_gather, {
  33002. install: function install(Vue) {
  33003. Vue.component(form_gather.name, form_gather);
  33004. }
  33005. });
  33006. /* harmony default export */ var packages_form_gather = (FormGather);
  33007. // CONCATENATED MODULE: ./packages/select/src/optgroup.js
  33008. var optgroup_props = {
  33009. label: {
  33010. type: [String, Number, Boolean],
  33011. default: ''
  33012. },
  33013. visible: {
  33014. type: Boolean,
  33015. default: null
  33016. },
  33017. className: [String, Function],
  33018. disabled: Boolean
  33019. };
  33020. var optgroup_watch = {};
  33021. Object.keys(optgroup_props).forEach(function (name) {
  33022. optgroup_watch[name] = function (value) {
  33023. this.optionConfig.update(name, value);
  33024. };
  33025. });
  33026. /* harmony default export */ var optgroup = ({
  33027. name: 'VxeOptgroup',
  33028. props: optgroup_props,
  33029. provide: function provide() {
  33030. return {
  33031. $xeoptgroup: this
  33032. };
  33033. },
  33034. inject: {
  33035. $xeselect: {
  33036. default: null
  33037. }
  33038. },
  33039. computed: {
  33040. vSize: function vSize() {
  33041. return this.size || this.$parent.size || this.$parent.vSize;
  33042. }
  33043. },
  33044. watch: optgroup_watch,
  33045. mounted: function mounted() {
  33046. assemOption(this);
  33047. },
  33048. created: function created() {
  33049. this.optionConfig = createOption(this.$xeselect, this);
  33050. },
  33051. destroyed: function destroyed() {
  33052. destroyOption(this);
  33053. },
  33054. render: function render(h) {
  33055. return h('div', this.$slots.default);
  33056. }
  33057. });
  33058. // CONCATENATED MODULE: ./packages/select/index.js
  33059. var Select = Object.assign(src_select, {
  33060. Option: src_option,
  33061. Optgroup: optgroup,
  33062. install: function install(Vue) {
  33063. Vue.component(src_select.name, src_select);
  33064. Vue.component(src_option.name, src_option);
  33065. Vue.component(optgroup.name, optgroup);
  33066. }
  33067. });
  33068. /* harmony default export */ var packages_select = (Select);
  33069. // CONCATENATED MODULE: ./packages/optgroup/index.js
  33070. var Optgroup = Object.assign(optgroup, {
  33071. install: function install(Vue) {
  33072. Vue.component(optgroup.name, optgroup);
  33073. }
  33074. });
  33075. /* harmony default export */ var packages_optgroup = (Optgroup);
  33076. // CONCATENATED MODULE: ./packages/option/index.js
  33077. var Option = Object.assign(src_option, {
  33078. install: function install(Vue) {
  33079. Vue.component(src_option.name, src_option);
  33080. }
  33081. });
  33082. /* harmony default export */ var packages_option = (Option);
  33083. // CONCATENATED MODULE: ./packages/switch/src/switch.js
  33084. /* harmony default export */ var src_switch = ({
  33085. name: 'VxeSwitch',
  33086. mixins: [size],
  33087. props: {
  33088. value: [String, Number, Boolean],
  33089. disabled: Boolean,
  33090. className: String,
  33091. size: {
  33092. type: String,
  33093. default: function _default() {
  33094. return src_conf.switch.size || src_conf.size;
  33095. }
  33096. },
  33097. openLabel: String,
  33098. closeLabel: String,
  33099. openValue: {
  33100. type: [String, Number, Boolean],
  33101. default: true
  33102. },
  33103. closeValue: {
  33104. type: [String, Number, Boolean],
  33105. default: false
  33106. },
  33107. openIcon: String,
  33108. closeIcon: String
  33109. },
  33110. inject: {
  33111. $xeform: {
  33112. default: null
  33113. },
  33114. $xeformiteminfo: {
  33115. default: null
  33116. }
  33117. },
  33118. data: function data() {
  33119. return {
  33120. isActivated: false,
  33121. hasAnimat: false,
  33122. offsetLeft: 0
  33123. };
  33124. },
  33125. computed: {
  33126. isChecked: function isChecked() {
  33127. return this.value === this.openValue;
  33128. },
  33129. onShowLabel: function onShowLabel() {
  33130. return getFuncText(this.openLabel);
  33131. },
  33132. offShowLabel: function offShowLabel() {
  33133. return getFuncText(this.closeLabel);
  33134. },
  33135. styles: function styles() {
  33136. return browse.msie && this.isChecked ? {
  33137. left: "".concat(this.offsetLeft, "px")
  33138. } : null;
  33139. }
  33140. },
  33141. created: function created() {
  33142. var _this = this;
  33143. if (browse.msie) {
  33144. this.$nextTick(function () {
  33145. return _this.updateStyle();
  33146. });
  33147. }
  33148. },
  33149. render: function render(h) {
  33150. var _ref;
  33151. var isChecked = this.isChecked,
  33152. vSize = this.vSize,
  33153. className = this.className,
  33154. disabled = this.disabled,
  33155. openIcon = this.openIcon,
  33156. closeIcon = this.closeIcon;
  33157. return h('div', {
  33158. class: ['vxe-switch', className, isChecked ? 'is--on' : 'is--off', (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, 'is--disabled', disabled), _defineProperty(_ref, 'is--animat', this.hasAnimat), _ref)]
  33159. }, [h('button', {
  33160. ref: 'btn',
  33161. class: 'vxe-switch--button',
  33162. attrs: {
  33163. type: 'button',
  33164. disabled: disabled
  33165. },
  33166. on: {
  33167. click: this.clickEvent,
  33168. focus: this.focusEvent,
  33169. blur: this.blurEvent
  33170. }
  33171. }, [h('span', {
  33172. class: 'vxe-switch--label vxe-switch--label-on'
  33173. }, [openIcon ? h('i', {
  33174. class: ['vxe-switch--label-icon', openIcon]
  33175. }) : null, this.onShowLabel]), h('span', {
  33176. class: 'vxe-switch--label vxe-switch--label-off'
  33177. }, [closeIcon ? h('i', {
  33178. class: ['vxe-switch--label-icon', closeIcon]
  33179. }) : null, this.offShowLabel]), h('span', {
  33180. class: 'vxe-switch--icon',
  33181. style: this.styles
  33182. })])]);
  33183. },
  33184. methods: {
  33185. updateStyle: function updateStyle() {
  33186. // 兼容 IE
  33187. this.hasAnimat = true;
  33188. this.offsetLeft = this.$refs.btn.offsetWidth;
  33189. },
  33190. clickEvent: function clickEvent(evnt) {
  33191. var _this2 = this;
  33192. if (!this.disabled) {
  33193. clearTimeout(this.activeTimeout);
  33194. var value = this.isChecked ? this.closeValue : this.openValue;
  33195. this.hasAnimat = true;
  33196. if (browse.msie) {
  33197. this.updateStyle();
  33198. }
  33199. this.$emit('input', value);
  33200. this.$emit('change', {
  33201. value: value,
  33202. $event: evnt
  33203. }); // 自动更新校验状态
  33204. if (this.$xeform && this.$xeformiteminfo) {
  33205. this.$xeform.triggerItemEvent(evnt, this.$xeformiteminfo.itemConfig.field, value);
  33206. }
  33207. this.activeTimeout = setTimeout(function () {
  33208. _this2.hasAnimat = false;
  33209. }, 400);
  33210. }
  33211. },
  33212. focusEvent: function focusEvent(evnt) {
  33213. this.isActivated = true;
  33214. this.$emit('focus', {
  33215. value: this.value,
  33216. $event: evnt
  33217. });
  33218. },
  33219. blurEvent: function blurEvent(evnt) {
  33220. this.isActivated = false;
  33221. this.$emit('blur', {
  33222. value: this.value,
  33223. $event: evnt
  33224. });
  33225. }
  33226. }
  33227. });
  33228. // CONCATENATED MODULE: ./packages/switch/index.js
  33229. var Switch = Object.assign(src_switch, {
  33230. install: function install(Vue) {
  33231. Vue.component(src_switch.name, src_switch);
  33232. }
  33233. });
  33234. /* harmony default export */ var packages_switch = (Switch);
  33235. // CONCATENATED MODULE: ./packages/list/src/list.js
  33236. /* harmony default export */ var src_list = ({
  33237. name: 'VxeList',
  33238. mixins: [size],
  33239. props: {
  33240. data: Array,
  33241. height: [Number, String],
  33242. maxHeight: [Number, String],
  33243. loading: Boolean,
  33244. className: [String, Function],
  33245. size: {
  33246. type: String,
  33247. default: function _default() {
  33248. return src_conf.list.size || src_conf.size;
  33249. }
  33250. },
  33251. autoResize: {
  33252. type: Boolean,
  33253. default: function _default() {
  33254. return src_conf.list.autoResize;
  33255. }
  33256. },
  33257. syncResize: [Boolean, String, Number],
  33258. scrollY: Object
  33259. },
  33260. data: function data() {
  33261. return {
  33262. scrollYLoad: false,
  33263. bodyHeight: 0,
  33264. topSpaceHeight: 0,
  33265. items: []
  33266. };
  33267. },
  33268. computed: {
  33269. sYOpts: function sYOpts() {
  33270. return Object.assign({}, src_conf.list.scrollY, this.scrollY);
  33271. },
  33272. styles: function styles() {
  33273. var height = this.height,
  33274. maxHeight = this.maxHeight;
  33275. var style = {};
  33276. if (height) {
  33277. style.height = isNaN(height) ? height : "".concat(height, "px");
  33278. } else if (maxHeight) {
  33279. style.height = 'auto';
  33280. style.maxHeight = isNaN(maxHeight) ? maxHeight : "".concat(maxHeight, "px");
  33281. }
  33282. return style;
  33283. }
  33284. },
  33285. watch: {
  33286. data: function data(value) {
  33287. this.loadData(value);
  33288. },
  33289. syncResize: function syncResize(value) {
  33290. var _this = this;
  33291. if (value) {
  33292. this.recalculate();
  33293. this.$nextTick(function () {
  33294. return setTimeout(function () {
  33295. return _this.recalculate();
  33296. });
  33297. });
  33298. }
  33299. }
  33300. },
  33301. created: function created() {
  33302. Object.assign(this, {
  33303. fullData: [],
  33304. lastScrollLeft: 0,
  33305. lastScrollTop: 0,
  33306. scrollYStore: {
  33307. startIndex: 0,
  33308. endIndex: 0,
  33309. visibleSize: 0
  33310. }
  33311. });
  33312. this.loadData(this.data);
  33313. GlobalEvent.on(this, 'resize', this.handleGlobalResizeEvent);
  33314. },
  33315. mounted: function mounted() {
  33316. var _this2 = this;
  33317. if (this.autoResize) {
  33318. var resizeObserver = createResizeEvent(function () {
  33319. return _this2.recalculate();
  33320. });
  33321. resizeObserver.observe(this.$el);
  33322. this.$resize = resizeObserver;
  33323. }
  33324. },
  33325. beforeDestroy: function beforeDestroy() {
  33326. if (this.$resize) {
  33327. this.$resize.disconnect();
  33328. }
  33329. },
  33330. destroyed: function destroyed() {
  33331. GlobalEvent.off(this, 'resize');
  33332. },
  33333. render: function render(h) {
  33334. var $scopedSlots = this.$scopedSlots,
  33335. styles = this.styles,
  33336. bodyHeight = this.bodyHeight,
  33337. topSpaceHeight = this.topSpaceHeight,
  33338. items = this.items,
  33339. className = this.className,
  33340. loading = this.loading;
  33341. return h('div', {
  33342. class: ['vxe-list', className ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(className) ? className({
  33343. $list: this
  33344. }) : className : '', {
  33345. 'is--loading': loading
  33346. }]
  33347. }, [h('div', {
  33348. ref: 'virtualWrapper',
  33349. class: 'vxe-list--virtual-wrapper',
  33350. style: styles,
  33351. on: {
  33352. scroll: this.scrollEvent
  33353. }
  33354. }, [h('div', {
  33355. ref: 'ySpace',
  33356. class: 'vxe-list--y-space',
  33357. style: {
  33358. height: bodyHeight ? "".concat(bodyHeight, "px") : ''
  33359. }
  33360. }), h('div', {
  33361. ref: 'virtualBody',
  33362. class: 'vxe-list--body',
  33363. style: {
  33364. marginTop: topSpaceHeight ? "".concat(topSpaceHeight, "px") : ''
  33365. }
  33366. }, $scopedSlots.default ? $scopedSlots.default.call(this, {
  33367. items: items,
  33368. $list: this
  33369. }, h) : [])]),
  33370. /**
  33371. * 加载中
  33372. */
  33373. h(packages_loading, {
  33374. class: 'vxe-list--loading',
  33375. props: {
  33376. value: loading
  33377. }
  33378. })]);
  33379. },
  33380. methods: {
  33381. getParentElem: function getParentElem() {
  33382. return this.$el.parentNode;
  33383. },
  33384. /**
  33385. * 加载数据
  33386. * @param {Array} datas 数据
  33387. */
  33388. loadData: function loadData(datas) {
  33389. var _this3 = this;
  33390. var sYOpts = this.sYOpts,
  33391. scrollYStore = this.scrollYStore;
  33392. var fullData = datas || [];
  33393. Object.assign(scrollYStore, {
  33394. startIndex: 0,
  33395. endIndex: 1,
  33396. visibleSize: 0
  33397. });
  33398. this.fullData = fullData;
  33399. this.scrollYLoad = sYOpts.enabled && sYOpts.gt > -1 && sYOpts.gt <= fullData.length;
  33400. this.handleData();
  33401. return this.computeScrollLoad().then(function () {
  33402. _this3.refreshScroll();
  33403. });
  33404. },
  33405. /**
  33406. * 重新加载数据
  33407. * @param {Array} datas 数据
  33408. */
  33409. reloadData: function reloadData(datas) {
  33410. this.clearScroll();
  33411. return this.loadData(datas);
  33412. },
  33413. handleData: function handleData() {
  33414. var fullData = this.fullData,
  33415. scrollYLoad = this.scrollYLoad,
  33416. scrollYStore = this.scrollYStore;
  33417. this.items = scrollYLoad ? fullData.slice(scrollYStore.startIndex, scrollYStore.endIndex) : fullData.slice(0);
  33418. return this.$nextTick();
  33419. },
  33420. /**
  33421. * 重新计算列表
  33422. */
  33423. recalculate: function recalculate() {
  33424. var $el = this.$el;
  33425. if ($el.clientWidth && $el.clientHeight) {
  33426. return this.computeScrollLoad();
  33427. }
  33428. return Promise.resolve();
  33429. },
  33430. /**
  33431. * 清除滚动条
  33432. */
  33433. clearScroll: function clearScroll() {
  33434. var scrollBodyElem = this.$refs.virtualWrapper;
  33435. if (scrollBodyElem) {
  33436. scrollBodyElem.scrollTop = 0;
  33437. }
  33438. return this.$nextTick();
  33439. },
  33440. /**
  33441. * 刷新滚动条
  33442. */
  33443. refreshScroll: function refreshScroll() {
  33444. var _this4 = this;
  33445. var lastScrollLeft = this.lastScrollLeft,
  33446. lastScrollTop = this.lastScrollTop;
  33447. return this.clearScroll().then(function () {
  33448. if (lastScrollLeft || lastScrollTop) {
  33449. _this4.lastScrollLeft = 0;
  33450. _this4.lastScrollTop = 0;
  33451. return _this4.scrollTo(lastScrollLeft, lastScrollTop);
  33452. }
  33453. });
  33454. },
  33455. /**
  33456. * 如果有滚动条,则滚动到对应的位置
  33457. * @param {Number} scrollLeft 左距离
  33458. * @param {Number} scrollTop 上距离
  33459. */
  33460. scrollTo: function scrollTo(scrollLeft, scrollTop) {
  33461. var _this5 = this;
  33462. var scrollBodyElem = this.$refs.virtualWrapper;
  33463. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNumber(scrollLeft)) {
  33464. scrollBodyElem.scrollLeft = scrollLeft;
  33465. }
  33466. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNumber(scrollTop)) {
  33467. scrollBodyElem.scrollTop = scrollTop;
  33468. }
  33469. if (this.scrollYLoad) {
  33470. return new Promise(function (resolve) {
  33471. return setTimeout(function () {
  33472. return resolve(_this5.$nextTick());
  33473. }, 50);
  33474. });
  33475. }
  33476. return this.$nextTick();
  33477. },
  33478. computeScrollLoad: function computeScrollLoad() {
  33479. var _this6 = this;
  33480. return this.$nextTick().then(function () {
  33481. var $refs = _this6.$refs,
  33482. sYOpts = _this6.sYOpts,
  33483. scrollYLoad = _this6.scrollYLoad,
  33484. scrollYStore = _this6.scrollYStore;
  33485. var virtualWrapperElem = $refs.virtualWrapper,
  33486. virtualBodyElem = $refs.virtualBody;
  33487. var rowHeight = 0;
  33488. var firstItemElem;
  33489. if (virtualBodyElem) {
  33490. if (sYOpts.sItem) {
  33491. firstItemElem = virtualBodyElem.querySelector(sYOpts.sItem);
  33492. }
  33493. if (!firstItemElem) {
  33494. firstItemElem = virtualBodyElem.children[0];
  33495. }
  33496. }
  33497. if (firstItemElem) {
  33498. rowHeight = firstItemElem.offsetHeight;
  33499. }
  33500. rowHeight = Math.max(20, rowHeight);
  33501. scrollYStore.rowHeight = rowHeight; // 计算 Y 逻辑
  33502. if (scrollYLoad) {
  33503. var visibleYSize = Math.max(8, Math.ceil(virtualWrapperElem.clientHeight / rowHeight));
  33504. var offsetYSize = sYOpts.oSize ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(sYOpts.oSize) : browse.msie ? 20 : browse.edge ? 10 : 0;
  33505. scrollYStore.offsetSize = offsetYSize;
  33506. scrollYStore.visibleSize = visibleYSize;
  33507. scrollYStore.endIndex = Math.max(scrollYStore.startIndex, visibleYSize + offsetYSize, scrollYStore.endIndex);
  33508. _this6.updateYData();
  33509. } else {
  33510. _this6.updateYSpace();
  33511. }
  33512. _this6.rowHeight = rowHeight;
  33513. });
  33514. },
  33515. scrollEvent: function scrollEvent(evnt) {
  33516. var scrollBodyElem = evnt.target;
  33517. var scrollTop = scrollBodyElem.scrollTop;
  33518. var scrollLeft = scrollBodyElem.scrollLeft;
  33519. var isX = scrollLeft !== this.lastScrollLeft;
  33520. var isY = scrollTop !== this.lastScrollTop;
  33521. this.lastScrollTop = scrollTop;
  33522. this.lastScrollLeft = scrollLeft;
  33523. if (this.scrollYLoad) {
  33524. this.loadYData(evnt);
  33525. }
  33526. this.$emit('scroll', {
  33527. scrollLeft: scrollLeft,
  33528. scrollTop: scrollTop,
  33529. isX: isX,
  33530. isY: isY,
  33531. $event: evnt
  33532. });
  33533. },
  33534. loadYData: function loadYData(evnt) {
  33535. var scrollYStore = this.scrollYStore;
  33536. var startIndex = scrollYStore.startIndex,
  33537. endIndex = scrollYStore.endIndex,
  33538. visibleSize = scrollYStore.visibleSize,
  33539. offsetSize = scrollYStore.offsetSize,
  33540. rowHeight = scrollYStore.rowHeight;
  33541. var scrollBodyElem = evnt.target;
  33542. var scrollTop = scrollBodyElem.scrollTop;
  33543. var toVisibleIndex = Math.floor(scrollTop / rowHeight);
  33544. var offsetStartIndex = Math.max(0, toVisibleIndex - 1 - offsetSize);
  33545. var offsetEndIndex = toVisibleIndex + visibleSize + offsetSize;
  33546. if (toVisibleIndex <= startIndex || toVisibleIndex >= endIndex - visibleSize - 1) {
  33547. if (startIndex !== offsetStartIndex || endIndex !== offsetEndIndex) {
  33548. scrollYStore.startIndex = offsetStartIndex;
  33549. scrollYStore.endIndex = offsetEndIndex;
  33550. this.updateYData();
  33551. }
  33552. }
  33553. },
  33554. updateYData: function updateYData() {
  33555. this.handleData();
  33556. this.updateYSpace();
  33557. },
  33558. updateYSpace: function updateYSpace() {
  33559. var scrollYStore = this.scrollYStore,
  33560. scrollYLoad = this.scrollYLoad,
  33561. fullData = this.fullData;
  33562. this.bodyHeight = scrollYLoad ? fullData.length * scrollYStore.rowHeight : 0;
  33563. this.topSpaceHeight = scrollYLoad ? Math.max(scrollYStore.startIndex * scrollYStore.rowHeight, 0) : 0;
  33564. },
  33565. handleGlobalResizeEvent: function handleGlobalResizeEvent() {
  33566. this.recalculate();
  33567. }
  33568. }
  33569. });
  33570. // CONCATENATED MODULE: ./packages/list/index.js
  33571. var List = Object.assign(src_list, {
  33572. install: function install(Vue) {
  33573. Vue.component(src_list.name, src_list);
  33574. }
  33575. });
  33576. /* harmony default export */ var packages_list = (List);
  33577. // CONCATENATED MODULE: ./packages/pulldown/src/pulldown.js
  33578. /* harmony default export */ var pulldown = ({
  33579. name: 'VxePulldown',
  33580. mixins: [size],
  33581. props: {
  33582. value: Boolean,
  33583. disabled: Boolean,
  33584. placement: String,
  33585. size: {
  33586. type: String,
  33587. default: function _default() {
  33588. return src_conf.size;
  33589. }
  33590. },
  33591. destroyOnClose: Boolean,
  33592. transfer: Boolean
  33593. },
  33594. data: function data() {
  33595. return {
  33596. inited: false,
  33597. panelIndex: 0,
  33598. panelStyle: null,
  33599. panelPlacement: null,
  33600. currentValue: null,
  33601. visiblePanel: false,
  33602. animatVisible: false,
  33603. isActivated: false
  33604. };
  33605. },
  33606. watch: {
  33607. value: function value(_value) {
  33608. if (_value) {
  33609. this.showPanel();
  33610. } else {
  33611. this.hidePanel();
  33612. }
  33613. }
  33614. },
  33615. created: function created() {
  33616. GlobalEvent.on(this, 'mousewheel', this.handleGlobalMousewheelEvent);
  33617. GlobalEvent.on(this, 'mousedown', this.handleGlobalMousedownEvent);
  33618. GlobalEvent.on(this, 'blur', this.handleGlobalBlurEvent);
  33619. },
  33620. beforeDestroy: function beforeDestroy() {
  33621. var panelElem = this.$refs.panel;
  33622. if (panelElem && panelElem.parentNode) {
  33623. panelElem.parentNode.removeChild(panelElem);
  33624. }
  33625. },
  33626. destroyed: function destroyed() {
  33627. GlobalEvent.off(this, 'mousewheel');
  33628. GlobalEvent.off(this, 'mousedown');
  33629. GlobalEvent.off(this, 'blur');
  33630. },
  33631. render: function render(h) {
  33632. var _ref, _ref2;
  33633. var $scopedSlots = this.$scopedSlots,
  33634. inited = this.inited,
  33635. vSize = this.vSize,
  33636. destroyOnClose = this.destroyOnClose,
  33637. transfer = this.transfer,
  33638. isActivated = this.isActivated,
  33639. disabled = this.disabled,
  33640. animatVisible = this.animatVisible,
  33641. visiblePanel = this.visiblePanel,
  33642. panelStyle = this.panelStyle,
  33643. panelPlacement = this.panelPlacement;
  33644. var defaultSlot = $scopedSlots.default;
  33645. var downSlot = $scopedSlots.dropdown;
  33646. return h('div', {
  33647. 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)]
  33648. }, [h('div', {
  33649. ref: 'content',
  33650. class: 'vxe-pulldown--content'
  33651. }, defaultSlot ? defaultSlot.call(this, {
  33652. $pulldown: this
  33653. }, h) : []), h('div', {
  33654. ref: 'panel',
  33655. 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)],
  33656. attrs: {
  33657. placement: panelPlacement
  33658. },
  33659. style: panelStyle
  33660. }, downSlot ? [h('div', {
  33661. class: 'vxe-pulldown--wrapper'
  33662. }, !inited || destroyOnClose && !visiblePanel && !animatVisible ? [] : downSlot.call(this, {
  33663. $pulldown: this
  33664. }, h))] : [])]);
  33665. },
  33666. methods: {
  33667. handleGlobalMousewheelEvent: function handleGlobalMousewheelEvent(evnt) {
  33668. var $refs = this.$refs,
  33669. disabled = this.disabled,
  33670. visiblePanel = this.visiblePanel;
  33671. if (!disabled) {
  33672. if (visiblePanel) {
  33673. if (dom.getEventTargetNode(evnt, $refs.panel).flag) {
  33674. this.updatePlacement();
  33675. } else {
  33676. this.hidePanel();
  33677. this.$emit('hide-panel', {
  33678. $event: evnt
  33679. });
  33680. }
  33681. }
  33682. }
  33683. },
  33684. handleGlobalMousedownEvent: function handleGlobalMousedownEvent(evnt) {
  33685. var $refs = this.$refs,
  33686. $el = this.$el,
  33687. disabled = this.disabled,
  33688. visiblePanel = this.visiblePanel;
  33689. if (!disabled) {
  33690. this.isActivated = dom.getEventTargetNode(evnt, $el).flag || dom.getEventTargetNode(evnt, $refs.panel).flag;
  33691. if (visiblePanel && !this.isActivated) {
  33692. this.hidePanel();
  33693. this.$emit('hide-panel', {
  33694. $event: evnt
  33695. });
  33696. }
  33697. }
  33698. },
  33699. handleGlobalBlurEvent: function handleGlobalBlurEvent(evnt) {
  33700. if (this.visiblePanel) {
  33701. this.isActivated = false;
  33702. this.hidePanel();
  33703. this.$emit('hide-panel', {
  33704. $event: evnt
  33705. });
  33706. }
  33707. },
  33708. updateZindex: function updateZindex() {
  33709. if (this.panelIndex < utils.getLastZIndex()) {
  33710. this.panelIndex = utils.nextZIndex();
  33711. }
  33712. },
  33713. isPanelVisible: function isPanelVisible() {
  33714. return this.visiblePanel;
  33715. },
  33716. /**
  33717. * 切换下拉面板
  33718. */
  33719. togglePanel: function togglePanel() {
  33720. if (this.visiblePanel) {
  33721. return this.hidePanel();
  33722. }
  33723. return this.showPanel();
  33724. },
  33725. /**
  33726. * 显示下拉面板
  33727. */
  33728. showPanel: function showPanel() {
  33729. var _this = this;
  33730. if (!this.inited) {
  33731. this.inited = true;
  33732. if (this.transfer) {
  33733. document.body.appendChild(this.$refs.panel);
  33734. }
  33735. }
  33736. return new Promise(function (resolve) {
  33737. if (!_this.disabled) {
  33738. clearTimeout(_this.hidePanelTimeout);
  33739. _this.isActivated = true;
  33740. _this.animatVisible = true;
  33741. setTimeout(function () {
  33742. _this.visiblePanel = true;
  33743. _this.$emit('update:input', true);
  33744. _this.updatePlacement();
  33745. setTimeout(function () {
  33746. resolve(_this.updatePlacement());
  33747. }, 40);
  33748. }, 10);
  33749. _this.updateZindex();
  33750. } else {
  33751. resolve(_this.$nextTick());
  33752. }
  33753. });
  33754. },
  33755. /**
  33756. * 隐藏下拉面板
  33757. */
  33758. hidePanel: function hidePanel() {
  33759. var _this2 = this;
  33760. this.visiblePanel = false;
  33761. this.$emit('update:input', false);
  33762. return new Promise(function (resolve) {
  33763. if (_this2.animatVisible) {
  33764. _this2.hidePanelTimeout = setTimeout(function () {
  33765. _this2.animatVisible = false;
  33766. resolve(_this2.$nextTick());
  33767. }, 350);
  33768. } else {
  33769. resolve(_this2.$nextTick());
  33770. }
  33771. });
  33772. },
  33773. /**
  33774. * 手动更新位置
  33775. */
  33776. updatePlacement: function updatePlacement() {
  33777. var _this3 = this;
  33778. return this.$nextTick().then(function () {
  33779. var $refs = _this3.$refs,
  33780. transfer = _this3.transfer,
  33781. placement = _this3.placement,
  33782. panelIndex = _this3.panelIndex,
  33783. visiblePanel = _this3.visiblePanel;
  33784. if (visiblePanel) {
  33785. var panelElem = $refs.panel;
  33786. var targetElem = $refs.content;
  33787. if (panelElem && targetElem) {
  33788. var targetHeight = targetElem.offsetHeight;
  33789. var targetWidth = targetElem.offsetWidth;
  33790. var panelHeight = panelElem.offsetHeight;
  33791. var panelWidth = panelElem.offsetWidth;
  33792. var marginSize = 5;
  33793. var panelStyle = {
  33794. zIndex: panelIndex
  33795. };
  33796. var _DomTools$getAbsolute = dom.getAbsolutePos(targetElem),
  33797. boundingTop = _DomTools$getAbsolute.boundingTop,
  33798. boundingLeft = _DomTools$getAbsolute.boundingLeft,
  33799. visibleHeight = _DomTools$getAbsolute.visibleHeight,
  33800. visibleWidth = _DomTools$getAbsolute.visibleWidth;
  33801. var panelPlacement = 'bottom';
  33802. if (transfer) {
  33803. var left = boundingLeft;
  33804. var top = boundingTop + targetHeight;
  33805. if (placement === 'top') {
  33806. panelPlacement = 'top';
  33807. top = boundingTop - panelHeight;
  33808. } else if (!placement) {
  33809. // 如果下面不够放,则向上
  33810. if (top + panelHeight + marginSize > visibleHeight) {
  33811. panelPlacement = 'top';
  33812. top = boundingTop - panelHeight;
  33813. } // 如果上面不够放,则向下(优先)
  33814. if (top < marginSize) {
  33815. panelPlacement = 'bottom';
  33816. top = boundingTop + targetHeight;
  33817. }
  33818. } // 如果溢出右边
  33819. if (left + panelWidth + marginSize > visibleWidth) {
  33820. left -= left + panelWidth + marginSize - visibleWidth;
  33821. } // 如果溢出左边
  33822. if (left < marginSize) {
  33823. left = marginSize;
  33824. }
  33825. Object.assign(panelStyle, {
  33826. left: "".concat(left, "px"),
  33827. top: "".concat(top, "px"),
  33828. minWidth: "".concat(targetWidth, "px")
  33829. });
  33830. } else {
  33831. if (placement === 'top') {
  33832. panelPlacement = 'top';
  33833. panelStyle.bottom = "".concat(targetHeight, "px");
  33834. } else if (!placement) {
  33835. // 如果下面不够放,则向上
  33836. if (boundingTop + targetHeight + panelHeight > visibleHeight) {
  33837. // 如果上面不够放,则向下(优先)
  33838. if (boundingTop - targetHeight - panelHeight > marginSize) {
  33839. panelPlacement = 'top';
  33840. panelStyle.bottom = "".concat(targetHeight, "px");
  33841. }
  33842. }
  33843. }
  33844. }
  33845. _this3.panelStyle = panelStyle;
  33846. _this3.panelPlacement = panelPlacement;
  33847. }
  33848. }
  33849. return _this3.$nextTick();
  33850. });
  33851. }
  33852. }
  33853. });
  33854. // CONCATENATED MODULE: ./packages/pulldown/index.js
  33855. var Pulldown = Object.assign(pulldown, {
  33856. install: function install(Vue) {
  33857. Vue.component(pulldown.name, pulldown);
  33858. }
  33859. });
  33860. /* harmony default export */ var packages_pulldown = (Pulldown);
  33861. // CONCATENATED MODULE: ./packages/locale/lang/zh-CN.js
  33862. /* harmony default export */ var zh_CN = ({
  33863. vxe: {
  33864. loading: {
  33865. text: '加载中...'
  33866. },
  33867. error: {
  33868. groupFixed: '如果使用分组表头,固定列必须按组设置',
  33869. groupMouseRange: '分组表头与 "{0}" 不能同时使用,这可能会出现错误',
  33870. groupTag: '分组列头应该使用 "{0}" 而不是 "{1}",这可能会出现错误',
  33871. scrollErrProp: '启用虚拟滚动后不支持该参数 "{0}"',
  33872. errConflicts: '参数 "{0}" 与 "{1}" 有冲突',
  33873. unableInsert: '无法插入到指定位置,请检查参数是否正确',
  33874. useErr: '安装 "{0}" 模块时发生错误,可能顺序不正确,依赖的模块需要在 Table 之前安装',
  33875. barUnableLink: '工具栏无法关联表格',
  33876. expandContent: '展开行的插槽应该是 "content",请检查是否正确',
  33877. reqModule: '缺少 "{0}" 模块',
  33878. reqProp: '缺少必要的 "{0}" 参数,这可能会导致出现错误',
  33879. emptyProp: '参数 "{0}" 不允许为空',
  33880. errProp: '不支持的参数 "{0}",可能为 "{1}"',
  33881. colRepet: 'column.{0}="{1}" 重复了,这可能会导致某些功能无法使用',
  33882. notFunc: '方法 "{0}" 不存在',
  33883. notSlot: '插槽 "{0}" 不存在',
  33884. noTree: '树结构不支持 "{0}"',
  33885. notProp: '不支持的参数 "{0}"',
  33886. coverProp: '"{0}" 的参数 "{1}" 被覆盖,这可能会出现错误',
  33887. delFunc: '方法 "{0}" 已废弃,请使用 "{1}"',
  33888. delProp: '参数 "{0}" 已废弃,请使用 "{1}"',
  33889. delEvent: '事件 "{0}" 已废弃,请使用 "{1}"',
  33890. removeProp: '参数 "{0}" 已废弃,不建议使用,这可能会导致出现错误',
  33891. errFormat: '全局的格式化内容应该使用 "VXETable.formats" 定义,挂载 "formatter={0}" 的方式已不建议使用',
  33892. notType: '不支持的文件类型 "{0}"',
  33893. notExp: '该浏览器不支持导入/导出功能',
  33894. impFields: '导入失败,请检查字段名和数据格式是否正确',
  33895. treeNotImp: '树表格不支持导入'
  33896. },
  33897. renderer: {
  33898. search: '搜索',
  33899. cases: {
  33900. equal: '等于',
  33901. unequal: '不等于',
  33902. gt: '大于',
  33903. ge: '大于或等于',
  33904. lt: '小于',
  33905. le: '小于或等于',
  33906. begin: '开头是',
  33907. notbegin: '开头不是',
  33908. endin: '结尾是',
  33909. notendin: '结尾不是',
  33910. include: '包含',
  33911. exclude: '不包含',
  33912. between: '介于',
  33913. custom: '自定义筛选',
  33914. insensitive: '不区分大小写',
  33915. isSensitive: '区分大小写'
  33916. },
  33917. combination: {
  33918. menus: {
  33919. clearSort: '清除排序',
  33920. sortAsc: '升序',
  33921. sortDesc: '降序',
  33922. fixedColumn: '锁定列',
  33923. fixedGroup: '锁定组',
  33924. cancelFixed: '取消锁定',
  33925. fixedLeft: '锁定左侧',
  33926. fixedRight: '锁定右侧',
  33927. clearFilter: '清除筛选',
  33928. textOption: '文本筛选',
  33929. numberOption: '数值筛选'
  33930. },
  33931. popup: {
  33932. title: '自定义筛选的方式',
  33933. currColumnTitle: '当前列:',
  33934. and: '与',
  33935. or: '或',
  33936. describeHtml: '可用 ? 代表单个字符<br/>用 * 代表任意多个字符'
  33937. },
  33938. empty: '(空白)',
  33939. notData: '无匹配项'
  33940. }
  33941. },
  33942. pro: {
  33943. area: {
  33944. mergeErr: '无法对合并单元格进行该操作',
  33945. multiErr: '无法对多重选择区域进行该操作',
  33946. extendErr: '如果延伸的区域包含被合并的单元格,所有合并的单元格需大小相同',
  33947. pasteMultiErr: '无法粘贴,需要相同大小的复制的区域和粘贴的区域才能执行此操作'
  33948. },
  33949. fnr: {
  33950. title: '查找和替换',
  33951. findLabel: '查找',
  33952. replaceLabel: '替换',
  33953. findTitle: '查找内容:',
  33954. replaceTitle: '替换为:',
  33955. tabs: {
  33956. find: '查找',
  33957. replace: '替换'
  33958. },
  33959. filter: {
  33960. re: '正则表达式',
  33961. whole: '全词匹配',
  33962. sensitive: '区分大小写'
  33963. },
  33964. btns: {
  33965. findNext: '查找下一个',
  33966. findAll: '查找全部',
  33967. replace: '替换',
  33968. replaceAll: '替换全部',
  33969. cancel: '取消'
  33970. },
  33971. header: {
  33972. seq: '#',
  33973. cell: '单元格',
  33974. value: '值'
  33975. },
  33976. empty: '(空值)',
  33977. reError: '无效的正则表达式',
  33978. recordCount: '已找到 {0} 个单元格',
  33979. notCell: '找不到匹配的单元格',
  33980. replaceSuccess: '成功替换 {0} 个单元格'
  33981. }
  33982. },
  33983. table: {
  33984. emptyText: '暂无数据',
  33985. allTitle: '全选/取消',
  33986. seqTitle: '#',
  33987. confirmFilter: '筛选',
  33988. resetFilter: '重置',
  33989. allFilter: '全部',
  33990. sortAsc: '升序:最低到最高',
  33991. sortDesc: '降序:最高到最低',
  33992. filter: '对所选的列启用筛选',
  33993. impSuccess: '成功导入 {0} 条记录',
  33994. expLoading: '正在导出中',
  33995. expSuccess: '导出成功',
  33996. expFilename: '导出_{0}',
  33997. expOriginFilename: '导出_源_{0}',
  33998. customTitle: '列设置',
  33999. customAll: '全部',
  34000. customConfirm: '确认',
  34001. customRestore: '还原'
  34002. },
  34003. grid: {
  34004. selectOneRecord: '请至少选择一条记录!',
  34005. deleteSelectRecord: '您确定要删除所选记录吗?',
  34006. removeSelectRecord: '您确定要移除所选记录吗?',
  34007. dataUnchanged: '数据未改动!',
  34008. delSuccess: '成功删除所选记录!',
  34009. saveSuccess: '保存成功!',
  34010. operError: '发生错误,操作失败!'
  34011. },
  34012. select: {
  34013. search: '搜索',
  34014. loadingText: '加载中',
  34015. emptyText: '暂无数据'
  34016. },
  34017. pager: {
  34018. goto: '前往',
  34019. pagesize: '{0}条/页',
  34020. total: '共 {0} 条记录',
  34021. pageClassifier: '页',
  34022. prevPage: '上一页',
  34023. nextPage: '下一页',
  34024. prevJump: '向上跳页',
  34025. nextJump: '向下跳页'
  34026. },
  34027. alert: {
  34028. title: '消息提示'
  34029. },
  34030. button: {
  34031. confirm: '确认',
  34032. cancel: '取消'
  34033. },
  34034. import: {
  34035. modes: {
  34036. covering: '覆盖',
  34037. insert: '新增'
  34038. },
  34039. impTitle: '导入数据',
  34040. impFile: '文件名',
  34041. impSelect: '选择文件',
  34042. impType: '文件类型',
  34043. impOpts: '参数设置',
  34044. impConfirm: '导入',
  34045. impCancel: '取消'
  34046. },
  34047. export: {
  34048. types: {
  34049. csv: 'CSV (逗号分隔)(*.csv)',
  34050. html: '网页(*.html)',
  34051. xml: 'XML 数据(*.xml)',
  34052. txt: '文本文件(制表符分隔)(*.txt)',
  34053. xls: 'Excel 97-2003 工作簿(*.xls)',
  34054. xlsx: 'Excel 工作簿(*.xlsx)',
  34055. pdf: 'PDF (*.pdf)'
  34056. },
  34057. modes: {
  34058. current: '当前数据(当前页的数据)',
  34059. selected: '选中数据(当前页选中的数据)',
  34060. all: '全量数据(包括所有分页的数据)'
  34061. },
  34062. printTitle: '打印数据',
  34063. expTitle: '导出数据',
  34064. expName: '文件名',
  34065. expNamePlaceholder: '请输入文件名',
  34066. expSheetName: '标题',
  34067. expSheetNamePlaceholder: '请输入标题',
  34068. expType: '保存类型',
  34069. expMode: '选择数据',
  34070. expCurrentColumn: '全部字段',
  34071. expColumn: '选择字段',
  34072. expOpts: '参数设置',
  34073. expOptHeader: '表头',
  34074. expHeaderTitle: '是否需要表头',
  34075. expOptFooter: '表尾',
  34076. expFooterTitle: '是否需要表尾',
  34077. expOptColgroup: '分组表头',
  34078. expColgroupTitle: '如果存在,则支持带有分组结构的表头',
  34079. expOptMerge: '合并',
  34080. expMergeTitle: '如果存在,则支持带有合并结构的单元格',
  34081. expOptAllExpand: '展开层级',
  34082. expAllExpandTitle: '如果存在,则支持将带有层级结构的数据全部展开',
  34083. expOptUseStyle: '样式',
  34084. expUseStyleTitle: '如果存在,则支持带样式的单元格',
  34085. expOptOriginal: '源数据',
  34086. expOriginalTitle: '如果为源数据,则支持导入到表格中',
  34087. expPrint: '打印',
  34088. expConfirm: '导出',
  34089. expCancel: '取消'
  34090. },
  34091. modal: {
  34092. zoomIn: '最大化',
  34093. zoomOut: '还原',
  34094. close: '关闭'
  34095. },
  34096. form: {
  34097. folding: '收起',
  34098. unfolding: '展开'
  34099. },
  34100. toolbar: {
  34101. import: '导入',
  34102. export: '导出',
  34103. print: '打印',
  34104. refresh: '刷新',
  34105. zoomIn: '全屏',
  34106. zoomOut: '还原',
  34107. custom: '列设置',
  34108. customAll: '全部',
  34109. customConfirm: '确认',
  34110. customRestore: '还原'
  34111. },
  34112. input: {
  34113. date: {
  34114. m1: '01 月',
  34115. m2: '02 月',
  34116. m3: '03 月',
  34117. m4: '04 月',
  34118. m5: '05 月',
  34119. m6: '06 月',
  34120. m7: '07 月',
  34121. m8: '08 月',
  34122. m9: '09 月',
  34123. m10: '10 月',
  34124. m11: '11 月',
  34125. m12: '12 月',
  34126. quarterLabel: '{0} 年',
  34127. monthLabel: '{0} 年',
  34128. dayLabel: '{0} 年 {1}',
  34129. labelFormat: {
  34130. date: 'yyyy-MM-dd',
  34131. time: 'HH:mm:ss',
  34132. datetime: 'yyyy-MM-dd HH:mm:ss',
  34133. week: 'yyyy 年第 WW 周',
  34134. month: 'yyyy-MM',
  34135. quarter: 'yyyy 年第 q 季度',
  34136. year: 'yyyy'
  34137. },
  34138. weeks: {
  34139. w: '周',
  34140. w0: '周日',
  34141. w1: '周一',
  34142. w2: '周二',
  34143. w3: '周三',
  34144. w4: '周四',
  34145. w5: '周五',
  34146. w6: '周六'
  34147. },
  34148. months: {
  34149. m0: '一月',
  34150. m1: '二月',
  34151. m2: '三月',
  34152. m3: '四月',
  34153. m4: '五月',
  34154. m5: '六月',
  34155. m6: '七月',
  34156. m7: '八月',
  34157. m8: '九月',
  34158. m9: '十月',
  34159. m10: '十一月',
  34160. m11: '十二月'
  34161. },
  34162. quarters: {
  34163. q1: '第一季度',
  34164. q2: '第二季度',
  34165. q3: '第三季度',
  34166. q4: '第四季度'
  34167. }
  34168. }
  34169. }
  34170. }
  34171. });
  34172. // CONCATENATED MODULE: ./packages/all.js
  34173. // 按需加载的组件
  34174. var components = [// 功能模块
  34175. Footer, Icon, Filter, Menu, Edit, Export, Keyboard, Validator, // 可选组件
  34176. Column, Colgroup, Grid, Toolbar, Pager, Checkbox, CheckboxGroup, Radio, RadioGroup, RadioButton, Input, Textarea, Button, Modal, Tooltip, Form, FormItem, FormGather, Select, Optgroup, Option, Switch, List, Pulldown, // 核心
  34177. Table]; // 默认安装
  34178. function all_install(Vue, options) {
  34179. if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isPlainObject(options)) {
  34180. VXETable.setup(options);
  34181. }
  34182. components.map(function (component) {
  34183. return component.install(Vue);
  34184. });
  34185. } // 默认中文
  34186. VXETable.setup({
  34187. i18n: function i18n(key, args) {
  34188. 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);
  34189. }
  34190. });
  34191. // EXTERNAL MODULE: ./styles/index.scss
  34192. var styles_0 = __webpack_require__("1a97");
  34193. // CONCATENATED MODULE: ./index.js
  34194. if (typeof window !== 'undefined' && window.Vue) {
  34195. window.Vue.use(all_namespaceObject);
  34196. }
  34197. /* harmony default export */ var index_0 = (all_namespaceObject);
  34198. // CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js
  34199. /* harmony default export */ var entry_lib = __webpack_exports__["default"] = (index_0);
  34200. /***/ }),
  34201. /***/ "fb6a":
  34202. /***/ (function(module, exports, __webpack_require__) {
  34203. "use strict";
  34204. var $ = __webpack_require__("23e7");
  34205. var isArray = __webpack_require__("e8b5");
  34206. var isConstructor = __webpack_require__("68ee");
  34207. var isObject = __webpack_require__("861d");
  34208. var toAbsoluteIndex = __webpack_require__("23cb");
  34209. var lengthOfArrayLike = __webpack_require__("07fa");
  34210. var toIndexedObject = __webpack_require__("fc6a");
  34211. var createProperty = __webpack_require__("8418");
  34212. var wellKnownSymbol = __webpack_require__("b622");
  34213. var arrayMethodHasSpeciesSupport = __webpack_require__("1dde");
  34214. var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('slice');
  34215. var SPECIES = wellKnownSymbol('species');
  34216. var nativeSlice = [].slice;
  34217. var max = Math.max;
  34218. // `Array.prototype.slice` method
  34219. // https://tc39.es/ecma262/#sec-array.prototype.slice
  34220. // fallback for not array-like ES3 strings and DOM objects
  34221. $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
  34222. slice: function slice(start, end) {
  34223. var O = toIndexedObject(this);
  34224. var length = lengthOfArrayLike(O);
  34225. var k = toAbsoluteIndex(start, length);
  34226. var fin = toAbsoluteIndex(end === undefined ? length : end, length);
  34227. // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible
  34228. var Constructor, result, n;
  34229. if (isArray(O)) {
  34230. Constructor = O.constructor;
  34231. // cross-realm fallback
  34232. if (isConstructor(Constructor) && (Constructor === Array || isArray(Constructor.prototype))) {
  34233. Constructor = undefined;
  34234. } else if (isObject(Constructor)) {
  34235. Constructor = Constructor[SPECIES];
  34236. if (Constructor === null) Constructor = undefined;
  34237. }
  34238. if (Constructor === Array || Constructor === undefined) {
  34239. return nativeSlice.call(O, k, fin);
  34240. }
  34241. }
  34242. result = new (Constructor === undefined ? Array : Constructor)(max(fin - k, 0));
  34243. for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);
  34244. result.length = n;
  34245. return result;
  34246. }
  34247. });
  34248. /***/ }),
  34249. /***/ "fc6a":
  34250. /***/ (function(module, exports, __webpack_require__) {
  34251. // toObject with fallback for non-array-like ES3 strings
  34252. var IndexedObject = __webpack_require__("44ad");
  34253. var requireObjectCoercible = __webpack_require__("1d80");
  34254. module.exports = function (it) {
  34255. return IndexedObject(requireObjectCoercible(it));
  34256. };
  34257. /***/ }),
  34258. /***/ "fce3":
  34259. /***/ (function(module, exports, __webpack_require__) {
  34260. var fails = __webpack_require__("d039");
  34261. var global = __webpack_require__("da84");
  34262. // babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError
  34263. var $RegExp = global.RegExp;
  34264. module.exports = fails(function () {
  34265. var re = $RegExp('.', 's');
  34266. return !(re.dotAll && re.exec('\n') && re.flags === 's');
  34267. });
  34268. /***/ }),
  34269. /***/ "fdbc":
  34270. /***/ (function(module, exports) {
  34271. // iterable DOM collections
  34272. // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
  34273. module.exports = {
  34274. CSSRuleList: 0,
  34275. CSSStyleDeclaration: 0,
  34276. CSSValueList: 0,
  34277. ClientRectList: 0,
  34278. DOMRectList: 0,
  34279. DOMStringList: 0,
  34280. DOMTokenList: 1,
  34281. DataTransferItemList: 0,
  34282. FileList: 0,
  34283. HTMLAllCollection: 0,
  34284. HTMLCollection: 0,
  34285. HTMLFormElement: 0,
  34286. HTMLSelectElement: 0,
  34287. MediaList: 0,
  34288. MimeTypeArray: 0,
  34289. NamedNodeMap: 0,
  34290. NodeList: 1,
  34291. PaintRequestList: 0,
  34292. Plugin: 0,
  34293. PluginArray: 0,
  34294. SVGLengthList: 0,
  34295. SVGNumberList: 0,
  34296. SVGPathSegList: 0,
  34297. SVGPointList: 0,
  34298. SVGStringList: 0,
  34299. SVGTransformList: 0,
  34300. SourceBufferList: 0,
  34301. StyleSheetList: 0,
  34302. TextTrackCueList: 0,
  34303. TextTrackList: 0,
  34304. TouchList: 0
  34305. };
  34306. /***/ }),
  34307. /***/ "fdbf":
  34308. /***/ (function(module, exports, __webpack_require__) {
  34309. /* eslint-disable es/no-symbol -- required for testing */
  34310. var NATIVE_SYMBOL = __webpack_require__("4930");
  34311. module.exports = NATIVE_SYMBOL
  34312. && !Symbol.sham
  34313. && typeof Symbol.iterator == 'symbol';
  34314. /***/ }),
  34315. /***/ "fea9":
  34316. /***/ (function(module, exports, __webpack_require__) {
  34317. var global = __webpack_require__("da84");
  34318. module.exports = global.Promise;
  34319. /***/ })
  34320. /******/ });
  34321. });