1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681 |
- module.exports =
- /******/ (function(modules) { // webpackBootstrap
- /******/ // The module cache
- /******/ var installedModules = {};
- /******/
- /******/ // The require function
- /******/ function __webpack_require__(moduleId) {
- /******/
- /******/ // Check if module is in cache
- /******/ if(installedModules[moduleId]) {
- /******/ return installedModules[moduleId].exports;
- /******/ }
- /******/ // Create a new module (and put it into the cache)
- /******/ var module = installedModules[moduleId] = {
- /******/ i: moduleId,
- /******/ l: false,
- /******/ exports: {}
- /******/ };
- /******/
- /******/ // Execute the module function
- /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
- /******/
- /******/ // Flag the module as loaded
- /******/ module.l = true;
- /******/
- /******/ // Return the exports of the module
- /******/ return module.exports;
- /******/ }
- /******/
- /******/
- /******/ // expose the modules object (__webpack_modules__)
- /******/ __webpack_require__.m = modules;
- /******/
- /******/ // expose the module cache
- /******/ __webpack_require__.c = installedModules;
- /******/
- /******/ // define getter function for harmony exports
- /******/ __webpack_require__.d = function(exports, name, getter) {
- /******/ if(!__webpack_require__.o(exports, name)) {
- /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
- /******/ }
- /******/ };
- /******/
- /******/ // define __esModule on exports
- /******/ __webpack_require__.r = function(exports) {
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
- /******/ }
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
- /******/ };
- /******/
- /******/ // create a fake namespace object
- /******/ // mode & 1: value is a module id, require it
- /******/ // mode & 2: merge all properties of value into the ns
- /******/ // mode & 4: return value when already ns object
- /******/ // mode & 8|1: behave like require
- /******/ __webpack_require__.t = function(value, mode) {
- /******/ if(mode & 1) value = __webpack_require__(value);
- /******/ if(mode & 8) return value;
- /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
- /******/ var ns = Object.create(null);
- /******/ __webpack_require__.r(ns);
- /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
- /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
- /******/ return ns;
- /******/ };
- /******/
- /******/ // getDefaultExport function for compatibility with non-harmony modules
- /******/ __webpack_require__.n = function(module) {
- /******/ var getter = module && module.__esModule ?
- /******/ function getDefault() { return module['default']; } :
- /******/ function getModuleExports() { return module; };
- /******/ __webpack_require__.d(getter, 'a', getter);
- /******/ return getter;
- /******/ };
- /******/
- /******/ // Object.prototype.hasOwnProperty.call
- /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
- /******/
- /******/ // __webpack_public_path__
- /******/ __webpack_require__.p = "";
- /******/
- /******/
- /******/ // Load entry module and return exports
- /******/ return __webpack_require__(__webpack_require__.s = "fb15");
- /******/ })
- /************************************************************************/
- /******/ ({
- /***/ "00ee":
- /***/ (function(module, exports, __webpack_require__) {
- var wellKnownSymbol = __webpack_require__("b622");
- var TO_STRING_TAG = wellKnownSymbol('toStringTag');
- var test = {};
- test[TO_STRING_TAG] = 'z';
- module.exports = String(test) === '[object z]';
- /***/ }),
- /***/ "0366":
- /***/ (function(module, exports, __webpack_require__) {
- var aFunction = __webpack_require__("1c0b");
- // optional / simple context binding
- module.exports = function (fn, that, length) {
- aFunction(fn);
- if (that === undefined) return fn;
- switch (length) {
- case 0: return function () {
- return fn.call(that);
- };
- case 1: return function (a) {
- return fn.call(that, a);
- };
- case 2: return function (a, b) {
- return fn.call(that, a, b);
- };
- case 3: return function (a, b, c) {
- return fn.call(that, a, b, c);
- };
- }
- return function (/* ...args */) {
- return fn.apply(that, arguments);
- };
- };
- /***/ }),
- /***/ "057f":
- /***/ (function(module, exports, __webpack_require__) {
- var toIndexedObject = __webpack_require__("fc6a");
- var nativeGetOwnPropertyNames = __webpack_require__("241c").f;
- var toString = {}.toString;
- var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
- ? Object.getOwnPropertyNames(window) : [];
- var getWindowNames = function (it) {
- try {
- return nativeGetOwnPropertyNames(it);
- } catch (error) {
- return windowNames.slice();
- }
- };
- // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
- module.exports.f = function getOwnPropertyNames(it) {
- return windowNames && toString.call(it) == '[object Window]'
- ? getWindowNames(it)
- : nativeGetOwnPropertyNames(toIndexedObject(it));
- };
- /***/ }),
- /***/ "06cf":
- /***/ (function(module, exports, __webpack_require__) {
- var DESCRIPTORS = __webpack_require__("83ab");
- var propertyIsEnumerableModule = __webpack_require__("d1e7");
- var createPropertyDescriptor = __webpack_require__("5c6c");
- var toIndexedObject = __webpack_require__("fc6a");
- var toPrimitive = __webpack_require__("c04e");
- var has = __webpack_require__("5135");
- var IE8_DOM_DEFINE = __webpack_require__("0cfb");
- var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
- // `Object.getOwnPropertyDescriptor` method
- // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor
- exports.f = DESCRIPTORS ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
- O = toIndexedObject(O);
- P = toPrimitive(P, true);
- if (IE8_DOM_DEFINE) try {
- return nativeGetOwnPropertyDescriptor(O, P);
- } catch (error) { /* empty */ }
- if (has(O, P)) return createPropertyDescriptor(!propertyIsEnumerableModule.f.call(O, P), O[P]);
- };
- /***/ }),
- /***/ "0ccb":
- /***/ (function(module, exports, __webpack_require__) {
- // https://github.com/tc39/proposal-string-pad-start-end
- var toLength = __webpack_require__("50c4");
- var repeat = __webpack_require__("1148");
- var requireObjectCoercible = __webpack_require__("1d80");
- var ceil = Math.ceil;
- // `String.prototype.{ padStart, padEnd }` methods implementation
- var createMethod = function (IS_END) {
- return function ($this, maxLength, fillString) {
- var S = String(requireObjectCoercible($this));
- var stringLength = S.length;
- var fillStr = fillString === undefined ? ' ' : String(fillString);
- var intMaxLength = toLength(maxLength);
- var fillLen, stringFiller;
- if (intMaxLength <= stringLength || fillStr == '') return S;
- fillLen = intMaxLength - stringLength;
- stringFiller = repeat.call(fillStr, ceil(fillLen / fillStr.length));
- if (stringFiller.length > fillLen) stringFiller = stringFiller.slice(0, fillLen);
- return IS_END ? S + stringFiller : stringFiller + S;
- };
- };
- module.exports = {
- // `String.prototype.padStart` method
- // https://tc39.github.io/ecma262/#sec-string.prototype.padstart
- start: createMethod(false),
- // `String.prototype.padEnd` method
- // https://tc39.github.io/ecma262/#sec-string.prototype.padend
- end: createMethod(true)
- };
- /***/ }),
- /***/ "0cfb":
- /***/ (function(module, exports, __webpack_require__) {
- var DESCRIPTORS = __webpack_require__("83ab");
- var fails = __webpack_require__("d039");
- var createElement = __webpack_require__("cc12");
- // Thank's IE8 for his funny defineProperty
- module.exports = !DESCRIPTORS && !fails(function () {
- return Object.defineProperty(createElement('div'), 'a', {
- get: function () { return 7; }
- }).a != 7;
- });
- /***/ }),
- /***/ "0d3b":
- /***/ (function(module, exports, __webpack_require__) {
- var fails = __webpack_require__("d039");
- var wellKnownSymbol = __webpack_require__("b622");
- var IS_PURE = __webpack_require__("c430");
- var ITERATOR = wellKnownSymbol('iterator');
- module.exports = !fails(function () {
- var url = new URL('b?a=1&b=2&c=3', 'http://a');
- var searchParams = url.searchParams;
- var result = '';
- url.pathname = 'c%20d';
- searchParams.forEach(function (value, key) {
- searchParams['delete']('b');
- result += key + value;
- });
- return (IS_PURE && !url.toJSON)
- || !searchParams.sort
- || url.href !== 'http://a/c%20d?a=1&c=3'
- || searchParams.get('c') !== '3'
- || String(new URLSearchParams('?a=1')) !== 'a=1'
- || !searchParams[ITERATOR]
- // throws in Edge
- || new URL('https://a@b').username !== 'a'
- || new URLSearchParams(new URLSearchParams('a=b')).get('a') !== 'b'
- // not punycoded in Edge
- || new URL('http://тест').host !== 'xn--e1aybc'
- // not escaped in Chrome 62-
- || new URL('http://a#б').hash !== '#%D0%B1'
- // fails in Chrome 66-
- || result !== 'a1c3'
- // throws in Safari
- || new URL('http://x', undefined).host !== 'x';
- });
- /***/ }),
- /***/ "1148":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var toInteger = __webpack_require__("a691");
- var requireObjectCoercible = __webpack_require__("1d80");
- // `String.prototype.repeat` method implementation
- // https://tc39.github.io/ecma262/#sec-string.prototype.repeat
- module.exports = ''.repeat || function repeat(count) {
- var str = String(requireObjectCoercible(this));
- var result = '';
- var n = toInteger(count);
- if (n < 0 || n == Infinity) throw RangeError('Wrong number of repetitions');
- for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) result += str;
- return result;
- };
- /***/ }),
- /***/ "1276":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var fixRegExpWellKnownSymbolLogic = __webpack_require__("d784");
- var isRegExp = __webpack_require__("44e7");
- var anObject = __webpack_require__("825a");
- var requireObjectCoercible = __webpack_require__("1d80");
- var speciesConstructor = __webpack_require__("4840");
- var advanceStringIndex = __webpack_require__("8aa5");
- var toLength = __webpack_require__("50c4");
- var callRegExpExec = __webpack_require__("14c3");
- var regexpExec = __webpack_require__("9263");
- var fails = __webpack_require__("d039");
- var arrayPush = [].push;
- var min = Math.min;
- var MAX_UINT32 = 0xFFFFFFFF;
- // babel-minify transpiles RegExp('x', 'y') -> /x/y and it causes SyntaxError
- var SUPPORTS_Y = !fails(function () { return !RegExp(MAX_UINT32, 'y'); });
- // @@split logic
- fixRegExpWellKnownSymbolLogic('split', 2, function (SPLIT, nativeSplit, maybeCallNative) {
- var internalSplit;
- if (
- 'abbc'.split(/(b)*/)[1] == 'c' ||
- 'test'.split(/(?:)/, -1).length != 4 ||
- 'ab'.split(/(?:ab)*/).length != 2 ||
- '.'.split(/(.?)(.?)/).length != 4 ||
- '.'.split(/()()/).length > 1 ||
- ''.split(/.?/).length
- ) {
- // based on es5-shim implementation, need to rework it
- internalSplit = function (separator, limit) {
- var string = String(requireObjectCoercible(this));
- var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
- if (lim === 0) return [];
- if (separator === undefined) return [string];
- // If `separator` is not a regex, use native split
- if (!isRegExp(separator)) {
- return nativeSplit.call(string, separator, lim);
- }
- var output = [];
- var flags = (separator.ignoreCase ? 'i' : '') +
- (separator.multiline ? 'm' : '') +
- (separator.unicode ? 'u' : '') +
- (separator.sticky ? 'y' : '');
- var lastLastIndex = 0;
- // Make `global` and avoid `lastIndex` issues by working with a copy
- var separatorCopy = new RegExp(separator.source, flags + 'g');
- var match, lastIndex, lastLength;
- while (match = regexpExec.call(separatorCopy, string)) {
- lastIndex = separatorCopy.lastIndex;
- if (lastIndex > lastLastIndex) {
- output.push(string.slice(lastLastIndex, match.index));
- if (match.length > 1 && match.index < string.length) arrayPush.apply(output, match.slice(1));
- lastLength = match[0].length;
- lastLastIndex = lastIndex;
- if (output.length >= lim) break;
- }
- if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++; // Avoid an infinite loop
- }
- if (lastLastIndex === string.length) {
- if (lastLength || !separatorCopy.test('')) output.push('');
- } else output.push(string.slice(lastLastIndex));
- return output.length > lim ? output.slice(0, lim) : output;
- };
- // Chakra, V8
- } else if ('0'.split(undefined, 0).length) {
- internalSplit = function (separator, limit) {
- return separator === undefined && limit === 0 ? [] : nativeSplit.call(this, separator, limit);
- };
- } else internalSplit = nativeSplit;
- return [
- // `String.prototype.split` method
- // https://tc39.github.io/ecma262/#sec-string.prototype.split
- function split(separator, limit) {
- var O = requireObjectCoercible(this);
- var splitter = separator == undefined ? undefined : separator[SPLIT];
- return splitter !== undefined
- ? splitter.call(separator, O, limit)
- : internalSplit.call(String(O), separator, limit);
- },
- // `RegExp.prototype[@@split]` method
- // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@split
- //
- // NOTE: This cannot be properly polyfilled in engines that don't support
- // the 'y' flag.
- function (regexp, limit) {
- var res = maybeCallNative(internalSplit, regexp, this, limit, internalSplit !== nativeSplit);
- if (res.done) return res.value;
- var rx = anObject(regexp);
- var S = String(this);
- var C = speciesConstructor(rx, RegExp);
- var unicodeMatching = rx.unicode;
- var flags = (rx.ignoreCase ? 'i' : '') +
- (rx.multiline ? 'm' : '') +
- (rx.unicode ? 'u' : '') +
- (SUPPORTS_Y ? 'y' : 'g');
- // ^(? + rx + ) is needed, in combination with some S slicing, to
- // simulate the 'y' flag.
- var splitter = new C(SUPPORTS_Y ? rx : '^(?:' + rx.source + ')', flags);
- var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
- if (lim === 0) return [];
- if (S.length === 0) return callRegExpExec(splitter, S) === null ? [S] : [];
- var p = 0;
- var q = 0;
- var A = [];
- while (q < S.length) {
- splitter.lastIndex = SUPPORTS_Y ? q : 0;
- var z = callRegExpExec(splitter, SUPPORTS_Y ? S : S.slice(q));
- var e;
- if (
- z === null ||
- (e = min(toLength(splitter.lastIndex + (SUPPORTS_Y ? 0 : q)), S.length)) === p
- ) {
- q = advanceStringIndex(S, q, unicodeMatching);
- } else {
- A.push(S.slice(p, q));
- if (A.length === lim) return A;
- for (var i = 1; i <= z.length - 1; i++) {
- A.push(z[i]);
- if (A.length === lim) return A;
- }
- q = p = e;
- }
- }
- A.push(S.slice(p));
- return A;
- }
- ];
- }, !SUPPORTS_Y);
- /***/ }),
- /***/ "13d5":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var $ = __webpack_require__("23e7");
- var $reduce = __webpack_require__("d58f").left;
- var arrayMethodIsStrict = __webpack_require__("a640");
- var arrayMethodUsesToLength = __webpack_require__("ae40");
- var CHROME_VERSION = __webpack_require__("2d00");
- var IS_NODE = __webpack_require__("605d");
- var STRICT_METHOD = arrayMethodIsStrict('reduce');
- var USES_TO_LENGTH = arrayMethodUsesToLength('reduce', { 1: 0 });
- // Chrome 80-82 has a critical bug
- // https://bugs.chromium.org/p/chromium/issues/detail?id=1049982
- var CHROME_BUG = !IS_NODE && CHROME_VERSION > 79 && CHROME_VERSION < 83;
- // `Array.prototype.reduce` method
- // https://tc39.github.io/ecma262/#sec-array.prototype.reduce
- $({ target: 'Array', proto: true, forced: !STRICT_METHOD || !USES_TO_LENGTH || CHROME_BUG }, {
- reduce: function reduce(callbackfn /* , initialValue */) {
- return $reduce(this, callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined);
- }
- });
- /***/ }),
- /***/ "14c3":
- /***/ (function(module, exports, __webpack_require__) {
- var classof = __webpack_require__("c6b6");
- var regexpExec = __webpack_require__("9263");
- // `RegExpExec` abstract operation
- // https://tc39.github.io/ecma262/#sec-regexpexec
- module.exports = function (R, S) {
- var exec = R.exec;
- if (typeof exec === 'function') {
- var result = exec.call(R, S);
- if (typeof result !== 'object') {
- throw TypeError('RegExp exec method returned something other than an Object or null');
- }
- return result;
- }
- if (classof(R) !== 'RegExp') {
- throw TypeError('RegExp#exec called on incompatible receiver');
- }
- return regexpExec.call(R, S);
- };
- /***/ }),
- /***/ "159b":
- /***/ (function(module, exports, __webpack_require__) {
- var global = __webpack_require__("da84");
- var DOMIterables = __webpack_require__("fdbc");
- var forEach = __webpack_require__("17c2");
- var createNonEnumerableProperty = __webpack_require__("9112");
- for (var COLLECTION_NAME in DOMIterables) {
- var Collection = global[COLLECTION_NAME];
- var CollectionPrototype = Collection && Collection.prototype;
- // some Chrome versions have non-configurable methods on DOMTokenList
- if (CollectionPrototype && CollectionPrototype.forEach !== forEach) try {
- createNonEnumerableProperty(CollectionPrototype, 'forEach', forEach);
- } catch (error) {
- CollectionPrototype.forEach = forEach;
- }
- }
- /***/ }),
- /***/ "17c2":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var $forEach = __webpack_require__("b727").forEach;
- var arrayMethodIsStrict = __webpack_require__("a640");
- var arrayMethodUsesToLength = __webpack_require__("ae40");
- var STRICT_METHOD = arrayMethodIsStrict('forEach');
- var USES_TO_LENGTH = arrayMethodUsesToLength('forEach');
- // `Array.prototype.forEach` method implementation
- // https://tc39.github.io/ecma262/#sec-array.prototype.foreach
- module.exports = (!STRICT_METHOD || !USES_TO_LENGTH) ? function forEach(callbackfn /* , thisArg */) {
- return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
- } : [].forEach;
- /***/ }),
- /***/ "19aa":
- /***/ (function(module, exports) {
- module.exports = function (it, Constructor, name) {
- if (!(it instanceof Constructor)) {
- throw TypeError('Incorrect ' + (name ? name + ' ' : '') + 'invocation');
- } return it;
- };
- /***/ }),
- /***/ "1a97":
- /***/ (function(module, exports, __webpack_require__) {
- // extracted by mini-css-extract-plugin
- /***/ }),
- /***/ "1be4":
- /***/ (function(module, exports, __webpack_require__) {
- var getBuiltIn = __webpack_require__("d066");
- module.exports = getBuiltIn('document', 'documentElement');
- /***/ }),
- /***/ "1c0b":
- /***/ (function(module, exports) {
- module.exports = function (it) {
- if (typeof it != 'function') {
- throw TypeError(String(it) + ' is not a function');
- } return it;
- };
- /***/ }),
- /***/ "1c7e":
- /***/ (function(module, exports, __webpack_require__) {
- var wellKnownSymbol = __webpack_require__("b622");
- var ITERATOR = wellKnownSymbol('iterator');
- var SAFE_CLOSING = false;
- try {
- var called = 0;
- var iteratorWithReturn = {
- next: function () {
- return { done: !!called++ };
- },
- 'return': function () {
- SAFE_CLOSING = true;
- }
- };
- iteratorWithReturn[ITERATOR] = function () {
- return this;
- };
- // eslint-disable-next-line no-throw-literal
- Array.from(iteratorWithReturn, function () { throw 2; });
- } catch (error) { /* empty */ }
- module.exports = function (exec, SKIP_CLOSING) {
- if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
- var ITERATION_SUPPORT = false;
- try {
- var object = {};
- object[ITERATOR] = function () {
- return {
- next: function () {
- return { done: ITERATION_SUPPORT = true };
- }
- };
- };
- exec(object);
- } catch (error) { /* empty */ }
- return ITERATION_SUPPORT;
- };
- /***/ }),
- /***/ "1d80":
- /***/ (function(module, exports) {
- // `RequireObjectCoercible` abstract operation
- // https://tc39.github.io/ecma262/#sec-requireobjectcoercible
- module.exports = function (it) {
- if (it == undefined) throw TypeError("Can't call method on " + it);
- return it;
- };
- /***/ }),
- /***/ "1dde":
- /***/ (function(module, exports, __webpack_require__) {
- var fails = __webpack_require__("d039");
- var wellKnownSymbol = __webpack_require__("b622");
- var V8_VERSION = __webpack_require__("2d00");
- var SPECIES = wellKnownSymbol('species');
- module.exports = function (METHOD_NAME) {
- // We can't use this feature detection in V8 since it causes
- // deoptimization and serious performance degradation
- // https://github.com/zloirock/core-js/issues/677
- return V8_VERSION >= 51 || !fails(function () {
- var array = [];
- var constructor = array.constructor = {};
- constructor[SPECIES] = function () {
- return { foo: 1 };
- };
- return array[METHOD_NAME](Boolean).foo !== 1;
- });
- };
- /***/ }),
- /***/ "2266":
- /***/ (function(module, exports, __webpack_require__) {
- var anObject = __webpack_require__("825a");
- var isArrayIteratorMethod = __webpack_require__("e95a");
- var toLength = __webpack_require__("50c4");
- var bind = __webpack_require__("0366");
- var getIteratorMethod = __webpack_require__("35a1");
- var iteratorClose = __webpack_require__("2a62");
- var Result = function (stopped, result) {
- this.stopped = stopped;
- this.result = result;
- };
- module.exports = function (iterable, unboundFunction, options) {
- var that = options && options.that;
- var AS_ENTRIES = !!(options && options.AS_ENTRIES);
- var IS_ITERATOR = !!(options && options.IS_ITERATOR);
- var INTERRUPTED = !!(options && options.INTERRUPTED);
- var fn = bind(unboundFunction, that, 1 + AS_ENTRIES + INTERRUPTED);
- var iterator, iterFn, index, length, result, next, step;
- var stop = function (condition) {
- if (iterator) iteratorClose(iterator);
- return new Result(true, condition);
- };
- var callFn = function (value) {
- if (AS_ENTRIES) {
- anObject(value);
- return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
- } return INTERRUPTED ? fn(value, stop) : fn(value);
- };
- if (IS_ITERATOR) {
- iterator = iterable;
- } else {
- iterFn = getIteratorMethod(iterable);
- if (typeof iterFn != 'function') throw TypeError('Target is not iterable');
- // optimisation for array iterators
- if (isArrayIteratorMethod(iterFn)) {
- for (index = 0, length = toLength(iterable.length); length > index; index++) {
- result = callFn(iterable[index]);
- if (result && result instanceof Result) return result;
- } return new Result(false);
- }
- iterator = iterFn.call(iterable);
- }
- next = iterator.next;
- while (!(step = next.call(iterator)).done) {
- try {
- result = callFn(step.value);
- } catch (error) {
- iteratorClose(iterator);
- throw error;
- }
- if (typeof result == 'object' && result && result instanceof Result) return result;
- } return new Result(false);
- };
- /***/ }),
- /***/ "23cb":
- /***/ (function(module, exports, __webpack_require__) {
- var toInteger = __webpack_require__("a691");
- var max = Math.max;
- var min = Math.min;
- // Helper for a popular repeating case of the spec:
- // Let integer be ? ToInteger(index).
- // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
- module.exports = function (index, length) {
- var integer = toInteger(index);
- return integer < 0 ? max(integer + length, 0) : min(integer, length);
- };
- /***/ }),
- /***/ "23e7":
- /***/ (function(module, exports, __webpack_require__) {
- var global = __webpack_require__("da84");
- var getOwnPropertyDescriptor = __webpack_require__("06cf").f;
- var createNonEnumerableProperty = __webpack_require__("9112");
- var redefine = __webpack_require__("6eeb");
- var setGlobal = __webpack_require__("ce4e");
- var copyConstructorProperties = __webpack_require__("e893");
- var isForced = __webpack_require__("94ca");
- /*
- options.target - name of the target object
- options.global - target is the global object
- options.stat - export as static methods of target
- options.proto - export as prototype methods of target
- options.real - real prototype method for the `pure` version
- options.forced - export even if the native feature is available
- options.bind - bind methods to the target, required for the `pure` version
- options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
- options.unsafe - use the simple assignment of property instead of delete + defineProperty
- options.sham - add a flag to not completely full polyfills
- options.enumerable - export as enumerable property
- options.noTargetGet - prevent calling a getter on target
- */
- module.exports = function (options, source) {
- var TARGET = options.target;
- var GLOBAL = options.global;
- var STATIC = options.stat;
- var FORCED, target, key, targetProperty, sourceProperty, descriptor;
- if (GLOBAL) {
- target = global;
- } else if (STATIC) {
- target = global[TARGET] || setGlobal(TARGET, {});
- } else {
- target = (global[TARGET] || {}).prototype;
- }
- if (target) for (key in source) {
- sourceProperty = source[key];
- if (options.noTargetGet) {
- descriptor = getOwnPropertyDescriptor(target, key);
- targetProperty = descriptor && descriptor.value;
- } else targetProperty = target[key];
- FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
- // contained in target
- if (!FORCED && targetProperty !== undefined) {
- if (typeof sourceProperty === typeof targetProperty) continue;
- copyConstructorProperties(sourceProperty, targetProperty);
- }
- // add a flag to not completely full polyfills
- if (options.sham || (targetProperty && targetProperty.sham)) {
- createNonEnumerableProperty(sourceProperty, 'sham', true);
- }
- // extend global
- redefine(target, key, sourceProperty, options);
- }
- };
- /***/ }),
- /***/ "241c":
- /***/ (function(module, exports, __webpack_require__) {
- var internalObjectKeys = __webpack_require__("ca84");
- var enumBugKeys = __webpack_require__("7839");
- var hiddenKeys = enumBugKeys.concat('length', 'prototype');
- // `Object.getOwnPropertyNames` method
- // https://tc39.github.io/ecma262/#sec-object.getownpropertynames
- exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
- return internalObjectKeys(O, hiddenKeys);
- };
- /***/ }),
- /***/ "2532":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var $ = __webpack_require__("23e7");
- var notARegExp = __webpack_require__("5a34");
- var requireObjectCoercible = __webpack_require__("1d80");
- var correctIsRegExpLogic = __webpack_require__("ab13");
- // `String.prototype.includes` method
- // https://tc39.github.io/ecma262/#sec-string.prototype.includes
- $({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, {
- includes: function includes(searchString /* , position = 0 */) {
- return !!~String(requireObjectCoercible(this))
- .indexOf(notARegExp(searchString), arguments.length > 1 ? arguments[1] : undefined);
- }
- });
- /***/ }),
- /***/ "25f0":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var redefine = __webpack_require__("6eeb");
- var anObject = __webpack_require__("825a");
- var fails = __webpack_require__("d039");
- var flags = __webpack_require__("ad6d");
- var TO_STRING = 'toString';
- var RegExpPrototype = RegExp.prototype;
- var nativeToString = RegExpPrototype[TO_STRING];
- var NOT_GENERIC = fails(function () { return nativeToString.call({ source: 'a', flags: 'b' }) != '/a/b'; });
- // FF44- RegExp#toString has a wrong name
- var INCORRECT_NAME = nativeToString.name != TO_STRING;
- // `RegExp.prototype.toString` method
- // https://tc39.github.io/ecma262/#sec-regexp.prototype.tostring
- if (NOT_GENERIC || INCORRECT_NAME) {
- redefine(RegExp.prototype, TO_STRING, function toString() {
- var R = anObject(this);
- var p = String(R.source);
- var rf = R.flags;
- var f = String(rf === undefined && R instanceof RegExp && !('flags' in RegExpPrototype) ? flags.call(R) : rf);
- return '/' + p + '/' + f;
- }, { unsafe: true });
- }
- /***/ }),
- /***/ "2626":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var getBuiltIn = __webpack_require__("d066");
- var definePropertyModule = __webpack_require__("9bf2");
- var wellKnownSymbol = __webpack_require__("b622");
- var DESCRIPTORS = __webpack_require__("83ab");
- var SPECIES = wellKnownSymbol('species');
- module.exports = function (CONSTRUCTOR_NAME) {
- var Constructor = getBuiltIn(CONSTRUCTOR_NAME);
- var defineProperty = definePropertyModule.f;
- if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) {
- defineProperty(Constructor, SPECIES, {
- configurable: true,
- get: function () { return this; }
- });
- }
- };
- /***/ }),
- /***/ "2a62":
- /***/ (function(module, exports, __webpack_require__) {
- var anObject = __webpack_require__("825a");
- module.exports = function (iterator) {
- var returnMethod = iterator['return'];
- if (returnMethod !== undefined) {
- return anObject(returnMethod.call(iterator)).value;
- }
- };
- /***/ }),
- /***/ "2b3d":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- // TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env`
- __webpack_require__("3ca3");
- var $ = __webpack_require__("23e7");
- var DESCRIPTORS = __webpack_require__("83ab");
- var USE_NATIVE_URL = __webpack_require__("0d3b");
- var global = __webpack_require__("da84");
- var defineProperties = __webpack_require__("37e8");
- var redefine = __webpack_require__("6eeb");
- var anInstance = __webpack_require__("19aa");
- var has = __webpack_require__("5135");
- var assign = __webpack_require__("60da");
- var arrayFrom = __webpack_require__("4df4");
- var codeAt = __webpack_require__("6547").codeAt;
- var toASCII = __webpack_require__("5fb2");
- var setToStringTag = __webpack_require__("d44e");
- var URLSearchParamsModule = __webpack_require__("9861");
- var InternalStateModule = __webpack_require__("69f3");
- var NativeURL = global.URL;
- var URLSearchParams = URLSearchParamsModule.URLSearchParams;
- var getInternalSearchParamsState = URLSearchParamsModule.getState;
- var setInternalState = InternalStateModule.set;
- var getInternalURLState = InternalStateModule.getterFor('URL');
- var floor = Math.floor;
- var pow = Math.pow;
- var INVALID_AUTHORITY = 'Invalid authority';
- var INVALID_SCHEME = 'Invalid scheme';
- var INVALID_HOST = 'Invalid host';
- var INVALID_PORT = 'Invalid port';
- var ALPHA = /[A-Za-z]/;
- var ALPHANUMERIC = /[\d+-.A-Za-z]/;
- var DIGIT = /\d/;
- var HEX_START = /^(0x|0X)/;
- var OCT = /^[0-7]+$/;
- var DEC = /^\d+$/;
- var HEX = /^[\dA-Fa-f]+$/;
- // eslint-disable-next-line no-control-regex
- var FORBIDDEN_HOST_CODE_POINT = /[\u0000\u0009\u000A\u000D #%/:?@[\\]]/;
- // eslint-disable-next-line no-control-regex
- var FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT = /[\u0000\u0009\u000A\u000D #/:?@[\\]]/;
- // eslint-disable-next-line no-control-regex
- var LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE = /^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g;
- // eslint-disable-next-line no-control-regex
- var TAB_AND_NEW_LINE = /[\u0009\u000A\u000D]/g;
- var EOF;
- var parseHost = function (url, input) {
- var result, codePoints, index;
- if (input.charAt(0) == '[') {
- if (input.charAt(input.length - 1) != ']') return INVALID_HOST;
- result = parseIPv6(input.slice(1, -1));
- if (!result) return INVALID_HOST;
- url.host = result;
- // opaque host
- } else if (!isSpecial(url)) {
- if (FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT.test(input)) return INVALID_HOST;
- result = '';
- codePoints = arrayFrom(input);
- for (index = 0; index < codePoints.length; index++) {
- result += percentEncode(codePoints[index], C0ControlPercentEncodeSet);
- }
- url.host = result;
- } else {
- input = toASCII(input);
- if (FORBIDDEN_HOST_CODE_POINT.test(input)) return INVALID_HOST;
- result = parseIPv4(input);
- if (result === null) return INVALID_HOST;
- url.host = result;
- }
- };
- var parseIPv4 = function (input) {
- var parts = input.split('.');
- var partsLength, numbers, index, part, radix, number, ipv4;
- if (parts.length && parts[parts.length - 1] == '') {
- parts.pop();
- }
- partsLength = parts.length;
- if (partsLength > 4) return input;
- numbers = [];
- for (index = 0; index < partsLength; index++) {
- part = parts[index];
- if (part == '') return input;
- radix = 10;
- if (part.length > 1 && part.charAt(0) == '0') {
- radix = HEX_START.test(part) ? 16 : 8;
- part = part.slice(radix == 8 ? 1 : 2);
- }
- if (part === '') {
- number = 0;
- } else {
- if (!(radix == 10 ? DEC : radix == 8 ? OCT : HEX).test(part)) return input;
- number = parseInt(part, radix);
- }
- numbers.push(number);
- }
- for (index = 0; index < partsLength; index++) {
- number = numbers[index];
- if (index == partsLength - 1) {
- if (number >= pow(256, 5 - partsLength)) return null;
- } else if (number > 255) return null;
- }
- ipv4 = numbers.pop();
- for (index = 0; index < numbers.length; index++) {
- ipv4 += numbers[index] * pow(256, 3 - index);
- }
- return ipv4;
- };
- // eslint-disable-next-line max-statements
- var parseIPv6 = function (input) {
- var address = [0, 0, 0, 0, 0, 0, 0, 0];
- var pieceIndex = 0;
- var compress = null;
- var pointer = 0;
- var value, length, numbersSeen, ipv4Piece, number, swaps, swap;
- var char = function () {
- return input.charAt(pointer);
- };
- if (char() == ':') {
- if (input.charAt(1) != ':') return;
- pointer += 2;
- pieceIndex++;
- compress = pieceIndex;
- }
- while (char()) {
- if (pieceIndex == 8) return;
- if (char() == ':') {
- if (compress !== null) return;
- pointer++;
- pieceIndex++;
- compress = pieceIndex;
- continue;
- }
- value = length = 0;
- while (length < 4 && HEX.test(char())) {
- value = value * 16 + parseInt(char(), 16);
- pointer++;
- length++;
- }
- if (char() == '.') {
- if (length == 0) return;
- pointer -= length;
- if (pieceIndex > 6) return;
- numbersSeen = 0;
- while (char()) {
- ipv4Piece = null;
- if (numbersSeen > 0) {
- if (char() == '.' && numbersSeen < 4) pointer++;
- else return;
- }
- if (!DIGIT.test(char())) return;
- while (DIGIT.test(char())) {
- number = parseInt(char(), 10);
- if (ipv4Piece === null) ipv4Piece = number;
- else if (ipv4Piece == 0) return;
- else ipv4Piece = ipv4Piece * 10 + number;
- if (ipv4Piece > 255) return;
- pointer++;
- }
- address[pieceIndex] = address[pieceIndex] * 256 + ipv4Piece;
- numbersSeen++;
- if (numbersSeen == 2 || numbersSeen == 4) pieceIndex++;
- }
- if (numbersSeen != 4) return;
- break;
- } else if (char() == ':') {
- pointer++;
- if (!char()) return;
- } else if (char()) return;
- address[pieceIndex++] = value;
- }
- if (compress !== null) {
- swaps = pieceIndex - compress;
- pieceIndex = 7;
- while (pieceIndex != 0 && swaps > 0) {
- swap = address[pieceIndex];
- address[pieceIndex--] = address[compress + swaps - 1];
- address[compress + --swaps] = swap;
- }
- } else if (pieceIndex != 8) return;
- return address;
- };
- var findLongestZeroSequence = function (ipv6) {
- var maxIndex = null;
- var maxLength = 1;
- var currStart = null;
- var currLength = 0;
- var index = 0;
- for (; index < 8; index++) {
- if (ipv6[index] !== 0) {
- if (currLength > maxLength) {
- maxIndex = currStart;
- maxLength = currLength;
- }
- currStart = null;
- currLength = 0;
- } else {
- if (currStart === null) currStart = index;
- ++currLength;
- }
- }
- if (currLength > maxLength) {
- maxIndex = currStart;
- maxLength = currLength;
- }
- return maxIndex;
- };
- var serializeHost = function (host) {
- var result, index, compress, ignore0;
- // ipv4
- if (typeof host == 'number') {
- result = [];
- for (index = 0; index < 4; index++) {
- result.unshift(host % 256);
- host = floor(host / 256);
- } return result.join('.');
- // ipv6
- } else if (typeof host == 'object') {
- result = '';
- compress = findLongestZeroSequence(host);
- for (index = 0; index < 8; index++) {
- if (ignore0 && host[index] === 0) continue;
- if (ignore0) ignore0 = false;
- if (compress === index) {
- result += index ? ':' : '::';
- ignore0 = true;
- } else {
- result += host[index].toString(16);
- if (index < 7) result += ':';
- }
- }
- return '[' + result + ']';
- } return host;
- };
- var C0ControlPercentEncodeSet = {};
- var fragmentPercentEncodeSet = assign({}, C0ControlPercentEncodeSet, {
- ' ': 1, '"': 1, '<': 1, '>': 1, '`': 1
- });
- var pathPercentEncodeSet = assign({}, fragmentPercentEncodeSet, {
- '#': 1, '?': 1, '{': 1, '}': 1
- });
- var userinfoPercentEncodeSet = assign({}, pathPercentEncodeSet, {
- '/': 1, ':': 1, ';': 1, '=': 1, '@': 1, '[': 1, '\\': 1, ']': 1, '^': 1, '|': 1
- });
- var percentEncode = function (char, set) {
- var code = codeAt(char, 0);
- return code > 0x20 && code < 0x7F && !has(set, char) ? char : encodeURIComponent(char);
- };
- var specialSchemes = {
- ftp: 21,
- file: null,
- http: 80,
- https: 443,
- ws: 80,
- wss: 443
- };
- var isSpecial = function (url) {
- return has(specialSchemes, url.scheme);
- };
- var includesCredentials = function (url) {
- return url.username != '' || url.password != '';
- };
- var cannotHaveUsernamePasswordPort = function (url) {
- return !url.host || url.cannotBeABaseURL || url.scheme == 'file';
- };
- var isWindowsDriveLetter = function (string, normalized) {
- var second;
- return string.length == 2 && ALPHA.test(string.charAt(0))
- && ((second = string.charAt(1)) == ':' || (!normalized && second == '|'));
- };
- var startsWithWindowsDriveLetter = function (string) {
- var third;
- return string.length > 1 && isWindowsDriveLetter(string.slice(0, 2)) && (
- string.length == 2 ||
- ((third = string.charAt(2)) === '/' || third === '\\' || third === '?' || third === '#')
- );
- };
- var shortenURLsPath = function (url) {
- var path = url.path;
- var pathSize = path.length;
- if (pathSize && (url.scheme != 'file' || pathSize != 1 || !isWindowsDriveLetter(path[0], true))) {
- path.pop();
- }
- };
- var isSingleDot = function (segment) {
- return segment === '.' || segment.toLowerCase() === '%2e';
- };
- var isDoubleDot = function (segment) {
- segment = segment.toLowerCase();
- return segment === '..' || segment === '%2e.' || segment === '.%2e' || segment === '%2e%2e';
- };
- // States:
- var SCHEME_START = {};
- var SCHEME = {};
- var NO_SCHEME = {};
- var SPECIAL_RELATIVE_OR_AUTHORITY = {};
- var PATH_OR_AUTHORITY = {};
- var RELATIVE = {};
- var RELATIVE_SLASH = {};
- var SPECIAL_AUTHORITY_SLASHES = {};
- var SPECIAL_AUTHORITY_IGNORE_SLASHES = {};
- var AUTHORITY = {};
- var HOST = {};
- var HOSTNAME = {};
- var PORT = {};
- var FILE = {};
- var FILE_SLASH = {};
- var FILE_HOST = {};
- var PATH_START = {};
- var PATH = {};
- var CANNOT_BE_A_BASE_URL_PATH = {};
- var QUERY = {};
- var FRAGMENT = {};
- // eslint-disable-next-line max-statements
- var parseURL = function (url, input, stateOverride, base) {
- var state = stateOverride || SCHEME_START;
- var pointer = 0;
- var buffer = '';
- var seenAt = false;
- var seenBracket = false;
- var seenPasswordToken = false;
- var codePoints, char, bufferCodePoints, failure;
- if (!stateOverride) {
- url.scheme = '';
- url.username = '';
- url.password = '';
- url.host = null;
- url.port = null;
- url.path = [];
- url.query = null;
- url.fragment = null;
- url.cannotBeABaseURL = false;
- input = input.replace(LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE, '');
- }
- input = input.replace(TAB_AND_NEW_LINE, '');
- codePoints = arrayFrom(input);
- while (pointer <= codePoints.length) {
- char = codePoints[pointer];
- switch (state) {
- case SCHEME_START:
- if (char && ALPHA.test(char)) {
- buffer += char.toLowerCase();
- state = SCHEME;
- } else if (!stateOverride) {
- state = NO_SCHEME;
- continue;
- } else return INVALID_SCHEME;
- break;
- case SCHEME:
- if (char && (ALPHANUMERIC.test(char) || char == '+' || char == '-' || char == '.')) {
- buffer += char.toLowerCase();
- } else if (char == ':') {
- if (stateOverride && (
- (isSpecial(url) != has(specialSchemes, buffer)) ||
- (buffer == 'file' && (includesCredentials(url) || url.port !== null)) ||
- (url.scheme == 'file' && !url.host)
- )) return;
- url.scheme = buffer;
- if (stateOverride) {
- if (isSpecial(url) && specialSchemes[url.scheme] == url.port) url.port = null;
- return;
- }
- buffer = '';
- if (url.scheme == 'file') {
- state = FILE;
- } else if (isSpecial(url) && base && base.scheme == url.scheme) {
- state = SPECIAL_RELATIVE_OR_AUTHORITY;
- } else if (isSpecial(url)) {
- state = SPECIAL_AUTHORITY_SLASHES;
- } else if (codePoints[pointer + 1] == '/') {
- state = PATH_OR_AUTHORITY;
- pointer++;
- } else {
- url.cannotBeABaseURL = true;
- url.path.push('');
- state = CANNOT_BE_A_BASE_URL_PATH;
- }
- } else if (!stateOverride) {
- buffer = '';
- state = NO_SCHEME;
- pointer = 0;
- continue;
- } else return INVALID_SCHEME;
- break;
- case NO_SCHEME:
- if (!base || (base.cannotBeABaseURL && char != '#')) return INVALID_SCHEME;
- if (base.cannotBeABaseURL && char == '#') {
- url.scheme = base.scheme;
- url.path = base.path.slice();
- url.query = base.query;
- url.fragment = '';
- url.cannotBeABaseURL = true;
- state = FRAGMENT;
- break;
- }
- state = base.scheme == 'file' ? FILE : RELATIVE;
- continue;
- case SPECIAL_RELATIVE_OR_AUTHORITY:
- if (char == '/' && codePoints[pointer + 1] == '/') {
- state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
- pointer++;
- } else {
- state = RELATIVE;
- continue;
- } break;
- case PATH_OR_AUTHORITY:
- if (char == '/') {
- state = AUTHORITY;
- break;
- } else {
- state = PATH;
- continue;
- }
- case RELATIVE:
- url.scheme = base.scheme;
- if (char == EOF) {
- url.username = base.username;
- url.password = base.password;
- url.host = base.host;
- url.port = base.port;
- url.path = base.path.slice();
- url.query = base.query;
- } else if (char == '/' || (char == '\\' && isSpecial(url))) {
- state = RELATIVE_SLASH;
- } else if (char == '?') {
- url.username = base.username;
- url.password = base.password;
- url.host = base.host;
- url.port = base.port;
- url.path = base.path.slice();
- url.query = '';
- state = QUERY;
- } else if (char == '#') {
- url.username = base.username;
- url.password = base.password;
- url.host = base.host;
- url.port = base.port;
- url.path = base.path.slice();
- url.query = base.query;
- url.fragment = '';
- state = FRAGMENT;
- } else {
- url.username = base.username;
- url.password = base.password;
- url.host = base.host;
- url.port = base.port;
- url.path = base.path.slice();
- url.path.pop();
- state = PATH;
- continue;
- } break;
- case RELATIVE_SLASH:
- if (isSpecial(url) && (char == '/' || char == '\\')) {
- state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
- } else if (char == '/') {
- state = AUTHORITY;
- } else {
- url.username = base.username;
- url.password = base.password;
- url.host = base.host;
- url.port = base.port;
- state = PATH;
- continue;
- } break;
- case SPECIAL_AUTHORITY_SLASHES:
- state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
- if (char != '/' || buffer.charAt(pointer + 1) != '/') continue;
- pointer++;
- break;
- case SPECIAL_AUTHORITY_IGNORE_SLASHES:
- if (char != '/' && char != '\\') {
- state = AUTHORITY;
- continue;
- } break;
- case AUTHORITY:
- if (char == '@') {
- if (seenAt) buffer = '%40' + buffer;
- seenAt = true;
- bufferCodePoints = arrayFrom(buffer);
- for (var i = 0; i < bufferCodePoints.length; i++) {
- var codePoint = bufferCodePoints[i];
- if (codePoint == ':' && !seenPasswordToken) {
- seenPasswordToken = true;
- continue;
- }
- var encodedCodePoints = percentEncode(codePoint, userinfoPercentEncodeSet);
- if (seenPasswordToken) url.password += encodedCodePoints;
- else url.username += encodedCodePoints;
- }
- buffer = '';
- } else if (
- char == EOF || char == '/' || char == '?' || char == '#' ||
- (char == '\\' && isSpecial(url))
- ) {
- if (seenAt && buffer == '') return INVALID_AUTHORITY;
- pointer -= arrayFrom(buffer).length + 1;
- buffer = '';
- state = HOST;
- } else buffer += char;
- break;
- case HOST:
- case HOSTNAME:
- if (stateOverride && url.scheme == 'file') {
- state = FILE_HOST;
- continue;
- } else if (char == ':' && !seenBracket) {
- if (buffer == '') return INVALID_HOST;
- failure = parseHost(url, buffer);
- if (failure) return failure;
- buffer = '';
- state = PORT;
- if (stateOverride == HOSTNAME) return;
- } else if (
- char == EOF || char == '/' || char == '?' || char == '#' ||
- (char == '\\' && isSpecial(url))
- ) {
- if (isSpecial(url) && buffer == '') return INVALID_HOST;
- if (stateOverride && buffer == '' && (includesCredentials(url) || url.port !== null)) return;
- failure = parseHost(url, buffer);
- if (failure) return failure;
- buffer = '';
- state = PATH_START;
- if (stateOverride) return;
- continue;
- } else {
- if (char == '[') seenBracket = true;
- else if (char == ']') seenBracket = false;
- buffer += char;
- } break;
- case PORT:
- if (DIGIT.test(char)) {
- buffer += char;
- } else if (
- char == EOF || char == '/' || char == '?' || char == '#' ||
- (char == '\\' && isSpecial(url)) ||
- stateOverride
- ) {
- if (buffer != '') {
- var port = parseInt(buffer, 10);
- if (port > 0xFFFF) return INVALID_PORT;
- url.port = (isSpecial(url) && port === specialSchemes[url.scheme]) ? null : port;
- buffer = '';
- }
- if (stateOverride) return;
- state = PATH_START;
- continue;
- } else return INVALID_PORT;
- break;
- case FILE:
- url.scheme = 'file';
- if (char == '/' || char == '\\') state = FILE_SLASH;
- else if (base && base.scheme == 'file') {
- if (char == EOF) {
- url.host = base.host;
- url.path = base.path.slice();
- url.query = base.query;
- } else if (char == '?') {
- url.host = base.host;
- url.path = base.path.slice();
- url.query = '';
- state = QUERY;
- } else if (char == '#') {
- url.host = base.host;
- url.path = base.path.slice();
- url.query = base.query;
- url.fragment = '';
- state = FRAGMENT;
- } else {
- if (!startsWithWindowsDriveLetter(codePoints.slice(pointer).join(''))) {
- url.host = base.host;
- url.path = base.path.slice();
- shortenURLsPath(url);
- }
- state = PATH;
- continue;
- }
- } else {
- state = PATH;
- continue;
- } break;
- case FILE_SLASH:
- if (char == '/' || char == '\\') {
- state = FILE_HOST;
- break;
- }
- if (base && base.scheme == 'file' && !startsWithWindowsDriveLetter(codePoints.slice(pointer).join(''))) {
- if (isWindowsDriveLetter(base.path[0], true)) url.path.push(base.path[0]);
- else url.host = base.host;
- }
- state = PATH;
- continue;
- case FILE_HOST:
- if (char == EOF || char == '/' || char == '\\' || char == '?' || char == '#') {
- if (!stateOverride && isWindowsDriveLetter(buffer)) {
- state = PATH;
- } else if (buffer == '') {
- url.host = '';
- if (stateOverride) return;
- state = PATH_START;
- } else {
- failure = parseHost(url, buffer);
- if (failure) return failure;
- if (url.host == 'localhost') url.host = '';
- if (stateOverride) return;
- buffer = '';
- state = PATH_START;
- } continue;
- } else buffer += char;
- break;
- case PATH_START:
- if (isSpecial(url)) {
- state = PATH;
- if (char != '/' && char != '\\') continue;
- } else if (!stateOverride && char == '?') {
- url.query = '';
- state = QUERY;
- } else if (!stateOverride && char == '#') {
- url.fragment = '';
- state = FRAGMENT;
- } else if (char != EOF) {
- state = PATH;
- if (char != '/') continue;
- } break;
- case PATH:
- if (
- char == EOF || char == '/' ||
- (char == '\\' && isSpecial(url)) ||
- (!stateOverride && (char == '?' || char == '#'))
- ) {
- if (isDoubleDot(buffer)) {
- shortenURLsPath(url);
- if (char != '/' && !(char == '\\' && isSpecial(url))) {
- url.path.push('');
- }
- } else if (isSingleDot(buffer)) {
- if (char != '/' && !(char == '\\' && isSpecial(url))) {
- url.path.push('');
- }
- } else {
- if (url.scheme == 'file' && !url.path.length && isWindowsDriveLetter(buffer)) {
- if (url.host) url.host = '';
- buffer = buffer.charAt(0) + ':'; // normalize windows drive letter
- }
- url.path.push(buffer);
- }
- buffer = '';
- if (url.scheme == 'file' && (char == EOF || char == '?' || char == '#')) {
- while (url.path.length > 1 && url.path[0] === '') {
- url.path.shift();
- }
- }
- if (char == '?') {
- url.query = '';
- state = QUERY;
- } else if (char == '#') {
- url.fragment = '';
- state = FRAGMENT;
- }
- } else {
- buffer += percentEncode(char, pathPercentEncodeSet);
- } break;
- case CANNOT_BE_A_BASE_URL_PATH:
- if (char == '?') {
- url.query = '';
- state = QUERY;
- } else if (char == '#') {
- url.fragment = '';
- state = FRAGMENT;
- } else if (char != EOF) {
- url.path[0] += percentEncode(char, C0ControlPercentEncodeSet);
- } break;
- case QUERY:
- if (!stateOverride && char == '#') {
- url.fragment = '';
- state = FRAGMENT;
- } else if (char != EOF) {
- if (char == "'" && isSpecial(url)) url.query += '%27';
- else if (char == '#') url.query += '%23';
- else url.query += percentEncode(char, C0ControlPercentEncodeSet);
- } break;
- case FRAGMENT:
- if (char != EOF) url.fragment += percentEncode(char, fragmentPercentEncodeSet);
- break;
- }
- pointer++;
- }
- };
- // `URL` constructor
- // https://url.spec.whatwg.org/#url-class
- var URLConstructor = function URL(url /* , base */) {
- var that = anInstance(this, URLConstructor, 'URL');
- var base = arguments.length > 1 ? arguments[1] : undefined;
- var urlString = String(url);
- var state = setInternalState(that, { type: 'URL' });
- var baseState, failure;
- if (base !== undefined) {
- if (base instanceof URLConstructor) baseState = getInternalURLState(base);
- else {
- failure = parseURL(baseState = {}, String(base));
- if (failure) throw TypeError(failure);
- }
- }
- failure = parseURL(state, urlString, null, baseState);
- if (failure) throw TypeError(failure);
- var searchParams = state.searchParams = new URLSearchParams();
- var searchParamsState = getInternalSearchParamsState(searchParams);
- searchParamsState.updateSearchParams(state.query);
- searchParamsState.updateURL = function () {
- state.query = String(searchParams) || null;
- };
- if (!DESCRIPTORS) {
- that.href = serializeURL.call(that);
- that.origin = getOrigin.call(that);
- that.protocol = getProtocol.call(that);
- that.username = getUsername.call(that);
- that.password = getPassword.call(that);
- that.host = getHost.call(that);
- that.hostname = getHostname.call(that);
- that.port = getPort.call(that);
- that.pathname = getPathname.call(that);
- that.search = getSearch.call(that);
- that.searchParams = getSearchParams.call(that);
- that.hash = getHash.call(that);
- }
- };
- var URLPrototype = URLConstructor.prototype;
- var serializeURL = function () {
- var url = getInternalURLState(this);
- var scheme = url.scheme;
- var username = url.username;
- var password = url.password;
- var host = url.host;
- var port = url.port;
- var path = url.path;
- var query = url.query;
- var fragment = url.fragment;
- var output = scheme + ':';
- if (host !== null) {
- output += '//';
- if (includesCredentials(url)) {
- output += username + (password ? ':' + password : '') + '@';
- }
- output += serializeHost(host);
- if (port !== null) output += ':' + port;
- } else if (scheme == 'file') output += '//';
- output += url.cannotBeABaseURL ? path[0] : path.length ? '/' + path.join('/') : '';
- if (query !== null) output += '?' + query;
- if (fragment !== null) output += '#' + fragment;
- return output;
- };
- var getOrigin = function () {
- var url = getInternalURLState(this);
- var scheme = url.scheme;
- var port = url.port;
- if (scheme == 'blob') try {
- return new URL(scheme.path[0]).origin;
- } catch (error) {
- return 'null';
- }
- if (scheme == 'file' || !isSpecial(url)) return 'null';
- return scheme + '://' + serializeHost(url.host) + (port !== null ? ':' + port : '');
- };
- var getProtocol = function () {
- return getInternalURLState(this).scheme + ':';
- };
- var getUsername = function () {
- return getInternalURLState(this).username;
- };
- var getPassword = function () {
- return getInternalURLState(this).password;
- };
- var getHost = function () {
- var url = getInternalURLState(this);
- var host = url.host;
- var port = url.port;
- return host === null ? ''
- : port === null ? serializeHost(host)
- : serializeHost(host) + ':' + port;
- };
- var getHostname = function () {
- var host = getInternalURLState(this).host;
- return host === null ? '' : serializeHost(host);
- };
- var getPort = function () {
- var port = getInternalURLState(this).port;
- return port === null ? '' : String(port);
- };
- var getPathname = function () {
- var url = getInternalURLState(this);
- var path = url.path;
- return url.cannotBeABaseURL ? path[0] : path.length ? '/' + path.join('/') : '';
- };
- var getSearch = function () {
- var query = getInternalURLState(this).query;
- return query ? '?' + query : '';
- };
- var getSearchParams = function () {
- return getInternalURLState(this).searchParams;
- };
- var getHash = function () {
- var fragment = getInternalURLState(this).fragment;
- return fragment ? '#' + fragment : '';
- };
- var accessorDescriptor = function (getter, setter) {
- return { get: getter, set: setter, configurable: true, enumerable: true };
- };
- if (DESCRIPTORS) {
- defineProperties(URLPrototype, {
- // `URL.prototype.href` accessors pair
- // https://url.spec.whatwg.org/#dom-url-href
- href: accessorDescriptor(serializeURL, function (href) {
- var url = getInternalURLState(this);
- var urlString = String(href);
- var failure = parseURL(url, urlString);
- if (failure) throw TypeError(failure);
- getInternalSearchParamsState(url.searchParams).updateSearchParams(url.query);
- }),
- // `URL.prototype.origin` getter
- // https://url.spec.whatwg.org/#dom-url-origin
- origin: accessorDescriptor(getOrigin),
- // `URL.prototype.protocol` accessors pair
- // https://url.spec.whatwg.org/#dom-url-protocol
- protocol: accessorDescriptor(getProtocol, function (protocol) {
- var url = getInternalURLState(this);
- parseURL(url, String(protocol) + ':', SCHEME_START);
- }),
- // `URL.prototype.username` accessors pair
- // https://url.spec.whatwg.org/#dom-url-username
- username: accessorDescriptor(getUsername, function (username) {
- var url = getInternalURLState(this);
- var codePoints = arrayFrom(String(username));
- if (cannotHaveUsernamePasswordPort(url)) return;
- url.username = '';
- for (var i = 0; i < codePoints.length; i++) {
- url.username += percentEncode(codePoints[i], userinfoPercentEncodeSet);
- }
- }),
- // `URL.prototype.password` accessors pair
- // https://url.spec.whatwg.org/#dom-url-password
- password: accessorDescriptor(getPassword, function (password) {
- var url = getInternalURLState(this);
- var codePoints = arrayFrom(String(password));
- if (cannotHaveUsernamePasswordPort(url)) return;
- url.password = '';
- for (var i = 0; i < codePoints.length; i++) {
- url.password += percentEncode(codePoints[i], userinfoPercentEncodeSet);
- }
- }),
- // `URL.prototype.host` accessors pair
- // https://url.spec.whatwg.org/#dom-url-host
- host: accessorDescriptor(getHost, function (host) {
- var url = getInternalURLState(this);
- if (url.cannotBeABaseURL) return;
- parseURL(url, String(host), HOST);
- }),
- // `URL.prototype.hostname` accessors pair
- // https://url.spec.whatwg.org/#dom-url-hostname
- hostname: accessorDescriptor(getHostname, function (hostname) {
- var url = getInternalURLState(this);
- if (url.cannotBeABaseURL) return;
- parseURL(url, String(hostname), HOSTNAME);
- }),
- // `URL.prototype.port` accessors pair
- // https://url.spec.whatwg.org/#dom-url-port
- port: accessorDescriptor(getPort, function (port) {
- var url = getInternalURLState(this);
- if (cannotHaveUsernamePasswordPort(url)) return;
- port = String(port);
- if (port == '') url.port = null;
- else parseURL(url, port, PORT);
- }),
- // `URL.prototype.pathname` accessors pair
- // https://url.spec.whatwg.org/#dom-url-pathname
- pathname: accessorDescriptor(getPathname, function (pathname) {
- var url = getInternalURLState(this);
- if (url.cannotBeABaseURL) return;
- url.path = [];
- parseURL(url, pathname + '', PATH_START);
- }),
- // `URL.prototype.search` accessors pair
- // https://url.spec.whatwg.org/#dom-url-search
- search: accessorDescriptor(getSearch, function (search) {
- var url = getInternalURLState(this);
- search = String(search);
- if (search == '') {
- url.query = null;
- } else {
- if ('?' == search.charAt(0)) search = search.slice(1);
- url.query = '';
- parseURL(url, search, QUERY);
- }
- getInternalSearchParamsState(url.searchParams).updateSearchParams(url.query);
- }),
- // `URL.prototype.searchParams` getter
- // https://url.spec.whatwg.org/#dom-url-searchparams
- searchParams: accessorDescriptor(getSearchParams),
- // `URL.prototype.hash` accessors pair
- // https://url.spec.whatwg.org/#dom-url-hash
- hash: accessorDescriptor(getHash, function (hash) {
- var url = getInternalURLState(this);
- hash = String(hash);
- if (hash == '') {
- url.fragment = null;
- return;
- }
- if ('#' == hash.charAt(0)) hash = hash.slice(1);
- url.fragment = '';
- parseURL(url, hash, FRAGMENT);
- })
- });
- }
- // `URL.prototype.toJSON` method
- // https://url.spec.whatwg.org/#dom-url-tojson
- redefine(URLPrototype, 'toJSON', function toJSON() {
- return serializeURL.call(this);
- }, { enumerable: true });
- // `URL.prototype.toString` method
- // https://url.spec.whatwg.org/#URL-stringification-behavior
- redefine(URLPrototype, 'toString', function toString() {
- return serializeURL.call(this);
- }, { enumerable: true });
- if (NativeURL) {
- var nativeCreateObjectURL = NativeURL.createObjectURL;
- var nativeRevokeObjectURL = NativeURL.revokeObjectURL;
- // `URL.createObjectURL` method
- // https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL
- // eslint-disable-next-line no-unused-vars
- if (nativeCreateObjectURL) redefine(URLConstructor, 'createObjectURL', function createObjectURL(blob) {
- return nativeCreateObjectURL.apply(NativeURL, arguments);
- });
- // `URL.revokeObjectURL` method
- // https://developer.mozilla.org/en-US/docs/Web/API/URL/revokeObjectURL
- // eslint-disable-next-line no-unused-vars
- if (nativeRevokeObjectURL) redefine(URLConstructor, 'revokeObjectURL', function revokeObjectURL(url) {
- return nativeRevokeObjectURL.apply(NativeURL, arguments);
- });
- }
- setToStringTag(URLConstructor, 'URL');
- $({ global: true, forced: !USE_NATIVE_URL, sham: !DESCRIPTORS }, {
- URL: URLConstructor
- });
- /***/ }),
- /***/ "2d00":
- /***/ (function(module, exports, __webpack_require__) {
- var global = __webpack_require__("da84");
- var userAgent = __webpack_require__("342f");
- var process = global.process;
- var versions = process && process.versions;
- var v8 = versions && versions.v8;
- var match, version;
- if (v8) {
- match = v8.split('.');
- version = match[0] + match[1];
- } else if (userAgent) {
- match = userAgent.match(/Edge\/(\d+)/);
- if (!match || match[1] >= 74) {
- match = userAgent.match(/Chrome\/(\d+)/);
- if (match) version = match[1];
- }
- }
- module.exports = version && +version;
- /***/ }),
- /***/ "342f":
- /***/ (function(module, exports, __webpack_require__) {
- var getBuiltIn = __webpack_require__("d066");
- module.exports = getBuiltIn('navigator', 'userAgent') || '';
- /***/ }),
- /***/ "35a1":
- /***/ (function(module, exports, __webpack_require__) {
- var classof = __webpack_require__("f5df");
- var Iterators = __webpack_require__("3f8c");
- var wellKnownSymbol = __webpack_require__("b622");
- var ITERATOR = wellKnownSymbol('iterator');
- module.exports = function (it) {
- if (it != undefined) return it[ITERATOR]
- || it['@@iterator']
- || Iterators[classof(it)];
- };
- /***/ }),
- /***/ "37e8":
- /***/ (function(module, exports, __webpack_require__) {
- var DESCRIPTORS = __webpack_require__("83ab");
- var definePropertyModule = __webpack_require__("9bf2");
- var anObject = __webpack_require__("825a");
- var objectKeys = __webpack_require__("df75");
- // `Object.defineProperties` method
- // https://tc39.github.io/ecma262/#sec-object.defineproperties
- module.exports = DESCRIPTORS ? Object.defineProperties : function defineProperties(O, Properties) {
- anObject(O);
- var keys = objectKeys(Properties);
- var length = keys.length;
- var index = 0;
- var key;
- while (length > index) definePropertyModule.f(O, key = keys[index++], Properties[key]);
- return O;
- };
- /***/ }),
- /***/ "3bbe":
- /***/ (function(module, exports, __webpack_require__) {
- var isObject = __webpack_require__("861d");
- module.exports = function (it) {
- if (!isObject(it) && it !== null) {
- throw TypeError("Can't set " + String(it) + ' as a prototype');
- } return it;
- };
- /***/ }),
- /***/ "3ca3":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var charAt = __webpack_require__("6547").charAt;
- var InternalStateModule = __webpack_require__("69f3");
- var defineIterator = __webpack_require__("7dd0");
- var STRING_ITERATOR = 'String Iterator';
- var setInternalState = InternalStateModule.set;
- var getInternalState = InternalStateModule.getterFor(STRING_ITERATOR);
- // `String.prototype[@@iterator]` method
- // https://tc39.github.io/ecma262/#sec-string.prototype-@@iterator
- defineIterator(String, 'String', function (iterated) {
- setInternalState(this, {
- type: STRING_ITERATOR,
- string: String(iterated),
- index: 0
- });
- // `%StringIteratorPrototype%.next` method
- // https://tc39.github.io/ecma262/#sec-%stringiteratorprototype%.next
- }, function next() {
- var state = getInternalState(this);
- var string = state.string;
- var index = state.index;
- var point;
- if (index >= string.length) return { value: undefined, done: true };
- point = charAt(string, index);
- state.index += point.length;
- return { value: point, done: false };
- });
- /***/ }),
- /***/ "3f8c":
- /***/ (function(module, exports) {
- module.exports = {};
- /***/ }),
- /***/ "408a":
- /***/ (function(module, exports, __webpack_require__) {
- var classof = __webpack_require__("c6b6");
- // `thisNumberValue` abstract operation
- // https://tc39.github.io/ecma262/#sec-thisnumbervalue
- module.exports = function (value) {
- if (typeof value != 'number' && classof(value) != 'Number') {
- throw TypeError('Incorrect invocation');
- }
- return +value;
- };
- /***/ }),
- /***/ "4160":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var $ = __webpack_require__("23e7");
- var forEach = __webpack_require__("17c2");
- // `Array.prototype.forEach` method
- // https://tc39.github.io/ecma262/#sec-array.prototype.foreach
- $({ target: 'Array', proto: true, forced: [].forEach != forEach }, {
- forEach: forEach
- });
- /***/ }),
- /***/ "428f":
- /***/ (function(module, exports, __webpack_require__) {
- var global = __webpack_require__("da84");
- module.exports = global;
- /***/ }),
- /***/ "44ad":
- /***/ (function(module, exports, __webpack_require__) {
- var fails = __webpack_require__("d039");
- var classof = __webpack_require__("c6b6");
- var split = ''.split;
- // fallback for non-array-like ES3 and non-enumerable old V8 strings
- module.exports = fails(function () {
- // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
- // eslint-disable-next-line no-prototype-builtins
- return !Object('z').propertyIsEnumerable(0);
- }) ? function (it) {
- return classof(it) == 'String' ? split.call(it, '') : Object(it);
- } : Object;
- /***/ }),
- /***/ "44d2":
- /***/ (function(module, exports, __webpack_require__) {
- var wellKnownSymbol = __webpack_require__("b622");
- var create = __webpack_require__("7c73");
- var definePropertyModule = __webpack_require__("9bf2");
- var UNSCOPABLES = wellKnownSymbol('unscopables');
- var ArrayPrototype = Array.prototype;
- // Array.prototype[@@unscopables]
- // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
- if (ArrayPrototype[UNSCOPABLES] == undefined) {
- definePropertyModule.f(ArrayPrototype, UNSCOPABLES, {
- configurable: true,
- value: create(null)
- });
- }
- // add a key to Array.prototype[@@unscopables]
- module.exports = function (key) {
- ArrayPrototype[UNSCOPABLES][key] = true;
- };
- /***/ }),
- /***/ "44e7":
- /***/ (function(module, exports, __webpack_require__) {
- var isObject = __webpack_require__("861d");
- var classof = __webpack_require__("c6b6");
- var wellKnownSymbol = __webpack_require__("b622");
- var MATCH = wellKnownSymbol('match');
- // `IsRegExp` abstract operation
- // https://tc39.github.io/ecma262/#sec-isregexp
- module.exports = function (it) {
- var isRegExp;
- return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classof(it) == 'RegExp');
- };
- /***/ }),
- /***/ "45fc":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var $ = __webpack_require__("23e7");
- var $some = __webpack_require__("b727").some;
- var arrayMethodIsStrict = __webpack_require__("a640");
- var arrayMethodUsesToLength = __webpack_require__("ae40");
- var STRICT_METHOD = arrayMethodIsStrict('some');
- var USES_TO_LENGTH = arrayMethodUsesToLength('some');
- // `Array.prototype.some` method
- // https://tc39.github.io/ecma262/#sec-array.prototype.some
- $({ target: 'Array', proto: true, forced: !STRICT_METHOD || !USES_TO_LENGTH }, {
- some: function some(callbackfn /* , thisArg */) {
- return $some(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
- }
- });
- /***/ }),
- /***/ "466d":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var fixRegExpWellKnownSymbolLogic = __webpack_require__("d784");
- var anObject = __webpack_require__("825a");
- var toLength = __webpack_require__("50c4");
- var requireObjectCoercible = __webpack_require__("1d80");
- var advanceStringIndex = __webpack_require__("8aa5");
- var regExpExec = __webpack_require__("14c3");
- // @@match logic
- fixRegExpWellKnownSymbolLogic('match', 1, function (MATCH, nativeMatch, maybeCallNative) {
- return [
- // `String.prototype.match` method
- // https://tc39.github.io/ecma262/#sec-string.prototype.match
- function match(regexp) {
- var O = requireObjectCoercible(this);
- var matcher = regexp == undefined ? undefined : regexp[MATCH];
- return matcher !== undefined ? matcher.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));
- },
- // `RegExp.prototype[@@match]` method
- // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@match
- function (regexp) {
- var res = maybeCallNative(nativeMatch, regexp, this);
- if (res.done) return res.value;
- var rx = anObject(regexp);
- var S = String(this);
- if (!rx.global) return regExpExec(rx, S);
- var fullUnicode = rx.unicode;
- rx.lastIndex = 0;
- var A = [];
- var n = 0;
- var result;
- while ((result = regExpExec(rx, S)) !== null) {
- var matchStr = String(result[0]);
- A[n] = matchStr;
- if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
- n++;
- }
- return n === 0 ? null : A;
- }
- ];
- });
- /***/ }),
- /***/ "4840":
- /***/ (function(module, exports, __webpack_require__) {
- var anObject = __webpack_require__("825a");
- var aFunction = __webpack_require__("1c0b");
- var wellKnownSymbol = __webpack_require__("b622");
- var SPECIES = wellKnownSymbol('species');
- // `SpeciesConstructor` abstract operation
- // https://tc39.github.io/ecma262/#sec-speciesconstructor
- module.exports = function (O, defaultConstructor) {
- var C = anObject(O).constructor;
- var S;
- return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? defaultConstructor : aFunction(S);
- };
- /***/ }),
- /***/ "4930":
- /***/ (function(module, exports, __webpack_require__) {
- var fails = __webpack_require__("d039");
- module.exports = !!Object.getOwnPropertySymbols && !fails(function () {
- // Chrome 38 Symbol has incorrect toString conversion
- // eslint-disable-next-line no-undef
- return !String(Symbol());
- });
- /***/ }),
- /***/ "498a":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var $ = __webpack_require__("23e7");
- var $trim = __webpack_require__("58a8").trim;
- var forcedStringTrimMethod = __webpack_require__("c8d2");
- // `String.prototype.trim` method
- // https://tc39.github.io/ecma262/#sec-string.prototype.trim
- $({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
- trim: function trim() {
- return $trim(this);
- }
- });
- /***/ }),
- /***/ "4d63":
- /***/ (function(module, exports, __webpack_require__) {
- var DESCRIPTORS = __webpack_require__("83ab");
- var global = __webpack_require__("da84");
- var isForced = __webpack_require__("94ca");
- var inheritIfRequired = __webpack_require__("7156");
- var defineProperty = __webpack_require__("9bf2").f;
- var getOwnPropertyNames = __webpack_require__("241c").f;
- var isRegExp = __webpack_require__("44e7");
- var getFlags = __webpack_require__("ad6d");
- var stickyHelpers = __webpack_require__("9f7f");
- var redefine = __webpack_require__("6eeb");
- var fails = __webpack_require__("d039");
- var setInternalState = __webpack_require__("69f3").set;
- var setSpecies = __webpack_require__("2626");
- var wellKnownSymbol = __webpack_require__("b622");
- var MATCH = wellKnownSymbol('match');
- var NativeRegExp = global.RegExp;
- var RegExpPrototype = NativeRegExp.prototype;
- var re1 = /a/g;
- var re2 = /a/g;
- // "new" should create a new object, old webkit bug
- var CORRECT_NEW = new NativeRegExp(re1) !== re1;
- var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y;
- var FORCED = DESCRIPTORS && isForced('RegExp', (!CORRECT_NEW || UNSUPPORTED_Y || fails(function () {
- re2[MATCH] = false;
- // RegExp constructor can alter flags and IsRegExp works correct with @@match
- return NativeRegExp(re1) != re1 || NativeRegExp(re2) == re2 || NativeRegExp(re1, 'i') != '/a/i';
- })));
- // `RegExp` constructor
- // https://tc39.github.io/ecma262/#sec-regexp-constructor
- if (FORCED) {
- var RegExpWrapper = function RegExp(pattern, flags) {
- var thisIsRegExp = this instanceof RegExpWrapper;
- var patternIsRegExp = isRegExp(pattern);
- var flagsAreUndefined = flags === undefined;
- var sticky;
- if (!thisIsRegExp && patternIsRegExp && pattern.constructor === RegExpWrapper && flagsAreUndefined) {
- return pattern;
- }
- if (CORRECT_NEW) {
- if (patternIsRegExp && !flagsAreUndefined) pattern = pattern.source;
- } else if (pattern instanceof RegExpWrapper) {
- if (flagsAreUndefined) flags = getFlags.call(pattern);
- pattern = pattern.source;
- }
- if (UNSUPPORTED_Y) {
- sticky = !!flags && flags.indexOf('y') > -1;
- if (sticky) flags = flags.replace(/y/g, '');
- }
- var result = inheritIfRequired(
- CORRECT_NEW ? new NativeRegExp(pattern, flags) : NativeRegExp(pattern, flags),
- thisIsRegExp ? this : RegExpPrototype,
- RegExpWrapper
- );
- if (UNSUPPORTED_Y && sticky) setInternalState(result, { sticky: sticky });
- return result;
- };
- var proxy = function (key) {
- key in RegExpWrapper || defineProperty(RegExpWrapper, key, {
- configurable: true,
- get: function () { return NativeRegExp[key]; },
- set: function (it) { NativeRegExp[key] = it; }
- });
- };
- var keys = getOwnPropertyNames(NativeRegExp);
- var index = 0;
- while (keys.length > index) proxy(keys[index++]);
- RegExpPrototype.constructor = RegExpWrapper;
- RegExpWrapper.prototype = RegExpPrototype;
- redefine(global, 'RegExp', RegExpWrapper);
- }
- // https://tc39.github.io/ecma262/#sec-get-regexp-@@species
- setSpecies('RegExp');
- /***/ }),
- /***/ "4d64":
- /***/ (function(module, exports, __webpack_require__) {
- var toIndexedObject = __webpack_require__("fc6a");
- var toLength = __webpack_require__("50c4");
- var toAbsoluteIndex = __webpack_require__("23cb");
- // `Array.prototype.{ indexOf, includes }` methods implementation
- var createMethod = function (IS_INCLUDES) {
- return function ($this, el, fromIndex) {
- var O = toIndexedObject($this);
- var length = toLength(O.length);
- var index = toAbsoluteIndex(fromIndex, length);
- var value;
- // Array#includes uses SameValueZero equality algorithm
- // eslint-disable-next-line no-self-compare
- if (IS_INCLUDES && el != el) while (length > index) {
- value = O[index++];
- // eslint-disable-next-line no-self-compare
- if (value != value) return true;
- // Array#indexOf ignores holes, Array#includes - not
- } else for (;length > index; index++) {
- if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
- } return !IS_INCLUDES && -1;
- };
- };
- module.exports = {
- // `Array.prototype.includes` method
- // https://tc39.github.io/ecma262/#sec-array.prototype.includes
- includes: createMethod(true),
- // `Array.prototype.indexOf` method
- // https://tc39.github.io/ecma262/#sec-array.prototype.indexof
- indexOf: createMethod(false)
- };
- /***/ }),
- /***/ "4d90":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var $ = __webpack_require__("23e7");
- var $padStart = __webpack_require__("0ccb").start;
- var WEBKIT_BUG = __webpack_require__("9a0c");
- // `String.prototype.padStart` method
- // https://tc39.github.io/ecma262/#sec-string.prototype.padstart
- $({ target: 'String', proto: true, forced: WEBKIT_BUG }, {
- padStart: function padStart(maxLength /* , fillString = ' ' */) {
- return $padStart(this, maxLength, arguments.length > 1 ? arguments[1] : undefined);
- }
- });
- /***/ }),
- /***/ "4de4":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var $ = __webpack_require__("23e7");
- var $filter = __webpack_require__("b727").filter;
- var arrayMethodHasSpeciesSupport = __webpack_require__("1dde");
- var arrayMethodUsesToLength = __webpack_require__("ae40");
- var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');
- // Edge 14- issue
- var USES_TO_LENGTH = arrayMethodUsesToLength('filter');
- // `Array.prototype.filter` method
- // https://tc39.github.io/ecma262/#sec-array.prototype.filter
- // with adding support of @@species
- $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {
- filter: function filter(callbackfn /* , thisArg */) {
- return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
- }
- });
- /***/ }),
- /***/ "4df4":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var bind = __webpack_require__("0366");
- var toObject = __webpack_require__("7b0b");
- var callWithSafeIterationClosing = __webpack_require__("9bdd");
- var isArrayIteratorMethod = __webpack_require__("e95a");
- var toLength = __webpack_require__("50c4");
- var createProperty = __webpack_require__("8418");
- var getIteratorMethod = __webpack_require__("35a1");
- // `Array.from` method implementation
- // https://tc39.github.io/ecma262/#sec-array.from
- module.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
- var O = toObject(arrayLike);
- var C = typeof this == 'function' ? this : Array;
- var argumentsLength = arguments.length;
- var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
- var mapping = mapfn !== undefined;
- var iteratorMethod = getIteratorMethod(O);
- var index = 0;
- var length, result, step, iterator, next, value;
- if (mapping) mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : undefined, 2);
- // if the target is not iterable or it's an array with the default iterator - use a simple case
- if (iteratorMethod != undefined && !(C == Array && isArrayIteratorMethod(iteratorMethod))) {
- iterator = iteratorMethod.call(O);
- next = iterator.next;
- result = new C();
- for (;!(step = next.call(iterator)).done; index++) {
- value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value;
- createProperty(result, index, value);
- }
- } else {
- length = toLength(O.length);
- result = new C(length);
- for (;length > index; index++) {
- value = mapping ? mapfn(O[index], index) : O[index];
- createProperty(result, index, value);
- }
- }
- result.length = index;
- return result;
- };
- /***/ }),
- /***/ "4ec9":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var collection = __webpack_require__("6d61");
- var collectionStrong = __webpack_require__("6566");
- // `Map` constructor
- // https://tc39.github.io/ecma262/#sec-map-objects
- module.exports = collection('Map', function (init) {
- return function Map() { return init(this, arguments.length ? arguments[0] : undefined); };
- }, collectionStrong);
- /***/ }),
- /***/ "50c4":
- /***/ (function(module, exports, __webpack_require__) {
- var toInteger = __webpack_require__("a691");
- var min = Math.min;
- // `ToLength` abstract operation
- // https://tc39.github.io/ecma262/#sec-tolength
- module.exports = function (argument) {
- return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
- };
- /***/ }),
- /***/ "5135":
- /***/ (function(module, exports) {
- var hasOwnProperty = {}.hasOwnProperty;
- module.exports = function (it, key) {
- return hasOwnProperty.call(it, key);
- };
- /***/ }),
- /***/ "5319":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var fixRegExpWellKnownSymbolLogic = __webpack_require__("d784");
- var anObject = __webpack_require__("825a");
- var toObject = __webpack_require__("7b0b");
- var toLength = __webpack_require__("50c4");
- var toInteger = __webpack_require__("a691");
- var requireObjectCoercible = __webpack_require__("1d80");
- var advanceStringIndex = __webpack_require__("8aa5");
- var regExpExec = __webpack_require__("14c3");
- var max = Math.max;
- var min = Math.min;
- var floor = Math.floor;
- var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d\d?|<[^>]*>)/g;
- var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d\d?)/g;
- var maybeToString = function (it) {
- return it === undefined ? it : String(it);
- };
- // @@replace logic
- fixRegExpWellKnownSymbolLogic('replace', 2, function (REPLACE, nativeReplace, maybeCallNative, reason) {
- var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = reason.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE;
- var REPLACE_KEEPS_$0 = reason.REPLACE_KEEPS_$0;
- var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0';
- return [
- // `String.prototype.replace` method
- // https://tc39.github.io/ecma262/#sec-string.prototype.replace
- function replace(searchValue, replaceValue) {
- var O = requireObjectCoercible(this);
- var replacer = searchValue == undefined ? undefined : searchValue[REPLACE];
- return replacer !== undefined
- ? replacer.call(searchValue, O, replaceValue)
- : nativeReplace.call(String(O), searchValue, replaceValue);
- },
- // `RegExp.prototype[@@replace]` method
- // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace
- function (regexp, replaceValue) {
- if (
- (!REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE && REPLACE_KEEPS_$0) ||
- (typeof replaceValue === 'string' && replaceValue.indexOf(UNSAFE_SUBSTITUTE) === -1)
- ) {
- var res = maybeCallNative(nativeReplace, regexp, this, replaceValue);
- if (res.done) return res.value;
- }
- var rx = anObject(regexp);
- var S = String(this);
- var functionalReplace = typeof replaceValue === 'function';
- if (!functionalReplace) replaceValue = String(replaceValue);
- var global = rx.global;
- if (global) {
- var fullUnicode = rx.unicode;
- rx.lastIndex = 0;
- }
- var results = [];
- while (true) {
- var result = regExpExec(rx, S);
- if (result === null) break;
- results.push(result);
- if (!global) break;
- var matchStr = String(result[0]);
- if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
- }
- var accumulatedResult = '';
- var nextSourcePosition = 0;
- for (var i = 0; i < results.length; i++) {
- result = results[i];
- var matched = String(result[0]);
- var position = max(min(toInteger(result.index), S.length), 0);
- var captures = [];
- // NOTE: This is equivalent to
- // captures = result.slice(1).map(maybeToString)
- // but for some reason `nativeSlice.call(result, 1, result.length)` (called in
- // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
- // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
- for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j]));
- var namedCaptures = result.groups;
- if (functionalReplace) {
- var replacerArgs = [matched].concat(captures, position, S);
- if (namedCaptures !== undefined) replacerArgs.push(namedCaptures);
- var replacement = String(replaceValue.apply(undefined, replacerArgs));
- } else {
- replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
- }
- if (position >= nextSourcePosition) {
- accumulatedResult += S.slice(nextSourcePosition, position) + replacement;
- nextSourcePosition = position + matched.length;
- }
- }
- return accumulatedResult + S.slice(nextSourcePosition);
- }
- ];
- // https://tc39.github.io/ecma262/#sec-getsubstitution
- function getSubstitution(matched, str, position, captures, namedCaptures, replacement) {
- var tailPos = position + matched.length;
- var m = captures.length;
- var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
- if (namedCaptures !== undefined) {
- namedCaptures = toObject(namedCaptures);
- symbols = SUBSTITUTION_SYMBOLS;
- }
- return nativeReplace.call(replacement, symbols, function (match, ch) {
- var capture;
- switch (ch.charAt(0)) {
- case '$': return '$';
- case '&': return matched;
- case '`': return str.slice(0, position);
- case "'": return str.slice(tailPos);
- case '<':
- capture = namedCaptures[ch.slice(1, -1)];
- break;
- default: // \d\d?
- var n = +ch;
- if (n === 0) return match;
- if (n > m) {
- var f = floor(n / 10);
- if (f === 0) return match;
- if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);
- return match;
- }
- capture = captures[n - 1];
- }
- return capture === undefined ? '' : capture;
- });
- }
- });
- /***/ }),
- /***/ "5692":
- /***/ (function(module, exports, __webpack_require__) {
- var IS_PURE = __webpack_require__("c430");
- var store = __webpack_require__("c6cd");
- (module.exports = function (key, value) {
- return store[key] || (store[key] = value !== undefined ? value : {});
- })('versions', []).push({
- version: '3.8.1',
- mode: IS_PURE ? 'pure' : 'global',
- copyright: '© 2020 Denis Pushkarev (zloirock.ru)'
- });
- /***/ }),
- /***/ "56ef":
- /***/ (function(module, exports, __webpack_require__) {
- var getBuiltIn = __webpack_require__("d066");
- var getOwnPropertyNamesModule = __webpack_require__("241c");
- var getOwnPropertySymbolsModule = __webpack_require__("7418");
- var anObject = __webpack_require__("825a");
- // all object keys, includes non-enumerable and symbols
- module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
- var keys = getOwnPropertyNamesModule.f(anObject(it));
- var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
- return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
- };
- /***/ }),
- /***/ "5899":
- /***/ (function(module, exports) {
- // a string of all valid unicode whitespaces
- // eslint-disable-next-line max-len
- module.exports = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
- /***/ }),
- /***/ "58a8":
- /***/ (function(module, exports, __webpack_require__) {
- var requireObjectCoercible = __webpack_require__("1d80");
- var whitespaces = __webpack_require__("5899");
- var whitespace = '[' + whitespaces + ']';
- var ltrim = RegExp('^' + whitespace + whitespace + '*');
- var rtrim = RegExp(whitespace + whitespace + '*$');
- // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
- var createMethod = function (TYPE) {
- return function ($this) {
- var string = String(requireObjectCoercible($this));
- if (TYPE & 1) string = string.replace(ltrim, '');
- if (TYPE & 2) string = string.replace(rtrim, '');
- return string;
- };
- };
- module.exports = {
- // `String.prototype.{ trimLeft, trimStart }` methods
- // https://tc39.github.io/ecma262/#sec-string.prototype.trimstart
- start: createMethod(1),
- // `String.prototype.{ trimRight, trimEnd }` methods
- // https://tc39.github.io/ecma262/#sec-string.prototype.trimend
- end: createMethod(2),
- // `String.prototype.trim` method
- // https://tc39.github.io/ecma262/#sec-string.prototype.trim
- trim: createMethod(3)
- };
- /***/ }),
- /***/ "5a34":
- /***/ (function(module, exports, __webpack_require__) {
- var isRegExp = __webpack_require__("44e7");
- module.exports = function (it) {
- if (isRegExp(it)) {
- throw TypeError("The method doesn't accept regular expressions");
- } return it;
- };
- /***/ }),
- /***/ "5c6c":
- /***/ (function(module, exports) {
- module.exports = function (bitmap, value) {
- return {
- enumerable: !(bitmap & 1),
- configurable: !(bitmap & 2),
- writable: !(bitmap & 4),
- value: value
- };
- };
- /***/ }),
- /***/ "5fb2":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- // based on https://github.com/bestiejs/punycode.js/blob/master/punycode.js
- var maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1
- var base = 36;
- var tMin = 1;
- var tMax = 26;
- var skew = 38;
- var damp = 700;
- var initialBias = 72;
- var initialN = 128; // 0x80
- var delimiter = '-'; // '\x2D'
- var regexNonASCII = /[^\0-\u007E]/; // non-ASCII chars
- var regexSeparators = /[.\u3002\uFF0E\uFF61]/g; // RFC 3490 separators
- var OVERFLOW_ERROR = 'Overflow: input needs wider integers to process';
- var baseMinusTMin = base - tMin;
- var floor = Math.floor;
- var stringFromCharCode = String.fromCharCode;
- /**
- * Creates an array containing the numeric code points of each Unicode
- * character in the string. While JavaScript uses UCS-2 internally,
- * this function will convert a pair of surrogate halves (each of which
- * UCS-2 exposes as separate characters) into a single code point,
- * matching UTF-16.
- */
- var ucs2decode = function (string) {
- var output = [];
- var counter = 0;
- var length = string.length;
- while (counter < length) {
- var value = string.charCodeAt(counter++);
- if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
- // It's a high surrogate, and there is a next character.
- var extra = string.charCodeAt(counter++);
- if ((extra & 0xFC00) == 0xDC00) { // Low surrogate.
- output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
- } else {
- // It's an unmatched surrogate; only append this code unit, in case the
- // next code unit is the high surrogate of a surrogate pair.
- output.push(value);
- counter--;
- }
- } else {
- output.push(value);
- }
- }
- return output;
- };
- /**
- * Converts a digit/integer into a basic code point.
- */
- var digitToBasic = function (digit) {
- // 0..25 map to ASCII a..z or A..Z
- // 26..35 map to ASCII 0..9
- return digit + 22 + 75 * (digit < 26);
- };
- /**
- * Bias adaptation function as per section 3.4 of RFC 3492.
- * https://tools.ietf.org/html/rfc3492#section-3.4
- */
- var adapt = function (delta, numPoints, firstTime) {
- var k = 0;
- delta = firstTime ? floor(delta / damp) : delta >> 1;
- delta += floor(delta / numPoints);
- for (; delta > baseMinusTMin * tMax >> 1; k += base) {
- delta = floor(delta / baseMinusTMin);
- }
- return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
- };
- /**
- * Converts a string of Unicode symbols (e.g. a domain name label) to a
- * Punycode string of ASCII-only symbols.
- */
- // eslint-disable-next-line max-statements
- var encode = function (input) {
- var output = [];
- // Convert the input in UCS-2 to an array of Unicode code points.
- input = ucs2decode(input);
- // Cache the length.
- var inputLength = input.length;
- // Initialize the state.
- var n = initialN;
- var delta = 0;
- var bias = initialBias;
- var i, currentValue;
- // Handle the basic code points.
- for (i = 0; i < input.length; i++) {
- currentValue = input[i];
- if (currentValue < 0x80) {
- output.push(stringFromCharCode(currentValue));
- }
- }
- var basicLength = output.length; // number of basic code points.
- var handledCPCount = basicLength; // number of code points that have been handled;
- // Finish the basic string with a delimiter unless it's empty.
- if (basicLength) {
- output.push(delimiter);
- }
- // Main encoding loop:
- while (handledCPCount < inputLength) {
- // All non-basic code points < n have been handled already. Find the next larger one:
- var m = maxInt;
- for (i = 0; i < input.length; i++) {
- currentValue = input[i];
- if (currentValue >= n && currentValue < m) {
- m = currentValue;
- }
- }
- // Increase `delta` enough to advance the decoder's <n,i> state to <m,0>, but guard against overflow.
- var handledCPCountPlusOne = handledCPCount + 1;
- if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
- throw RangeError(OVERFLOW_ERROR);
- }
- delta += (m - n) * handledCPCountPlusOne;
- n = m;
- for (i = 0; i < input.length; i++) {
- currentValue = input[i];
- if (currentValue < n && ++delta > maxInt) {
- throw RangeError(OVERFLOW_ERROR);
- }
- if (currentValue == n) {
- // Represent delta as a generalized variable-length integer.
- var q = delta;
- for (var k = base; /* no condition */; k += base) {
- var t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
- if (q < t) break;
- var qMinusT = q - t;
- var baseMinusT = base - t;
- output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT)));
- q = floor(qMinusT / baseMinusT);
- }
- output.push(stringFromCharCode(digitToBasic(q)));
- bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);
- delta = 0;
- ++handledCPCount;
- }
- }
- ++delta;
- ++n;
- }
- return output.join('');
- };
- module.exports = function (input) {
- var encoded = [];
- var labels = input.toLowerCase().replace(regexSeparators, '\u002E').split('.');
- var i, label;
- for (i = 0; i < labels.length; i++) {
- label = labels[i];
- encoded.push(regexNonASCII.test(label) ? 'xn--' + encode(label) : label);
- }
- return encoded.join('.');
- };
- /***/ }),
- /***/ "605d":
- /***/ (function(module, exports, __webpack_require__) {
- var classof = __webpack_require__("c6b6");
- var global = __webpack_require__("da84");
- module.exports = classof(global.process) == 'process';
- /***/ }),
- /***/ "60da":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var DESCRIPTORS = __webpack_require__("83ab");
- var fails = __webpack_require__("d039");
- var objectKeys = __webpack_require__("df75");
- var getOwnPropertySymbolsModule = __webpack_require__("7418");
- var propertyIsEnumerableModule = __webpack_require__("d1e7");
- var toObject = __webpack_require__("7b0b");
- var IndexedObject = __webpack_require__("44ad");
- var nativeAssign = Object.assign;
- var defineProperty = Object.defineProperty;
- // `Object.assign` method
- // https://tc39.github.io/ecma262/#sec-object.assign
- module.exports = !nativeAssign || fails(function () {
- // should have correct order of operations (Edge bug)
- if (DESCRIPTORS && nativeAssign({ b: 1 }, nativeAssign(defineProperty({}, 'a', {
- enumerable: true,
- get: function () {
- defineProperty(this, 'b', {
- value: 3,
- enumerable: false
- });
- }
- }), { b: 2 })).b !== 1) return true;
- // should work with symbols and should have deterministic property order (V8 bug)
- var A = {};
- var B = {};
- // eslint-disable-next-line no-undef
- var symbol = Symbol();
- var alphabet = 'abcdefghijklmnopqrst';
- A[symbol] = 7;
- alphabet.split('').forEach(function (chr) { B[chr] = chr; });
- return nativeAssign({}, A)[symbol] != 7 || objectKeys(nativeAssign({}, B)).join('') != alphabet;
- }) ? function assign(target, source) { // eslint-disable-line no-unused-vars
- var T = toObject(target);
- var argumentsLength = arguments.length;
- var index = 1;
- var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
- var propertyIsEnumerable = propertyIsEnumerableModule.f;
- while (argumentsLength > index) {
- var S = IndexedObject(arguments[index++]);
- var keys = getOwnPropertySymbols ? objectKeys(S).concat(getOwnPropertySymbols(S)) : objectKeys(S);
- var length = keys.length;
- var j = 0;
- var key;
- while (length > j) {
- key = keys[j++];
- if (!DESCRIPTORS || propertyIsEnumerable.call(S, key)) T[key] = S[key];
- }
- } return T;
- } : nativeAssign;
- /***/ }),
- /***/ "6547":
- /***/ (function(module, exports, __webpack_require__) {
- var toInteger = __webpack_require__("a691");
- var requireObjectCoercible = __webpack_require__("1d80");
- // `String.prototype.{ codePointAt, at }` methods implementation
- var createMethod = function (CONVERT_TO_STRING) {
- return function ($this, pos) {
- var S = String(requireObjectCoercible($this));
- var position = toInteger(pos);
- var size = S.length;
- var first, second;
- if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
- first = S.charCodeAt(position);
- return first < 0xD800 || first > 0xDBFF || position + 1 === size
- || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF
- ? CONVERT_TO_STRING ? S.charAt(position) : first
- : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
- };
- };
- module.exports = {
- // `String.prototype.codePointAt` method
- // https://tc39.github.io/ecma262/#sec-string.prototype.codepointat
- codeAt: createMethod(false),
- // `String.prototype.at` method
- // https://github.com/mathiasbynens/String.prototype.at
- charAt: createMethod(true)
- };
- /***/ }),
- /***/ "6566":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var defineProperty = __webpack_require__("9bf2").f;
- var create = __webpack_require__("7c73");
- var redefineAll = __webpack_require__("e2cc");
- var bind = __webpack_require__("0366");
- var anInstance = __webpack_require__("19aa");
- var iterate = __webpack_require__("2266");
- var defineIterator = __webpack_require__("7dd0");
- var setSpecies = __webpack_require__("2626");
- var DESCRIPTORS = __webpack_require__("83ab");
- var fastKey = __webpack_require__("f183").fastKey;
- var InternalStateModule = __webpack_require__("69f3");
- var setInternalState = InternalStateModule.set;
- var internalStateGetterFor = InternalStateModule.getterFor;
- module.exports = {
- getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) {
- var C = wrapper(function (that, iterable) {
- anInstance(that, C, CONSTRUCTOR_NAME);
- setInternalState(that, {
- type: CONSTRUCTOR_NAME,
- index: create(null),
- first: undefined,
- last: undefined,
- size: 0
- });
- if (!DESCRIPTORS) that.size = 0;
- if (iterable != undefined) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
- });
- var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);
- var define = function (that, key, value) {
- var state = getInternalState(that);
- var entry = getEntry(that, key);
- var previous, index;
- // change existing entry
- if (entry) {
- entry.value = value;
- // create new entry
- } else {
- state.last = entry = {
- index: index = fastKey(key, true),
- key: key,
- value: value,
- previous: previous = state.last,
- next: undefined,
- removed: false
- };
- if (!state.first) state.first = entry;
- if (previous) previous.next = entry;
- if (DESCRIPTORS) state.size++;
- else that.size++;
- // add to index
- if (index !== 'F') state.index[index] = entry;
- } return that;
- };
- var getEntry = function (that, key) {
- var state = getInternalState(that);
- // fast case
- var index = fastKey(key);
- var entry;
- if (index !== 'F') return state.index[index];
- // frozen object case
- for (entry = state.first; entry; entry = entry.next) {
- if (entry.key == key) return entry;
- }
- };
- redefineAll(C.prototype, {
- // 23.1.3.1 Map.prototype.clear()
- // 23.2.3.2 Set.prototype.clear()
- clear: function clear() {
- var that = this;
- var state = getInternalState(that);
- var data = state.index;
- var entry = state.first;
- while (entry) {
- entry.removed = true;
- if (entry.previous) entry.previous = entry.previous.next = undefined;
- delete data[entry.index];
- entry = entry.next;
- }
- state.first = state.last = undefined;
- if (DESCRIPTORS) state.size = 0;
- else that.size = 0;
- },
- // 23.1.3.3 Map.prototype.delete(key)
- // 23.2.3.4 Set.prototype.delete(value)
- 'delete': function (key) {
- var that = this;
- var state = getInternalState(that);
- var entry = getEntry(that, key);
- if (entry) {
- var next = entry.next;
- var prev = entry.previous;
- delete state.index[entry.index];
- entry.removed = true;
- if (prev) prev.next = next;
- if (next) next.previous = prev;
- if (state.first == entry) state.first = next;
- if (state.last == entry) state.last = prev;
- if (DESCRIPTORS) state.size--;
- else that.size--;
- } return !!entry;
- },
- // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)
- // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)
- forEach: function forEach(callbackfn /* , that = undefined */) {
- var state = getInternalState(this);
- var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);
- var entry;
- while (entry = entry ? entry.next : state.first) {
- boundFunction(entry.value, entry.key, this);
- // revert to the last existing entry
- while (entry && entry.removed) entry = entry.previous;
- }
- },
- // 23.1.3.7 Map.prototype.has(key)
- // 23.2.3.7 Set.prototype.has(value)
- has: function has(key) {
- return !!getEntry(this, key);
- }
- });
- redefineAll(C.prototype, IS_MAP ? {
- // 23.1.3.6 Map.prototype.get(key)
- get: function get(key) {
- var entry = getEntry(this, key);
- return entry && entry.value;
- },
- // 23.1.3.9 Map.prototype.set(key, value)
- set: function set(key, value) {
- return define(this, key === 0 ? 0 : key, value);
- }
- } : {
- // 23.2.3.1 Set.prototype.add(value)
- add: function add(value) {
- return define(this, value = value === 0 ? 0 : value, value);
- }
- });
- if (DESCRIPTORS) defineProperty(C.prototype, 'size', {
- get: function () {
- return getInternalState(this).size;
- }
- });
- return C;
- },
- setStrong: function (C, CONSTRUCTOR_NAME, IS_MAP) {
- var ITERATOR_NAME = CONSTRUCTOR_NAME + ' Iterator';
- var getInternalCollectionState = internalStateGetterFor(CONSTRUCTOR_NAME);
- var getInternalIteratorState = internalStateGetterFor(ITERATOR_NAME);
- // add .keys, .values, .entries, [@@iterator]
- // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11
- defineIterator(C, CONSTRUCTOR_NAME, function (iterated, kind) {
- setInternalState(this, {
- type: ITERATOR_NAME,
- target: iterated,
- state: getInternalCollectionState(iterated),
- kind: kind,
- last: undefined
- });
- }, function () {
- var state = getInternalIteratorState(this);
- var kind = state.kind;
- var entry = state.last;
- // revert to the last existing entry
- while (entry && entry.removed) entry = entry.previous;
- // get next entry
- if (!state.target || !(state.last = entry = entry ? entry.next : state.state.first)) {
- // or finish the iteration
- state.target = undefined;
- return { value: undefined, done: true };
- }
- // return step by kind
- if (kind == 'keys') return { value: entry.key, done: false };
- if (kind == 'values') return { value: entry.value, done: false };
- return { value: [entry.key, entry.value], done: false };
- }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);
- // add [@@species], 23.1.2.2, 23.2.2.2
- setSpecies(CONSTRUCTOR_NAME);
- }
- };
- /***/ }),
- /***/ "65f0":
- /***/ (function(module, exports, __webpack_require__) {
- var isObject = __webpack_require__("861d");
- var isArray = __webpack_require__("e8b5");
- var wellKnownSymbol = __webpack_require__("b622");
- var SPECIES = wellKnownSymbol('species');
- // `ArraySpeciesCreate` abstract operation
- // https://tc39.github.io/ecma262/#sec-arrayspeciescreate
- module.exports = function (originalArray, length) {
- var C;
- if (isArray(originalArray)) {
- C = originalArray.constructor;
- // cross-realm fallback
- if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
- else if (isObject(C)) {
- C = C[SPECIES];
- if (C === null) C = undefined;
- }
- } return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
- };
- /***/ }),
- /***/ "69f3":
- /***/ (function(module, exports, __webpack_require__) {
- var NATIVE_WEAK_MAP = __webpack_require__("7f9a");
- var global = __webpack_require__("da84");
- var isObject = __webpack_require__("861d");
- var createNonEnumerableProperty = __webpack_require__("9112");
- var objectHas = __webpack_require__("5135");
- var shared = __webpack_require__("c6cd");
- var sharedKey = __webpack_require__("f772");
- var hiddenKeys = __webpack_require__("d012");
- var WeakMap = global.WeakMap;
- var set, get, has;
- var enforce = function (it) {
- return has(it) ? get(it) : set(it, {});
- };
- var getterFor = function (TYPE) {
- return function (it) {
- var state;
- if (!isObject(it) || (state = get(it)).type !== TYPE) {
- throw TypeError('Incompatible receiver, ' + TYPE + ' required');
- } return state;
- };
- };
- if (NATIVE_WEAK_MAP) {
- var store = shared.state || (shared.state = new WeakMap());
- var wmget = store.get;
- var wmhas = store.has;
- var wmset = store.set;
- set = function (it, metadata) {
- metadata.facade = it;
- wmset.call(store, it, metadata);
- return metadata;
- };
- get = function (it) {
- return wmget.call(store, it) || {};
- };
- has = function (it) {
- return wmhas.call(store, it);
- };
- } else {
- var STATE = sharedKey('state');
- hiddenKeys[STATE] = true;
- set = function (it, metadata) {
- metadata.facade = it;
- createNonEnumerableProperty(it, STATE, metadata);
- return metadata;
- };
- get = function (it) {
- return objectHas(it, STATE) ? it[STATE] : {};
- };
- has = function (it) {
- return objectHas(it, STATE);
- };
- }
- module.exports = {
- set: set,
- get: get,
- has: has,
- enforce: enforce,
- getterFor: getterFor
- };
- /***/ }),
- /***/ "6d61":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var $ = __webpack_require__("23e7");
- var global = __webpack_require__("da84");
- var isForced = __webpack_require__("94ca");
- var redefine = __webpack_require__("6eeb");
- var InternalMetadataModule = __webpack_require__("f183");
- var iterate = __webpack_require__("2266");
- var anInstance = __webpack_require__("19aa");
- var isObject = __webpack_require__("861d");
- var fails = __webpack_require__("d039");
- var checkCorrectnessOfIteration = __webpack_require__("1c7e");
- var setToStringTag = __webpack_require__("d44e");
- var inheritIfRequired = __webpack_require__("7156");
- module.exports = function (CONSTRUCTOR_NAME, wrapper, common) {
- var IS_MAP = CONSTRUCTOR_NAME.indexOf('Map') !== -1;
- var IS_WEAK = CONSTRUCTOR_NAME.indexOf('Weak') !== -1;
- var ADDER = IS_MAP ? 'set' : 'add';
- var NativeConstructor = global[CONSTRUCTOR_NAME];
- var NativePrototype = NativeConstructor && NativeConstructor.prototype;
- var Constructor = NativeConstructor;
- var exported = {};
- var fixMethod = function (KEY) {
- var nativeMethod = NativePrototype[KEY];
- redefine(NativePrototype, KEY,
- KEY == 'add' ? function add(value) {
- nativeMethod.call(this, value === 0 ? 0 : value);
- return this;
- } : KEY == 'delete' ? function (key) {
- return IS_WEAK && !isObject(key) ? false : nativeMethod.call(this, key === 0 ? 0 : key);
- } : KEY == 'get' ? function get(key) {
- return IS_WEAK && !isObject(key) ? undefined : nativeMethod.call(this, key === 0 ? 0 : key);
- } : KEY == 'has' ? function has(key) {
- return IS_WEAK && !isObject(key) ? false : nativeMethod.call(this, key === 0 ? 0 : key);
- } : function set(key, value) {
- nativeMethod.call(this, key === 0 ? 0 : key, value);
- return this;
- }
- );
- };
- // eslint-disable-next-line max-len
- if (isForced(CONSTRUCTOR_NAME, typeof NativeConstructor != 'function' || !(IS_WEAK || NativePrototype.forEach && !fails(function () {
- new NativeConstructor().entries().next();
- })))) {
- // create collection constructor
- Constructor = common.getConstructor(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER);
- InternalMetadataModule.REQUIRED = true;
- } else if (isForced(CONSTRUCTOR_NAME, true)) {
- var instance = new Constructor();
- // early implementations not supports chaining
- var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance;
- // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false
- var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); });
- // most early implementations doesn't supports iterables, most modern - not close it correctly
- // eslint-disable-next-line no-new
- var ACCEPT_ITERABLES = checkCorrectnessOfIteration(function (iterable) { new NativeConstructor(iterable); });
- // for early implementations -0 and +0 not the same
- var BUGGY_ZERO = !IS_WEAK && fails(function () {
- // V8 ~ Chromium 42- fails only with 5+ elements
- var $instance = new NativeConstructor();
- var index = 5;
- while (index--) $instance[ADDER](index, index);
- return !$instance.has(-0);
- });
- if (!ACCEPT_ITERABLES) {
- Constructor = wrapper(function (dummy, iterable) {
- anInstance(dummy, Constructor, CONSTRUCTOR_NAME);
- var that = inheritIfRequired(new NativeConstructor(), dummy, Constructor);
- if (iterable != undefined) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
- return that;
- });
- Constructor.prototype = NativePrototype;
- NativePrototype.constructor = Constructor;
- }
- if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) {
- fixMethod('delete');
- fixMethod('has');
- IS_MAP && fixMethod('get');
- }
- if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER);
- // weak collections should not contains .clear method
- if (IS_WEAK && NativePrototype.clear) delete NativePrototype.clear;
- }
- exported[CONSTRUCTOR_NAME] = Constructor;
- $({ global: true, forced: Constructor != NativeConstructor }, exported);
- setToStringTag(Constructor, CONSTRUCTOR_NAME);
- if (!IS_WEAK) common.setStrong(Constructor, CONSTRUCTOR_NAME, IS_MAP);
- return Constructor;
- };
- /***/ }),
- /***/ "6eeb":
- /***/ (function(module, exports, __webpack_require__) {
- var global = __webpack_require__("da84");
- var createNonEnumerableProperty = __webpack_require__("9112");
- var has = __webpack_require__("5135");
- var setGlobal = __webpack_require__("ce4e");
- var inspectSource = __webpack_require__("8925");
- var InternalStateModule = __webpack_require__("69f3");
- var getInternalState = InternalStateModule.get;
- var enforceInternalState = InternalStateModule.enforce;
- var TEMPLATE = String(String).split('String');
- (module.exports = function (O, key, value, options) {
- var unsafe = options ? !!options.unsafe : false;
- var simple = options ? !!options.enumerable : false;
- var noTargetGet = options ? !!options.noTargetGet : false;
- var state;
- if (typeof value == 'function') {
- if (typeof key == 'string' && !has(value, 'name')) {
- createNonEnumerableProperty(value, 'name', key);
- }
- state = enforceInternalState(value);
- if (!state.source) {
- state.source = TEMPLATE.join(typeof key == 'string' ? key : '');
- }
- }
- if (O === global) {
- if (simple) O[key] = value;
- else setGlobal(key, value);
- return;
- } else if (!unsafe) {
- delete O[key];
- } else if (!noTargetGet && O[key]) {
- simple = true;
- }
- if (simple) O[key] = value;
- else createNonEnumerableProperty(O, key, value);
- // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
- })(Function.prototype, 'toString', function toString() {
- return typeof this == 'function' && getInternalState(this).source || inspectSource(this);
- });
- /***/ }),
- /***/ "7156":
- /***/ (function(module, exports, __webpack_require__) {
- var isObject = __webpack_require__("861d");
- var setPrototypeOf = __webpack_require__("d2bb");
- // makes subclassing work correct for wrapped built-ins
- module.exports = function ($this, dummy, Wrapper) {
- var NewTarget, NewTargetPrototype;
- if (
- // it can work only with native `setPrototypeOf`
- setPrototypeOf &&
- // we haven't completely correct pre-ES6 way for getting `new.target`, so use this
- typeof (NewTarget = dummy.constructor) == 'function' &&
- NewTarget !== Wrapper &&
- isObject(NewTargetPrototype = NewTarget.prototype) &&
- NewTargetPrototype !== Wrapper.prototype
- ) setPrototypeOf($this, NewTargetPrototype);
- return $this;
- };
- /***/ }),
- /***/ "7418":
- /***/ (function(module, exports) {
- exports.f = Object.getOwnPropertySymbols;
- /***/ }),
- /***/ "746f":
- /***/ (function(module, exports, __webpack_require__) {
- var path = __webpack_require__("428f");
- var has = __webpack_require__("5135");
- var wrappedWellKnownSymbolModule = __webpack_require__("e538");
- var defineProperty = __webpack_require__("9bf2").f;
- module.exports = function (NAME) {
- var Symbol = path.Symbol || (path.Symbol = {});
- if (!has(Symbol, NAME)) defineProperty(Symbol, NAME, {
- value: wrappedWellKnownSymbolModule.f(NAME)
- });
- };
- /***/ }),
- /***/ "7839":
- /***/ (function(module, exports) {
- // IE8- don't enum bug keys
- module.exports = [
- 'constructor',
- 'hasOwnProperty',
- 'isPrototypeOf',
- 'propertyIsEnumerable',
- 'toLocaleString',
- 'toString',
- 'valueOf'
- ];
- /***/ }),
- /***/ "7b0b":
- /***/ (function(module, exports, __webpack_require__) {
- var requireObjectCoercible = __webpack_require__("1d80");
- // `ToObject` abstract operation
- // https://tc39.github.io/ecma262/#sec-toobject
- module.exports = function (argument) {
- return Object(requireObjectCoercible(argument));
- };
- /***/ }),
- /***/ "7c73":
- /***/ (function(module, exports, __webpack_require__) {
- var anObject = __webpack_require__("825a");
- var defineProperties = __webpack_require__("37e8");
- var enumBugKeys = __webpack_require__("7839");
- var hiddenKeys = __webpack_require__("d012");
- var html = __webpack_require__("1be4");
- var documentCreateElement = __webpack_require__("cc12");
- var sharedKey = __webpack_require__("f772");
- var GT = '>';
- var LT = '<';
- var PROTOTYPE = 'prototype';
- var SCRIPT = 'script';
- var IE_PROTO = sharedKey('IE_PROTO');
- var EmptyConstructor = function () { /* empty */ };
- var scriptTag = function (content) {
- return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
- };
- // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
- var NullProtoObjectViaActiveX = function (activeXDocument) {
- activeXDocument.write(scriptTag(''));
- activeXDocument.close();
- var temp = activeXDocument.parentWindow.Object;
- activeXDocument = null; // avoid memory leak
- return temp;
- };
- // Create object with fake `null` prototype: use iframe Object with cleared prototype
- var NullProtoObjectViaIFrame = function () {
- // Thrash, waste and sodomy: IE GC bug
- var iframe = documentCreateElement('iframe');
- var JS = 'java' + SCRIPT + ':';
- var iframeDocument;
- iframe.style.display = 'none';
- html.appendChild(iframe);
- // https://github.com/zloirock/core-js/issues/475
- iframe.src = String(JS);
- iframeDocument = iframe.contentWindow.document;
- iframeDocument.open();
- iframeDocument.write(scriptTag('document.F=Object'));
- iframeDocument.close();
- return iframeDocument.F;
- };
- // Check for document.domain and active x support
- // No need to use active x approach when document.domain is not set
- // see https://github.com/es-shims/es5-shim/issues/150
- // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
- // avoid IE GC bug
- var activeXDocument;
- var NullProtoObject = function () {
- try {
- /* global ActiveXObject */
- activeXDocument = document.domain && new ActiveXObject('htmlfile');
- } catch (error) { /* ignore */ }
- NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame();
- var length = enumBugKeys.length;
- while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
- return NullProtoObject();
- };
- hiddenKeys[IE_PROTO] = true;
- // `Object.create` method
- // https://tc39.github.io/ecma262/#sec-object.create
- module.exports = Object.create || function create(O, Properties) {
- var result;
- if (O !== null) {
- EmptyConstructor[PROTOTYPE] = anObject(O);
- result = new EmptyConstructor();
- EmptyConstructor[PROTOTYPE] = null;
- // add "__proto__" for Object.getPrototypeOf polyfill
- result[IE_PROTO] = O;
- } else result = NullProtoObject();
- return Properties === undefined ? result : defineProperties(result, Properties);
- };
- /***/ }),
- /***/ "7db0":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var $ = __webpack_require__("23e7");
- var $find = __webpack_require__("b727").find;
- var addToUnscopables = __webpack_require__("44d2");
- var arrayMethodUsesToLength = __webpack_require__("ae40");
- var FIND = 'find';
- var SKIPS_HOLES = true;
- var USES_TO_LENGTH = arrayMethodUsesToLength(FIND);
- // Shouldn't skip holes
- if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
- // `Array.prototype.find` method
- // https://tc39.github.io/ecma262/#sec-array.prototype.find
- $({ target: 'Array', proto: true, forced: SKIPS_HOLES || !USES_TO_LENGTH }, {
- find: function find(callbackfn /* , that = undefined */) {
- return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
- }
- });
- // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
- addToUnscopables(FIND);
- /***/ }),
- /***/ "7dd0":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var $ = __webpack_require__("23e7");
- var createIteratorConstructor = __webpack_require__("9ed3");
- var getPrototypeOf = __webpack_require__("e163");
- var setPrototypeOf = __webpack_require__("d2bb");
- var setToStringTag = __webpack_require__("d44e");
- var createNonEnumerableProperty = __webpack_require__("9112");
- var redefine = __webpack_require__("6eeb");
- var wellKnownSymbol = __webpack_require__("b622");
- var IS_PURE = __webpack_require__("c430");
- var Iterators = __webpack_require__("3f8c");
- var IteratorsCore = __webpack_require__("ae93");
- var IteratorPrototype = IteratorsCore.IteratorPrototype;
- var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
- var ITERATOR = wellKnownSymbol('iterator');
- var KEYS = 'keys';
- var VALUES = 'values';
- var ENTRIES = 'entries';
- var returnThis = function () { return this; };
- module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
- createIteratorConstructor(IteratorConstructor, NAME, next);
- var getIterationMethod = function (KIND) {
- if (KIND === DEFAULT && defaultIterator) return defaultIterator;
- if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];
- switch (KIND) {
- case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
- case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
- case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
- } return function () { return new IteratorConstructor(this); };
- };
- var TO_STRING_TAG = NAME + ' Iterator';
- var INCORRECT_VALUES_NAME = false;
- var IterablePrototype = Iterable.prototype;
- var nativeIterator = IterablePrototype[ITERATOR]
- || IterablePrototype['@@iterator']
- || DEFAULT && IterablePrototype[DEFAULT];
- var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
- var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
- var CurrentIteratorPrototype, methods, KEY;
- // fix native
- if (anyNativeIterator) {
- CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
- if (IteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
- if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
- if (setPrototypeOf) {
- setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
- } else if (typeof CurrentIteratorPrototype[ITERATOR] != 'function') {
- createNonEnumerableProperty(CurrentIteratorPrototype, ITERATOR, returnThis);
- }
- }
- // Set @@toStringTag to native iterators
- setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true);
- if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis;
- }
- }
- // fix Array#{values, @@iterator}.name in V8 / FF
- if (DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
- INCORRECT_VALUES_NAME = true;
- defaultIterator = function values() { return nativeIterator.call(this); };
- }
- // define iterator
- if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) {
- createNonEnumerableProperty(IterablePrototype, ITERATOR, defaultIterator);
- }
- Iterators[NAME] = defaultIterator;
- // export additional methods
- if (DEFAULT) {
- methods = {
- values: getIterationMethod(VALUES),
- keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
- entries: getIterationMethod(ENTRIES)
- };
- if (FORCED) for (KEY in methods) {
- if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
- redefine(IterablePrototype, KEY, methods[KEY]);
- }
- } else $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
- }
- return methods;
- };
- /***/ }),
- /***/ "7f9a":
- /***/ (function(module, exports, __webpack_require__) {
- var global = __webpack_require__("da84");
- var inspectSource = __webpack_require__("8925");
- var WeakMap = global.WeakMap;
- module.exports = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap));
- /***/ }),
- /***/ "7fd6":
- /***/ (function(module, exports) {
- module.exports = require("xe-utils/ctor");
- /***/ }),
- /***/ "825a":
- /***/ (function(module, exports, __webpack_require__) {
- var isObject = __webpack_require__("861d");
- module.exports = function (it) {
- if (!isObject(it)) {
- throw TypeError(String(it) + ' is not an object');
- } return it;
- };
- /***/ }),
- /***/ "83ab":
- /***/ (function(module, exports, __webpack_require__) {
- var fails = __webpack_require__("d039");
- // Thank's IE8 for his funny defineProperty
- module.exports = !fails(function () {
- return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
- });
- /***/ }),
- /***/ "8418":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var toPrimitive = __webpack_require__("c04e");
- var definePropertyModule = __webpack_require__("9bf2");
- var createPropertyDescriptor = __webpack_require__("5c6c");
- module.exports = function (object, key, value) {
- var propertyKey = toPrimitive(key);
- if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));
- else object[propertyKey] = value;
- };
- /***/ }),
- /***/ "857a":
- /***/ (function(module, exports, __webpack_require__) {
- var requireObjectCoercible = __webpack_require__("1d80");
- var quot = /"/g;
- // B.2.3.2.1 CreateHTML(string, tag, attribute, value)
- // https://tc39.github.io/ecma262/#sec-createhtml
- module.exports = function (string, tag, attribute, value) {
- var S = String(requireObjectCoercible(string));
- var p1 = '<' + tag;
- if (attribute !== '') p1 += ' ' + attribute + '="' + String(value).replace(quot, '"') + '"';
- return p1 + '>' + S + '</' + tag + '>';
- };
- /***/ }),
- /***/ "861d":
- /***/ (function(module, exports) {
- module.exports = function (it) {
- return typeof it === 'object' ? it !== null : typeof it === 'function';
- };
- /***/ }),
- /***/ "8875":
- /***/ (function(module, exports, __webpack_require__) {
- var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// addapted from the document.currentScript polyfill by Adam Miller
- // MIT license
- // source: https://github.com/amiller-gh/currentScript-polyfill
- // added support for Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1620505
- (function (root, factory) {
- if (true) {
- !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
- __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
- (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
- __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
- } else {}
- }(typeof self !== 'undefined' ? self : this, function () {
- function getCurrentScript () {
- var descriptor = Object.getOwnPropertyDescriptor(document, 'currentScript')
- // for chrome
- if (!descriptor && 'currentScript' in document && document.currentScript) {
- return document.currentScript
- }
- // for other browsers with native support for currentScript
- if (descriptor && descriptor.get !== getCurrentScript && document.currentScript) {
- return document.currentScript
- }
-
- // IE 8-10 support script readyState
- // IE 11+ & Firefox support stack trace
- try {
- throw new Error();
- }
- catch (err) {
- // Find the second match for the "at" string to get file src url from stack.
- var ieStackRegExp = /.*at [^(]*\((.*):(.+):(.+)\)$/ig,
- ffStackRegExp = /@([^@]*):(\d+):(\d+)\s*$/ig,
- stackDetails = ieStackRegExp.exec(err.stack) || ffStackRegExp.exec(err.stack),
- scriptLocation = (stackDetails && stackDetails[1]) || false,
- line = (stackDetails && stackDetails[2]) || false,
- currentLocation = document.location.href.replace(document.location.hash, ''),
- pageSource,
- inlineScriptSourceRegExp,
- inlineScriptSource,
- scripts = document.getElementsByTagName('script'); // Live NodeList collection
-
- if (scriptLocation === currentLocation) {
- pageSource = document.documentElement.outerHTML;
- inlineScriptSourceRegExp = new RegExp('(?:[^\\n]+?\\n){0,' + (line - 2) + '}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*', 'i');
- inlineScriptSource = pageSource.replace(inlineScriptSourceRegExp, '$1').trim();
- }
-
- for (var i = 0; i < scripts.length; i++) {
- // If ready state is interactive, return the script tag
- if (scripts[i].readyState === 'interactive') {
- return scripts[i];
- }
-
- // If src matches, return the script tag
- if (scripts[i].src === scriptLocation) {
- return scripts[i];
- }
-
- // If inline source matches, return the script tag
- if (
- scriptLocation === currentLocation &&
- scripts[i].innerHTML &&
- scripts[i].innerHTML.trim() === inlineScriptSource
- ) {
- return scripts[i];
- }
- }
-
- // If no match, return null
- return null;
- }
- };
- return getCurrentScript
- }));
- /***/ }),
- /***/ "8925":
- /***/ (function(module, exports, __webpack_require__) {
- var store = __webpack_require__("c6cd");
- var functionToString = Function.toString;
- // this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper
- if (typeof store.inspectSource != 'function') {
- store.inspectSource = function (it) {
- return functionToString.call(it);
- };
- }
- module.exports = store.inspectSource;
- /***/ }),
- /***/ "8aa5":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var charAt = __webpack_require__("6547").charAt;
- // `AdvanceStringIndex` abstract operation
- // https://tc39.github.io/ecma262/#sec-advancestringindex
- module.exports = function (S, index, unicode) {
- return index + (unicode ? charAt(S, index).length : 1);
- };
- /***/ }),
- /***/ "90e3":
- /***/ (function(module, exports) {
- var id = 0;
- var postfix = Math.random();
- module.exports = function (key) {
- return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);
- };
- /***/ }),
- /***/ "9112":
- /***/ (function(module, exports, __webpack_require__) {
- var DESCRIPTORS = __webpack_require__("83ab");
- var definePropertyModule = __webpack_require__("9bf2");
- var createPropertyDescriptor = __webpack_require__("5c6c");
- module.exports = DESCRIPTORS ? function (object, key, value) {
- return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));
- } : function (object, key, value) {
- object[key] = value;
- return object;
- };
- /***/ }),
- /***/ "9263":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var regexpFlags = __webpack_require__("ad6d");
- var stickyHelpers = __webpack_require__("9f7f");
- var nativeExec = RegExp.prototype.exec;
- // This always refers to the native implementation, because the
- // String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js,
- // which loads this file before patching the method.
- var nativeReplace = String.prototype.replace;
- var patchedExec = nativeExec;
- var UPDATES_LAST_INDEX_WRONG = (function () {
- var re1 = /a/;
- var re2 = /b*/g;
- nativeExec.call(re1, 'a');
- nativeExec.call(re2, 'a');
- return re1.lastIndex !== 0 || re2.lastIndex !== 0;
- })();
- var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y || stickyHelpers.BROKEN_CARET;
- // nonparticipating capturing group, copied from es5-shim's String#split patch.
- var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
- var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y;
- if (PATCH) {
- patchedExec = function exec(str) {
- var re = this;
- var lastIndex, reCopy, match, i;
- var sticky = UNSUPPORTED_Y && re.sticky;
- var flags = regexpFlags.call(re);
- var source = re.source;
- var charsAdded = 0;
- var strCopy = str;
- if (sticky) {
- flags = flags.replace('y', '');
- if (flags.indexOf('g') === -1) {
- flags += 'g';
- }
- strCopy = String(str).slice(re.lastIndex);
- // Support anchored sticky behavior.
- if (re.lastIndex > 0 && (!re.multiline || re.multiline && str[re.lastIndex - 1] !== '\n')) {
- source = '(?: ' + source + ')';
- strCopy = ' ' + strCopy;
- charsAdded++;
- }
- // ^(? + rx + ) is needed, in combination with some str slicing, to
- // simulate the 'y' flag.
- reCopy = new RegExp('^(?:' + source + ')', flags);
- }
- if (NPCG_INCLUDED) {
- reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
- }
- if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
- match = nativeExec.call(sticky ? reCopy : re, strCopy);
- if (sticky) {
- if (match) {
- match.input = match.input.slice(charsAdded);
- match[0] = match[0].slice(charsAdded);
- match.index = re.lastIndex;
- re.lastIndex += match[0].length;
- } else re.lastIndex = 0;
- } else if (UPDATES_LAST_INDEX_WRONG && match) {
- re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
- }
- if (NPCG_INCLUDED && match && match.length > 1) {
- // Fix browsers whose `exec` methods don't consistently return `undefined`
- // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
- nativeReplace.call(match[0], reCopy, function () {
- for (i = 1; i < arguments.length - 2; i++) {
- if (arguments[i] === undefined) match[i] = undefined;
- }
- });
- }
- return match;
- };
- }
- module.exports = patchedExec;
- /***/ }),
- /***/ "94ca":
- /***/ (function(module, exports, __webpack_require__) {
- var fails = __webpack_require__("d039");
- var replacement = /#|\.prototype\./;
- var isForced = function (feature, detection) {
- var value = data[normalize(feature)];
- return value == POLYFILL ? true
- : value == NATIVE ? false
- : typeof detection == 'function' ? fails(detection)
- : !!detection;
- };
- var normalize = isForced.normalize = function (string) {
- return String(string).replace(replacement, '.').toLowerCase();
- };
- var data = isForced.data = {};
- var NATIVE = isForced.NATIVE = 'N';
- var POLYFILL = isForced.POLYFILL = 'P';
- module.exports = isForced;
- /***/ }),
- /***/ "9861":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- // TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env`
- __webpack_require__("e260");
- var $ = __webpack_require__("23e7");
- var getBuiltIn = __webpack_require__("d066");
- var USE_NATIVE_URL = __webpack_require__("0d3b");
- var redefine = __webpack_require__("6eeb");
- var redefineAll = __webpack_require__("e2cc");
- var setToStringTag = __webpack_require__("d44e");
- var createIteratorConstructor = __webpack_require__("9ed3");
- var InternalStateModule = __webpack_require__("69f3");
- var anInstance = __webpack_require__("19aa");
- var hasOwn = __webpack_require__("5135");
- var bind = __webpack_require__("0366");
- var classof = __webpack_require__("f5df");
- var anObject = __webpack_require__("825a");
- var isObject = __webpack_require__("861d");
- var create = __webpack_require__("7c73");
- var createPropertyDescriptor = __webpack_require__("5c6c");
- var getIterator = __webpack_require__("9a1f");
- var getIteratorMethod = __webpack_require__("35a1");
- var wellKnownSymbol = __webpack_require__("b622");
- var $fetch = getBuiltIn('fetch');
- var Headers = getBuiltIn('Headers');
- var ITERATOR = wellKnownSymbol('iterator');
- var URL_SEARCH_PARAMS = 'URLSearchParams';
- var URL_SEARCH_PARAMS_ITERATOR = URL_SEARCH_PARAMS + 'Iterator';
- var setInternalState = InternalStateModule.set;
- var getInternalParamsState = InternalStateModule.getterFor(URL_SEARCH_PARAMS);
- var getInternalIteratorState = InternalStateModule.getterFor(URL_SEARCH_PARAMS_ITERATOR);
- var plus = /\+/g;
- var sequences = Array(4);
- var percentSequence = function (bytes) {
- return sequences[bytes - 1] || (sequences[bytes - 1] = RegExp('((?:%[\\da-f]{2}){' + bytes + '})', 'gi'));
- };
- var percentDecode = function (sequence) {
- try {
- return decodeURIComponent(sequence);
- } catch (error) {
- return sequence;
- }
- };
- var deserialize = function (it) {
- var result = it.replace(plus, ' ');
- var bytes = 4;
- try {
- return decodeURIComponent(result);
- } catch (error) {
- while (bytes) {
- result = result.replace(percentSequence(bytes--), percentDecode);
- }
- return result;
- }
- };
- var find = /[!'()~]|%20/g;
- var replace = {
- '!': '%21',
- "'": '%27',
- '(': '%28',
- ')': '%29',
- '~': '%7E',
- '%20': '+'
- };
- var replacer = function (match) {
- return replace[match];
- };
- var serialize = function (it) {
- return encodeURIComponent(it).replace(find, replacer);
- };
- var parseSearchParams = function (result, query) {
- if (query) {
- var attributes = query.split('&');
- var index = 0;
- var attribute, entry;
- while (index < attributes.length) {
- attribute = attributes[index++];
- if (attribute.length) {
- entry = attribute.split('=');
- result.push({
- key: deserialize(entry.shift()),
- value: deserialize(entry.join('='))
- });
- }
- }
- }
- };
- var updateSearchParams = function (query) {
- this.entries.length = 0;
- parseSearchParams(this.entries, query);
- };
- var validateArgumentsLength = function (passed, required) {
- if (passed < required) throw TypeError('Not enough arguments');
- };
- var URLSearchParamsIterator = createIteratorConstructor(function Iterator(params, kind) {
- setInternalState(this, {
- type: URL_SEARCH_PARAMS_ITERATOR,
- iterator: getIterator(getInternalParamsState(params).entries),
- kind: kind
- });
- }, 'Iterator', function next() {
- var state = getInternalIteratorState(this);
- var kind = state.kind;
- var step = state.iterator.next();
- var entry = step.value;
- if (!step.done) {
- step.value = kind === 'keys' ? entry.key : kind === 'values' ? entry.value : [entry.key, entry.value];
- } return step;
- });
- // `URLSearchParams` constructor
- // https://url.spec.whatwg.org/#interface-urlsearchparams
- var URLSearchParamsConstructor = function URLSearchParams(/* init */) {
- anInstance(this, URLSearchParamsConstructor, URL_SEARCH_PARAMS);
- var init = arguments.length > 0 ? arguments[0] : undefined;
- var that = this;
- var entries = [];
- var iteratorMethod, iterator, next, step, entryIterator, entryNext, first, second, key;
- setInternalState(that, {
- type: URL_SEARCH_PARAMS,
- entries: entries,
- updateURL: function () { /* empty */ },
- updateSearchParams: updateSearchParams
- });
- if (init !== undefined) {
- if (isObject(init)) {
- iteratorMethod = getIteratorMethod(init);
- if (typeof iteratorMethod === 'function') {
- iterator = iteratorMethod.call(init);
- next = iterator.next;
- while (!(step = next.call(iterator)).done) {
- entryIterator = getIterator(anObject(step.value));
- entryNext = entryIterator.next;
- if (
- (first = entryNext.call(entryIterator)).done ||
- (second = entryNext.call(entryIterator)).done ||
- !entryNext.call(entryIterator).done
- ) throw TypeError('Expected sequence with length 2');
- entries.push({ key: first.value + '', value: second.value + '' });
- }
- } else for (key in init) if (hasOwn(init, key)) entries.push({ key: key, value: init[key] + '' });
- } else {
- parseSearchParams(entries, typeof init === 'string' ? init.charAt(0) === '?' ? init.slice(1) : init : init + '');
- }
- }
- };
- var URLSearchParamsPrototype = URLSearchParamsConstructor.prototype;
- redefineAll(URLSearchParamsPrototype, {
- // `URLSearchParams.prototype.append` method
- // https://url.spec.whatwg.org/#dom-urlsearchparams-append
- append: function append(name, value) {
- validateArgumentsLength(arguments.length, 2);
- var state = getInternalParamsState(this);
- state.entries.push({ key: name + '', value: value + '' });
- state.updateURL();
- },
- // `URLSearchParams.prototype.delete` method
- // https://url.spec.whatwg.org/#dom-urlsearchparams-delete
- 'delete': function (name) {
- validateArgumentsLength(arguments.length, 1);
- var state = getInternalParamsState(this);
- var entries = state.entries;
- var key = name + '';
- var index = 0;
- while (index < entries.length) {
- if (entries[index].key === key) entries.splice(index, 1);
- else index++;
- }
- state.updateURL();
- },
- // `URLSearchParams.prototype.get` method
- // https://url.spec.whatwg.org/#dom-urlsearchparams-get
- get: function get(name) {
- validateArgumentsLength(arguments.length, 1);
- var entries = getInternalParamsState(this).entries;
- var key = name + '';
- var index = 0;
- for (; index < entries.length; index++) {
- if (entries[index].key === key) return entries[index].value;
- }
- return null;
- },
- // `URLSearchParams.prototype.getAll` method
- // https://url.spec.whatwg.org/#dom-urlsearchparams-getall
- getAll: function getAll(name) {
- validateArgumentsLength(arguments.length, 1);
- var entries = getInternalParamsState(this).entries;
- var key = name + '';
- var result = [];
- var index = 0;
- for (; index < entries.length; index++) {
- if (entries[index].key === key) result.push(entries[index].value);
- }
- return result;
- },
- // `URLSearchParams.prototype.has` method
- // https://url.spec.whatwg.org/#dom-urlsearchparams-has
- has: function has(name) {
- validateArgumentsLength(arguments.length, 1);
- var entries = getInternalParamsState(this).entries;
- var key = name + '';
- var index = 0;
- while (index < entries.length) {
- if (entries[index++].key === key) return true;
- }
- return false;
- },
- // `URLSearchParams.prototype.set` method
- // https://url.spec.whatwg.org/#dom-urlsearchparams-set
- set: function set(name, value) {
- validateArgumentsLength(arguments.length, 1);
- var state = getInternalParamsState(this);
- var entries = state.entries;
- var found = false;
- var key = name + '';
- var val = value + '';
- var index = 0;
- var entry;
- for (; index < entries.length; index++) {
- entry = entries[index];
- if (entry.key === key) {
- if (found) entries.splice(index--, 1);
- else {
- found = true;
- entry.value = val;
- }
- }
- }
- if (!found) entries.push({ key: key, value: val });
- state.updateURL();
- },
- // `URLSearchParams.prototype.sort` method
- // https://url.spec.whatwg.org/#dom-urlsearchparams-sort
- sort: function sort() {
- var state = getInternalParamsState(this);
- var entries = state.entries;
- // Array#sort is not stable in some engines
- var slice = entries.slice();
- var entry, entriesIndex, sliceIndex;
- entries.length = 0;
- for (sliceIndex = 0; sliceIndex < slice.length; sliceIndex++) {
- entry = slice[sliceIndex];
- for (entriesIndex = 0; entriesIndex < sliceIndex; entriesIndex++) {
- if (entries[entriesIndex].key > entry.key) {
- entries.splice(entriesIndex, 0, entry);
- break;
- }
- }
- if (entriesIndex === sliceIndex) entries.push(entry);
- }
- state.updateURL();
- },
- // `URLSearchParams.prototype.forEach` method
- forEach: function forEach(callback /* , thisArg */) {
- var entries = getInternalParamsState(this).entries;
- var boundFunction = bind(callback, arguments.length > 1 ? arguments[1] : undefined, 3);
- var index = 0;
- var entry;
- while (index < entries.length) {
- entry = entries[index++];
- boundFunction(entry.value, entry.key, this);
- }
- },
- // `URLSearchParams.prototype.keys` method
- keys: function keys() {
- return new URLSearchParamsIterator(this, 'keys');
- },
- // `URLSearchParams.prototype.values` method
- values: function values() {
- return new URLSearchParamsIterator(this, 'values');
- },
- // `URLSearchParams.prototype.entries` method
- entries: function entries() {
- return new URLSearchParamsIterator(this, 'entries');
- }
- }, { enumerable: true });
- // `URLSearchParams.prototype[@@iterator]` method
- redefine(URLSearchParamsPrototype, ITERATOR, URLSearchParamsPrototype.entries);
- // `URLSearchParams.prototype.toString` method
- // https://url.spec.whatwg.org/#urlsearchparams-stringification-behavior
- redefine(URLSearchParamsPrototype, 'toString', function toString() {
- var entries = getInternalParamsState(this).entries;
- var result = [];
- var index = 0;
- var entry;
- while (index < entries.length) {
- entry = entries[index++];
- result.push(serialize(entry.key) + '=' + serialize(entry.value));
- } return result.join('&');
- }, { enumerable: true });
- setToStringTag(URLSearchParamsConstructor, URL_SEARCH_PARAMS);
- $({ global: true, forced: !USE_NATIVE_URL }, {
- URLSearchParams: URLSearchParamsConstructor
- });
- // Wrap `fetch` for correct work with polyfilled `URLSearchParams`
- // https://github.com/zloirock/core-js/issues/674
- if (!USE_NATIVE_URL && typeof $fetch == 'function' && typeof Headers == 'function') {
- $({ global: true, enumerable: true, forced: true }, {
- fetch: function fetch(input /* , init */) {
- var args = [input];
- var init, body, headers;
- if (arguments.length > 1) {
- init = arguments[1];
- if (isObject(init)) {
- body = init.body;
- if (classof(body) === URL_SEARCH_PARAMS) {
- headers = init.headers ? new Headers(init.headers) : new Headers();
- if (!headers.has('content-type')) {
- headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8');
- }
- init = create(init, {
- body: createPropertyDescriptor(0, String(body)),
- headers: createPropertyDescriptor(0, headers)
- });
- }
- }
- args.push(init);
- } return $fetch.apply(this, args);
- }
- });
- }
- module.exports = {
- URLSearchParams: URLSearchParamsConstructor,
- getState: getInternalParamsState
- };
- /***/ }),
- /***/ "99af":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var $ = __webpack_require__("23e7");
- var fails = __webpack_require__("d039");
- var isArray = __webpack_require__("e8b5");
- var isObject = __webpack_require__("861d");
- var toObject = __webpack_require__("7b0b");
- var toLength = __webpack_require__("50c4");
- var createProperty = __webpack_require__("8418");
- var arraySpeciesCreate = __webpack_require__("65f0");
- var arrayMethodHasSpeciesSupport = __webpack_require__("1dde");
- var wellKnownSymbol = __webpack_require__("b622");
- var V8_VERSION = __webpack_require__("2d00");
- var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
- var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
- var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
- // We can't use this feature detection in V8 since it causes
- // deoptimization and serious performance degradation
- // https://github.com/zloirock/core-js/issues/679
- var IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails(function () {
- var array = [];
- array[IS_CONCAT_SPREADABLE] = false;
- return array.concat()[0] !== array;
- });
- var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
- var isConcatSpreadable = function (O) {
- if (!isObject(O)) return false;
- var spreadable = O[IS_CONCAT_SPREADABLE];
- return spreadable !== undefined ? !!spreadable : isArray(O);
- };
- var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
- // `Array.prototype.concat` method
- // https://tc39.github.io/ecma262/#sec-array.prototype.concat
- // with adding support of @@isConcatSpreadable and @@species
- $({ target: 'Array', proto: true, forced: FORCED }, {
- concat: function concat(arg) { // eslint-disable-line no-unused-vars
- var O = toObject(this);
- var A = arraySpeciesCreate(O, 0);
- var n = 0;
- var i, k, length, len, E;
- for (i = -1, length = arguments.length; i < length; i++) {
- E = i === -1 ? O : arguments[i];
- if (isConcatSpreadable(E)) {
- len = toLength(E.length);
- if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
- for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
- } else {
- if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
- createProperty(A, n++, E);
- }
- }
- A.length = n;
- return A;
- }
- });
- /***/ }),
- /***/ "9a0c":
- /***/ (function(module, exports, __webpack_require__) {
- // https://github.com/zloirock/core-js/issues/280
- var userAgent = __webpack_require__("342f");
- // eslint-disable-next-line unicorn/no-unsafe-regex
- module.exports = /Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(userAgent);
- /***/ }),
- /***/ "9a1f":
- /***/ (function(module, exports, __webpack_require__) {
- var anObject = __webpack_require__("825a");
- var getIteratorMethod = __webpack_require__("35a1");
- module.exports = function (it) {
- var iteratorMethod = getIteratorMethod(it);
- if (typeof iteratorMethod != 'function') {
- throw TypeError(String(it) + ' is not iterable');
- } return anObject(iteratorMethod.call(it));
- };
- /***/ }),
- /***/ "9bdd":
- /***/ (function(module, exports, __webpack_require__) {
- var anObject = __webpack_require__("825a");
- var iteratorClose = __webpack_require__("2a62");
- // call something on iterator step with safe closing on error
- module.exports = function (iterator, fn, value, ENTRIES) {
- try {
- return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);
- // 7.4.6 IteratorClose(iterator, completion)
- } catch (error) {
- iteratorClose(iterator);
- throw error;
- }
- };
- /***/ }),
- /***/ "9bf2":
- /***/ (function(module, exports, __webpack_require__) {
- var DESCRIPTORS = __webpack_require__("83ab");
- var IE8_DOM_DEFINE = __webpack_require__("0cfb");
- var anObject = __webpack_require__("825a");
- var toPrimitive = __webpack_require__("c04e");
- var nativeDefineProperty = Object.defineProperty;
- // `Object.defineProperty` method
- // https://tc39.github.io/ecma262/#sec-object.defineproperty
- exports.f = DESCRIPTORS ? nativeDefineProperty : function defineProperty(O, P, Attributes) {
- anObject(O);
- P = toPrimitive(P, true);
- anObject(Attributes);
- if (IE8_DOM_DEFINE) try {
- return nativeDefineProperty(O, P, Attributes);
- } catch (error) { /* empty */ }
- if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
- if ('value' in Attributes) O[P] = Attributes.value;
- return O;
- };
- /***/ }),
- /***/ "9ed3":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var IteratorPrototype = __webpack_require__("ae93").IteratorPrototype;
- var create = __webpack_require__("7c73");
- var createPropertyDescriptor = __webpack_require__("5c6c");
- var setToStringTag = __webpack_require__("d44e");
- var Iterators = __webpack_require__("3f8c");
- var returnThis = function () { return this; };
- module.exports = function (IteratorConstructor, NAME, next) {
- var TO_STRING_TAG = NAME + ' Iterator';
- IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(1, next) });
- setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true);
- Iterators[TO_STRING_TAG] = returnThis;
- return IteratorConstructor;
- };
- /***/ }),
- /***/ "9f7f":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var fails = __webpack_require__("d039");
- // babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError,
- // so we use an intermediate function.
- function RE(s, f) {
- return RegExp(s, f);
- }
- exports.UNSUPPORTED_Y = fails(function () {
- // babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
- var re = RE('a', 'y');
- re.lastIndex = 2;
- return re.exec('abcd') != null;
- });
- exports.BROKEN_CARET = fails(function () {
- // https://bugzilla.mozilla.org/show_bug.cgi?id=773687
- var re = RE('^r', 'gy');
- re.lastIndex = 2;
- return re.exec('str') != null;
- });
- /***/ }),
- /***/ "a15b":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var $ = __webpack_require__("23e7");
- var IndexedObject = __webpack_require__("44ad");
- var toIndexedObject = __webpack_require__("fc6a");
- var arrayMethodIsStrict = __webpack_require__("a640");
- var nativeJoin = [].join;
- var ES3_STRINGS = IndexedObject != Object;
- var STRICT_METHOD = arrayMethodIsStrict('join', ',');
- // `Array.prototype.join` method
- // https://tc39.github.io/ecma262/#sec-array.prototype.join
- $({ target: 'Array', proto: true, forced: ES3_STRINGS || !STRICT_METHOD }, {
- join: function join(separator) {
- return nativeJoin.call(toIndexedObject(this), separator === undefined ? ',' : separator);
- }
- });
- /***/ }),
- /***/ "a434":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var $ = __webpack_require__("23e7");
- var toAbsoluteIndex = __webpack_require__("23cb");
- var toInteger = __webpack_require__("a691");
- var toLength = __webpack_require__("50c4");
- var toObject = __webpack_require__("7b0b");
- var arraySpeciesCreate = __webpack_require__("65f0");
- var createProperty = __webpack_require__("8418");
- var arrayMethodHasSpeciesSupport = __webpack_require__("1dde");
- var arrayMethodUsesToLength = __webpack_require__("ae40");
- var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('splice');
- var USES_TO_LENGTH = arrayMethodUsesToLength('splice', { ACCESSORS: true, 0: 0, 1: 2 });
- var max = Math.max;
- var min = Math.min;
- var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
- var MAXIMUM_ALLOWED_LENGTH_EXCEEDED = 'Maximum allowed length exceeded';
- // `Array.prototype.splice` method
- // https://tc39.github.io/ecma262/#sec-array.prototype.splice
- // with adding support of @@species
- $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {
- splice: function splice(start, deleteCount /* , ...items */) {
- var O = toObject(this);
- var len = toLength(O.length);
- var actualStart = toAbsoluteIndex(start, len);
- var argumentsLength = arguments.length;
- var insertCount, actualDeleteCount, A, k, from, to;
- if (argumentsLength === 0) {
- insertCount = actualDeleteCount = 0;
- } else if (argumentsLength === 1) {
- insertCount = 0;
- actualDeleteCount = len - actualStart;
- } else {
- insertCount = argumentsLength - 2;
- actualDeleteCount = min(max(toInteger(deleteCount), 0), len - actualStart);
- }
- if (len + insertCount - actualDeleteCount > MAX_SAFE_INTEGER) {
- throw TypeError(MAXIMUM_ALLOWED_LENGTH_EXCEEDED);
- }
- A = arraySpeciesCreate(O, actualDeleteCount);
- for (k = 0; k < actualDeleteCount; k++) {
- from = actualStart + k;
- if (from in O) createProperty(A, k, O[from]);
- }
- A.length = actualDeleteCount;
- if (insertCount < actualDeleteCount) {
- for (k = actualStart; k < len - actualDeleteCount; k++) {
- from = k + actualDeleteCount;
- to = k + insertCount;
- if (from in O) O[to] = O[from];
- else delete O[to];
- }
- for (k = len; k > len - actualDeleteCount + insertCount; k--) delete O[k - 1];
- } else if (insertCount > actualDeleteCount) {
- for (k = len - actualDeleteCount; k > actualStart; k--) {
- from = k + actualDeleteCount - 1;
- to = k + insertCount - 1;
- if (from in O) O[to] = O[from];
- else delete O[to];
- }
- }
- for (k = 0; k < insertCount; k++) {
- O[k + actualStart] = arguments[k + 2];
- }
- O.length = len - actualDeleteCount + insertCount;
- return A;
- }
- });
- /***/ }),
- /***/ "a4d3":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var $ = __webpack_require__("23e7");
- var global = __webpack_require__("da84");
- var getBuiltIn = __webpack_require__("d066");
- var IS_PURE = __webpack_require__("c430");
- var DESCRIPTORS = __webpack_require__("83ab");
- var NATIVE_SYMBOL = __webpack_require__("4930");
- var USE_SYMBOL_AS_UID = __webpack_require__("fdbf");
- var fails = __webpack_require__("d039");
- var has = __webpack_require__("5135");
- var isArray = __webpack_require__("e8b5");
- var isObject = __webpack_require__("861d");
- var anObject = __webpack_require__("825a");
- var toObject = __webpack_require__("7b0b");
- var toIndexedObject = __webpack_require__("fc6a");
- var toPrimitive = __webpack_require__("c04e");
- var createPropertyDescriptor = __webpack_require__("5c6c");
- var nativeObjectCreate = __webpack_require__("7c73");
- var objectKeys = __webpack_require__("df75");
- var getOwnPropertyNamesModule = __webpack_require__("241c");
- var getOwnPropertyNamesExternal = __webpack_require__("057f");
- var getOwnPropertySymbolsModule = __webpack_require__("7418");
- var getOwnPropertyDescriptorModule = __webpack_require__("06cf");
- var definePropertyModule = __webpack_require__("9bf2");
- var propertyIsEnumerableModule = __webpack_require__("d1e7");
- var createNonEnumerableProperty = __webpack_require__("9112");
- var redefine = __webpack_require__("6eeb");
- var shared = __webpack_require__("5692");
- var sharedKey = __webpack_require__("f772");
- var hiddenKeys = __webpack_require__("d012");
- var uid = __webpack_require__("90e3");
- var wellKnownSymbol = __webpack_require__("b622");
- var wrappedWellKnownSymbolModule = __webpack_require__("e538");
- var defineWellKnownSymbol = __webpack_require__("746f");
- var setToStringTag = __webpack_require__("d44e");
- var InternalStateModule = __webpack_require__("69f3");
- var $forEach = __webpack_require__("b727").forEach;
- var HIDDEN = sharedKey('hidden');
- var SYMBOL = 'Symbol';
- var PROTOTYPE = 'prototype';
- var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
- var setInternalState = InternalStateModule.set;
- var getInternalState = InternalStateModule.getterFor(SYMBOL);
- var ObjectPrototype = Object[PROTOTYPE];
- var $Symbol = global.Symbol;
- var $stringify = getBuiltIn('JSON', 'stringify');
- var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
- var nativeDefineProperty = definePropertyModule.f;
- var nativeGetOwnPropertyNames = getOwnPropertyNamesExternal.f;
- var nativePropertyIsEnumerable = propertyIsEnumerableModule.f;
- var AllSymbols = shared('symbols');
- var ObjectPrototypeSymbols = shared('op-symbols');
- var StringToSymbolRegistry = shared('string-to-symbol-registry');
- var SymbolToStringRegistry = shared('symbol-to-string-registry');
- var WellKnownSymbolsStore = shared('wks');
- var QObject = global.QObject;
- // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
- var USE_SETTER = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
- // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
- var setSymbolDescriptor = DESCRIPTORS && fails(function () {
- return nativeObjectCreate(nativeDefineProperty({}, 'a', {
- get: function () { return nativeDefineProperty(this, 'a', { value: 7 }).a; }
- })).a != 7;
- }) ? function (O, P, Attributes) {
- var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor(ObjectPrototype, P);
- if (ObjectPrototypeDescriptor) delete ObjectPrototype[P];
- nativeDefineProperty(O, P, Attributes);
- if (ObjectPrototypeDescriptor && O !== ObjectPrototype) {
- nativeDefineProperty(ObjectPrototype, P, ObjectPrototypeDescriptor);
- }
- } : nativeDefineProperty;
- var wrap = function (tag, description) {
- var symbol = AllSymbols[tag] = nativeObjectCreate($Symbol[PROTOTYPE]);
- setInternalState(symbol, {
- type: SYMBOL,
- tag: tag,
- description: description
- });
- if (!DESCRIPTORS) symbol.description = description;
- return symbol;
- };
- var isSymbol = USE_SYMBOL_AS_UID ? function (it) {
- return typeof it == 'symbol';
- } : function (it) {
- return Object(it) instanceof $Symbol;
- };
- var $defineProperty = function defineProperty(O, P, Attributes) {
- if (O === ObjectPrototype) $defineProperty(ObjectPrototypeSymbols, P, Attributes);
- anObject(O);
- var key = toPrimitive(P, true);
- anObject(Attributes);
- if (has(AllSymbols, key)) {
- if (!Attributes.enumerable) {
- if (!has(O, HIDDEN)) nativeDefineProperty(O, HIDDEN, createPropertyDescriptor(1, {}));
- O[HIDDEN][key] = true;
- } else {
- if (has(O, HIDDEN) && O[HIDDEN][key]) O[HIDDEN][key] = false;
- Attributes = nativeObjectCreate(Attributes, { enumerable: createPropertyDescriptor(0, false) });
- } return setSymbolDescriptor(O, key, Attributes);
- } return nativeDefineProperty(O, key, Attributes);
- };
- var $defineProperties = function defineProperties(O, Properties) {
- anObject(O);
- var properties = toIndexedObject(Properties);
- var keys = objectKeys(properties).concat($getOwnPropertySymbols(properties));
- $forEach(keys, function (key) {
- if (!DESCRIPTORS || $propertyIsEnumerable.call(properties, key)) $defineProperty(O, key, properties[key]);
- });
- return O;
- };
- var $create = function create(O, Properties) {
- return Properties === undefined ? nativeObjectCreate(O) : $defineProperties(nativeObjectCreate(O), Properties);
- };
- var $propertyIsEnumerable = function propertyIsEnumerable(V) {
- var P = toPrimitive(V, true);
- var enumerable = nativePropertyIsEnumerable.call(this, P);
- if (this === ObjectPrototype && has(AllSymbols, P) && !has(ObjectPrototypeSymbols, P)) return false;
- return enumerable || !has(this, P) || !has(AllSymbols, P) || has(this, HIDDEN) && this[HIDDEN][P] ? enumerable : true;
- };
- var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(O, P) {
- var it = toIndexedObject(O);
- var key = toPrimitive(P, true);
- if (it === ObjectPrototype && has(AllSymbols, key) && !has(ObjectPrototypeSymbols, key)) return;
- var descriptor = nativeGetOwnPropertyDescriptor(it, key);
- if (descriptor && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) {
- descriptor.enumerable = true;
- }
- return descriptor;
- };
- var $getOwnPropertyNames = function getOwnPropertyNames(O) {
- var names = nativeGetOwnPropertyNames(toIndexedObject(O));
- var result = [];
- $forEach(names, function (key) {
- if (!has(AllSymbols, key) && !has(hiddenKeys, key)) result.push(key);
- });
- return result;
- };
- var $getOwnPropertySymbols = function getOwnPropertySymbols(O) {
- var IS_OBJECT_PROTOTYPE = O === ObjectPrototype;
- var names = nativeGetOwnPropertyNames(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject(O));
- var result = [];
- $forEach(names, function (key) {
- if (has(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || has(ObjectPrototype, key))) {
- result.push(AllSymbols[key]);
- }
- });
- return result;
- };
- // `Symbol` constructor
- // https://tc39.github.io/ecma262/#sec-symbol-constructor
- if (!NATIVE_SYMBOL) {
- $Symbol = function Symbol() {
- if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor');
- var description = !arguments.length || arguments[0] === undefined ? undefined : String(arguments[0]);
- var tag = uid(description);
- var setter = function (value) {
- if (this === ObjectPrototype) setter.call(ObjectPrototypeSymbols, value);
- if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
- setSymbolDescriptor(this, tag, createPropertyDescriptor(1, value));
- };
- if (DESCRIPTORS && USE_SETTER) setSymbolDescriptor(ObjectPrototype, tag, { configurable: true, set: setter });
- return wrap(tag, description);
- };
- redefine($Symbol[PROTOTYPE], 'toString', function toString() {
- return getInternalState(this).tag;
- });
- redefine($Symbol, 'withoutSetter', function (description) {
- return wrap(uid(description), description);
- });
- propertyIsEnumerableModule.f = $propertyIsEnumerable;
- definePropertyModule.f = $defineProperty;
- getOwnPropertyDescriptorModule.f = $getOwnPropertyDescriptor;
- getOwnPropertyNamesModule.f = getOwnPropertyNamesExternal.f = $getOwnPropertyNames;
- getOwnPropertySymbolsModule.f = $getOwnPropertySymbols;
- wrappedWellKnownSymbolModule.f = function (name) {
- return wrap(wellKnownSymbol(name), name);
- };
- if (DESCRIPTORS) {
- // https://github.com/tc39/proposal-Symbol-description
- nativeDefineProperty($Symbol[PROTOTYPE], 'description', {
- configurable: true,
- get: function description() {
- return getInternalState(this).description;
- }
- });
- if (!IS_PURE) {
- redefine(ObjectPrototype, 'propertyIsEnumerable', $propertyIsEnumerable, { unsafe: true });
- }
- }
- }
- $({ global: true, wrap: true, forced: !NATIVE_SYMBOL, sham: !NATIVE_SYMBOL }, {
- Symbol: $Symbol
- });
- $forEach(objectKeys(WellKnownSymbolsStore), function (name) {
- defineWellKnownSymbol(name);
- });
- $({ target: SYMBOL, stat: true, forced: !NATIVE_SYMBOL }, {
- // `Symbol.for` method
- // https://tc39.github.io/ecma262/#sec-symbol.for
- 'for': function (key) {
- var string = String(key);
- if (has(StringToSymbolRegistry, string)) return StringToSymbolRegistry[string];
- var symbol = $Symbol(string);
- StringToSymbolRegistry[string] = symbol;
- SymbolToStringRegistry[symbol] = string;
- return symbol;
- },
- // `Symbol.keyFor` method
- // https://tc39.github.io/ecma262/#sec-symbol.keyfor
- keyFor: function keyFor(sym) {
- if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol');
- if (has(SymbolToStringRegistry, sym)) return SymbolToStringRegistry[sym];
- },
- useSetter: function () { USE_SETTER = true; },
- useSimple: function () { USE_SETTER = false; }
- });
- $({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL, sham: !DESCRIPTORS }, {
- // `Object.create` method
- // https://tc39.github.io/ecma262/#sec-object.create
- create: $create,
- // `Object.defineProperty` method
- // https://tc39.github.io/ecma262/#sec-object.defineproperty
- defineProperty: $defineProperty,
- // `Object.defineProperties` method
- // https://tc39.github.io/ecma262/#sec-object.defineproperties
- defineProperties: $defineProperties,
- // `Object.getOwnPropertyDescriptor` method
- // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptors
- getOwnPropertyDescriptor: $getOwnPropertyDescriptor
- });
- $({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL }, {
- // `Object.getOwnPropertyNames` method
- // https://tc39.github.io/ecma262/#sec-object.getownpropertynames
- getOwnPropertyNames: $getOwnPropertyNames,
- // `Object.getOwnPropertySymbols` method
- // https://tc39.github.io/ecma262/#sec-object.getownpropertysymbols
- getOwnPropertySymbols: $getOwnPropertySymbols
- });
- // Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives
- // https://bugs.chromium.org/p/v8/issues/detail?id=3443
- $({ target: 'Object', stat: true, forced: fails(function () { getOwnPropertySymbolsModule.f(1); }) }, {
- getOwnPropertySymbols: function getOwnPropertySymbols(it) {
- return getOwnPropertySymbolsModule.f(toObject(it));
- }
- });
- // `JSON.stringify` method behavior with symbols
- // https://tc39.github.io/ecma262/#sec-json.stringify
- if ($stringify) {
- var FORCED_JSON_STRINGIFY = !NATIVE_SYMBOL || fails(function () {
- var symbol = $Symbol();
- // MS Edge converts symbol values to JSON as {}
- return $stringify([symbol]) != '[null]'
- // WebKit converts symbol values to JSON as null
- || $stringify({ a: symbol }) != '{}'
- // V8 throws on boxed symbols
- || $stringify(Object(symbol)) != '{}';
- });
- $({ target: 'JSON', stat: true, forced: FORCED_JSON_STRINGIFY }, {
- // eslint-disable-next-line no-unused-vars
- stringify: function stringify(it, replacer, space) {
- var args = [it];
- var index = 1;
- var $replacer;
- while (arguments.length > index) args.push(arguments[index++]);
- $replacer = replacer;
- if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined
- if (!isArray(replacer)) replacer = function (key, value) {
- if (typeof $replacer == 'function') value = $replacer.call(this, key, value);
- if (!isSymbol(value)) return value;
- };
- args[1] = replacer;
- return $stringify.apply(null, args);
- }
- });
- }
- // `Symbol.prototype[@@toPrimitive]` method
- // https://tc39.github.io/ecma262/#sec-symbol.prototype-@@toprimitive
- if (!$Symbol[PROTOTYPE][TO_PRIMITIVE]) {
- createNonEnumerableProperty($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);
- }
- // `Symbol.prototype[@@toStringTag]` property
- // https://tc39.github.io/ecma262/#sec-symbol.prototype-@@tostringtag
- setToStringTag($Symbol, SYMBOL);
- hiddenKeys[HIDDEN] = true;
- /***/ }),
- /***/ "a623":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var $ = __webpack_require__("23e7");
- var $every = __webpack_require__("b727").every;
- var arrayMethodIsStrict = __webpack_require__("a640");
- var arrayMethodUsesToLength = __webpack_require__("ae40");
- var STRICT_METHOD = arrayMethodIsStrict('every');
- var USES_TO_LENGTH = arrayMethodUsesToLength('every');
- // `Array.prototype.every` method
- // https://tc39.github.io/ecma262/#sec-array.prototype.every
- $({ target: 'Array', proto: true, forced: !STRICT_METHOD || !USES_TO_LENGTH }, {
- every: function every(callbackfn /* , thisArg */) {
- return $every(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
- }
- });
- /***/ }),
- /***/ "a630":
- /***/ (function(module, exports, __webpack_require__) {
- var $ = __webpack_require__("23e7");
- var from = __webpack_require__("4df4");
- var checkCorrectnessOfIteration = __webpack_require__("1c7e");
- var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function (iterable) {
- Array.from(iterable);
- });
- // `Array.from` method
- // https://tc39.github.io/ecma262/#sec-array.from
- $({ target: 'Array', stat: true, forced: INCORRECT_ITERATION }, {
- from: from
- });
- /***/ }),
- /***/ "a640":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var fails = __webpack_require__("d039");
- module.exports = function (METHOD_NAME, argument) {
- var method = [][METHOD_NAME];
- return !!method && fails(function () {
- // eslint-disable-next-line no-useless-call,no-throw-literal
- method.call(null, argument || function () { throw 1; }, 1);
- });
- };
- /***/ }),
- /***/ "a691":
- /***/ (function(module, exports) {
- var ceil = Math.ceil;
- var floor = Math.floor;
- // `ToInteger` abstract operation
- // https://tc39.github.io/ecma262/#sec-tointeger
- module.exports = function (argument) {
- return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);
- };
- /***/ }),
- /***/ "a9e3":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var DESCRIPTORS = __webpack_require__("83ab");
- var global = __webpack_require__("da84");
- var isForced = __webpack_require__("94ca");
- var redefine = __webpack_require__("6eeb");
- var has = __webpack_require__("5135");
- var classof = __webpack_require__("c6b6");
- var inheritIfRequired = __webpack_require__("7156");
- var toPrimitive = __webpack_require__("c04e");
- var fails = __webpack_require__("d039");
- var create = __webpack_require__("7c73");
- var getOwnPropertyNames = __webpack_require__("241c").f;
- var getOwnPropertyDescriptor = __webpack_require__("06cf").f;
- var defineProperty = __webpack_require__("9bf2").f;
- var trim = __webpack_require__("58a8").trim;
- var NUMBER = 'Number';
- var NativeNumber = global[NUMBER];
- var NumberPrototype = NativeNumber.prototype;
- // Opera ~12 has broken Object#toString
- var BROKEN_CLASSOF = classof(create(NumberPrototype)) == NUMBER;
- // `ToNumber` abstract operation
- // https://tc39.github.io/ecma262/#sec-tonumber
- var toNumber = function (argument) {
- var it = toPrimitive(argument, false);
- var first, third, radix, maxCode, digits, length, index, code;
- if (typeof it == 'string' && it.length > 2) {
- it = trim(it);
- first = it.charCodeAt(0);
- if (first === 43 || first === 45) {
- third = it.charCodeAt(2);
- if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix
- } else if (first === 48) {
- switch (it.charCodeAt(1)) {
- case 66: case 98: radix = 2; maxCode = 49; break; // fast equal of /^0b[01]+$/i
- case 79: case 111: radix = 8; maxCode = 55; break; // fast equal of /^0o[0-7]+$/i
- default: return +it;
- }
- digits = it.slice(2);
- length = digits.length;
- for (index = 0; index < length; index++) {
- code = digits.charCodeAt(index);
- // parseInt parses a string to a first unavailable symbol
- // but ToNumber should return NaN if a string contains unavailable symbols
- if (code < 48 || code > maxCode) return NaN;
- } return parseInt(digits, radix);
- }
- } return +it;
- };
- // `Number` constructor
- // https://tc39.github.io/ecma262/#sec-number-constructor
- if (isForced(NUMBER, !NativeNumber(' 0o1') || !NativeNumber('0b1') || NativeNumber('+0x1'))) {
- var NumberWrapper = function Number(value) {
- var it = arguments.length < 1 ? 0 : value;
- var dummy = this;
- return dummy instanceof NumberWrapper
- // check on 1..constructor(foo) case
- && (BROKEN_CLASSOF ? fails(function () { NumberPrototype.valueOf.call(dummy); }) : classof(dummy) != NUMBER)
- ? inheritIfRequired(new NativeNumber(toNumber(it)), dummy, NumberWrapper) : toNumber(it);
- };
- for (var keys = DESCRIPTORS ? getOwnPropertyNames(NativeNumber) : (
- // ES3:
- 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' +
- // ES2015 (in case, if modules with ES2015 Number statics required before):
- 'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' +
- 'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger,' +
- // ESNext
- 'fromString,range'
- ).split(','), j = 0, key; keys.length > j; j++) {
- if (has(NativeNumber, key = keys[j]) && !has(NumberWrapper, key)) {
- defineProperty(NumberWrapper, key, getOwnPropertyDescriptor(NativeNumber, key));
- }
- }
- NumberWrapper.prototype = NumberPrototype;
- NumberPrototype.constructor = NumberWrapper;
- redefine(global, NUMBER, NumberWrapper);
- }
- /***/ }),
- /***/ "ab13":
- /***/ (function(module, exports, __webpack_require__) {
- var wellKnownSymbol = __webpack_require__("b622");
- var MATCH = wellKnownSymbol('match');
- module.exports = function (METHOD_NAME) {
- var regexp = /./;
- try {
- '/./'[METHOD_NAME](regexp);
- } catch (error1) {
- try {
- regexp[MATCH] = false;
- return '/./'[METHOD_NAME](regexp);
- } catch (error2) { /* empty */ }
- } return false;
- };
- /***/ }),
- /***/ "ac1f":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var $ = __webpack_require__("23e7");
- var exec = __webpack_require__("9263");
- $({ target: 'RegExp', proto: true, forced: /./.exec !== exec }, {
- exec: exec
- });
- /***/ }),
- /***/ "ad6d":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var anObject = __webpack_require__("825a");
- // `RegExp.prototype.flags` getter implementation
- // https://tc39.github.io/ecma262/#sec-get-regexp.prototype.flags
- module.exports = function () {
- var that = anObject(this);
- var result = '';
- if (that.global) result += 'g';
- if (that.ignoreCase) result += 'i';
- if (that.multiline) result += 'm';
- if (that.dotAll) result += 's';
- if (that.unicode) result += 'u';
- if (that.sticky) result += 'y';
- return result;
- };
- /***/ }),
- /***/ "ae40":
- /***/ (function(module, exports, __webpack_require__) {
- var DESCRIPTORS = __webpack_require__("83ab");
- var fails = __webpack_require__("d039");
- var has = __webpack_require__("5135");
- var defineProperty = Object.defineProperty;
- var cache = {};
- var thrower = function (it) { throw it; };
- module.exports = function (METHOD_NAME, options) {
- if (has(cache, METHOD_NAME)) return cache[METHOD_NAME];
- if (!options) options = {};
- var method = [][METHOD_NAME];
- var ACCESSORS = has(options, 'ACCESSORS') ? options.ACCESSORS : false;
- var argument0 = has(options, 0) ? options[0] : thrower;
- var argument1 = has(options, 1) ? options[1] : undefined;
- return cache[METHOD_NAME] = !!method && !fails(function () {
- if (ACCESSORS && !DESCRIPTORS) return true;
- var O = { length: -1 };
- if (ACCESSORS) defineProperty(O, 1, { enumerable: true, get: thrower });
- else O[1] = 1;
- method.call(O, argument0, argument1);
- });
- };
- /***/ }),
- /***/ "ae93":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var getPrototypeOf = __webpack_require__("e163");
- var createNonEnumerableProperty = __webpack_require__("9112");
- var has = __webpack_require__("5135");
- var wellKnownSymbol = __webpack_require__("b622");
- var IS_PURE = __webpack_require__("c430");
- var ITERATOR = wellKnownSymbol('iterator');
- var BUGGY_SAFARI_ITERATORS = false;
- var returnThis = function () { return this; };
- // `%IteratorPrototype%` object
- // https://tc39.github.io/ecma262/#sec-%iteratorprototype%-object
- var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;
- if ([].keys) {
- arrayIterator = [].keys();
- // Safari 8 has buggy iterators w/o `next`
- if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;
- else {
- PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator));
- if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;
- }
- }
- if (IteratorPrototype == undefined) IteratorPrototype = {};
- // 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
- if (!IS_PURE && !has(IteratorPrototype, ITERATOR)) {
- createNonEnumerableProperty(IteratorPrototype, ITERATOR, returnThis);
- }
- module.exports = {
- IteratorPrototype: IteratorPrototype,
- BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS
- };
- /***/ }),
- /***/ "af03":
- /***/ (function(module, exports, __webpack_require__) {
- var fails = __webpack_require__("d039");
- // check the existence of a method, lowercase
- // of a tag and escaping quotes in arguments
- module.exports = function (METHOD_NAME) {
- return fails(function () {
- var test = ''[METHOD_NAME]('"');
- return test !== test.toLowerCase() || test.split('"').length > 3;
- });
- };
- /***/ }),
- /***/ "b041":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var TO_STRING_TAG_SUPPORT = __webpack_require__("00ee");
- var classof = __webpack_require__("f5df");
- // `Object.prototype.toString` method implementation
- // https://tc39.github.io/ecma262/#sec-object.prototype.tostring
- module.exports = TO_STRING_TAG_SUPPORT ? {}.toString : function toString() {
- return '[object ' + classof(this) + ']';
- };
- /***/ }),
- /***/ "b0c0":
- /***/ (function(module, exports, __webpack_require__) {
- var DESCRIPTORS = __webpack_require__("83ab");
- var defineProperty = __webpack_require__("9bf2").f;
- var FunctionPrototype = Function.prototype;
- var FunctionPrototypeToString = FunctionPrototype.toString;
- var nameRE = /^\s*function ([^ (]*)/;
- var NAME = 'name';
- // Function instances `.name` property
- // https://tc39.github.io/ecma262/#sec-function-instances-name
- if (DESCRIPTORS && !(NAME in FunctionPrototype)) {
- defineProperty(FunctionPrototype, NAME, {
- configurable: true,
- get: function () {
- try {
- return FunctionPrototypeToString.call(this).match(nameRE)[1];
- } catch (error) {
- return '';
- }
- }
- });
- }
- /***/ }),
- /***/ "b622":
- /***/ (function(module, exports, __webpack_require__) {
- var global = __webpack_require__("da84");
- var shared = __webpack_require__("5692");
- var has = __webpack_require__("5135");
- var uid = __webpack_require__("90e3");
- var NATIVE_SYMBOL = __webpack_require__("4930");
- var USE_SYMBOL_AS_UID = __webpack_require__("fdbf");
- var WellKnownSymbolsStore = shared('wks');
- var Symbol = global.Symbol;
- var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol : Symbol && Symbol.withoutSetter || uid;
- module.exports = function (name) {
- if (!has(WellKnownSymbolsStore, name)) {
- if (NATIVE_SYMBOL && has(Symbol, name)) WellKnownSymbolsStore[name] = Symbol[name];
- else WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);
- } return WellKnownSymbolsStore[name];
- };
- /***/ }),
- /***/ "b64b":
- /***/ (function(module, exports, __webpack_require__) {
- var $ = __webpack_require__("23e7");
- var toObject = __webpack_require__("7b0b");
- var nativeKeys = __webpack_require__("df75");
- var fails = __webpack_require__("d039");
- var FAILS_ON_PRIMITIVES = fails(function () { nativeKeys(1); });
- // `Object.keys` method
- // https://tc39.github.io/ecma262/#sec-object.keys
- $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {
- keys: function keys(it) {
- return nativeKeys(toObject(it));
- }
- });
- /***/ }),
- /***/ "b680":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var $ = __webpack_require__("23e7");
- var toInteger = __webpack_require__("a691");
- var thisNumberValue = __webpack_require__("408a");
- var repeat = __webpack_require__("1148");
- var fails = __webpack_require__("d039");
- var nativeToFixed = 1.0.toFixed;
- var floor = Math.floor;
- var pow = function (x, n, acc) {
- return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc);
- };
- var log = function (x) {
- var n = 0;
- var x2 = x;
- while (x2 >= 4096) {
- n += 12;
- x2 /= 4096;
- }
- while (x2 >= 2) {
- n += 1;
- x2 /= 2;
- } return n;
- };
- var FORCED = nativeToFixed && (
- 0.00008.toFixed(3) !== '0.000' ||
- 0.9.toFixed(0) !== '1' ||
- 1.255.toFixed(2) !== '1.25' ||
- 1000000000000000128.0.toFixed(0) !== '1000000000000000128'
- ) || !fails(function () {
- // V8 ~ Android 4.3-
- nativeToFixed.call({});
- });
- // `Number.prototype.toFixed` method
- // https://tc39.github.io/ecma262/#sec-number.prototype.tofixed
- $({ target: 'Number', proto: true, forced: FORCED }, {
- // eslint-disable-next-line max-statements
- toFixed: function toFixed(fractionDigits) {
- var number = thisNumberValue(this);
- var fractDigits = toInteger(fractionDigits);
- var data = [0, 0, 0, 0, 0, 0];
- var sign = '';
- var result = '0';
- var e, z, j, k;
- var multiply = function (n, c) {
- var index = -1;
- var c2 = c;
- while (++index < 6) {
- c2 += n * data[index];
- data[index] = c2 % 1e7;
- c2 = floor(c2 / 1e7);
- }
- };
- var divide = function (n) {
- var index = 6;
- var c = 0;
- while (--index >= 0) {
- c += data[index];
- data[index] = floor(c / n);
- c = (c % n) * 1e7;
- }
- };
- var dataToString = function () {
- var index = 6;
- var s = '';
- while (--index >= 0) {
- if (s !== '' || index === 0 || data[index] !== 0) {
- var t = String(data[index]);
- s = s === '' ? t : s + repeat.call('0', 7 - t.length) + t;
- }
- } return s;
- };
- if (fractDigits < 0 || fractDigits > 20) throw RangeError('Incorrect fraction digits');
- // eslint-disable-next-line no-self-compare
- if (number != number) return 'NaN';
- if (number <= -1e21 || number >= 1e21) return String(number);
- if (number < 0) {
- sign = '-';
- number = -number;
- }
- if (number > 1e-21) {
- e = log(number * pow(2, 69, 1)) - 69;
- z = e < 0 ? number * pow(2, -e, 1) : number / pow(2, e, 1);
- z *= 0x10000000000000;
- e = 52 - e;
- if (e > 0) {
- multiply(0, z);
- j = fractDigits;
- while (j >= 7) {
- multiply(1e7, 0);
- j -= 7;
- }
- multiply(pow(10, j, 1), 0);
- j = e - 1;
- while (j >= 23) {
- divide(1 << 23);
- j -= 23;
- }
- divide(1 << j);
- multiply(1, 1);
- divide(2);
- result = dataToString();
- } else {
- multiply(0, z);
- multiply(1 << -e, 0);
- result = dataToString() + repeat.call('0', fractDigits);
- }
- }
- if (fractDigits > 0) {
- k = result.length;
- result = sign + (k <= fractDigits
- ? '0.' + repeat.call('0', fractDigits - k) + result
- : result.slice(0, k - fractDigits) + '.' + result.slice(k - fractDigits));
- } else {
- result = sign + result;
- } return result;
- }
- });
- /***/ }),
- /***/ "b727":
- /***/ (function(module, exports, __webpack_require__) {
- var bind = __webpack_require__("0366");
- var IndexedObject = __webpack_require__("44ad");
- var toObject = __webpack_require__("7b0b");
- var toLength = __webpack_require__("50c4");
- var arraySpeciesCreate = __webpack_require__("65f0");
- var push = [].push;
- // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterOut }` methods implementation
- var createMethod = function (TYPE) {
- var IS_MAP = TYPE == 1;
- var IS_FILTER = TYPE == 2;
- var IS_SOME = TYPE == 3;
- var IS_EVERY = TYPE == 4;
- var IS_FIND_INDEX = TYPE == 6;
- var IS_FILTER_OUT = TYPE == 7;
- var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
- return function ($this, callbackfn, that, specificCreate) {
- var O = toObject($this);
- var self = IndexedObject(O);
- var boundFunction = bind(callbackfn, that, 3);
- var length = toLength(self.length);
- var index = 0;
- var create = specificCreate || arraySpeciesCreate;
- var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_OUT ? create($this, 0) : undefined;
- var value, result;
- for (;length > index; index++) if (NO_HOLES || index in self) {
- value = self[index];
- result = boundFunction(value, index, O);
- if (TYPE) {
- if (IS_MAP) target[index] = result; // map
- else if (result) switch (TYPE) {
- case 3: return true; // some
- case 5: return value; // find
- case 6: return index; // findIndex
- case 2: push.call(target, value); // filter
- } else switch (TYPE) {
- case 4: return false; // every
- case 7: push.call(target, value); // filterOut
- }
- }
- }
- return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
- };
- };
- module.exports = {
- // `Array.prototype.forEach` method
- // https://tc39.github.io/ecma262/#sec-array.prototype.foreach
- forEach: createMethod(0),
- // `Array.prototype.map` method
- // https://tc39.github.io/ecma262/#sec-array.prototype.map
- map: createMethod(1),
- // `Array.prototype.filter` method
- // https://tc39.github.io/ecma262/#sec-array.prototype.filter
- filter: createMethod(2),
- // `Array.prototype.some` method
- // https://tc39.github.io/ecma262/#sec-array.prototype.some
- some: createMethod(3),
- // `Array.prototype.every` method
- // https://tc39.github.io/ecma262/#sec-array.prototype.every
- every: createMethod(4),
- // `Array.prototype.find` method
- // https://tc39.github.io/ecma262/#sec-array.prototype.find
- find: createMethod(5),
- // `Array.prototype.findIndex` method
- // https://tc39.github.io/ecma262/#sec-array.prototype.findIndex
- findIndex: createMethod(6),
- // `Array.prototype.filterOut` method
- // https://github.com/tc39/proposal-array-filtering
- filterOut: createMethod(7)
- };
- /***/ }),
- /***/ "baa5":
- /***/ (function(module, exports, __webpack_require__) {
- var $ = __webpack_require__("23e7");
- var lastIndexOf = __webpack_require__("e58c");
- // `Array.prototype.lastIndexOf` method
- // https://tc39.github.io/ecma262/#sec-array.prototype.lastindexof
- $({ target: 'Array', proto: true, forced: lastIndexOf !== [].lastIndexOf }, {
- lastIndexOf: lastIndexOf
- });
- /***/ }),
- /***/ "bb2f":
- /***/ (function(module, exports, __webpack_require__) {
- var fails = __webpack_require__("d039");
- module.exports = !fails(function () {
- return Object.isExtensible(Object.preventExtensions({}));
- });
- /***/ }),
- /***/ "c04e":
- /***/ (function(module, exports, __webpack_require__) {
- var isObject = __webpack_require__("861d");
- // `ToPrimitive` abstract operation
- // https://tc39.github.io/ecma262/#sec-toprimitive
- // instead of the ES6 spec version, we didn't implement @@toPrimitive case
- // and the second argument - flag - preferred type is a string
- module.exports = function (input, PREFERRED_STRING) {
- if (!isObject(input)) return input;
- var fn, val;
- if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
- if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;
- if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
- throw TypeError("Can't convert object to primitive value");
- };
- /***/ }),
- /***/ "c430":
- /***/ (function(module, exports) {
- module.exports = false;
- /***/ }),
- /***/ "c6b6":
- /***/ (function(module, exports) {
- var toString = {}.toString;
- module.exports = function (it) {
- return toString.call(it).slice(8, -1);
- };
- /***/ }),
- /***/ "c6cd":
- /***/ (function(module, exports, __webpack_require__) {
- var global = __webpack_require__("da84");
- var setGlobal = __webpack_require__("ce4e");
- var SHARED = '__core-js_shared__';
- var store = global[SHARED] || setGlobal(SHARED, {});
- module.exports = store;
- /***/ }),
- /***/ "c7cd":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var $ = __webpack_require__("23e7");
- var createHTML = __webpack_require__("857a");
- var forcedStringHTMLMethod = __webpack_require__("af03");
- // `String.prototype.fixed` method
- // https://tc39.github.io/ecma262/#sec-string.prototype.fixed
- $({ target: 'String', proto: true, forced: forcedStringHTMLMethod('fixed') }, {
- fixed: function fixed() {
- return createHTML(this, 'tt', '', '');
- }
- });
- /***/ }),
- /***/ "c8ba":
- /***/ (function(module, exports) {
- var g;
- // This works in non-strict mode
- g = (function() {
- return this;
- })();
- try {
- // This works if eval is allowed (see CSP)
- g = g || new Function("return this")();
- } catch (e) {
- // This works if the window reference is available
- if (typeof window === "object") g = window;
- }
- // g can still be undefined, but nothing to do about it...
- // We return undefined, instead of nothing here, so it's
- // easier to handle this case. if(!global) { ...}
- module.exports = g;
- /***/ }),
- /***/ "c8d2":
- /***/ (function(module, exports, __webpack_require__) {
- var fails = __webpack_require__("d039");
- var whitespaces = __webpack_require__("5899");
- var non = '\u200B\u0085\u180E';
- // check that a method works with the correct list
- // of whitespaces and has a correct name
- module.exports = function (METHOD_NAME) {
- return fails(function () {
- return !!whitespaces[METHOD_NAME]() || non[METHOD_NAME]() != non || whitespaces[METHOD_NAME].name !== METHOD_NAME;
- });
- };
- /***/ }),
- /***/ "c975":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var $ = __webpack_require__("23e7");
- var $indexOf = __webpack_require__("4d64").indexOf;
- var arrayMethodIsStrict = __webpack_require__("a640");
- var arrayMethodUsesToLength = __webpack_require__("ae40");
- var nativeIndexOf = [].indexOf;
- var NEGATIVE_ZERO = !!nativeIndexOf && 1 / [1].indexOf(1, -0) < 0;
- var STRICT_METHOD = arrayMethodIsStrict('indexOf');
- var USES_TO_LENGTH = arrayMethodUsesToLength('indexOf', { ACCESSORS: true, 1: 0 });
- // `Array.prototype.indexOf` method
- // https://tc39.github.io/ecma262/#sec-array.prototype.indexof
- $({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD || !USES_TO_LENGTH }, {
- indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
- return NEGATIVE_ZERO
- // convert -0 to +0
- ? nativeIndexOf.apply(this, arguments) || 0
- : $indexOf(this, searchElement, arguments.length > 1 ? arguments[1] : undefined);
- }
- });
- /***/ }),
- /***/ "ca84":
- /***/ (function(module, exports, __webpack_require__) {
- var has = __webpack_require__("5135");
- var toIndexedObject = __webpack_require__("fc6a");
- var indexOf = __webpack_require__("4d64").indexOf;
- var hiddenKeys = __webpack_require__("d012");
- module.exports = function (object, names) {
- var O = toIndexedObject(object);
- var i = 0;
- var result = [];
- var key;
- for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key);
- // Don't enum bug & hidden keys
- while (names.length > i) if (has(O, key = names[i++])) {
- ~indexOf(result, key) || result.push(key);
- }
- return result;
- };
- /***/ }),
- /***/ "caad":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var $ = __webpack_require__("23e7");
- var $includes = __webpack_require__("4d64").includes;
- var addToUnscopables = __webpack_require__("44d2");
- var arrayMethodUsesToLength = __webpack_require__("ae40");
- var USES_TO_LENGTH = arrayMethodUsesToLength('indexOf', { ACCESSORS: true, 1: 0 });
- // `Array.prototype.includes` method
- // https://tc39.github.io/ecma262/#sec-array.prototype.includes
- $({ target: 'Array', proto: true, forced: !USES_TO_LENGTH }, {
- includes: function includes(el /* , fromIndex = 0 */) {
- return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
- }
- });
- // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
- addToUnscopables('includes');
- /***/ }),
- /***/ "cc12":
- /***/ (function(module, exports, __webpack_require__) {
- var global = __webpack_require__("da84");
- var isObject = __webpack_require__("861d");
- var document = global.document;
- // typeof document.createElement is 'object' in old IE
- var EXISTS = isObject(document) && isObject(document.createElement);
- module.exports = function (it) {
- return EXISTS ? document.createElement(it) : {};
- };
- /***/ }),
- /***/ "ce4e":
- /***/ (function(module, exports, __webpack_require__) {
- var global = __webpack_require__("da84");
- var createNonEnumerableProperty = __webpack_require__("9112");
- module.exports = function (key, value) {
- try {
- createNonEnumerableProperty(global, key, value);
- } catch (error) {
- global[key] = value;
- } return value;
- };
- /***/ }),
- /***/ "d012":
- /***/ (function(module, exports) {
- module.exports = {};
- /***/ }),
- /***/ "d039":
- /***/ (function(module, exports) {
- module.exports = function (exec) {
- try {
- return !!exec();
- } catch (error) {
- return true;
- }
- };
- /***/ }),
- /***/ "d066":
- /***/ (function(module, exports, __webpack_require__) {
- var path = __webpack_require__("428f");
- var global = __webpack_require__("da84");
- var aFunction = function (variable) {
- return typeof variable == 'function' ? variable : undefined;
- };
- module.exports = function (namespace, method) {
- return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global[namespace])
- : path[namespace] && path[namespace][method] || global[namespace] && global[namespace][method];
- };
- /***/ }),
- /***/ "d1e7":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var nativePropertyIsEnumerable = {}.propertyIsEnumerable;
- var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
- // Nashorn ~ JDK8 bug
- var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1);
- // `Object.prototype.propertyIsEnumerable` method implementation
- // https://tc39.github.io/ecma262/#sec-object.prototype.propertyisenumerable
- exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
- var descriptor = getOwnPropertyDescriptor(this, V);
- return !!descriptor && descriptor.enumerable;
- } : nativePropertyIsEnumerable;
- /***/ }),
- /***/ "d28b":
- /***/ (function(module, exports, __webpack_require__) {
- var defineWellKnownSymbol = __webpack_require__("746f");
- // `Symbol.iterator` well-known symbol
- // https://tc39.github.io/ecma262/#sec-symbol.iterator
- defineWellKnownSymbol('iterator');
- /***/ }),
- /***/ "d2bb":
- /***/ (function(module, exports, __webpack_require__) {
- var anObject = __webpack_require__("825a");
- var aPossiblePrototype = __webpack_require__("3bbe");
- // `Object.setPrototypeOf` method
- // https://tc39.github.io/ecma262/#sec-object.setprototypeof
- // Works with __proto__ only. Old v8 can't work with null proto objects.
- /* eslint-disable no-proto */
- module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () {
- var CORRECT_SETTER = false;
- var test = {};
- var setter;
- try {
- setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set;
- setter.call(test, []);
- CORRECT_SETTER = test instanceof Array;
- } catch (error) { /* empty */ }
- return function setPrototypeOf(O, proto) {
- anObject(O);
- aPossiblePrototype(proto);
- if (CORRECT_SETTER) setter.call(O, proto);
- else O.__proto__ = proto;
- return O;
- };
- }() : undefined);
- /***/ }),
- /***/ "d3b7":
- /***/ (function(module, exports, __webpack_require__) {
- var TO_STRING_TAG_SUPPORT = __webpack_require__("00ee");
- var redefine = __webpack_require__("6eeb");
- var toString = __webpack_require__("b041");
- // `Object.prototype.toString` method
- // https://tc39.github.io/ecma262/#sec-object.prototype.tostring
- if (!TO_STRING_TAG_SUPPORT) {
- redefine(Object.prototype, 'toString', toString, { unsafe: true });
- }
- /***/ }),
- /***/ "d44e":
- /***/ (function(module, exports, __webpack_require__) {
- var defineProperty = __webpack_require__("9bf2").f;
- var has = __webpack_require__("5135");
- var wellKnownSymbol = __webpack_require__("b622");
- var TO_STRING_TAG = wellKnownSymbol('toStringTag');
- module.exports = function (it, TAG, STATIC) {
- if (it && !has(it = STATIC ? it : it.prototype, TO_STRING_TAG)) {
- defineProperty(it, TO_STRING_TAG, { configurable: true, value: TAG });
- }
- };
- /***/ }),
- /***/ "d58f":
- /***/ (function(module, exports, __webpack_require__) {
- var aFunction = __webpack_require__("1c0b");
- var toObject = __webpack_require__("7b0b");
- var IndexedObject = __webpack_require__("44ad");
- var toLength = __webpack_require__("50c4");
- // `Array.prototype.{ reduce, reduceRight }` methods implementation
- var createMethod = function (IS_RIGHT) {
- return function (that, callbackfn, argumentsLength, memo) {
- aFunction(callbackfn);
- var O = toObject(that);
- var self = IndexedObject(O);
- var length = toLength(O.length);
- var index = IS_RIGHT ? length - 1 : 0;
- var i = IS_RIGHT ? -1 : 1;
- if (argumentsLength < 2) while (true) {
- if (index in self) {
- memo = self[index];
- index += i;
- break;
- }
- index += i;
- if (IS_RIGHT ? index < 0 : length <= index) {
- throw TypeError('Reduce of empty array with no initial value');
- }
- }
- for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {
- memo = callbackfn(memo, self[index], index, O);
- }
- return memo;
- };
- };
- module.exports = {
- // `Array.prototype.reduce` method
- // https://tc39.github.io/ecma262/#sec-array.prototype.reduce
- left: createMethod(false),
- // `Array.prototype.reduceRight` method
- // https://tc39.github.io/ecma262/#sec-array.prototype.reduceright
- right: createMethod(true)
- };
- /***/ }),
- /***/ "d784":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- // TODO: Remove from `core-js@4` since it's moved to entry points
- __webpack_require__("ac1f");
- var redefine = __webpack_require__("6eeb");
- var fails = __webpack_require__("d039");
- var wellKnownSymbol = __webpack_require__("b622");
- var regexpExec = __webpack_require__("9263");
- var createNonEnumerableProperty = __webpack_require__("9112");
- var SPECIES = wellKnownSymbol('species');
- var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
- // #replace needs built-in support for named groups.
- // #match works fine because it just return the exec results, even if it has
- // a "grops" property.
- var re = /./;
- re.exec = function () {
- var result = [];
- result.groups = { a: '7' };
- return result;
- };
- return ''.replace(re, '$<a>') !== '7';
- });
- // IE <= 11 replaces $0 with the whole match, as if it was $&
- // https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
- var REPLACE_KEEPS_$0 = (function () {
- return 'a'.replace(/./, '$0') === '$0';
- })();
- var REPLACE = wellKnownSymbol('replace');
- // Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string
- var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
- if (/./[REPLACE]) {
- return /./[REPLACE]('a', '$0') === '';
- }
- return false;
- })();
- // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
- // Weex JS has frozen built-in prototypes, so use try / catch wrapper
- var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
- var re = /(?:)/;
- var originalExec = re.exec;
- re.exec = function () { return originalExec.apply(this, arguments); };
- var result = 'ab'.split(re);
- return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
- });
- module.exports = function (KEY, length, exec, sham) {
- var SYMBOL = wellKnownSymbol(KEY);
- var DELEGATES_TO_SYMBOL = !fails(function () {
- // String methods call symbol-named RegEp methods
- var O = {};
- O[SYMBOL] = function () { return 7; };
- return ''[KEY](O) != 7;
- });
- var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
- // Symbol-named RegExp methods call .exec
- var execCalled = false;
- var re = /a/;
- if (KEY === 'split') {
- // We can't use real regex here since it causes deoptimization
- // and serious performance degradation in V8
- // https://github.com/zloirock/core-js/issues/306
- re = {};
- // RegExp[@@split] doesn't call the regex's exec method, but first creates
- // a new one. We need to return the patched regex when creating the new one.
- re.constructor = {};
- re.constructor[SPECIES] = function () { return re; };
- re.flags = '';
- re[SYMBOL] = /./[SYMBOL];
- }
- re.exec = function () { execCalled = true; return null; };
- re[SYMBOL]('');
- return !execCalled;
- });
- if (
- !DELEGATES_TO_SYMBOL ||
- !DELEGATES_TO_EXEC ||
- (KEY === 'replace' && !(
- REPLACE_SUPPORTS_NAMED_GROUPS &&
- REPLACE_KEEPS_$0 &&
- !REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE
- )) ||
- (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)
- ) {
- var nativeRegExpMethod = /./[SYMBOL];
- var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
- if (regexp.exec === regexpExec) {
- if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
- // The native String method already delegates to @@method (this
- // polyfilled function), leasing to infinite recursion.
- // We avoid it by directly calling the native @@method method.
- return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };
- }
- return { done: true, value: nativeMethod.call(str, regexp, arg2) };
- }
- return { done: false };
- }, {
- REPLACE_KEEPS_$0: REPLACE_KEEPS_$0,
- REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE: REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE
- });
- var stringMethod = methods[0];
- var regexMethod = methods[1];
- redefine(String.prototype, KEY, stringMethod);
- redefine(RegExp.prototype, SYMBOL, length == 2
- // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)
- // 21.2.5.11 RegExp.prototype[@@split](string, limit)
- ? function (string, arg) { return regexMethod.call(string, this, arg); }
- // 21.2.5.6 RegExp.prototype[@@match](string)
- // 21.2.5.9 RegExp.prototype[@@search](string)
- : function (string) { return regexMethod.call(string, this); }
- );
- }
- if (sham) createNonEnumerableProperty(RegExp.prototype[SYMBOL], 'sham', true);
- };
- /***/ }),
- /***/ "d81d":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var $ = __webpack_require__("23e7");
- var $map = __webpack_require__("b727").map;
- var arrayMethodHasSpeciesSupport = __webpack_require__("1dde");
- var arrayMethodUsesToLength = __webpack_require__("ae40");
- var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('map');
- // FF49- issue
- var USES_TO_LENGTH = arrayMethodUsesToLength('map');
- // `Array.prototype.map` method
- // https://tc39.github.io/ecma262/#sec-array.prototype.map
- // with adding support of @@species
- $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {
- map: function map(callbackfn /* , thisArg */) {
- return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
- }
- });
- /***/ }),
- /***/ "da84":
- /***/ (function(module, exports, __webpack_require__) {
- /* WEBPACK VAR INJECTION */(function(global) {var check = function (it) {
- return it && it.Math == Math && it;
- };
- // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
- module.exports =
- // eslint-disable-next-line no-undef
- check(typeof globalThis == 'object' && globalThis) ||
- check(typeof window == 'object' && window) ||
- check(typeof self == 'object' && self) ||
- check(typeof global == 'object' && global) ||
- // eslint-disable-next-line no-new-func
- (function () { return this; })() || Function('return this')();
- /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("c8ba")))
- /***/ }),
- /***/ "dbb4":
- /***/ (function(module, exports, __webpack_require__) {
- var $ = __webpack_require__("23e7");
- var DESCRIPTORS = __webpack_require__("83ab");
- var ownKeys = __webpack_require__("56ef");
- var toIndexedObject = __webpack_require__("fc6a");
- var getOwnPropertyDescriptorModule = __webpack_require__("06cf");
- var createProperty = __webpack_require__("8418");
- // `Object.getOwnPropertyDescriptors` method
- // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptors
- $({ target: 'Object', stat: true, sham: !DESCRIPTORS }, {
- getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) {
- var O = toIndexedObject(object);
- var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
- var keys = ownKeys(O);
- var result = {};
- var index = 0;
- var key, descriptor;
- while (keys.length > index) {
- descriptor = getOwnPropertyDescriptor(O, key = keys[index++]);
- if (descriptor !== undefined) createProperty(result, key, descriptor);
- }
- return result;
- }
- });
- /***/ }),
- /***/ "ddb0":
- /***/ (function(module, exports, __webpack_require__) {
- var global = __webpack_require__("da84");
- var DOMIterables = __webpack_require__("fdbc");
- var ArrayIteratorMethods = __webpack_require__("e260");
- var createNonEnumerableProperty = __webpack_require__("9112");
- var wellKnownSymbol = __webpack_require__("b622");
- var ITERATOR = wellKnownSymbol('iterator');
- var TO_STRING_TAG = wellKnownSymbol('toStringTag');
- var ArrayValues = ArrayIteratorMethods.values;
- for (var COLLECTION_NAME in DOMIterables) {
- var Collection = global[COLLECTION_NAME];
- var CollectionPrototype = Collection && Collection.prototype;
- if (CollectionPrototype) {
- // some Chrome versions have non-configurable methods on DOMTokenList
- if (CollectionPrototype[ITERATOR] !== ArrayValues) try {
- createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues);
- } catch (error) {
- CollectionPrototype[ITERATOR] = ArrayValues;
- }
- if (!CollectionPrototype[TO_STRING_TAG]) {
- createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME);
- }
- if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {
- // some Chrome versions have non-configurable methods on DOMTokenList
- if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try {
- createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);
- } catch (error) {
- CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];
- }
- }
- }
- }
- /***/ }),
- /***/ "df75":
- /***/ (function(module, exports, __webpack_require__) {
- var internalObjectKeys = __webpack_require__("ca84");
- var enumBugKeys = __webpack_require__("7839");
- // `Object.keys` method
- // https://tc39.github.io/ecma262/#sec-object.keys
- module.exports = Object.keys || function keys(O) {
- return internalObjectKeys(O, enumBugKeys);
- };
- /***/ }),
- /***/ "e01a":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- // `Symbol.prototype.description` getter
- // https://tc39.github.io/ecma262/#sec-symbol.prototype.description
- var $ = __webpack_require__("23e7");
- var DESCRIPTORS = __webpack_require__("83ab");
- var global = __webpack_require__("da84");
- var has = __webpack_require__("5135");
- var isObject = __webpack_require__("861d");
- var defineProperty = __webpack_require__("9bf2").f;
- var copyConstructorProperties = __webpack_require__("e893");
- var NativeSymbol = global.Symbol;
- if (DESCRIPTORS && typeof NativeSymbol == 'function' && (!('description' in NativeSymbol.prototype) ||
- // Safari 12 bug
- NativeSymbol().description !== undefined
- )) {
- var EmptyStringDescriptionStore = {};
- // wrap Symbol constructor for correct work with undefined description
- var SymbolWrapper = function Symbol() {
- var description = arguments.length < 1 || arguments[0] === undefined ? undefined : String(arguments[0]);
- var result = this instanceof SymbolWrapper
- ? new NativeSymbol(description)
- // in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)'
- : description === undefined ? NativeSymbol() : NativeSymbol(description);
- if (description === '') EmptyStringDescriptionStore[result] = true;
- return result;
- };
- copyConstructorProperties(SymbolWrapper, NativeSymbol);
- var symbolPrototype = SymbolWrapper.prototype = NativeSymbol.prototype;
- symbolPrototype.constructor = SymbolWrapper;
- var symbolToString = symbolPrototype.toString;
- var native = String(NativeSymbol('test')) == 'Symbol(test)';
- var regexp = /^Symbol\((.*)\)[^)]+$/;
- defineProperty(symbolPrototype, 'description', {
- configurable: true,
- get: function description() {
- var symbol = isObject(this) ? this.valueOf() : this;
- var string = symbolToString.call(symbol);
- if (has(EmptyStringDescriptionStore, symbol)) return '';
- var desc = native ? string.slice(7, -1) : string.replace(regexp, '$1');
- return desc === '' ? undefined : desc;
- }
- });
- $({ global: true, forced: true }, {
- Symbol: SymbolWrapper
- });
- }
- /***/ }),
- /***/ "e163":
- /***/ (function(module, exports, __webpack_require__) {
- var has = __webpack_require__("5135");
- var toObject = __webpack_require__("7b0b");
- var sharedKey = __webpack_require__("f772");
- var CORRECT_PROTOTYPE_GETTER = __webpack_require__("e177");
- var IE_PROTO = sharedKey('IE_PROTO');
- var ObjectPrototype = Object.prototype;
- // `Object.getPrototypeOf` method
- // https://tc39.github.io/ecma262/#sec-object.getprototypeof
- module.exports = CORRECT_PROTOTYPE_GETTER ? Object.getPrototypeOf : function (O) {
- O = toObject(O);
- if (has(O, IE_PROTO)) return O[IE_PROTO];
- if (typeof O.constructor == 'function' && O instanceof O.constructor) {
- return O.constructor.prototype;
- } return O instanceof Object ? ObjectPrototype : null;
- };
- /***/ }),
- /***/ "e177":
- /***/ (function(module, exports, __webpack_require__) {
- var fails = __webpack_require__("d039");
- module.exports = !fails(function () {
- function F() { /* empty */ }
- F.prototype.constructor = null;
- return Object.getPrototypeOf(new F()) !== F.prototype;
- });
- /***/ }),
- /***/ "e260":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var toIndexedObject = __webpack_require__("fc6a");
- var addToUnscopables = __webpack_require__("44d2");
- var Iterators = __webpack_require__("3f8c");
- var InternalStateModule = __webpack_require__("69f3");
- var defineIterator = __webpack_require__("7dd0");
- var ARRAY_ITERATOR = 'Array Iterator';
- var setInternalState = InternalStateModule.set;
- var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);
- // `Array.prototype.entries` method
- // https://tc39.github.io/ecma262/#sec-array.prototype.entries
- // `Array.prototype.keys` method
- // https://tc39.github.io/ecma262/#sec-array.prototype.keys
- // `Array.prototype.values` method
- // https://tc39.github.io/ecma262/#sec-array.prototype.values
- // `Array.prototype[@@iterator]` method
- // https://tc39.github.io/ecma262/#sec-array.prototype-@@iterator
- // `CreateArrayIterator` internal method
- // https://tc39.github.io/ecma262/#sec-createarrayiterator
- module.exports = defineIterator(Array, 'Array', function (iterated, kind) {
- setInternalState(this, {
- type: ARRAY_ITERATOR,
- target: toIndexedObject(iterated), // target
- index: 0, // next index
- kind: kind // kind
- });
- // `%ArrayIteratorPrototype%.next` method
- // https://tc39.github.io/ecma262/#sec-%arrayiteratorprototype%.next
- }, function () {
- var state = getInternalState(this);
- var target = state.target;
- var kind = state.kind;
- var index = state.index++;
- if (!target || index >= target.length) {
- state.target = undefined;
- return { value: undefined, done: true };
- }
- if (kind == 'keys') return { value: index, done: false };
- if (kind == 'values') return { value: target[index], done: false };
- return { value: [index, target[index]], done: false };
- }, 'values');
- // argumentsList[@@iterator] is %ArrayProto_values%
- // https://tc39.github.io/ecma262/#sec-createunmappedargumentsobject
- // https://tc39.github.io/ecma262/#sec-createmappedargumentsobject
- Iterators.Arguments = Iterators.Array;
- // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
- addToUnscopables('keys');
- addToUnscopables('values');
- addToUnscopables('entries');
- /***/ }),
- /***/ "e2cc":
- /***/ (function(module, exports, __webpack_require__) {
- var redefine = __webpack_require__("6eeb");
- module.exports = function (target, src, options) {
- for (var key in src) redefine(target, key, src[key], options);
- return target;
- };
- /***/ }),
- /***/ "e439":
- /***/ (function(module, exports, __webpack_require__) {
- var $ = __webpack_require__("23e7");
- var fails = __webpack_require__("d039");
- var toIndexedObject = __webpack_require__("fc6a");
- var nativeGetOwnPropertyDescriptor = __webpack_require__("06cf").f;
- var DESCRIPTORS = __webpack_require__("83ab");
- var FAILS_ON_PRIMITIVES = fails(function () { nativeGetOwnPropertyDescriptor(1); });
- var FORCED = !DESCRIPTORS || FAILS_ON_PRIMITIVES;
- // `Object.getOwnPropertyDescriptor` method
- // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor
- $({ target: 'Object', stat: true, forced: FORCED, sham: !DESCRIPTORS }, {
- getOwnPropertyDescriptor: function getOwnPropertyDescriptor(it, key) {
- return nativeGetOwnPropertyDescriptor(toIndexedObject(it), key);
- }
- });
- /***/ }),
- /***/ "e538":
- /***/ (function(module, exports, __webpack_require__) {
- var wellKnownSymbol = __webpack_require__("b622");
- exports.f = wellKnownSymbol;
- /***/ }),
- /***/ "e58c":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var toIndexedObject = __webpack_require__("fc6a");
- var toInteger = __webpack_require__("a691");
- var toLength = __webpack_require__("50c4");
- var arrayMethodIsStrict = __webpack_require__("a640");
- var arrayMethodUsesToLength = __webpack_require__("ae40");
- var min = Math.min;
- var nativeLastIndexOf = [].lastIndexOf;
- var NEGATIVE_ZERO = !!nativeLastIndexOf && 1 / [1].lastIndexOf(1, -0) < 0;
- var STRICT_METHOD = arrayMethodIsStrict('lastIndexOf');
- // For preventing possible almost infinite loop in non-standard implementations, test the forward version of the method
- var USES_TO_LENGTH = arrayMethodUsesToLength('indexOf', { ACCESSORS: true, 1: 0 });
- var FORCED = NEGATIVE_ZERO || !STRICT_METHOD || !USES_TO_LENGTH;
- // `Array.prototype.lastIndexOf` method implementation
- // https://tc39.github.io/ecma262/#sec-array.prototype.lastindexof
- module.exports = FORCED ? function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) {
- // convert -0 to +0
- if (NEGATIVE_ZERO) return nativeLastIndexOf.apply(this, arguments) || 0;
- var O = toIndexedObject(this);
- var length = toLength(O.length);
- var index = length - 1;
- if (arguments.length > 1) index = min(index, toInteger(arguments[1]));
- if (index < 0) index = length + index;
- for (;index >= 0; index--) if (index in O && O[index] === searchElement) return index || 0;
- return -1;
- } : nativeLastIndexOf;
- /***/ }),
- /***/ "e893":
- /***/ (function(module, exports, __webpack_require__) {
- var has = __webpack_require__("5135");
- var ownKeys = __webpack_require__("56ef");
- var getOwnPropertyDescriptorModule = __webpack_require__("06cf");
- var definePropertyModule = __webpack_require__("9bf2");
- module.exports = function (target, source) {
- var keys = ownKeys(source);
- var defineProperty = definePropertyModule.f;
- var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
- for (var i = 0; i < keys.length; i++) {
- var key = keys[i];
- if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
- }
- };
- /***/ }),
- /***/ "e8b5":
- /***/ (function(module, exports, __webpack_require__) {
- var classof = __webpack_require__("c6b6");
- // `IsArray` abstract operation
- // https://tc39.github.io/ecma262/#sec-isarray
- module.exports = Array.isArray || function isArray(arg) {
- return classof(arg) == 'Array';
- };
- /***/ }),
- /***/ "e95a":
- /***/ (function(module, exports, __webpack_require__) {
- var wellKnownSymbol = __webpack_require__("b622");
- var Iterators = __webpack_require__("3f8c");
- var ITERATOR = wellKnownSymbol('iterator');
- var ArrayPrototype = Array.prototype;
- // check on default Array iterator
- module.exports = function (it) {
- return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);
- };
- /***/ }),
- /***/ "f183":
- /***/ (function(module, exports, __webpack_require__) {
- var hiddenKeys = __webpack_require__("d012");
- var isObject = __webpack_require__("861d");
- var has = __webpack_require__("5135");
- var defineProperty = __webpack_require__("9bf2").f;
- var uid = __webpack_require__("90e3");
- var FREEZING = __webpack_require__("bb2f");
- var METADATA = uid('meta');
- var id = 0;
- var isExtensible = Object.isExtensible || function () {
- return true;
- };
- var setMetadata = function (it) {
- defineProperty(it, METADATA, { value: {
- objectID: 'O' + ++id, // object ID
- weakData: {} // weak collections IDs
- } });
- };
- var fastKey = function (it, create) {
- // return a primitive with prefix
- if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
- if (!has(it, METADATA)) {
- // can't set metadata to uncaught frozen object
- if (!isExtensible(it)) return 'F';
- // not necessary to add metadata
- if (!create) return 'E';
- // add missing metadata
- setMetadata(it);
- // return object ID
- } return it[METADATA].objectID;
- };
- var getWeakData = function (it, create) {
- if (!has(it, METADATA)) {
- // can't set metadata to uncaught frozen object
- if (!isExtensible(it)) return true;
- // not necessary to add metadata
- if (!create) return false;
- // add missing metadata
- setMetadata(it);
- // return the store of weak collections IDs
- } return it[METADATA].weakData;
- };
- // add metadata on freeze-family methods calling
- var onFreeze = function (it) {
- if (FREEZING && meta.REQUIRED && isExtensible(it) && !has(it, METADATA)) setMetadata(it);
- return it;
- };
- var meta = module.exports = {
- REQUIRED: false,
- fastKey: fastKey,
- getWeakData: getWeakData,
- onFreeze: onFreeze
- };
- hiddenKeys[METADATA] = true;
- /***/ }),
- /***/ "f5df":
- /***/ (function(module, exports, __webpack_require__) {
- var TO_STRING_TAG_SUPPORT = __webpack_require__("00ee");
- var classofRaw = __webpack_require__("c6b6");
- var wellKnownSymbol = __webpack_require__("b622");
- var TO_STRING_TAG = wellKnownSymbol('toStringTag');
- // ES3 wrong here
- var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
- // fallback for IE11 Script Access Denied error
- var tryGet = function (it, key) {
- try {
- return it[key];
- } catch (error) { /* empty */ }
- };
- // getting tag from ES6+ `Object.prototype.toString`
- module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
- var O, tag, result;
- return it === undefined ? 'Undefined' : it === null ? 'Null'
- // @@toStringTag case
- : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG)) == 'string' ? tag
- // builtinTag case
- : CORRECT_ARGUMENTS ? classofRaw(O)
- // ES3 arguments fallback
- : (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result;
- };
- /***/ }),
- /***/ "f772":
- /***/ (function(module, exports, __webpack_require__) {
- var shared = __webpack_require__("5692");
- var uid = __webpack_require__("90e3");
- var keys = shared('keys');
- module.exports = function (key) {
- return keys[key] || (keys[key] = uid(key));
- };
- /***/ }),
- /***/ "fb15":
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- // ESM COMPAT FLAG
- __webpack_require__.r(__webpack_exports__);
- // EXPORTS
- __webpack_require__.d(__webpack_exports__, "VXETable", function() { return /* reexport */ VXETable; });
- __webpack_require__.d(__webpack_exports__, "Column", function() { return /* reexport */ Column; });
- __webpack_require__.d(__webpack_exports__, "Header", function() { return /* reexport */ Header; });
- __webpack_require__.d(__webpack_exports__, "Body", function() { return /* reexport */ Body; });
- __webpack_require__.d(__webpack_exports__, "Footer", function() { return /* reexport */ Footer; });
- __webpack_require__.d(__webpack_exports__, "Filter", function() { return /* reexport */ Filter; });
- __webpack_require__.d(__webpack_exports__, "Loading", function() { return /* reexport */ Loading; });
- __webpack_require__.d(__webpack_exports__, "Grid", function() { return /* reexport */ Grid; });
- __webpack_require__.d(__webpack_exports__, "Menu", function() { return /* reexport */ Menu; });
- __webpack_require__.d(__webpack_exports__, "Toolbar", function() { return /* reexport */ Toolbar; });
- __webpack_require__.d(__webpack_exports__, "Pager", function() { return /* reexport */ Pager; });
- __webpack_require__.d(__webpack_exports__, "Checkbox", function() { return /* reexport */ Checkbox; });
- __webpack_require__.d(__webpack_exports__, "Radio", function() { return /* reexport */ Radio; });
- __webpack_require__.d(__webpack_exports__, "Input", function() { return /* reexport */ Input; });
- __webpack_require__.d(__webpack_exports__, "Textarea", function() { return /* reexport */ Textarea; });
- __webpack_require__.d(__webpack_exports__, "Button", function() { return /* reexport */ Button; });
- __webpack_require__.d(__webpack_exports__, "ModalController", function() { return /* reexport */ ModalController; });
- __webpack_require__.d(__webpack_exports__, "Modal", function() { return /* reexport */ Modal; });
- __webpack_require__.d(__webpack_exports__, "Tooltip", function() { return /* reexport */ Tooltip; });
- __webpack_require__.d(__webpack_exports__, "Form", function() { return /* reexport */ Form; });
- __webpack_require__.d(__webpack_exports__, "Select", function() { return /* reexport */ Select; });
- __webpack_require__.d(__webpack_exports__, "Switch", function() { return /* reexport */ Switch; });
- __webpack_require__.d(__webpack_exports__, "List", function() { return /* reexport */ List; });
- __webpack_require__.d(__webpack_exports__, "Pulldown", function() { return /* reexport */ Pulldown; });
- __webpack_require__.d(__webpack_exports__, "Edit", function() { return /* reexport */ Edit; });
- __webpack_require__.d(__webpack_exports__, "Export", function() { return /* reexport */ Export; });
- __webpack_require__.d(__webpack_exports__, "Keyboard", function() { return /* reexport */ Keyboard; });
- __webpack_require__.d(__webpack_exports__, "Validator", function() { return /* reexport */ Validator; });
- __webpack_require__.d(__webpack_exports__, "Resize", function() { return /* reexport */ Resize; });
- __webpack_require__.d(__webpack_exports__, "Table", function() { return /* reexport */ Table; });
- // CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js
- // This file is imported into lib/wc client bundles.
- if (typeof window !== 'undefined') {
- var currentScript = window.document.currentScript
- if (true) {
- var getCurrentScript = __webpack_require__("8875")
- currentScript = getCurrentScript()
- // for backward compatibility, because previously we directly included the polyfill
- if (!('currentScript' in document)) {
- Object.defineProperty(document, 'currentScript', { get: getCurrentScript })
- }
- }
- var src = currentScript && currentScript.src.match(/(.+\/)[^/]+\.js(\?.*)?$/)
- if (src) {
- __webpack_require__.p = src[1] // eslint-disable-line
- }
- }
- // Indicate to webpack that this file can be concatenated
- /* harmony default export */ var setPublicPath = (null);
- // EXTERNAL MODULE: ./styles/index.scss
- var styles = __webpack_require__("1a97");
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.map.js
- var es_array_map = __webpack_require__("d81d");
- // EXTERNAL MODULE: external {"root":"XEUtils","commonjs":"xe-utils/ctor","commonjs2":"xe-utils/ctor","amd":"xe-utils"}
- var ctor_amd_xe_utils_ = __webpack_require__("7fd6");
- var ctor_amd_xe_utils_default = /*#__PURE__*/__webpack_require__.n(ctor_amd_xe_utils_);
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.index-of.js
- var es_array_index_of = __webpack_require__("c975");
- // CONCATENATED MODULE: ./packages/conf/index.js
- var iconPrefix = 'vxe-icon--';
- var GlobalConfig = {
- // size: null, // 全局尺寸
- zIndex: 999,
- // 全局 zIndex 起始值,如果项目的的 z-index 样式值过大时就需要跟随设置更大,避免被遮挡
- version: 0,
- // 版本号,对于某些带数据缓存的功能有用到,上升版本号可以用于重置数据
- // resizeInterval: 500,
- emptyCell: ' ',
- table: {
- fit: true,
- showHeader: true,
- animat: true,
- delayHover: 250,
- // keepSource: false,
- // cloak: false,
- // showOverflow: null,
- // showHeaderOverflow: null,
- // showFooterOverflow: null,
- // resizeInterval: 500,
- // size: null,
- // zIndex: null,
- // resizable: false,
- // autoResize: false,
- // stripe: false,
- // border: false,
- // round: false,
- // emptyRender: {
- // name: ''
- // },
- // radioConfig: {
- // trigger: 'default'
- // },
- // checkboxConfig: {
- // trigger: 'default'
- // },
- // tooltipConfig: {
- // theme: 'dark',
- // enterable: false
- // },
- validConfig: {
- showMessage: true,
- message: 'default'
- },
- // menuConfig: {
- // visibleMethod () {}
- // },
- // customConfig: {
- // storage: false,
- // checkMethod () {}
- // },
- // rowId: '_XID', // 行数据的唯一主键字段名
- sortConfig: {
- // remote: false,
- // trigger: 'default',
- // orders: ['asc', 'desc', null],
- // sortMethod: null,
- showIcon: true
- },
- filterConfig: {
- // remote: false,
- // filterMethod: null,
- showIcon: true
- },
- treeConfig: {
- children: 'children',
- hasChild: 'hasChild',
- indent: 20,
- showIcon: true
- },
- keyboardConfig: {
- isChecked: true
- },
- expandConfig: {
- // trigger: 'default',
- showIcon: true
- },
- editConfig: {
- // mode: 'cell',
- showIcon: true,
- showAsterisk: true
- },
- importConfig: {
- modes: ['insert', 'covering']
- },
- exportConfig: {
- // isPrint: false,
- modes: ['current', 'selected']
- },
- mouseConfig: {
- extension: true
- },
- areaConfig: {
- selectCellByHeader: true
- },
- clipConfig: {
- isCopy: true,
- isCut: true,
- isPaste: true
- },
- fnrConfig: {
- isFind: true,
- isReplace: true
- },
- scrollX: {
- enabled: true,
- gt: 60 // oSize: 0,
- // rSize: 0
- // vSize: 0
- },
- scrollY: {
- enabled: true,
- gt: 100 // oSize: 0,
- // rSize: 0
- // vSize: 0,
- // rHeight: 0
- }
- },
- export: {
- types: {}
- },
- icon: {
- // table
- TABLE_SORT_ASC: iconPrefix + 'caret-top',
- TABLE_SORT_DESC: iconPrefix + 'caret-bottom',
- TABLE_FILTER_NONE: iconPrefix + 'funnel',
- TABLE_FILTER_MATCH: iconPrefix + 'funnel',
- TABLE_EDIT: iconPrefix + 'edit-outline',
- TABLE_HELP: iconPrefix + 'question',
- TABLE_TREE_LOADED: iconPrefix + 'refresh roll',
- TABLE_TREE_OPEN: iconPrefix + 'caret-right rotate90',
- TABLE_TREE_CLOSE: iconPrefix + 'caret-right',
- TABLE_EXPAND_LOADED: iconPrefix + 'refresh roll',
- TABLE_EXPAND_OPEN: iconPrefix + 'arrow-right rotate90',
- TABLE_EXPAND_CLOSE: iconPrefix + 'arrow-right',
- // button
- BUTTON_DROPDOWN: iconPrefix + 'arrow-bottom',
- BUTTON_LOADING: iconPrefix + 'refresh roll',
- // select
- SELECT_LOADED: iconPrefix + 'refresh roll',
- SELECT_OPEN: iconPrefix + 'caret-bottom rotate180',
- SELECT_CLOSE: iconPrefix + 'caret-bottom',
- // pager
- PAGER_JUMP_PREV: iconPrefix + 'd-arrow-left',
- PAGER_JUMP_NEXT: iconPrefix + 'd-arrow-right',
- PAGER_PREV_PAGE: iconPrefix + 'arrow-left',
- PAGER_NEXT_PAGE: iconPrefix + 'arrow-right',
- PAGER_JUMP_MORE: iconPrefix + 'more',
- // input
- INPUT_CLEAR: iconPrefix + 'close',
- INPUT_PWD: iconPrefix + 'eye-slash',
- INPUT_SHOW_PWD: iconPrefix + 'eye',
- INPUT_PREV_NUM: iconPrefix + 'caret-top',
- INPUT_NEXT_NUM: iconPrefix + 'caret-bottom',
- INPUT_DATE: iconPrefix + 'calendar',
- INPUT_SEARCH: iconPrefix + 'search',
- // modal
- MODAL_ZOOM_IN: iconPrefix + 'square',
- MODAL_ZOOM_OUT: iconPrefix + 'zoomout',
- MODAL_CLOSE: iconPrefix + 'close',
- MODAL_INFO: iconPrefix + 'info',
- MODAL_SUCCESS: iconPrefix + 'success',
- MODAL_WARNING: iconPrefix + 'warning',
- MODAL_ERROR: iconPrefix + 'error',
- MODAL_QUESTION: iconPrefix + 'question',
- MODAL_LOADING: iconPrefix + 'refresh roll',
- // toolbar
- TOOLBAR_TOOLS_REFRESH: iconPrefix + 'refresh',
- TOOLBAR_TOOLS_REFRESH_LOADING: iconPrefix + 'refresh roll',
- TOOLBAR_TOOLS_IMPORT: iconPrefix + 'upload',
- TOOLBAR_TOOLS_EXPORT: iconPrefix + 'download',
- TOOLBAR_TOOLS_PRINT: iconPrefix + 'print',
- TOOLBAR_TOOLS_ZOOM_IN: iconPrefix + 'zoomin',
- TOOLBAR_TOOLS_ZOOM_OUT: iconPrefix + 'zoomout',
- TOOLBAR_TOOLS_CUSTOM: iconPrefix + 'menu',
- // form
- FORM_PREFIX: iconPrefix + 'info',
- FORM_SUFFIX: iconPrefix + 'info',
- FORM_FOLDING: iconPrefix + 'arrow-top rotate180',
- FORM_UNFOLDING: iconPrefix + 'arrow-top'
- },
- grid: {
- // size: null,
- // zoomConfig: {
- // escRestore: true
- // },
- formConfig: {
- enabled: true
- },
- pagerConfig: {
- enabled: true // perfect: false
- },
- toolbarConfig: {
- enabled: true // perfect: false
- },
- proxyConfig: {
- enabled: true,
- autoLoad: true,
- message: true,
- props: {
- list: null,
- result: 'result',
- total: 'page.total',
- message: 'message'
- } // beforeItem: null,
- // beforeColumn: null,
- // beforeQuery: null,
- // afterQuery: null,
- // beforeDelete: null,
- // afterDelete: null,
- // beforeSave: null,
- // afterSave: null
- }
- },
- tooltip: {
- // size: null,
- trigger: 'hover',
- theme: 'dark',
- leaveDelay: 300
- },
- pager: {// size: null,
- // autoHidden: false,
- // perfect: true,
- // pageSize: 10,
- // pagerCount: 7,
- // pageSizes: [10, 15, 20, 50, 100],
- // layouts: ['PrevJump', 'PrevPage', 'Jump', 'PageCount', 'NextPage', 'NextJump', 'Sizes', 'Total']
- },
- form: {
- // preventSubmit: false,
- validConfig: {
- showMessage: true,
- autoPos: true
- },
- // size: null,
- // colon: false,
- titleAsterisk: true
- },
- input: {
- // size: null,
- // transfer: false
- // parseFormat: 'yyyy-MM-dd HH:mm:ss.SSS',
- // labelFormat: '',
- // valueFormat: '',
- minDate: new Date(1900, 0, 1),
- maxDate: new Date(2100, 0, 1),
- startDay: 1,
- selectDay: 1,
- digits: 2,
- controls: true
- },
- textarea: {// size: null,
- // autosize: {
- // minRows: 1,
- // maxRows: 10
- // }
- },
- select: {
- // size: null,
- // transfer: false,
- multiCharOverflow: 8
- },
- toolbar: {// size: null,
- // import: {
- // mode: 'covering'
- // },
- // export: {
- // types: ['csv', 'html', 'xml', 'txt']
- // },
- // custom: {
- // isFooter: true
- // },
- // buttons: []
- },
- button: {// size: null,
- // transfer: false
- },
- radio: {// size: null
- },
- checkbox: {// size: null
- },
- switch: {// size: null
- },
- modal: {
- // size: null,
- top: 15,
- showHeader: true,
- minWidth: 340,
- minHeight: 140,
- lockView: true,
- mask: true,
- duration: 3000,
- marginSize: 0,
- dblclickZoom: true,
- showTitleOverflow: true,
- animat: true,
- showClose: true,
- // storage: false,
- storageKey: 'VXE_MODAL_POSITION'
- },
- list: {
- // size: null,
- scrollY: {
- enabled: true,
- gt: 100 // oSize: 0,
- // rSize: 0
- // vSize: 0,
- // rHeight: 0
- }
- },
- i18n: function i18n(key) {
- return key;
- }
- };
- /* harmony default export */ var conf = (GlobalConfig);
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.object.to-string.js
- var es_object_to_string = __webpack_require__("d3b7");
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.regexp.exec.js
- var es_regexp_exec = __webpack_require__("ac1f");
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.regexp.to-string.js
- var es_regexp_to_string = __webpack_require__("25f0");
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.replace.js
- var es_string_replace = __webpack_require__("5319");
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.split.js
- var es_string_split = __webpack_require__("1276");
- // CONCATENATED MODULE: ./packages/v-x-e-table/src/interceptor.js
- function toType(type) {
- return ctor_amd_xe_utils_default.a.toString(type).replace('_', '').toLowerCase();
- }
- var eventTypes = 'created,mounted,activated,beforeDestroy,destroyed,event.clearActived,event.clearFilter,event.clearAreas,event.showMenu,event.keydown,event.export,event.import'.split(',').map(toType);
- var storeMap = {};
- var interceptor = {
- mixin: function mixin(map) {
- ctor_amd_xe_utils_default.a.each(map, function (evntFn, type) {
- return interceptor.add(type, evntFn);
- });
- return interceptor;
- },
- get: function get(type) {
- return storeMap[toType(type)] || [];
- },
- add: function add(type, evntFn) {
- type = toType(type);
- if (evntFn && eventTypes.indexOf(type) > -1) {
- var eList = storeMap[type];
- if (!eList) {
- eList = storeMap[type] = [];
- }
- eList.push(evntFn);
- }
- return interceptor;
- },
- delete: function _delete(type, evntFn) {
- var eList = storeMap[toType(type)];
- if (eList) {
- ctor_amd_xe_utils_default.a.remove(eList, function (fn) {
- return fn === evntFn;
- });
- }
- return interceptor;
- }
- };
- /* harmony default export */ var src_interceptor = (interceptor);
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.concat.js
- var es_array_concat = __webpack_require__("99af");
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.find.js
- var es_array_find = __webpack_require__("7db0");
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.join.js
- var es_array_join = __webpack_require__("a15b");
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.function.name.js
- var es_function_name = __webpack_require__("b0c0");
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.number.to-fixed.js
- var es_number_to_fixed = __webpack_require__("b680");
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.for-each.js
- var es_array_for_each = __webpack_require__("4160");
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.last-index-of.js
- var es_array_last_index_of = __webpack_require__("baa5");
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.splice.js
- var es_array_splice = __webpack_require__("a434");
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.fixed.js
- var es_string_fixed = __webpack_require__("c7cd");
- // EXTERNAL MODULE: ./node_modules/core-js/modules/web.dom-collections.for-each.js
- var web_dom_collections_for_each = __webpack_require__("159b");
- // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
- function _arrayLikeToArray(arr, len) {
- if (len == null || len > arr.length) len = arr.length;
- for (var i = 0, arr2 = new Array(len); i < len; i++) {
- arr2[i] = arr[i];
- }
- return arr2;
- }
- // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
- function _arrayWithoutHoles(arr) {
- if (Array.isArray(arr)) return _arrayLikeToArray(arr);
- }
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.symbol.js
- var es_symbol = __webpack_require__("a4d3");
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.symbol.description.js
- var es_symbol_description = __webpack_require__("e01a");
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.symbol.iterator.js
- var es_symbol_iterator = __webpack_require__("d28b");
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.from.js
- var es_array_from = __webpack_require__("a630");
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.iterator.js
- var es_string_iterator = __webpack_require__("3ca3");
- // EXTERNAL MODULE: ./node_modules/core-js/modules/web.dom-collections.iterator.js
- var web_dom_collections_iterator = __webpack_require__("ddb0");
- // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js
- function _iterableToArray(iter) {
- if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
- }
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.slice.js
- var es_array_slice = __webpack_require__("fb6a");
- // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
- function _unsupportedIterableToArray(o, minLen) {
- if (!o) return;
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
- var n = Object.prototype.toString.call(o).slice(8, -1);
- if (n === "Object" && o.constructor) n = o.constructor.name;
- if (n === "Map" || n === "Set") return Array.from(o);
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
- }
- // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
- function _nonIterableSpread() {
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
- }
- // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
- function _toConsumableArray(arr) {
- return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
- }
- // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js
- function _classCallCheck(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
- // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js
- function _defineProperties(target, props) {
- for (var i = 0; i < props.length; i++) {
- var descriptor = props[i];
- descriptor.enumerable = descriptor.enumerable || false;
- descriptor.configurable = true;
- if ("value" in descriptor) descriptor.writable = true;
- Object.defineProperty(target, descriptor.key, descriptor);
- }
- }
- function _createClass(Constructor, protoProps, staticProps) {
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
- if (staticProps) _defineProperties(Constructor, staticProps);
- return Constructor;
- }
- // CONCATENATED MODULE: ./packages/v-x-e-table/src/store.js
- /**
- * 创建数据仓库
- */
- var store_Store = /*#__PURE__*/function () {
- function Store() {
- _classCallCheck(this, Store);
- this.store = {};
- }
- _createClass(Store, [{
- key: "mixin",
- value: function mixin(map) {
- Object.assign(this.store, map);
- return Store;
- }
- }, {
- key: "get",
- value: function get(type) {
- return this.store[type];
- }
- }, {
- key: "add",
- value: function add(type, render) {
- this.store[type] = render;
- return Store;
- }
- }, {
- key: "delete",
- value: function _delete(type) {
- delete this.store[type];
- return Store;
- }
- }]);
- return Store;
- }();
- /* harmony default export */ var store = (store_Store);
- // CONCATENATED MODULE: ./packages/v-x-e-table/src/formats.js
- var formats = new store();
- /* harmony default export */ var src_formats = (formats);
- // CONCATENATED MODULE: ./packages/tools/src/utils.js
- var zindexIndex = 0;
- var lastZindex = 1;
- function getColFuncWidth(isExists) {
- var defaultWidth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 16;
- return isExists ? defaultWidth : 0;
- }
- var utils_ColumnInfo = /*#__PURE__*/function () {
- /* eslint-disable @typescript-eslint/no-use-before-define */
- function ColumnInfo($xetable, _vm) {
- var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
- renderHeader = _ref.renderHeader,
- renderCell = _ref.renderCell,
- renderFooter = _ref.renderFooter,
- renderData = _ref.renderData;
- _classCallCheck(this, ColumnInfo);
- var $xegrid = $xetable.$xegrid;
- var proxyOpts = $xegrid ? $xegrid.proxyOpts : null;
- var formatter = _vm.formatter;
- var visible = ctor_amd_xe_utils_default.a.isBoolean(_vm.visible) ? _vm.visible : true;
- if (_vm.cellRender && _vm.editRender) {
- UtilTools.warn('vxe.error.errConflicts', ['column.cell-render', 'column.edit-render']);
- } // 在 v3.0 中废弃 editRender.type
- if (_vm.editRender && _vm.editRender.type === 'visible') {
- UtilTools.warn('vxe.error.delProp', ['column.edit-render.type', 'column.cell-render']);
- } // 在 v3.0 中废弃 prop
- if (_vm.prop) {
- UtilTools.warn('vxe.error.delProp', ['column.prop', 'column.field']);
- } // 在 v3.0 中废弃 label
- if (_vm.label) {
- UtilTools.warn('vxe.error.delProp', ['column.label', 'column.title']);
- } // 在 v3.0 中废弃 class
- if (_vm.class) {
- UtilTools.warn('vxe.error.delProp', ['column.class', 'column.className']);
- } // 在 v3.0 中废弃 type=index
- if (_vm.type === 'index') {
- UtilTools.warn('vxe.error.delProp', ['column.type=index', 'column.type=seq']);
- } else if (_vm.type === 'selection') {
- // 在 v3.0 中废弃 type=selection
- UtilTools.warn('vxe.error.delProp', ['column.type=selection', 'column.type=checkbox']);
- } else if (_vm.type === 'expand') {
- if ($xetable.treeConfig && $xetable.treeOpts.line) {
- UtilTools.error('vxe.error.errConflicts', ['tree-config.line', 'column.type=expand']);
- }
- if (_vm.slots && !_vm.slots.content && _vm.slots.default) {
- UtilTools.error('vxe.error.expandContent');
- }
- } // 在 v3.0 中 cellRender 只能是对象类型
- if (ctor_amd_xe_utils_default.a.isBoolean(_vm.cellRender) || _vm.cellRender && !ctor_amd_xe_utils_default.a.isObject(_vm.cellRender)) {
- UtilTools.warn('vxe.error.errProp', ["column.cell-render=".concat(_vm.cellRender), 'column.cell-render={}']);
- } // 在 v3.0 中 editRender 只能是对象类型
- if (ctor_amd_xe_utils_default.a.isBoolean(_vm.editRender) || _vm.editRender && !ctor_amd_xe_utils_default.a.isObject(_vm.editRender)) {
- UtilTools.warn('vxe.error.errProp', ["column.edit-render=".concat(_vm.editRender), 'column.edit-render={}']);
- } // 在 v3.0 中废弃 remoteSort
- if (_vm.remoteSort) {
- UtilTools.warn('vxe.error.delProp', ['column.remote-sort', 'sort-config.remote']);
- } // 在 v3.0 中废弃 sortMethod
- if (_vm.sortMethod) {
- UtilTools.warn('vxe.error.delProp', ['column.sort-method', 'sort-config.sortMethod']);
- } // 在 v3.0 中 sortBy 只能是字符串
- if (_vm.sortBy && !ctor_amd_xe_utils_default.a.isString(_vm.sortBy)) {
- UtilTools.warn('vxe.error.errProp', ["column.sort-by=".concat(JSON.stringify(_vm.sortBy)), "column.sort-by=\"".concat(_vm.sortBy[0], "\"")]);
- }
- if (formatter) {
- if (ctor_amd_xe_utils_default.a.isString(formatter)) {
- var globalFunc = src_formats.get(formatter);
- if (!globalFunc && ctor_amd_xe_utils_default.a[formatter]) {
- globalFunc = ctor_amd_xe_utils_default.a[formatter]; // 在 v3.0 中废弃挂载格式化方式
- UtilTools.warn('vxe.error.errFormat', [formatter]);
- }
- if (!ctor_amd_xe_utils_default.a.isFunction(globalFunc)) {
- UtilTools.error('vxe.error.notFunc', [formatter]);
- }
- } else if (ctor_amd_xe_utils_default.a.isArray(formatter)) {
- var _globalFunc = src_formats.get(formatter[0]);
- if (!_globalFunc && ctor_amd_xe_utils_default.a[formatter[0]]) {
- _globalFunc = ctor_amd_xe_utils_default.a[formatter[0]]; // 在 v3.0 中废弃挂载格式化方式
- UtilTools.warn('vxe.error.errFormat', [formatter[0]]);
- }
- if (!ctor_amd_xe_utils_default.a.isFunction(_globalFunc)) {
- UtilTools.error('vxe.error.notFunc', [formatter[0]]);
- }
- }
- }
- Object.assign(this, {
- // 基本属性
- type: _vm.type,
- // 在 v3.0 中废弃 prop
- prop: _vm.prop,
- property: _vm.field || _vm.prop,
- title: _vm.title,
- // 在 v3.0 中废弃 label
- label: _vm.label,
- width: _vm.width,
- minWidth: _vm.minWidth,
- resizable: _vm.resizable,
- fixed: _vm.fixed,
- align: _vm.align,
- headerAlign: _vm.headerAlign,
- footerAlign: _vm.footerAlign,
- showOverflow: _vm.showOverflow,
- showHeaderOverflow: _vm.showHeaderOverflow,
- showFooterOverflow: _vm.showFooterOverflow,
- className: _vm.class || _vm.className,
- headerClassName: _vm.headerClassName,
- footerClassName: _vm.footerClassName,
- indexMethod: _vm.indexMethod,
- seqMethod: _vm.seqMethod,
- formatter: formatter,
- sortable: _vm.sortable,
- sortBy: _vm.sortBy,
- sortType: _vm.sortType,
- sortMethod: _vm.sortMethod,
- remoteSort: _vm.remoteSort,
- filters: UtilTools.getFilters(_vm.filters),
- filterMultiple: ctor_amd_xe_utils_default.a.isBoolean(_vm.filterMultiple) ? _vm.filterMultiple : true,
- filterMethod: _vm.filterMethod,
- filterResetMethod: _vm.filterResetMethod,
- filterRecoverMethod: _vm.filterRecoverMethod,
- filterRender: _vm.filterRender,
- treeNode: _vm.treeNode,
- cellType: _vm.cellType,
- cellRender: _vm.cellRender,
- editRender: _vm.editRender,
- contentRender: _vm.contentRender,
- exportMethod: _vm.exportMethod,
- footerExportMethod: _vm.footerExportMethod,
- titleHelp: _vm.titleHelp,
- // 自定义参数
- params: _vm.params,
- // 渲染属性
- id: _vm.colId || ctor_amd_xe_utils_default.a.uniqueId('col_'),
- parentId: null,
- visible: visible,
- // 内部属性(一旦被使用,将导致不可升级版本)
- halfVisible: false,
- defaultVisible: visible,
- checked: false,
- halfChecked: false,
- disabled: false,
- level: 1,
- rowSpan: 1,
- colSpan: 1,
- order: null,
- sortTime: 0,
- renderWidth: 0,
- renderHeight: 0,
- resizeWidth: 0,
- renderLeft: 0,
- renderArgs: [],
- // 渲染参数可用于扩展
- model: {},
- renderHeader: renderHeader || _vm.renderHeader,
- renderCell: renderCell || _vm.renderCell,
- renderFooter: renderFooter || _vm.renderFooter,
- renderData: renderData,
- // 单元格插槽,只对 grid 有效
- slots: _vm.slots,
- _own: _vm
- });
- if (proxyOpts && proxyOpts.beforeColumn) {
- proxyOpts.beforeColumn({
- $grid: $xegrid,
- column: this
- });
- }
- }
- _createClass(ColumnInfo, [{
- key: "getTitle",
- value: function getTitle() {
- // 在 v3.0 中废弃 label、type=index
- return UtilTools.getFuncText(this.title || this.label || (this.type === 'seq' || this.type === 'index' ? conf.i18n('vxe.table.seqTitle') : ''));
- }
- }, {
- key: "getKey",
- value: function getKey() {
- return this.property || (this.type ? "type=".concat(this.type) : null);
- }
- }, {
- key: "getMinWidth",
- value: function getMinWidth() {
- var type = this.type,
- filters = this.filters,
- sortable = this.sortable,
- remoteSort = this.remoteSort,
- sortOpts = this.sortOpts,
- editRender = this.editRender,
- editOpts = this.editOpts,
- titleHelp = this.titleHelp;
- return 40 + getColFuncWidth(type === 'checkbox' || type === 'selection', 18) + getColFuncWidth(titleHelp, 18) + getColFuncWidth(filters) + getColFuncWidth((sortable || remoteSort) && sortOpts.showIcon) + getColFuncWidth(editRender && editOpts.showIcon, 32);
- }
- }, {
- key: "update",
- value: function update(name, value) {
- // 不支持双向的属性
- if (name !== 'filters') {
- this[name] = value;
- if (name === 'field') {
- this.property = value;
- }
- }
- }
- }, {
- key: "own",
- get: function get() {
- console.warn('[vxe-table] This is an internal attribute "column.own". Please pay attention to locking the version number to avoid errors caused by upgrade.');
- return this._own;
- }
- }]);
- return ColumnInfo;
- }();
- function outLog(type) {
- return function (message, params) {
- var msg = UtilTools.getLog(message, params);
- console[type](msg);
- return msg;
- };
- }
- var UtilTools = {
- warn: outLog('warn'),
- error: outLog('error'),
- getLog: function getLog(message, args) {
- return "[vxe-table] ".concat(conf.i18n(message, args));
- },
- getFuncText: function getFuncText(content) {
- return ctor_amd_xe_utils_default.a.isFunction(content) ? content() : conf.translate ? conf.translate(content) : content;
- },
- nextZIndex: function nextZIndex() {
- lastZindex = conf.zIndex + zindexIndex++;
- return lastZindex;
- },
- getLastZIndex: function getLastZIndex() {
- return lastZindex;
- },
- // 行主键 key
- getRowkey: function getRowkey($xetable) {
- return $xetable.rowId || '_XID';
- },
- // 行主键 value
- getRowid: function getRowid($xetable, row) {
- var rowId = ctor_amd_xe_utils_default.a.get(row, UtilTools.getRowkey($xetable));
- return ctor_amd_xe_utils_default.a.eqNull(rowId) ? '' : encodeURIComponent(rowId);
- },
- // 获取所有的列,排除分组
- getColumnList: function getColumnList(columns) {
- var result = [];
- columns.forEach(function (column) {
- result.push.apply(result, _toConsumableArray(column.children && column.children.length ? UtilTools.getColumnList(column.children) : [column]));
- });
- return result;
- },
- getClass: function getClass(property, params) {
- return property ? ctor_amd_xe_utils_default.a.isFunction(property) ? property(params) : property : '';
- },
- getFilters: function getFilters(filters) {
- if (filters && ctor_amd_xe_utils_default.a.isArray(filters)) {
- return filters.map(function (_ref2) {
- var label = _ref2.label,
- value = _ref2.value,
- data = _ref2.data,
- resetValue = _ref2.resetValue,
- checked = _ref2.checked;
- return {
- label: label,
- value: value,
- data: data,
- resetValue: resetValue,
- checked: !!checked,
- _checked: !!checked
- };
- });
- }
- return filters;
- },
- formatText: function formatText(value, placeholder) {
- return '' + (value === '' || value === null || value === undefined ? placeholder ? conf.emptyCell : '' : value);
- },
- getCellValue: function getCellValue(row, column) {
- return ctor_amd_xe_utils_default.a.get(row, column.property);
- },
- setCellValue: function setCellValue(row, column, value) {
- return ctor_amd_xe_utils_default.a.set(row, column.property, value);
- },
- isColumn: function isColumn(column) {
- return column instanceof utils_ColumnInfo;
- },
- getColumnConfig: function getColumnConfig($xetable, _vm, options) {
- return UtilTools.isColumn(_vm) ? _vm : new utils_ColumnInfo($xetable, _vm, options);
- },
- // 组装列配置
- assemColumn: function assemColumn(_vm) {
- var $el = _vm.$el,
- $xetable = _vm.$xetable,
- $xecolumn = _vm.$xecolumn,
- columnConfig = _vm.columnConfig;
- var groupConfig = $xecolumn ? $xecolumn.columnConfig : null;
- columnConfig.slots = _vm.$scopedSlots;
- if (groupConfig) {
- if ($xecolumn.$options._componentTag === 'vxe-table-column') {
- UtilTools.warn('vxe.error.groupTag', ["<vxe-table-colgroup title=".concat($xecolumn.title, " ...>"), "<vxe-table-column title=".concat($xecolumn.title, " ...>")]);
- } else if ($xecolumn.$options._componentTag === 'vxe-column') {
- UtilTools.warn('vxe.error.groupTag', ["<vxe-colgroup title=".concat($xecolumn.title, " ...>"), "<vxe-column title=".concat($xecolumn.title, " ...>")]);
- }
- if (!groupConfig.children) {
- groupConfig.children = [];
- }
- groupConfig.children.splice([].indexOf.call($xecolumn.$el.children, $el), 0, columnConfig);
- } else {
- $xetable.collectColumn.splice([].indexOf.call($xetable.$refs.hideColumn.children, $el), 0, columnConfig);
- }
- },
- // 销毁列
- destroyColumn: function destroyColumn(_vm) {
- var $xetable = _vm.$xetable,
- columnConfig = _vm.columnConfig;
- var matchObj = ctor_amd_xe_utils_default.a.findTree($xetable.collectColumn, function (column) {
- return column === columnConfig;
- });
- if (matchObj) {
- matchObj.items.splice(matchObj.index, 1);
- }
- },
- hasChildrenList: function hasChildrenList(item) {
- return item && item.children && item.children.length > 0;
- },
- getColMinWidth: function getColMinWidth(params) {
- var $table = params.$table,
- column = params.column;
- var allColumnHeaderOverflow = $table.showHeaderOverflow,
- resizableOpts = $table.resizableOpts,
- sortOpts = $table.sortOpts,
- filterOpts = $table.filterOpts,
- editOpts = $table.editOpts;
- var type = column.type,
- showHeaderOverflow = column.showHeaderOverflow,
- filters = column.filters,
- sortable = column.sortable,
- remoteSort = column.remoteSort,
- titleHelp = column.titleHelp,
- editRender = column.editRender;
- var minWidth = resizableOpts.minWidth;
- if (minWidth) {
- var customMinWidth = ctor_amd_xe_utils_default.a.isFunction(minWidth) ? minWidth(params) : minWidth;
- if (customMinWidth !== 'auto') {
- return Math.max(1, ctor_amd_xe_utils_default.a.toNumber(customMinWidth));
- }
- }
- var headOverflow = ctor_amd_xe_utils_default.a.isUndefined(showHeaderOverflow) || ctor_amd_xe_utils_default.a.isNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow;
- var showEllipsis = headOverflow === 'ellipsis';
- var showTitle = headOverflow === 'title';
- var showTooltip = headOverflow === true || headOverflow === 'tooltip';
- var hasEllipsis = showTitle || showTooltip || showEllipsis;
- var colMinWidth = 40;
- if (hasEllipsis) {
- colMinWidth += getColFuncWidth(type === 'checkbox' || type === 'selection', 18) + getColFuncWidth(titleHelp, 18) + getColFuncWidth(filters && filterOpts.showIcon) + getColFuncWidth((sortable || remoteSort) && sortOpts.showIcon) + getColFuncWidth(UtilTools.isEnableConf(editRender) && editOpts.showIcon, 32);
- }
- return colMinWidth;
- },
- parseFile: function parseFile(file) {
- var name = file.name;
- var tIndex = ctor_amd_xe_utils_default.a.lastIndexOf(name, '.');
- var type = name.substring(tIndex + 1, name.length);
- var filename = name.substring(0, tIndex);
- return {
- filename: filename,
- type: type
- };
- },
- isNumVal: function isNumVal(num) {
- return !isNaN(parseFloat('' + num));
- },
- isEnableConf: function isEnableConf(conf) {
- return conf && conf.enabled !== false;
- },
- /**
- * 判断值为:'' | null | undefined 时都属于空值
- */
- eqEmptyValue: function eqEmptyValue(cellValue) {
- return cellValue === '' || ctor_amd_xe_utils_default.a.eqNull(cellValue);
- }
- };
- /* harmony default export */ var utils = (UtilTools);
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.regexp.constructor.js
- var es_regexp_constructor = __webpack_require__("4d63");
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.match.js
- var es_string_match = __webpack_require__("466d");
- // CONCATENATED MODULE: ./packages/tools/src/dom.js
- var browse = ctor_amd_xe_utils_default.a.browse();
- var htmlElem = browse.isDoc ? document.querySelector('html') : 0;
- var dom_bodyElem = browse.isDoc ? document.body : 0;
- var reClsMap = {};
- function getClsRE(cls) {
- if (!reClsMap[cls]) {
- reClsMap[cls] = new RegExp("(?:^|\\s)".concat(cls, "(?!\\S)"), 'g');
- }
- return reClsMap[cls];
- }
- function getNodeOffset(elem, container, rest) {
- if (elem) {
- var parentElem = elem.parentNode;
- rest.top += elem.offsetTop;
- rest.left += elem.offsetLeft;
- if (parentElem && parentElem !== htmlElem && parentElem !== dom_bodyElem) {
- rest.top -= parentElem.scrollTop;
- rest.left -= parentElem.scrollLeft;
- }
- if (container && (elem === container || elem.offsetParent === container) ? 0 : elem.offsetParent) {
- return getNodeOffset(elem.offsetParent, container, rest);
- }
- }
- return rest;
- }
- var DomTools = {
- browse: browse,
- isPx: function isPx(val) {
- return val && /^\d+(px)?$/.test(val);
- },
- isScale: function isScale(val) {
- return val && /^\d+%$/.test(val);
- },
- hasClass: function hasClass(elem, cls) {
- return elem && elem.className && elem.className.match && elem.className.match(getClsRE(cls));
- },
- removeClass: function removeClass(elem, cls) {
- if (elem && DomTools.hasClass(elem, cls)) {
- elem.className = elem.className.replace(getClsRE(cls), '');
- }
- },
- addClass: function addClass(elem, cls) {
- if (elem && !DomTools.hasClass(elem, cls)) {
- DomTools.removeClass(elem, cls);
- elem.className = "".concat(elem.className, " ").concat(cls);
- }
- },
- updateCellTitle: function updateCellTitle(overflowElem, column) {
- var content = column.type === 'html' ? overflowElem.innerText : overflowElem.textContent;
- if (overflowElem.getAttribute('title') !== content) {
- overflowElem.setAttribute('title', content);
- }
- },
- rowToVisible: function rowToVisible($xetable, row) {
- var bodyElem = $xetable.$refs.tableBody.$el;
- var trElem = bodyElem.querySelector("[data-rowid=\"".concat(utils.getRowid($xetable, row), "\"]"));
- if (trElem) {
- var bodyHeight = bodyElem.clientHeight;
- var bodySrcollTop = bodyElem.scrollTop;
- var trOffsetTop = trElem.offsetTop + (trElem.offsetParent ? trElem.offsetParent.offsetTop : 0);
- var trHeight = trElem.clientHeight; // 检测行是否在可视区中
- if (trOffsetTop < bodySrcollTop || trOffsetTop > bodySrcollTop + bodyHeight) {
- // 向上定位
- return $xetable.scrollTo(null, trOffsetTop);
- } else if (trOffsetTop + trHeight >= bodyHeight + bodySrcollTop) {
- // 向下定位
- return $xetable.scrollTo(null, bodySrcollTop + trHeight);
- }
- } else {
- // 如果是虚拟渲染跨行滚动
- if ($xetable.scrollYLoad) {
- return $xetable.scrollTo(null, ($xetable.afterFullData.indexOf(row) - 1) * $xetable.scrollYStore.rowHeight);
- }
- }
- return Promise.resolve();
- },
- colToVisible: function colToVisible($xetable, column) {
- var bodyElem = $xetable.$refs.tableBody.$el;
- var tdElem = bodyElem.querySelector(".".concat(column.id));
- if (tdElem) {
- var bodyWidth = bodyElem.clientWidth;
- var bodySrcollLeft = bodyElem.scrollLeft;
- var tdOffsetLeft = tdElem.offsetLeft + (tdElem.offsetParent ? tdElem.offsetParent.offsetLeft : 0);
- var tdWidth = tdElem.clientWidth; // 检测行是否在可视区中
- if (tdOffsetLeft < bodySrcollLeft || tdOffsetLeft > bodySrcollLeft + bodyWidth) {
- // 向左定位
- return $xetable.scrollTo(tdOffsetLeft);
- } else if (tdOffsetLeft + tdWidth >= bodyWidth + bodySrcollLeft) {
- // 向右定位
- return $xetable.scrollTo(bodySrcollLeft + tdWidth);
- }
- } else {
- // 如果是虚拟渲染跨行滚动
- if ($xetable.scrollXLoad) {
- var visibleColumn = $xetable.visibleColumn;
- var scrollLeft = 0;
- for (var index = 0; index < visibleColumn.length; index++) {
- if (visibleColumn[index] === column) {
- break;
- }
- scrollLeft += visibleColumn[index].renderWidth;
- }
- return $xetable.scrollTo(scrollLeft);
- }
- }
- return Promise.resolve();
- },
- getDomNode: function getDomNode() {
- var documentElement = document.documentElement;
- var bodyElem = document.body;
- return {
- scrollTop: documentElement.scrollTop || bodyElem.scrollTop,
- scrollLeft: documentElement.scrollLeft || bodyElem.scrollLeft,
- visibleHeight: documentElement.clientHeight || bodyElem.clientHeight,
- visibleWidth: documentElement.clientWidth || bodyElem.clientWidth
- };
- },
- /**
- * 检查触发源是否属于目标节点
- */
- getEventTargetNode: function getEventTargetNode(evnt, container, queryCls, queryMethod) {
- var targetElem;
- var target = evnt.target;
- while (target && target.nodeType && target !== document) {
- if (queryCls && DomTools.hasClass(target, queryCls) && (!queryMethod || queryMethod(target))) {
- targetElem = target;
- } else if (target === container) {
- return {
- flag: queryCls ? !!targetElem : true,
- container: container,
- targetElem: targetElem
- };
- }
- target = target.parentNode;
- }
- return {
- flag: false
- };
- },
- /**
- * 获取元素相对于 document 的位置
- */
- getOffsetPos: function getOffsetPos(elem, container) {
- return getNodeOffset(elem, container, {
- left: 0,
- top: 0
- });
- },
- getAbsolutePos: function getAbsolutePos(elem) {
- var bounding = elem.getBoundingClientRect();
- var boundingTop = bounding.top;
- var boundingLeft = bounding.left;
- var _DomTools$getDomNode = DomTools.getDomNode(),
- scrollTop = _DomTools$getDomNode.scrollTop,
- scrollLeft = _DomTools$getDomNode.scrollLeft,
- visibleHeight = _DomTools$getDomNode.visibleHeight,
- visibleWidth = _DomTools$getDomNode.visibleWidth;
- return {
- boundingTop: boundingTop,
- top: scrollTop + boundingTop,
- boundingLeft: boundingLeft,
- left: scrollLeft + boundingLeft,
- visibleHeight: visibleHeight,
- visibleWidth: visibleWidth
- };
- },
- /**
- * 获取单元格节点索引
- */
- getCellNodeIndex: function getCellNodeIndex(cell) {
- var trElem = cell.parentNode;
- var columnIndex = ctor_amd_xe_utils_default.a.arrayIndexOf(trElem.children, cell);
- var rowIndex = ctor_amd_xe_utils_default.a.arrayIndexOf(trElem.parentNode.children, trElem);
- return {
- columnIndex: columnIndex,
- rowIndex: rowIndex
- };
- },
- /**
- * 获取选中单元格矩阵范围
- */
- getRowNodes: function getRowNodes(trList, cellNode, targetCellNode) {
- var startColIndex = cellNode.columnIndex;
- var startRowIndex = cellNode.rowIndex;
- var targetColIndex = targetCellNode.columnIndex;
- var targetRowIndex = targetCellNode.rowIndex;
- var rows = [];
- for (var rowIndex = Math.min(startRowIndex, targetRowIndex), rowLen = Math.max(startRowIndex, targetRowIndex); rowIndex <= rowLen; rowIndex++) {
- var cells = [];
- var trElem = trList[rowIndex];
- for (var colIndex = Math.min(startColIndex, targetColIndex), colLen = Math.max(startColIndex, targetColIndex); colIndex <= colLen; colIndex++) {
- var tdElem = trElem.children[colIndex];
- cells.push(tdElem);
- }
- rows.push(cells);
- }
- return rows;
- },
- getCellIndexs: function getCellIndexs(cell) {
- var trElem = cell.parentNode;
- var rowid = trElem.getAttribute('data-rowid');
- var columnIndex = [].indexOf.call(trElem.children, cell);
- var rowIndex = [].indexOf.call(trElem.parentNode.children, trElem);
- return {
- rowid: rowid,
- rowIndex: rowIndex,
- columnIndex: columnIndex
- };
- },
- toView: function toView(elem) {
- var scrollIntoViewIfNeeded = 'scrollIntoViewIfNeeded';
- var scrollIntoView = 'scrollIntoView';
- if (elem) {
- if (elem[scrollIntoViewIfNeeded]) {
- elem[scrollIntoViewIfNeeded]();
- } else if (elem[scrollIntoView]) {
- elem[scrollIntoView]();
- }
- }
- },
- triggerEvent: function triggerEvent(targetElem, type) {
- var evnt;
- if (typeof Event === 'function') {
- evnt = new Event(type);
- } else {
- evnt = document.createEvent('Event');
- evnt.initEvent(type, true, true);
- }
- targetElem.dispatchEvent(evnt);
- },
- calcHeight: function calcHeight($xetable, key) {
- var val = $xetable[key];
- var num = 0;
- if (val) {
- if (val === 'auto') {
- num = $xetable.parentHeight;
- } else {
- if (DomTools.isScale(val)) {
- num = Math.floor(parseInt(val) / 100 * $xetable.parentHeight);
- } else {
- num = ctor_amd_xe_utils_default.a.toNumber(val);
- }
- num -= $xetable.getExcludeHeight();
- }
- }
- return num;
- }
- };
- /* harmony default export */ var dom = (DomTools);
- // CONCATENATED MODULE: ./packages/tools/src/event.js
- // 监听全局事件
- var event_browse = dom.browse;
- var wheelName = event_browse.firefox ? 'DOMMouseScroll' : 'mousewheel';
- var eventStore = [];
- var GlobalEvent = {
- on: function on(comp, type, cb) {
- if (cb) {
- eventStore.push({
- comp: comp,
- type: type,
- cb: cb
- });
- }
- },
- off: function off(comp, type) {
- ctor_amd_xe_utils_default.a.remove(eventStore, function (item) {
- return item.comp === comp && item.type === type;
- });
- },
- trigger: function trigger(evnt) {
- var isWheel = evnt.type === wheelName;
- eventStore.forEach(function (_ref) {
- var comp = _ref.comp,
- type = _ref.type,
- cb = _ref.cb;
- if (type === evnt.type || isWheel && type === 'mousewheel') {
- cb.call(comp, evnt);
- }
- });
- },
- eqKeypad: function eqKeypad(evnt, keyVal) {
- var key = evnt.key;
- if (keyVal.toLowerCase() === key.toLowerCase()) {
- return true;
- }
- return false;
- }
- };
- if (event_browse.isDoc) {
- if (!event_browse.msie) {
- document.addEventListener('copy', GlobalEvent.trigger, false);
- document.addEventListener('cut', GlobalEvent.trigger, false);
- document.addEventListener('paste', GlobalEvent.trigger, false);
- }
- document.addEventListener('keydown', GlobalEvent.trigger, false);
- document.addEventListener('contextmenu', GlobalEvent.trigger, false);
- window.addEventListener('mousedown', GlobalEvent.trigger, false);
- window.addEventListener('blur', GlobalEvent.trigger, false);
- window.addEventListener('resize', GlobalEvent.trigger, false);
- window.addEventListener(wheelName, ctor_amd_xe_utils_default.a.throttle(GlobalEvent.trigger, 100, {
- leading: true,
- trailing: false
- }), false);
- }
- /* harmony default export */ var src_event = (GlobalEvent);
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.some.js
- var es_array_some = __webpack_require__("45fc");
- // CONCATENATED MODULE: ./packages/tools/src/resize.js
- /**
- * 监听 resize 事件
- * 如果项目中已使用了 resize-observer-polyfill,那么只需要将方法定义全局,该组件就会自动使用
- */
- var resizeTimeout;
- var resize_eventStore = [];
- var defaultInterval = 500;
- function eventHandle() {
- if (resize_eventStore.length) {
- resize_eventStore.forEach(function (item) {
- item.tarList.forEach(function (observer) {
- var target = observer.target,
- width = observer.width,
- heighe = observer.heighe;
- var clientWidth = target.clientWidth;
- var clientHeight = target.clientHeight;
- var rWidth = clientWidth && width !== clientWidth;
- var rHeight = clientHeight && heighe !== clientHeight;
- if (rWidth || rHeight) {
- observer.width = clientWidth;
- observer.heighe = clientHeight;
- requestAnimationFrame(item.callback);
- }
- });
- });
- /* eslint-disable @typescript-eslint/no-use-before-define */
- eventListener();
- }
- }
- function eventListener() {
- clearTimeout(resizeTimeout);
- resizeTimeout = setTimeout(eventHandle, conf.resizeInterval || defaultInterval);
- }
- var resize_ResizeObserverPolyfill = /*#__PURE__*/function () {
- function ResizeObserverPolyfill(callback) {
- _classCallCheck(this, ResizeObserverPolyfill);
- this.tarList = [];
- this.callback = callback;
- }
- _createClass(ResizeObserverPolyfill, [{
- key: "observe",
- value: function observe(target) {
- var _this = this;
- if (target) {
- if (!this.tarList.some(function (observer) {
- return observer.target === target;
- })) {
- this.tarList.push({
- target: target,
- width: target.clientWidth,
- heighe: target.clientHeight
- });
- }
- if (!resize_eventStore.length) {
- eventListener();
- }
- if (!resize_eventStore.some(function (item) {
- return item === _this;
- })) {
- resize_eventStore.push(this);
- }
- }
- }
- }, {
- key: "unobserve",
- value: function unobserve(target) {
- ctor_amd_xe_utils_default.a.remove(resize_eventStore, function (item) {
- return item.tarList.some(function (observer) {
- return observer.target === target;
- });
- });
- }
- }, {
- key: "disconnect",
- value: function disconnect() {
- var _this2 = this;
- ctor_amd_xe_utils_default.a.remove(resize_eventStore, function (item) {
- return item === _this2;
- });
- }
- }]);
- return ResizeObserverPolyfill;
- }();
- var ResizeEvent = dom.browse.isDoc ? window.ResizeObserver || resize_ResizeObserverPolyfill : resize_ResizeObserverPolyfill;
- /* harmony default export */ var src_resize = (ResizeEvent);
- // CONCATENATED MODULE: ./packages/tools/index.js
- /* harmony default export */ var tools = ({
- UtilTools: utils,
- DomTools: dom,
- GlobalEvent: src_event,
- ResizeEvent: src_resize
- });
- // CONCATENATED MODULE: ./packages/v-x-e-table/src/renderer.js
- var inputEventTypes = ['input', 'textarea', '$input', '$textarea'];
- var defaultCompProps = {
- transfer: true
- };
- function isEmptyValue(cellValue) {
- return cellValue === null || cellValue === undefined || cellValue === '';
- }
- function getChangeEvent(renderOpts) {
- return inputEventTypes.indexOf(renderOpts.name) > -1 ? 'input' : 'change';
- }
- function parseDate(value, props) {
- return value && props.valueFormat ? ctor_amd_xe_utils_default.a.toStringDate(value, props.valueFormat) : value;
- }
- function getFormatDate(value, props, defaultFormat) {
- var _props$dateConfig = props.dateConfig,
- dateConfig = _props$dateConfig === void 0 ? {} : _props$dateConfig;
- return ctor_amd_xe_utils_default.a.toDateString(parseDate(value, props), dateConfig.labelFormat || defaultFormat);
- }
- function getLabelFormatDate(value, props) {
- return getFormatDate(value, props, conf.i18n("vxe.input.date.labelFormat.".concat(props.type)));
- }
- function getDefaultComponentName(_ref) {
- var name = _ref.name;
- return "vxe-".concat(name.replace('$', ''));
- }
- function handleConfirmFilter(params, checked, option) {
- var $panel = params.$panel;
- $panel.changeOption({}, checked, option);
- }
- function getNativeAttrs(_ref2) {
- var name = _ref2.name,
- attrs = _ref2.attrs;
- if (name === 'input') {
- attrs = Object.assign({
- type: 'text'
- }, attrs);
- }
- return attrs;
- }
- function getCellEditFilterProps(renderOpts, params, value, defaultProps) {
- var vSize = params.$table.vSize;
- return ctor_amd_xe_utils_default.a.assign(vSize ? {
- size: vSize
- } : {}, defaultCompProps, defaultProps, renderOpts.props, {
- value: value
- });
- }
- function getItemProps(renderOpts, params, value, defaultProps) {
- var vSize = params.$form.vSize;
- return ctor_amd_xe_utils_default.a.assign(vSize ? {
- size: vSize
- } : {}, defaultCompProps, defaultProps, renderOpts.props, {
- value: value
- });
- }
- function getCellLabelVNs(h, renderOpts, params, cellLabel) {
- var placeholder = renderOpts.placeholder;
- return [h('span', {
- class: 'vxe-cell--label'
- }, placeholder && isEmptyValue(cellLabel) ? [h('span', {
- class: 'vxe-cell--placeholder'
- }, UtilTools.formatText(UtilTools.getFuncText(placeholder), 1))] : UtilTools.formatText(cellLabel, 1))];
- }
- function getNativeOns(renderOpts, params) {
- var nativeEvents = renderOpts.nativeEvents;
- var nativeOns = {};
- ctor_amd_xe_utils_default.a.objectEach(nativeEvents, function (func, key) {
- nativeOns[key] = function () {
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
- func.apply(void 0, [params].concat(args));
- };
- });
- return nativeOns;
- }
- function getOns(renderOpts, params, inputFunc, changeFunc) {
- var events = renderOpts.events;
- var modelEvent = 'input';
- var changeEvent = getChangeEvent(renderOpts);
- var isSameEvent = changeEvent === modelEvent;
- var ons = {};
- ctor_amd_xe_utils_default.a.objectEach(events, function (func, key) {
- ons[key] = function () {
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
- args[_key2] = arguments[_key2];
- }
- func.apply(void 0, [params].concat(args));
- };
- });
- if (inputFunc) {
- ons[modelEvent] = function (targetEvnt) {
- inputFunc(targetEvnt);
- if (events && events[modelEvent]) {
- events[modelEvent](params, targetEvnt);
- }
- if (isSameEvent && changeFunc) {
- changeFunc(targetEvnt);
- }
- };
- }
- if (!isSameEvent && changeFunc) {
- ons[changeEvent] = function () {
- for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
- args[_key3] = arguments[_key3];
- }
- changeFunc.apply(void 0, args);
- if (events && events[changeEvent]) {
- events[changeEvent].apply(events, [params].concat(args));
- }
- };
- }
- return ons;
- }
- function getEditOns(renderOpts, params) {
- var $table = params.$table,
- row = params.row,
- column = params.column;
- return getOns(renderOpts, params, function (value) {
- // 处理 model 值双向绑定
- ctor_amd_xe_utils_default.a.set(row, column.property, value);
- }, function () {
- // 处理 change 事件相关逻辑
- $table.updateStatus(params);
- });
- }
- function getFilterOns(renderOpts, params, option) {
- return getOns(renderOpts, params, function (value) {
- // 处理 model 值双向绑定
- option.data = value;
- }, function () {
- handleConfirmFilter(params, !ctor_amd_xe_utils_default.a.eqNull(option.data), option);
- });
- }
- function getItemOns(renderOpts, params) {
- var $form = params.$form,
- data = params.data,
- property = params.property;
- return getOns(renderOpts, params, function (value) {
- // 处理 model 值双向绑定
- ctor_amd_xe_utils_default.a.set(data, property, value);
- }, function () {
- // 处理 change 事件相关逻辑
- $form.updateStatus(params);
- });
- }
- function isSyncCell(renderOpts, params) {
- // 在 v3.0 中废弃 editRender.type
- return renderOpts.immediate || renderOpts.type === 'visible' || params.$type === 'cell';
- }
- function getNativeEditOns(renderOpts, params) {
- var $table = params.$table,
- row = params.row,
- column = params.column;
- var model = column.model;
- return getOns(renderOpts, params, function (evnt) {
- // 处理 model 值双向绑定
- var cellValue = evnt.target.value;
- if (isSyncCell(renderOpts, params)) {
- UtilTools.setCellValue(row, column, cellValue);
- } else {
- model.update = true;
- model.value = cellValue;
- }
- }, function (evnt) {
- // 处理 change 事件相关逻辑
- var cellValue = evnt.target.value;
- $table.updateStatus(params, cellValue);
- });
- }
- function getNativeFilterOns(renderOpts, params, option) {
- return getOns(renderOpts, params, function (evnt) {
- // 处理 model 值双向绑定
- option.data = evnt.target.value;
- }, function () {
- handleConfirmFilter(params, !ctor_amd_xe_utils_default.a.eqNull(option.data), option);
- });
- }
- function getNativeItemOns(renderOpts, params) {
- var $form = params.$form,
- data = params.data,
- property = params.property;
- return getOns(renderOpts, params, function (evnt) {
- // 处理 model 值双向绑定
- var itemValue = evnt.target.value;
- ctor_amd_xe_utils_default.a.set(data, property, itemValue);
- }, function () {
- // 处理 change 事件相关逻辑
- $form.updateStatus(params);
- });
- }
- /**
- * 单元格可编辑渲染-原生的标签
- * input、textarea、select
- */
- function nativeEditRender(h, renderOpts, params) {
- var row = params.row,
- column = params.column;
- var name = renderOpts.name;
- var attrs = getNativeAttrs(renderOpts);
- var cellValue = isSyncCell(renderOpts, params) ? UtilTools.getCellValue(row, column) : column.model.value;
- return [h(name, {
- class: "vxe-default-".concat(name),
- attrs: attrs,
- domProps: {
- value: cellValue
- },
- on: getNativeEditOns(renderOpts, params)
- })];
- }
- function defaultEditRender(h, renderOpts, params) {
- var row = params.row,
- column = params.column;
- var cellValue = UtilTools.getCellValue(row, column);
- return [h(getDefaultComponentName(renderOpts), {
- props: getCellEditFilterProps(renderOpts, params, cellValue),
- on: getEditOns(renderOpts, params),
- nativeOn: getNativeOns(renderOpts, params)
- })];
- }
- function defaultButtonEditRender(h, renderOpts, params) {
- return [h('vxe-button', {
- props: getCellEditFilterProps(renderOpts, params),
- on: getOns(renderOpts, params),
- nativeOn: getNativeOns(renderOpts, params)
- })];
- }
- function defaultButtonsEditRender(h, renderOpts, params) {
- return renderOpts.children.map(function (childRenderOpts) {
- return defaultButtonEditRender(h, childRenderOpts, params)[0];
- });
- }
- function renderNativeOptgroups(h, renderOpts, params, renderOptionsMethods) {
- var optionGroups = renderOpts.optionGroups,
- _renderOpts$optionGro = renderOpts.optionGroupProps,
- optionGroupProps = _renderOpts$optionGro === void 0 ? {} : _renderOpts$optionGro;
- var groupOptions = optionGroupProps.options || 'options';
- var groupLabel = optionGroupProps.label || 'label';
- return optionGroups.map(function (group, gIndex) {
- return h('optgroup', {
- key: gIndex,
- domProps: {
- label: group[groupLabel]
- }
- }, renderOptionsMethods(h, group[groupOptions], renderOpts, params));
- });
- }
- /**
- * 渲染原生的 option 标签
- */
- function renderNativeOptions(h, options, renderOpts, params) {
- var _renderOpts$optionPro = renderOpts.optionProps,
- optionProps = _renderOpts$optionPro === void 0 ? {} : _renderOpts$optionPro;
- var row = params.row,
- column = params.column;
- var labelProp = optionProps.label || 'label';
- var valueProp = optionProps.value || 'value';
- var disabledProp = optionProps.disabled || 'disabled';
- var cellValue = isSyncCell(renderOpts, params) ? UtilTools.getCellValue(row, column) : column.model.value;
- return options.map(function (option, oIndex) {
- return h('option', {
- key: oIndex,
- attrs: {
- value: option[valueProp],
- disabled: option[disabledProp]
- },
- domProps: {
- /* eslint-disable eqeqeq */
- selected: option[valueProp] == cellValue
- }
- }, option[labelProp]);
- });
- }
- function nativeFilterRender(h, renderOpts, params) {
- var column = params.column;
- var name = renderOpts.name;
- var attrs = getNativeAttrs(renderOpts);
- return column.filters.map(function (option, oIndex) {
- return h(name, {
- key: oIndex,
- class: "vxe-default-".concat(name),
- attrs: attrs,
- domProps: {
- value: option.data
- },
- on: getNativeFilterOns(renderOpts, params, option)
- });
- });
- }
- function defaultFilterRender(h, renderOpts, params) {
- var column = params.column;
- return column.filters.map(function (option, oIndex) {
- var optionValue = option.data;
- return h(getDefaultComponentName(renderOpts), {
- key: oIndex,
- props: getCellEditFilterProps(renderOpts, renderOpts, optionValue),
- on: getFilterOns(renderOpts, params, option)
- });
- });
- }
- function handleFilterMethod(_ref3) {
- var option = _ref3.option,
- row = _ref3.row,
- column = _ref3.column;
- var data = option.data;
- var cellValue = ctor_amd_xe_utils_default.a.get(row, column.property);
- /* eslint-disable eqeqeq */
- return cellValue == data;
- }
- function nativeSelectEditRender(h, renderOpts, params) {
- return [h('select', {
- class: 'vxe-default-select',
- attrs: getNativeAttrs(renderOpts),
- on: getNativeEditOns(renderOpts, params)
- }, renderOpts.optionGroups ? renderNativeOptgroups(h, renderOpts, params, renderNativeOptions) : renderNativeOptions(h, renderOpts.options, renderOpts, params))];
- }
- function defaultSelectEditRender(h, renderOpts, params) {
- var row = params.row,
- column = params.column;
- var options = renderOpts.options,
- optionProps = renderOpts.optionProps,
- optionGroups = renderOpts.optionGroups,
- optionGroupProps = renderOpts.optionGroupProps;
- var cellValue = UtilTools.getCellValue(row, column);
- return [h(getDefaultComponentName(renderOpts), {
- props: getCellEditFilterProps(renderOpts, params, cellValue, {
- options: options,
- optionProps: optionProps,
- optionGroups: optionGroups,
- optionGroupProps: optionGroupProps
- }),
- on: getEditOns(renderOpts, params)
- })];
- }
- function getSelectCellValue(renderOpts, _ref4) {
- var row = _ref4.row,
- column = _ref4.column;
- var _renderOpts$props = renderOpts.props,
- props = _renderOpts$props === void 0 ? {} : _renderOpts$props,
- options = renderOpts.options,
- optionGroups = renderOpts.optionGroups,
- _renderOpts$optionPro2 = renderOpts.optionProps,
- optionProps = _renderOpts$optionPro2 === void 0 ? {} : _renderOpts$optionPro2,
- _renderOpts$optionGro2 = renderOpts.optionGroupProps,
- optionGroupProps = _renderOpts$optionGro2 === void 0 ? {} : _renderOpts$optionGro2;
- var cellValue = ctor_amd_xe_utils_default.a.get(row, column.property);
- var selectItem;
- var labelProp = optionProps.label || 'label';
- var valueProp = optionProps.value || 'value';
- if (!isEmptyValue(cellValue)) {
- return ctor_amd_xe_utils_default.a.map(props.multiple ? cellValue : [cellValue], optionGroups ? function (value) {
- var groupOptions = optionGroupProps.options || 'options';
- for (var index = 0; index < optionGroups.length; index++) {
- /* eslint-disable eqeqeq */
- selectItem = ctor_amd_xe_utils_default.a.find(optionGroups[index][groupOptions], function (item) {
- return item[valueProp] == value;
- });
- if (selectItem) {
- break;
- }
- }
- return selectItem ? selectItem[labelProp] : value;
- } : function (value) {
- /* eslint-disable eqeqeq */
- selectItem = ctor_amd_xe_utils_default.a.find(options, function (item) {
- return item[valueProp] == value;
- });
- return selectItem ? selectItem[labelProp] : value;
- }).join(', ');
- }
- return null;
- }
- /**
- * 渲染表单-项
- * 用于渲染原生的标签
- */
- function nativeItemRender(h, renderOpts, params) {
- var data = params.data,
- property = params.property;
- var name = renderOpts.name;
- var attrs = getNativeAttrs(renderOpts);
- var itemValue = ctor_amd_xe_utils_default.a.get(data, property);
- return [h(name, {
- class: "vxe-default-".concat(name),
- attrs: attrs,
- domProps: attrs && name === 'input' && (attrs.type === 'submit' || attrs.type === 'reset') ? null : {
- value: itemValue
- },
- on: getNativeItemOns(renderOpts, params)
- })];
- }
- function defaultItemRender(h, renderOpts, params) {
- var data = params.data,
- property = params.property;
- var itemValue = ctor_amd_xe_utils_default.a.get(data, property);
- return [h(getDefaultComponentName(renderOpts), {
- props: getItemProps(renderOpts, params, itemValue),
- on: getItemOns(renderOpts, params),
- nativeOn: getNativeOns(renderOpts, params)
- })];
- }
- function defaultButtonItemRender(h, renderOpts, params) {
- return [h('vxe-button', {
- props: getItemProps(renderOpts, params),
- on: getOns(renderOpts, params),
- nativeOn: getNativeOns(renderOpts, params)
- })];
- }
- function defaultButtonsItemRender(h, renderOpts, params) {
- return renderOpts.children.map(function (childRenderOpts) {
- return defaultButtonItemRender(h, childRenderOpts, params)[0];
- });
- }
- /**
- * 渲染原生的 select 标签
- */
- function renderNativeFormOptions(h, options, renderOpts, params) {
- var data = params.data,
- property = params.property;
- var _renderOpts$optionPro3 = renderOpts.optionProps,
- optionProps = _renderOpts$optionPro3 === void 0 ? {} : _renderOpts$optionPro3;
- var labelProp = optionProps.label || 'label';
- var valueProp = optionProps.value || 'value';
- var disabledProp = optionProps.disabled || 'disabled';
- var cellValue = ctor_amd_xe_utils_default.a.get(data, property);
- return options.map(function (item, oIndex) {
- return h('option', {
- key: oIndex,
- attrs: {
- value: item[valueProp],
- disabled: item[disabledProp]
- },
- domProps: {
- /* eslint-disable eqeqeq */
- selected: item[valueProp] == cellValue
- }
- }, item[labelProp]);
- });
- }
- function handleExportSelectMethod(params) {
- var row = params.row,
- column = params.column,
- options = params.options;
- return options.original ? UtilTools.getCellValue(row, column) : getSelectCellValue(column.editRender || column.cellRender, params);
- }
- /**
- * 渲染表单-项中
- * 单选框和复选框
- */
- function defaultFormItemRadioAndCheckboxRender(h, renderOpts, params) {
- var options = renderOpts.options,
- _renderOpts$optionPro4 = renderOpts.optionProps,
- optionProps = _renderOpts$optionPro4 === void 0 ? {} : _renderOpts$optionPro4;
- var data = params.data,
- property = params.property;
- var labelProp = optionProps.label || 'label';
- var valueProp = optionProps.value || 'value';
- var disabledProp = optionProps.disabled || 'disabled';
- var itemValue = ctor_amd_xe_utils_default.a.get(data, property);
- var name = getDefaultComponentName(renderOpts); // 如果是分组
- if (options) {
- return [h("".concat(name, "-group"), {
- props: getItemProps(renderOpts, params, itemValue),
- on: getItemOns(renderOpts, params),
- nativeOn: getNativeOns(renderOpts, params)
- }, options.map(function (item, index) {
- return h(name, {
- key: index,
- props: {
- label: item[valueProp],
- content: item[labelProp],
- disabled: item[disabledProp]
- }
- });
- }))];
- }
- return [h(name, {
- props: getItemProps(renderOpts, params, itemValue),
- on: getItemOns(renderOpts, params),
- nativeOn: getNativeOns(renderOpts, params)
- })];
- }
- /**
- * 内置的组件渲染
- */
- var renderMap = {
- input: {
- autofocus: 'input',
- renderEdit: nativeEditRender,
- renderDefault: nativeEditRender,
- renderFilter: nativeFilterRender,
- filterMethod: handleFilterMethod,
- renderItemContent: nativeItemRender
- },
- textarea: {
- autofocus: 'textarea',
- renderEdit: nativeEditRender,
- renderItemContent: nativeItemRender
- },
- select: {
- renderEdit: nativeSelectEditRender,
- renderDefault: nativeSelectEditRender,
- renderCell: function renderCell(h, renderOpts, params) {
- return getCellLabelVNs(h, renderOpts, params, getSelectCellValue(renderOpts, params));
- },
- renderFilter: function renderFilter(h, renderOpts, params) {
- var column = params.column;
- return column.filters.map(function (option, oIndex) {
- return h('select', {
- key: oIndex,
- class: 'vxe-default-select',
- attrs: getNativeAttrs(renderOpts),
- on: getNativeFilterOns(renderOpts, params, option)
- }, renderOpts.optionGroups ? renderNativeOptgroups(h, renderOpts, params, renderNativeOptions) : renderNativeOptions(h, renderOpts.options, renderOpts, params));
- });
- },
- filterMethod: handleFilterMethod,
- renderItemContent: function renderItemContent(h, renderOpts, params) {
- return [h('select', {
- class: 'vxe-default-select',
- attrs: getNativeAttrs(renderOpts),
- on: getNativeItemOns(renderOpts, params)
- }, renderOpts.optionGroups ? renderNativeOptgroups(h, renderOpts, params, renderNativeFormOptions) : renderNativeFormOptions(h, renderOpts.options, renderOpts, params))];
- },
- cellExportMethod: handleExportSelectMethod
- },
- $input: {
- autofocus: '.vxe-input--inner',
- renderEdit: defaultEditRender,
- renderCell: function renderCell(h, renderOpts, params) {
- var _renderOpts$props2 = renderOpts.props,
- props = _renderOpts$props2 === void 0 ? {} : _renderOpts$props2;
- var row = params.row,
- column = params.column;
- var digits = props.digits || conf.input.digits;
- var cellValue = ctor_amd_xe_utils_default.a.get(row, column.property);
- if (cellValue) {
- switch (props.type) {
- case 'date':
- case 'week':
- case 'month':
- case 'year':
- cellValue = getLabelFormatDate(cellValue, props);
- break;
- case 'float':
- cellValue = ctor_amd_xe_utils_default.a.toFixed(ctor_amd_xe_utils_default.a.floor(cellValue, digits), digits);
- break;
- }
- }
- return getCellLabelVNs(h, renderOpts, params, cellValue);
- },
- renderDefault: defaultEditRender,
- renderFilter: defaultFilterRender,
- filterMethod: handleFilterMethod,
- renderItemContent: defaultItemRender
- },
- $textarea: {
- autofocus: '.vxe-textarea--inner',
- renderItemContent: defaultItemRender
- },
- $button: {
- renderDefault: defaultButtonEditRender,
- renderItemContent: defaultButtonItemRender
- },
- $buttons: {
- renderDefault: defaultButtonsEditRender,
- renderItemContent: defaultButtonsItemRender
- },
- $select: {
- autofocus: '.vxe-input--inner',
- renderEdit: defaultSelectEditRender,
- renderDefault: defaultSelectEditRender,
- renderCell: function renderCell(h, renderOpts, params) {
- return getCellLabelVNs(h, renderOpts, params, getSelectCellValue(renderOpts, params));
- },
- renderFilter: function renderFilter(h, renderOpts, params) {
- var column = params.column;
- var options = renderOpts.options,
- optionProps = renderOpts.optionProps,
- optionGroups = renderOpts.optionGroups,
- optionGroupProps = renderOpts.optionGroupProps;
- var nativeOn = getNativeOns(renderOpts, params);
- return column.filters.map(function (option, oIndex) {
- var optionValue = option.data;
- return h(getDefaultComponentName(renderOpts), {
- key: oIndex,
- props: getCellEditFilterProps(renderOpts, params, optionValue, {
- options: options,
- optionProps: optionProps,
- optionGroups: optionGroups,
- optionGroupProps: optionGroupProps
- }),
- on: getFilterOns(renderOpts, params, option),
- nativeOn: nativeOn
- });
- });
- },
- filterMethod: handleFilterMethod,
- renderItemContent: function renderItemContent(h, renderOpts, params) {
- var data = params.data,
- property = params.property;
- var options = renderOpts.options,
- optionProps = renderOpts.optionProps,
- optionGroups = renderOpts.optionGroups,
- optionGroupProps = renderOpts.optionGroupProps;
- var itemValue = ctor_amd_xe_utils_default.a.get(data, property);
- return [h(getDefaultComponentName(renderOpts), {
- props: getItemProps(renderOpts, params, itemValue, {
- options: options,
- optionProps: optionProps,
- optionGroups: optionGroups,
- optionGroupProps: optionGroupProps
- }),
- on: getItemOns(renderOpts, params),
- nativeOn: getNativeOns(renderOpts, params)
- })];
- },
- cellExportMethod: handleExportSelectMethod
- },
- $radio: {
- autofocus: '.vxe-radio--input',
- renderItemContent: defaultFormItemRadioAndCheckboxRender
- },
- $checkbox: {
- autofocus: '.vxe-checkbox--input',
- renderItemContent: defaultFormItemRadioAndCheckboxRender
- },
- $switch: {
- autofocus: '.vxe-switch--button',
- renderEdit: defaultEditRender,
- renderDefault: defaultEditRender,
- renderItemContent: defaultItemRender
- }
- };
- /**
- * 全局渲染器
- */
- var renderer = {
- mixin: function mixin(map) {
- ctor_amd_xe_utils_default.a.each(map, function (options, name) {
- return renderer.add(name, options);
- });
- return renderer;
- },
- get: function get(name) {
- return renderMap[name] || null;
- },
- add: function add(name, options) {
- if (name && options) {
- var renders = renderMap[name];
- if (renders) {
- Object.assign(renders, options);
- } else {
- renderMap[name] = options;
- }
- }
- return renderer;
- },
- delete: function _delete(name) {
- delete renderMap[name];
- return renderer;
- }
- };
- /* harmony default export */ var src_renderer = (renderer);
- // CONCATENATED MODULE: ./packages/v-x-e-table/src/commands.js
- var commands = new store();
- /* harmony default export */ var src_commands = (commands);
- // CONCATENATED MODULE: ./packages/v-x-e-table/src/menus.js
- var menus = new store();
- /* harmony default export */ var src_menus = (menus);
- // CONCATENATED MODULE: ./packages/v-x-e-table/src/setup.js
- /**
- * 全局参数设置
- */
- function setup() {
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- // 在 v3.0 中废弃 setup.menu
- if (options.menu && !(options.menuConfig || options.contextMenu)) {
- options.contextMenu = options.menu;
- options.menuConfig = options.menu;
- console.warn('[vxe-table] parameter "menu" has been replaced by "menuConfig"');
- }
- return ctor_amd_xe_utils_default.a.merge(conf, options);
- }
- /* harmony default export */ var src_setup = (setup);
- // CONCATENATED MODULE: ./packages/v-x-e-table/index.js
- var installedPlugins = [];
- function use(Plugin, options) {
- /* eslint-disable @typescript-eslint/no-use-before-define */
- if (Plugin && Plugin.install) {
- if (installedPlugins.indexOf(Plugin) === -1) {
- Plugin.install(VXETable, options);
- installedPlugins.push(Plugin);
- }
- }
- return VXETable;
- }
- /**
- * 检测模块的安装顺序是否正确
- */
- function reg(key) {
- /* eslint-disable @typescript-eslint/no-use-before-define */
- if (VXETable.Table) {
- UtilTools.error('vxe.error.useErr', [key]);
- }
- VXETable["_".concat(key)] = 1;
- }
- function _t(key, args) {
- return key ? ctor_amd_xe_utils_default.a.toValueString(conf.translate ? conf.translate(key, args) : key) : '';
- }
- var VXETable = {
- t: function t(key, args) {
- return conf.i18n(key, args);
- },
- _t: _t,
- v: 'v2',
- reg: reg,
- use: use,
- types: {},
- setup: src_setup,
- interceptor: src_interceptor,
- renderer: src_renderer,
- commands: src_commands,
- formats: src_formats,
- menus: src_menus
- }; // v3.0 中废弃 buttons
- Object.defineProperty(VXETable, 'buttons', {
- get: function get() {
- UtilTools.warn('vxe.error.delProp', ['buttons', 'commands']);
- return src_commands;
- }
- });
- /**
- * 获取当前的 zIndex
- */
- Object.defineProperty(VXETable, 'zIndex', {
- get: UtilTools.getLastZIndex
- });
- /**
- * 获取下一个 zIndex
- */
- Object.defineProperty(VXETable, 'nextZIndex', {
- get: UtilTools.nextZIndex
- });
- function getExportOrImpotType(types, flag) {
- var rest = [];
- ctor_amd_xe_utils_default.a.objectEach(types, function (val, type) {
- if (val === 0 || val === flag) {
- rest.push(type);
- }
- });
- return rest;
- }
- /**
- * 获取所有导出类型
- */
- Object.defineProperty(VXETable, 'exportTypes', {
- get: function get() {
- return getExportOrImpotType(conf.export.types, 1);
- }
- });
- /**
- * 获取所有导入类型
- */
- Object.defineProperty(VXETable, 'importTypes', {
- get: function get() {
- return getExportOrImpotType(conf.export.types, 2);
- }
- });
- /* harmony default export */ var v_x_e_table = (VXETable);
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.every.js
- var es_array_every = __webpack_require__("a623");
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.map.js
- var es_map = __webpack_require__("4ec9");
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.number.constructor.js
- var es_number_constructor = __webpack_require__("a9e3");
- // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
- function _defineProperty(obj, key, value) {
- if (key in obj) {
- Object.defineProperty(obj, key, {
- value: value,
- enumerable: true,
- configurable: true,
- writable: true
- });
- } else {
- obj[key] = value;
- }
- return obj;
- }
- // CONCATENATED MODULE: ./packages/body/src/body.js
- var cellType = 'body'; // 滚动、拖动过程中不需要触发
- function isOperateMouse($xetable) {
- // 在 v3.0 中废弃 optimization.delayHover
- return $xetable._isResize || $xetable.lastScrollTime && Date.now() < $xetable.lastScrollTime + $xetable.delayHover;
- }
- function countTreeExpand(prevRow, params) {
- var $table = params.$table;
- var rowChildren = prevRow[$table.treeOpts.children];
- var count = 1;
- if ($table.isTreeExpandByRow(prevRow)) {
- for (var index = 0; index < rowChildren.length; index++) {
- count += countTreeExpand(rowChildren[index], params);
- }
- }
- return count;
- }
- function getOffsetSize($xetable) {
- switch ($xetable.vSize) {
- case 'mini':
- return 3;
- case 'small':
- return 2;
- case 'medium':
- return 1;
- }
- return 0;
- }
- function calcTreeLine(params, items) {
- var $table = params.$table,
- $rowIndex = params.$rowIndex;
- var expandSize = 1;
- if ($rowIndex) {
- expandSize = countTreeExpand(items[$rowIndex - 1], params);
- }
- return $table.rowHeight * expandSize - ($rowIndex ? 1 : 12 - getOffsetSize($table));
- }
- function renderLine(h, _vm, $xetable, rowLevel, items, params) {
- var column = params.column;
- var treeOpts = $xetable.treeOpts,
- treeConfig = $xetable.treeConfig;
- return column.slots && column.slots.line ? column.slots.line.call($xetable, params, h) : column.treeNode && treeConfig && treeOpts.line ? [h('div', {
- class: 'vxe-tree--line-wrapper'
- }, [h('div', {
- class: 'vxe-tree--line',
- style: {
- height: "".concat(calcTreeLine(params, items), "px"),
- left: "".concat(rowLevel * treeOpts.indent + (rowLevel ? 2 - getOffsetSize($xetable) : 0) + 16, "px")
- }
- })])] : [];
- }
- function renderBorder(h, type) {
- return h('div', {
- class: "vxe-table-".concat(type, "ed-borders"),
- ref: "".concat(type, "Borders")
- }, [h('span', {
- class: 'vxe-table-border-top',
- ref: "".concat(type, "Top")
- }), h('span', {
- class: 'vxe-table-border-right',
- ref: "".concat(type, "Right")
- }), h('span', {
- class: 'vxe-table-border-bottom',
- ref: "".concat(type, "Bottom")
- }), h('span', {
- class: 'vxe-table-border-left',
- ref: "".concat(type, "Left")
- })]);
- }
- function mergeMethod(mergeList, _rowIndex, _columnIndex) {
- for (var mIndex = 0; mIndex < mergeList.length; mIndex++) {
- var _mergeList$mIndex = mergeList[mIndex],
- mergeRowIndex = _mergeList$mIndex.row,
- mergeColIndex = _mergeList$mIndex.col,
- mergeRowspan = _mergeList$mIndex.rowspan,
- mergeColspan = _mergeList$mIndex.colspan;
- if (mergeColIndex > -1 && mergeRowIndex > -1 && mergeRowspan && mergeColspan) {
- if (mergeRowIndex === _rowIndex && mergeColIndex === _columnIndex) {
- return {
- rowspan: mergeRowspan,
- colspan: mergeColspan
- };
- }
- if (_rowIndex >= mergeRowIndex && _rowIndex < mergeRowIndex + mergeRowspan && _columnIndex >= mergeColIndex && _columnIndex < mergeColIndex + mergeColspan) {
- return {
- rowspan: 0,
- colspan: 0
- };
- }
- }
- }
- }
- /**
- * 渲染列
- */
- function renderColumn(h, _vm, $xetable, $seq, seq, rowid, fixedType, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, columns, items) {
- var _ref2;
- var _e = $xetable._e,
- tableListeners = $xetable.$listeners,
- afterFullData = $xetable.afterFullData,
- tableData = $xetable.tableData,
- height = $xetable.height,
- columnKey = $xetable.columnKey,
- overflowX = $xetable.overflowX,
- scrollXLoad = $xetable.scrollXLoad,
- scrollYLoad = $xetable.scrollYLoad,
- highlightCurrentRow = $xetable.highlightCurrentRow,
- allColumnOverflow = $xetable.showOverflow,
- allAlign = $xetable.align,
- currentColumn = $xetable.currentColumn,
- cellClassName = $xetable.cellClassName,
- cellStyle = $xetable.cellStyle,
- mergeList = $xetable.mergeList,
- spanMethod = $xetable.spanMethod,
- radioOpts = $xetable.radioOpts,
- checkboxOpts = $xetable.checkboxOpts,
- expandOpts = $xetable.expandOpts,
- treeOpts = $xetable.treeOpts,
- tooltipOpts = $xetable.tooltipOpts,
- mouseConfig = $xetable.mouseConfig,
- editConfig = $xetable.editConfig,
- editOpts = $xetable.editOpts,
- editRules = $xetable.editRules,
- validOpts = $xetable.validOpts,
- editStore = $xetable.editStore,
- validStore = $xetable.validStore;
- var cellRender = column.cellRender,
- editRender = column.editRender,
- align = column.align,
- showOverflow = column.showOverflow,
- className = column.className,
- treeNode = column.treeNode;
- var actived = editStore.actived;
- var showAllTip = tooltipOpts.showAll || tooltipOpts.enabled;
- var columnIndex = $xetable.getColumnIndex(column);
- var _columnIndex = $xetable.getVTColumnIndex(column);
- var isEdit = UtilTools.isEnableConf(editRender);
- var fixedHiddenColumn = fixedType ? column.fixed !== fixedType : column.fixed && overflowX;
- var cellOverflow = ctor_amd_xe_utils_default.a.isUndefined(showOverflow) || ctor_amd_xe_utils_default.a.isNull(showOverflow) ? allColumnOverflow : showOverflow;
- var showEllipsis = cellOverflow === 'ellipsis';
- var showTitle = cellOverflow === 'title';
- var showTooltip = cellOverflow === true || cellOverflow === 'tooltip';
- var hasEllipsis = showTitle || showTooltip || showEllipsis;
- var isDirty;
- var tdOns = {};
- var cellAlign = align || allAlign;
- var hasValidError = validStore.row === row && validStore.column === column;
- var showValidTip = editRules && validOpts.showMessage && (validOpts.message === 'default' ? height || tableData.length > 1 : validOpts.message === 'inline');
- var attrs = {
- 'data-colid': column.id
- };
- var bindMouseenter = tableListeners['cell-mouseenter'];
- var bindMouseleave = tableListeners['cell-mouseleave'];
- var triggerDblclick = editRender && editConfig && editOpts.trigger === 'dblclick';
- var params = {
- $table: $xetable,
- $seq: $seq,
- seq: seq,
- rowid: rowid,
- row: row,
- rowIndex: rowIndex,
- $rowIndex: $rowIndex,
- _rowIndex: _rowIndex,
- column: column,
- columnIndex: columnIndex,
- $columnIndex: $columnIndex,
- _columnIndex: _columnIndex,
- fixed: fixedType,
- type: cellType,
- isHidden: fixedHiddenColumn,
- level: rowLevel,
- visibleData: afterFullData,
- data: tableData,
- items: items
- }; // 虚拟滚动不支持动态高度
- if ((scrollXLoad || scrollYLoad) && !hasEllipsis) {
- showEllipsis = hasEllipsis = true;
- } // hover 进入事件
- if (showTitle || showTooltip || showAllTip || bindMouseenter) {
- tdOns.mouseenter = function (evnt) {
- if (isOperateMouse($xetable)) {
- return;
- }
- if (showTitle) {
- DomTools.updateCellTitle(evnt.currentTarget, column);
- } else if (showTooltip || showAllTip) {
- // 如果配置了显示 tooltip
- $xetable.triggerBodyTooltipEvent(evnt, params);
- }
- if (bindMouseenter) {
- $xetable.emitEvent('cell-mouseenter', Object.assign({
- cell: evnt.currentTarget
- }, params), evnt);
- }
- };
- } // hover 退出事件
- if (showTooltip || showAllTip || bindMouseleave) {
- tdOns.mouseleave = function (evnt) {
- if (isOperateMouse($xetable)) {
- return;
- }
- if (showTooltip || showAllTip) {
- $xetable.handleTargetLeaveEvent(evnt);
- }
- if (bindMouseleave) {
- $xetable.emitEvent('cell-mouseleave', Object.assign({
- cell: evnt.currentTarget
- }, params), evnt);
- }
- };
- } // 按下事件处理
- if (checkboxOpts.range || mouseConfig) {
- tdOns.mousedown = function (evnt) {
- $xetable.triggerCellMousedownEvent(evnt, params);
- };
- } // 点击事件处理
- if (highlightCurrentRow || mouseConfig || tableListeners['cell-click'] || editRender && editConfig || expandOpts.trigger === 'row' || expandOpts.trigger === 'cell' || radioOpts.trigger === 'row' || column.type === 'radio' && radioOpts.trigger === 'cell' || // 在 v3.0 中废弃 type=selection
- checkboxOpts.trigger === 'row' || (column.type === 'checkbox' || column.type === 'selection') && checkboxOpts.trigger === 'cell' || treeOpts.trigger === 'row' || column.treeNode && treeOpts.trigger === 'cell') {
- tdOns.click = function (evnt) {
- $xetable.triggerCellClickEvent(evnt, params);
- };
- } // 双击事件处理
- if (triggerDblclick || tableListeners['cell-dblclick']) {
- tdOns.dblclick = function (evnt) {
- $xetable.triggerCellDBLClickEvent(evnt, params);
- };
- } // 合并行或列
- if (mergeList.length) {
- var spanRest = mergeMethod(mergeList, _rowIndex, _columnIndex);
- if (spanRest) {
- var rowspan = spanRest.rowspan,
- colspan = spanRest.colspan;
- if (!rowspan || !colspan) {
- return null;
- }
- if (rowspan > 1) {
- attrs.rowspan = rowspan;
- }
- if (colspan > 1) {
- attrs.colspan = colspan;
- }
- }
- } else if (spanMethod) {
- // 自定义合并行或列的方法
- var _ref = spanMethod(params) || {},
- _ref$rowspan = _ref.rowspan,
- _rowspan = _ref$rowspan === void 0 ? 1 : _ref$rowspan,
- _ref$colspan = _ref.colspan,
- _colspan = _ref$colspan === void 0 ? 1 : _ref$colspan;
- if (!_rowspan || !_colspan) {
- return null;
- }
- if (_rowspan > 1) {
- attrs.rowspan = _rowspan;
- }
- if (_colspan > 1) {
- attrs.colspan = _colspan;
- }
- } // 如果被合并不可隐藏
- if (fixedHiddenColumn && mergeList) {
- if (attrs.colspan > 1 || attrs.rowspan > 1) {
- fixedHiddenColumn = false;
- }
- } // 如果编辑列开启显示状态
- if (!fixedHiddenColumn && editConfig && (editRender || cellRender) && (editOpts.showStatus || editOpts.showUpdateStatus)) {
- isDirty = $xetable.isUpdateByRow(row, column.property);
- }
- var type = column.type === 'seq' || column.type === 'index' ? 'seq' : column.type;
- return h('td', {
- class: ['vxe-body--column', column.id, (_ref2 = {}, _defineProperty(_ref2, "col--".concat(cellAlign), cellAlign), _defineProperty(_ref2, "col--".concat(type), type), _defineProperty(_ref2, 'col--last', $columnIndex === columns.length - 1), _defineProperty(_ref2, 'col--tree-node', treeNode), _defineProperty(_ref2, 'col--edit', isEdit), _defineProperty(_ref2, 'col--ellipsis', hasEllipsis), _defineProperty(_ref2, 'fixed--hidden', fixedHiddenColumn), _defineProperty(_ref2, 'col--dirty', isDirty), _defineProperty(_ref2, 'col--actived', editConfig && isEdit && actived.row === row && (actived.column === column || editOpts.mode === 'row')), _defineProperty(_ref2, 'col--valid-error', hasValidError), _defineProperty(_ref2, 'col--current', currentColumn === column), _ref2), UtilTools.getClass(className, params), UtilTools.getClass(cellClassName, params)],
- key: columnKey ? column.id : $columnIndex,
- attrs: attrs,
- style: cellStyle ? ctor_amd_xe_utils_default.a.isFunction(cellStyle) ? cellStyle(params) : cellStyle : null,
- on: tdOns
- }, allColumnOverflow && fixedHiddenColumn ? [h('div', {
- class: ['vxe-cell', {
- 'c--title': showTitle,
- 'c--tooltip': showTooltip,
- 'c--ellipsis': showEllipsis
- }]
- })] : renderLine(h, _vm, $xetable, rowLevel, items, params).concat([h('div', {
- class: ['vxe-cell', {
- 'c--title': showTitle,
- 'c--tooltip': showTooltip,
- 'c--ellipsis': showEllipsis
- }],
- attrs: {
- title: showTitle ? $xetable.getCellLabel(row, column) : null
- }
- }, column.renderCell(h, params)), showValidTip ? hasValidError ? h('div', {
- class: 'vxe-cell--valid',
- style: validStore.rule && validStore.rule.maxWidth ? {
- width: "".concat(validStore.rule.maxWidth, "px")
- } : null
- }, [h('span', {
- class: 'vxe-cell--valid-msg'
- }, validStore.content)]) : _e() : null]));
- }
- function renderRows(h, _vm, $xetable, $seq, rowLevel, fixedType, tableData, tableColumn) {
- var stripe = $xetable.stripe,
- rowKey = $xetable.rowKey,
- highlightHoverRow = $xetable.highlightHoverRow,
- rowClassName = $xetable.rowClassName,
- rowStyle = $xetable.rowStyle,
- allColumnOverflow = $xetable.showOverflow,
- treeConfig = $xetable.treeConfig,
- treeOpts = $xetable.treeOpts,
- treeExpandeds = $xetable.treeExpandeds,
- scrollYLoad = $xetable.scrollYLoad,
- scrollYStore = $xetable.scrollYStore,
- editStore = $xetable.editStore,
- rowExpandeds = $xetable.rowExpandeds,
- radioOpts = $xetable.radioOpts,
- checkboxOpts = $xetable.checkboxOpts,
- expandColumn = $xetable.expandColumn;
- var rows = [];
- tableData.forEach(function (row, $rowIndex) {
- var trOn = {};
- var rowIndex = $rowIndex;
- var seq = rowIndex + 1;
- if (scrollYLoad) {
- seq += scrollYStore.startIndex;
- }
- var _rowIndex = $xetable.getVTRowIndex(row); // 确保任何情况下 rowIndex 都精准指向真实 data 索引
- rowIndex = $xetable.getRowIndex(row); // 事件绑定
- if (highlightHoverRow) {
- trOn.mouseenter = function (evnt) {
- if (isOperateMouse($xetable)) {
- return;
- }
- $xetable.triggerHoverEvent(evnt, {
- row: row,
- rowIndex: rowIndex
- });
- };
- trOn.mouseleave = function () {
- if (isOperateMouse($xetable)) {
- return;
- }
- $xetable.clearHoverRow();
- };
- }
- var rowid = UtilTools.getRowid($xetable, row);
- var params = {
- $table: $xetable,
- $seq: $seq,
- seq: seq,
- rowid: rowid,
- fixed: fixedType,
- type: cellType,
- level: rowLevel,
- row: row,
- rowIndex: rowIndex,
- $rowIndex: $rowIndex
- };
- rows.push(h('tr', {
- class: ['vxe-body--row', {
- 'row--stripe': stripe && ($xetable.getVTRowIndex(row) + 1) % 2 === 0,
- 'is--new': editStore.insertList.indexOf(row) > -1,
- 'row--radio': radioOpts.highlight && $xetable.selectRow === row,
- 'row--checked': checkboxOpts.highlight && $xetable.isCheckedByCheckboxRow(row)
- }, rowClassName ? ctor_amd_xe_utils_default.a.isFunction(rowClassName) ? rowClassName(params) : rowClassName : ''],
- attrs: {
- 'data-rowid': rowid
- },
- style: rowStyle ? ctor_amd_xe_utils_default.a.isFunction(rowStyle) ? rowStyle(params) : rowStyle : null,
- key: rowKey || treeConfig ? rowid : $rowIndex,
- on: trOn
- }, tableColumn.map(function (column, $columnIndex) {
- return renderColumn(h, _vm, $xetable, $seq, seq, rowid, fixedType, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, tableColumn, tableData);
- }))); // 如果行被展开了
- if (expandColumn && rowExpandeds.length && rowExpandeds.indexOf(row) > -1) {
- var expandColumnIndex = $xetable.getColumnIndex(expandColumn);
- var cellStyle;
- if (treeConfig) {
- cellStyle = {
- paddingLeft: "".concat(rowLevel * treeOpts.indent + 30, "px")
- };
- }
- var showOverflow = expandColumn.showOverflow;
- var hasEllipsis = ctor_amd_xe_utils_default.a.isUndefined(showOverflow) || ctor_amd_xe_utils_default.a.isNull(showOverflow) ? allColumnOverflow : showOverflow;
- var expandParams = {
- $table: $xetable,
- $seq: $seq,
- seq: seq,
- column: expandColumn,
- columnIndex: expandColumnIndex,
- fixed: fixedType,
- type: cellType,
- level: rowLevel,
- row: row,
- rowIndex: rowIndex,
- $rowIndex: $rowIndex
- };
- rows.push(h('tr', {
- class: 'vxe-body--expanded-row',
- key: "expand_".concat(rowid),
- style: rowStyle ? ctor_amd_xe_utils_default.a.isFunction(rowStyle) ? rowStyle(expandParams) : rowStyle : null,
- on: trOn
- }, [h('td', {
- class: ['vxe-body--expanded-column', {
- 'fixed--hidden': fixedType,
- 'col--ellipsis': hasEllipsis
- }],
- attrs: {
- colspan: tableColumn.length
- }
- }, [h('div', {
- class: 'vxe-body--expanded-cell',
- style: cellStyle
- }, [expandColumn.renderData(h, expandParams)])])]));
- } // 如果是树形表格
- if (treeConfig && treeExpandeds.length) {
- var rowChildren = row[treeOpts.children];
- if (rowChildren && rowChildren.length && treeExpandeds.indexOf(row) > -1) {
- rows.push.apply(rows, _toConsumableArray(renderRows(h, _vm, $xetable, $seq ? "".concat($seq, ".").concat(seq) : "".concat(seq), rowLevel + 1, fixedType, rowChildren, tableColumn)));
- }
- }
- });
- return rows;
- }
- /**
- * 同步滚动条
- * scroll 方式:可以使固定列与内容保持一致的滚动效果,实现相对麻烦
- * mousewheel 方式:对于同步滚动效果就略差了,左右滚动,内容跟随即可
- * css3 translate 方式:对于同步滚动效果会有产生卡顿感觉,虽然可以利用硬件加速,渲染性能略优,但失去table布局能力
- */
- var scrollProcessTimeout;
- function syncBodyScroll(scrollTop, elem1, elem2) {
- if (elem1 || elem2) {
- if (elem1) {
- elem1.onscroll = null;
- elem1.scrollTop = scrollTop;
- }
- if (elem2) {
- elem2.onscroll = null;
- elem2.scrollTop = scrollTop;
- }
- clearTimeout(scrollProcessTimeout);
- scrollProcessTimeout = setTimeout(function () {
- if (elem1) {
- elem1.onscroll = elem1._onscroll;
- }
- if (elem2) {
- elem2.onscroll = elem2._onscroll;
- }
- }, 300);
- }
- }
- /* harmony default export */ var src_body = ({
- name: 'VxeTableBody',
- props: {
- tableData: Array,
- tableColumn: Array,
- visibleColumn: Array,
- fixedColumn: Array,
- size: String,
- fixedType: String,
- isGroup: Boolean
- },
- mounted: function mounted() {
- var $xetable = this.$parent,
- $el = this.$el,
- $refs = this.$refs,
- fixedType = this.fixedType;
- var elemStore = $xetable.elemStore;
- var prefix = "".concat(fixedType || 'main', "-body-");
- elemStore["".concat(prefix, "wrapper")] = $el;
- elemStore["".concat(prefix, "table")] = $refs.table;
- elemStore["".concat(prefix, "colgroup")] = $refs.colgroup;
- elemStore["".concat(prefix, "list")] = $refs.tbody;
- elemStore["".concat(prefix, "xSpace")] = $refs.xSpace;
- elemStore["".concat(prefix, "ySpace")] = $refs.ySpace;
- elemStore["".concat(prefix, "emptyBlock")] = $refs.emptyBlock;
- this.$el.onscroll = this.scrollEvent;
- this.$el._onscroll = this.scrollEvent;
- },
- beforeDestroy: function beforeDestroy() {
- this.$el._onscroll = null;
- this.$el.onscroll = null;
- },
- render: function render(h) {
- var _e = this._e,
- $xetable = this.$parent,
- fixedColumn = this.fixedColumn,
- fixedType = this.fixedType;
- var $scopedSlots = $xetable.$scopedSlots,
- tId = $xetable.tId,
- tableData = $xetable.tableData,
- tableColumn = $xetable.tableColumn,
- allColumnOverflow = $xetable.showOverflow,
- mergeList = $xetable.mergeList,
- spanMethod = $xetable.spanMethod,
- scrollXLoad = $xetable.scrollXLoad,
- mouseConfig = $xetable.mouseConfig,
- mouseOpts = $xetable.mouseOpts,
- emptyRender = $xetable.emptyRender,
- emptyOpts = $xetable.emptyOpts,
- keyboardConfig = $xetable.keyboardConfig,
- keyboardOpts = $xetable.keyboardOpts; // 在 v3.0 中废弃 mouse-config.checked
- var isMouseChecked = mouseConfig && mouseOpts.checked; // 如果是固定列与设置了超出隐藏
- if (!mergeList.length && !spanMethod && !(keyboardConfig && keyboardOpts.isMerge)) {
- if (fixedType && allColumnOverflow) {
- tableColumn = fixedColumn;
- } else if (scrollXLoad) {
- if (fixedType) {
- tableColumn = fixedColumn;
- }
- }
- }
- var emptyContent;
- if ($scopedSlots.empty) {
- emptyContent = $scopedSlots.empty.call(this, {
- $table: $xetable
- }, h);
- } else {
- var compConf = emptyRender ? v_x_e_table.renderer.get(emptyOpts.name) : null;
- if (compConf && compConf.renderEmpty) {
- emptyContent = compConf.renderEmpty.call(this, h, emptyOpts, {
- $table: $xetable
- }, {
- $table: $xetable
- });
- } else {
- emptyContent = $xetable.emptyText || conf.i18n('vxe.table.emptyText');
- }
- }
- return h('div', {
- class: ['vxe-table--body-wrapper', fixedType ? "fixed-".concat(fixedType, "--wrapper") : 'body--wrapper'],
- attrs: {
- 'data-tid': tId
- }
- }, [fixedType ? _e() : h('div', {
- class: 'vxe-body--x-space',
- ref: 'xSpace'
- }), h('div', {
- class: 'vxe-body--y-space',
- ref: 'ySpace'
- }), h('table', {
- class: 'vxe-table--body',
- attrs: {
- 'data-tid': tId,
- cellspacing: 0,
- cellpadding: 0,
- border: 0
- },
- ref: 'table'
- }, [
- /**
- * 列宽
- */
- h('colgroup', {
- ref: 'colgroup'
- }, tableColumn.map(function (column, columnIndex) {
- return h('col', {
- attrs: {
- name: column.id
- },
- key: columnIndex
- });
- })),
- /**
- * 内容
- */
- h('tbody', {
- ref: 'tbody'
- }, renderRows(h, this, $xetable, '', 0, fixedType, tableData, tableColumn))]),
- /**
- * 选中边框线
- */
- !fixedType && (isMouseChecked || keyboardOpts.isCut) ? h('div', {
- class: 'vxe-table--borders'
- }, [isMouseChecked ? renderBorder(h, 'check') : null, keyboardOpts.isCut ? renderBorder(h, 'copy') : null]) : null, h('div', {
- class: 'vxe-table--checkbox-range'
- }), mouseConfig && mouseOpts.area ? h('div', {
- class: 'vxe-table--cell-area'
- }, [h('span', {
- class: 'vxe-table--cell-main-area'
- }, mouseOpts.extension ? [h('span', {
- class: 'vxe-table--cell-main-area-btn',
- on: {
- mousedown: function mousedown(evnt) {
- $xetable.triggerCellExtendMousedownEvent(evnt, {
- $table: $xetable,
- fixed: fixedType,
- type: cellType
- });
- }
- }
- })] : null), h('span', {
- class: 'vxe-table--cell-copy-area'
- }), h('span', {
- class: 'vxe-table--cell-extend-area'
- }), h('span', {
- class: 'vxe-table--cell-multi-area'
- }), h('span', {
- class: 'vxe-table--cell-active-area'
- })]) : null, !fixedType ? h('div', {
- class: 'vxe-table--empty-block',
- ref: 'emptyBlock'
- }, [h('div', {
- class: 'vxe-table--empty-content'
- }, emptyContent)]) : null]);
- },
- methods: {
- /**
- * 滚动处理
- * 如果存在列固定左侧,同步更新滚动状态
- * 如果存在列固定右侧,同步更新滚动状态
- */
- scrollEvent: function scrollEvent(evnt) {
- var $el = this.$el,
- $xetable = this.$parent,
- fixedType = this.fixedType;
- var $refs = $xetable.$refs,
- highlightHoverRow = $xetable.highlightHoverRow,
- scrollXLoad = $xetable.scrollXLoad,
- scrollYLoad = $xetable.scrollYLoad,
- lastScrollTop = $xetable.lastScrollTop,
- lastScrollLeft = $xetable.lastScrollLeft;
- var tableHeader = $refs.tableHeader,
- tableBody = $refs.tableBody,
- leftBody = $refs.leftBody,
- rightBody = $refs.rightBody,
- tableFooter = $refs.tableFooter,
- validTip = $refs.validTip;
- var headerElem = tableHeader ? tableHeader.$el : null;
- var footerElem = tableFooter ? tableFooter.$el : null;
- var bodyElem = tableBody.$el;
- var leftElem = leftBody ? leftBody.$el : null;
- var rightElem = rightBody ? rightBody.$el : null;
- var scrollTop = $el.scrollTop;
- var scrollLeft = bodyElem.scrollLeft;
- var isX = scrollLeft !== lastScrollLeft;
- var isY = scrollTop !== lastScrollTop;
- $xetable.lastScrollTop = scrollTop;
- $xetable.lastScrollLeft = scrollLeft;
- $xetable.lastScrollTime = Date.now();
- if (highlightHoverRow) {
- $xetable.clearHoverRow();
- }
- if (leftElem && fixedType === 'left') {
- scrollTop = leftElem.scrollTop;
- syncBodyScroll(scrollTop, bodyElem, rightElem);
- } else if (rightElem && fixedType === 'right') {
- scrollTop = rightElem.scrollTop;
- syncBodyScroll(scrollTop, bodyElem, leftElem);
- } else {
- if (isX) {
- if (headerElem) {
- headerElem.scrollLeft = bodyElem.scrollLeft;
- }
- if (footerElem) {
- footerElem.scrollLeft = bodyElem.scrollLeft;
- }
- }
- if (leftElem || rightElem) {
- $xetable.checkScrolling();
- if (isY) {
- syncBodyScroll(scrollTop, leftElem, rightElem);
- }
- }
- }
- if (scrollXLoad && isX) {
- $xetable.triggerScrollXEvent(evnt);
- if (headerElem && scrollLeft + bodyElem.clientWidth >= bodyElem.scrollWidth - 80) {
- // 修复拖动滚动条时可能存在不同步问题
- this.$nextTick(function () {
- if (bodyElem.scrollLeft !== headerElem.scrollLeft) {
- headerElem.scrollLeft = bodyElem.scrollLeft;
- }
- });
- }
- }
- if (scrollYLoad && isY) {
- $xetable.triggerScrollYEvent(evnt);
- }
- if (isX && validTip && validTip.visible) {
- validTip.updatePlacement();
- }
- $xetable.emitEvent('scroll', {
- type: cellType,
- fixed: fixedType,
- scrollTop: scrollTop,
- scrollLeft: scrollLeft,
- isX: isX,
- isY: isY
- }, evnt);
- }
- }
- });
- // CONCATENATED MODULE: ./packages/body/index.js
- src_body.install = function (Vue) {
- Vue.component(src_body.name, src_body);
- };
- var Body = src_body;
- /* harmony default export */ var packages_body = (src_body);
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.filter.js
- var es_array_filter = __webpack_require__("4de4");
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.reduce.js
- var es_array_reduce = __webpack_require__("13d5");
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.object.keys.js
- var es_object_keys = __webpack_require__("b64b");
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.trim.js
- var es_string_trim = __webpack_require__("498a");
- // CONCATENATED MODULE: ./packages/cell/src/cell.js
- function renderHelpIcon(h, params) {
- var $table = params.$table,
- column = params.column;
- var titleHelp = column.titleHelp;
- return titleHelp ? [h('i', {
- class: ['vxe-cell-help-icon', titleHelp.icon || conf.icon.TABLE_HELP],
- on: {
- mouseenter: function mouseenter(evnt) {
- $table.triggerHeaderHelpEvent(evnt, params);
- },
- mouseleave: function mouseleave(evnt) {
- $table.handleTargetLeaveEvent(evnt);
- }
- }
- })] : [];
- }
- function renderTitleContent(h, params, content) {
- var $table = params.$table,
- column = params.column;
- var showHeaderOverflow = column.showHeaderOverflow;
- var allColumnHeaderOverflow = $table.showHeaderOverflow,
- tooltipOpts = $table.tooltipOpts;
- var showAllTip = tooltipOpts.showAll || tooltipOpts.enabled;
- var headOverflow = ctor_amd_xe_utils_default.a.isUndefined(showHeaderOverflow) || ctor_amd_xe_utils_default.a.isNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow;
- var showTitle = headOverflow === 'title';
- var showTooltip = headOverflow === true || headOverflow === 'tooltip';
- var ons = {};
- if (showTitle || showTooltip || showAllTip) {
- ons.mouseenter = function (evnt) {
- if ($table._isResize) {
- return;
- }
- if (showTitle) {
- DomTools.updateCellTitle(evnt.currentTarget, column);
- } else if (showTooltip || showAllTip) {
- $table.triggerHeaderTooltipEvent(evnt, params);
- }
- };
- }
- if (showTooltip || showAllTip) {
- ons.mouseleave = function (evnt) {
- if ($table._isResize) {
- return;
- }
- if (showTooltip || showAllTip) {
- $table.handleTargetLeaveEvent(evnt);
- }
- };
- }
- return [h('span', {
- class: 'vxe-cell--title',
- on: ons
- }, content)];
- }
- function getFooterContent(h, params) {
- var $table = params.$table,
- column = params.column,
- _columnIndex = params._columnIndex,
- items = params.items;
- var slots = column.slots,
- editRender = column.editRender,
- cellRender = column.cellRender;
- var renderOpts = editRender || cellRender;
- if (slots && slots.footer) {
- return slots.footer.call($table, params, h);
- }
- if (renderOpts) {
- var compConf = v_x_e_table.renderer.get(renderOpts.name);
- if (compConf && compConf.renderFooter) {
- return compConf.renderFooter.call($table, h, renderOpts, params, {
- $grid: $table.$xegrid,
- $excel: $table.$parent,
- $table: $table
- });
- }
- }
- return [UtilTools.formatText(items[_columnIndex], 1)];
- }
- function getDefaultCellLabel(params) {
- var $table = params.$table,
- row = params.row,
- column = params.column;
- return UtilTools.formatText($table.getCellLabel(row, column), 1);
- }
- var Cell = {
- createColumn: function createColumn($xetable, _vm) {
- var type = _vm.type,
- sortable = _vm.sortable,
- remoteSort = _vm.remoteSort,
- filters = _vm.filters,
- editRender = _vm.editRender,
- treeNode = _vm.treeNode;
- var editConfig = $xetable.editConfig,
- editOpts = $xetable.editOpts,
- checkboxOpts = $xetable.checkboxOpts;
- var renMaps = {
- renderHeader: this.renderDefaultHeader,
- renderCell: treeNode ? this.renderTreeCell : this.renderDefaultCell,
- renderFooter: this.renderDefaultFooter
- };
- switch (type) {
- case 'seq':
- case 'index':
- renMaps.renderHeader = this.renderIndexHeader;
- renMaps.renderCell = treeNode ? this.renderTreeIndexCell : this.renderIndexCell;
- break;
- case 'radio':
- renMaps.renderHeader = this.renderRadioHeader;
- renMaps.renderCell = treeNode ? this.renderTreeRadioCell : this.renderRadioCell;
- break;
- // 在 v3.0 中废弃 type=selection
- case 'checkbox':
- case 'selection':
- renMaps.renderHeader = this.renderSelectionHeader;
- renMaps.renderCell = checkboxOpts.checkField ? treeNode ? this.renderTreeSelectionCellByProp : this.renderSelectionCellByProp : treeNode ? this.renderTreeSelectionCell : this.renderSelectionCell;
- break;
- case 'expand':
- renMaps.renderCell = this.renderExpandCell;
- renMaps.renderData = this.renderExpandData;
- break;
- case 'html':
- renMaps.renderCell = treeNode ? this.renderTreeHTMLCell : this.renderHTMLCell;
- if (filters && (sortable || remoteSort)) {
- renMaps.renderHeader = this.renderSortAndFilterHeader;
- } else if (sortable || remoteSort) {
- renMaps.renderHeader = this.renderSortHeader;
- } else if (filters) {
- renMaps.renderHeader = this.renderFilterHeader;
- }
- break;
- default:
- if (editConfig && editRender) {
- renMaps.renderHeader = this.renderEditHeader;
- renMaps.renderCell = editOpts.mode === 'cell' ? treeNode ? this.renderTreeCellEdit : this.renderCellEdit : treeNode ? this.renderTreeRowEdit : this.renderRowEdit;
- } else if (filters && (sortable || remoteSort)) {
- renMaps.renderHeader = this.renderSortAndFilterHeader;
- } else if (sortable || remoteSort) {
- renMaps.renderHeader = this.renderSortHeader;
- } else if (filters) {
- renMaps.renderHeader = this.renderFilterHeader;
- }
- }
- return UtilTools.getColumnConfig($xetable, _vm, renMaps);
- },
- /**
- * 单元格
- */
- renderHeaderTitle: function renderHeaderTitle(h, params) {
- var $table = params.$table,
- column = params.column;
- var slots = column.slots,
- editRender = column.editRender,
- cellRender = column.cellRender;
- var renderOpts = editRender || cellRender;
- if (slots && slots.header) {
- return renderTitleContent(h, params, slots.header.call($table, params, h));
- }
- if (renderOpts) {
- var compConf = v_x_e_table.renderer.get(renderOpts.name);
- if (compConf && compConf.renderHeader) {
- return renderTitleContent(h, params, compConf.renderHeader.call($table, h, renderOpts, params, {
- $grid: $table.$xegrid,
- $excel: $table.$parent,
- $table: $table
- }));
- }
- }
- return renderTitleContent(h, params, UtilTools.formatText(column.getTitle(), 1));
- },
- renderDefaultHeader: function renderDefaultHeader(h, params) {
- return renderHelpIcon(h, params).concat(Cell.renderHeaderTitle(h, params));
- },
- renderDefaultCell: function renderDefaultCell(h, params) {
- var $table = params.$table,
- row = params.row,
- column = params.column;
- var slots = column.slots,
- editRender = column.editRender,
- cellRender = column.cellRender;
- var renderOpts = editRender || cellRender;
- if (slots && slots.default) {
- return slots.default.call($table, params, h);
- }
- if (renderOpts) {
- var funName = editRender ? 'renderCell' : 'renderDefault';
- var compConf = v_x_e_table.renderer.get(renderOpts.name);
- if (compConf && compConf[funName]) {
- return compConf[funName].call($table, h, renderOpts, Object.assign({
- $type: editRender ? 'edit' : 'cell',
- isEdit: !!editRender
- }, params), {
- $type: editRender ? 'edit' : 'cell',
- $grid: $table.$xegrid,
- $excel: $table.$parent,
- $table: $table
- });
- }
- }
- var cellValue = $table.getCellLabel(row, column);
- var cellPlaceholder = editRender ? editRender.placeholder : '';
- return [h('span', {
- class: 'vxe-cell--label'
- }, editRender && (cellValue === '' || ctor_amd_xe_utils_default.a.eqNull(cellValue)) ? [// 如果设置占位符
- h('span', {
- class: 'vxe-cell--placeholder'
- }, UtilTools.formatText(UtilTools.getFuncText(cellPlaceholder), 1))] : UtilTools.formatText(cellValue, 1))];
- },
- renderTreeCell: function renderTreeCell(h, params) {
- return Cell.renderTreeIcon(h, params, Cell.renderDefaultCell.call(this, h, params));
- },
- renderDefaultFooter: function renderDefaultFooter(h, params) {
- return [h('span', {
- class: 'vxe-cell--item'
- }, getFooterContent(h, params))];
- },
- /**
- * 树节点
- */
- renderTreeIcon: function renderTreeIcon(h, params, cellVNodes) {
- var $table = params.$table,
- isHidden = params.isHidden;
- var treeOpts = $table.treeOpts,
- treeExpandeds = $table.treeExpandeds,
- treeLazyLoadeds = $table.treeLazyLoadeds;
- var row = params.row,
- column = params.column,
- level = params.level;
- var slots = column.slots;
- var children = treeOpts.children,
- hasChild = treeOpts.hasChild,
- indent = treeOpts.indent,
- lazy = treeOpts.lazy,
- trigger = treeOpts.trigger,
- iconLoaded = treeOpts.iconLoaded,
- showIcon = treeOpts.showIcon,
- iconOpen = treeOpts.iconOpen,
- iconClose = treeOpts.iconClose;
- var rowChilds = row[children];
- var hasLazyChilds = false;
- var isAceived = false;
- var isLazyLoaded = false;
- var on = {};
- if (slots && slots.icon) {
- return slots.icon.call($table, params, h, cellVNodes);
- }
- if (!isHidden) {
- isAceived = treeExpandeds.indexOf(row) > -1;
- if (lazy) {
- isLazyLoaded = treeLazyLoadeds.indexOf(row) > -1;
- hasLazyChilds = row[hasChild];
- }
- }
- if (!trigger || trigger === 'default') {
- on.click = function (evnt) {
- return $table.triggerTreeExpandEvent(evnt, params);
- };
- }
- return [h('div', {
- class: ['vxe-cell--tree-node', {
- 'is--active': isAceived
- }],
- style: {
- paddingLeft: "".concat(level * indent, "px")
- }
- }, [showIcon && (rowChilds && rowChilds.length || hasLazyChilds) ? [h('div', {
- class: 'vxe-tree--btn-wrapper',
- on: on
- }, [h('i', {
- class: ['vxe-tree--node-btn', isLazyLoaded ? iconLoaded || conf.icon.TABLE_TREE_LOADED : isAceived ? iconOpen || conf.icon.TABLE_TREE_OPEN : iconClose || conf.icon.TABLE_TREE_CLOSE]
- })])] : null, h('div', {
- class: 'vxe-tree-cell'
- }, cellVNodes)])];
- },
- /**
- * 索引
- */
- renderIndexHeader: function renderIndexHeader(h, params) {
- var $table = params.$table,
- column = params.column;
- var slots = column.slots;
- return renderTitleContent(h, params, slots && slots.header ? slots.header.call($table, params, h) : UtilTools.formatText(column.getTitle(), 1));
- },
- renderIndexCell: function renderIndexCell(h, params) {
- var $table = params.$table,
- column = params.column;
- var seqOpts = $table.seqOpts,
- startIndex = $table.startIndex;
- var slots = column.slots;
- if (slots && slots.default) {
- return slots.default.call($table, params, h);
- }
- var $seq = params.$seq,
- seq = params.seq,
- level = params.level; // 在 v3.0 中废弃 startIndex、indexMethod
- var seqMethod = seqOpts.seqMethod || column.seqMethod || column.indexMethod;
- return [UtilTools.formatText(seqMethod ? seqMethod(params) : level ? "".concat($seq, ".").concat(seq) : (seqOpts.startIndex || startIndex) + seq, 1)];
- },
- renderTreeIndexCell: function renderTreeIndexCell(h, params) {
- return Cell.renderTreeIcon(h, params, Cell.renderIndexCell(h, params));
- },
- /**
- * 单选
- */
- renderRadioHeader: function renderRadioHeader(h, params) {
- var $table = params.$table,
- column = params.column;
- var slots = column.slots; // 在 v3.0 中废弃 label
- return renderTitleContent(h, params, slots && slots.header ? slots.header.call($table, params, h) : [h('span', {
- class: 'vxe-radio--label'
- }, UtilTools.formatText(column.getTitle(), 1))]);
- },
- renderRadioCell: function renderRadioCell(h, params) {
- var $table = params.$table,
- column = params.column,
- isHidden = params.isHidden;
- var radioOpts = $table.radioOpts,
- selectRow = $table.selectRow;
- var slots = column.slots;
- var labelField = radioOpts.labelField,
- checkMethod = radioOpts.checkMethod;
- var row = params.row;
- var isChecked = row === selectRow;
- var isDisabled = !!checkMethod;
- var on;
- if (!isHidden) {
- on = {
- click: function click(evnt) {
- if (!isDisabled) {
- $table.triggerRadioRowEvent(evnt, params);
- }
- }
- };
- if (checkMethod) {
- isDisabled = !checkMethod(params);
- }
- }
- return [h('span', {
- class: ['vxe-cell--radio', {
- 'is--checked': isChecked,
- 'is--disabled': isDisabled
- }],
- on: on
- }, [h('span', {
- class: 'vxe-radio--icon vxe-radio--checked-icon'
- }), h('span', {
- class: 'vxe-radio--icon vxe-radio--unchecked-icon'
- })].concat(slots && slots.default ? slots.default.call($table, params, h) : labelField ? [h('span', {
- class: 'vxe-radio--label'
- }, ctor_amd_xe_utils_default.a.get(row, labelField))] : []))];
- },
- renderTreeRadioCell: function renderTreeRadioCell(h, params) {
- return Cell.renderTreeIcon(h, params, Cell.renderRadioCell(h, params));
- },
- /**
- * 多选
- */
- renderSelectionHeader: function renderSelectionHeader(h, params) {
- var $table = params.$table,
- column = params.column,
- isHidden = params.isHidden;
- var isIndeterminate = $table.isIndeterminate,
- isAllCheckboxDisabled = $table.isAllCheckboxDisabled;
- var slots = column.slots,
- title = column.title,
- label = column.label;
- var checkboxOpts = $table.checkboxOpts; // 在 v3.0 中废弃 label
- var headerTitle = title || label;
- var isChecked = false;
- var on;
- if (checkboxOpts.checkStrictly ? !checkboxOpts.showHeader : checkboxOpts.showHeader === false) {
- return renderTitleContent(h, params, slots && slots.header ? slots.header.call($table, params, h) : [h('span', {
- class: 'vxe-checkbox--label'
- }, headerTitle)]);
- }
- if (!isHidden) {
- isChecked = isAllCheckboxDisabled ? false : $table.isAllSelected;
- on = {
- click: function click(evnt) {
- if (!isAllCheckboxDisabled) {
- $table.triggerCheckAllEvent(evnt, !isChecked);
- }
- }
- };
- }
- return renderTitleContent(h, params, [h('span', {
- class: ['vxe-cell--checkbox', {
- 'is--checked': isChecked,
- 'is--disabled': isAllCheckboxDisabled,
- 'is--indeterminate': isIndeterminate
- }],
- attrs: {
- title: conf.i18n('vxe.table.allTitle')
- },
- on: on
- }, [h('span', {
- class: 'vxe-checkbox--icon vxe-checkbox--checked-icon'
- }), h('span', {
- class: 'vxe-checkbox--icon vxe-checkbox--unchecked-icon'
- }), h('span', {
- class: 'vxe-checkbox--icon vxe-checkbox--indeterminate-icon'
- })].concat(slots && slots.header ? slots.header.call($table, params, h) : headerTitle ? [h('span', {
- class: 'vxe-checkbox--label'
- }, headerTitle)] : []))]);
- },
- renderSelectionCell: function renderSelectionCell(h, params) {
- var $table = params.$table,
- row = params.row,
- column = params.column,
- isHidden = params.isHidden;
- var treeConfig = $table.treeConfig,
- treeIndeterminates = $table.treeIndeterminates;
- var _$table$checkboxOpts = $table.checkboxOpts,
- labelField = _$table$checkboxOpts.labelField,
- checkMethod = _$table$checkboxOpts.checkMethod;
- var slots = column.slots;
- var indeterminate = false;
- var isChecked = false;
- var isDisabled = !!checkMethod;
- var on;
- if (!isHidden) {
- isChecked = $table.selection.indexOf(row) > -1;
- on = {
- click: function click(evnt) {
- if (!isDisabled) {
- $table.triggerCheckRowEvent(evnt, params, !isChecked);
- }
- }
- };
- if (checkMethod) {
- isDisabled = !checkMethod(params);
- }
- if (treeConfig) {
- indeterminate = treeIndeterminates.indexOf(row) > -1;
- }
- }
- return [h('span', {
- class: ['vxe-cell--checkbox', {
- 'is--checked': isChecked,
- 'is--disabled': isDisabled,
- 'is--indeterminate': indeterminate
- }],
- on: on
- }, [h('span', {
- class: 'vxe-checkbox--icon vxe-checkbox--checked-icon'
- }), h('span', {
- class: 'vxe-checkbox--icon vxe-checkbox--unchecked-icon'
- }), h('span', {
- class: 'vxe-checkbox--icon vxe-checkbox--indeterminate-icon'
- })].concat(slots && slots.default ? slots.default.call($table, params, h) : labelField ? [h('span', {
- class: 'vxe-checkbox--label'
- }, ctor_amd_xe_utils_default.a.get(row, labelField))] : []))];
- },
- renderTreeSelectionCell: function renderTreeSelectionCell(h, params) {
- return Cell.renderTreeIcon(h, params, Cell.renderSelectionCell(h, params));
- },
- renderSelectionCellByProp: function renderSelectionCellByProp(h, params) {
- var $table = params.$table,
- row = params.row,
- column = params.column,
- isHidden = params.isHidden;
- var treeConfig = $table.treeConfig,
- treeIndeterminates = $table.treeIndeterminates;
- var _$table$checkboxOpts2 = $table.checkboxOpts,
- labelField = _$table$checkboxOpts2.labelField,
- property = _$table$checkboxOpts2.checkField,
- halfField = _$table$checkboxOpts2.halfField,
- checkMethod = _$table$checkboxOpts2.checkMethod;
- var slots = column.slots;
- var indeterminate = false;
- var isChecked = false;
- var isDisabled = !!checkMethod;
- var on;
- if (!isHidden) {
- isChecked = ctor_amd_xe_utils_default.a.get(row, property);
- on = {
- click: function click(evnt) {
- if (!isDisabled) {
- $table.triggerCheckRowEvent(evnt, params, !isChecked);
- }
- }
- };
- if (checkMethod) {
- isDisabled = !checkMethod(params);
- }
- if (treeConfig) {
- indeterminate = treeIndeterminates.indexOf(row) > -1;
- }
- }
- return [h('span', {
- class: ['vxe-cell--checkbox', {
- 'is--checked': isChecked,
- 'is--disabled': isDisabled,
- 'is--indeterminate': halfField && !isChecked ? row[halfField] : indeterminate
- }],
- on: on
- }, [h('span', {
- class: 'vxe-checkbox--icon vxe-checkbox--checked-icon'
- }), h('span', {
- class: 'vxe-checkbox--icon vxe-checkbox--unchecked-icon'
- }), h('span', {
- class: 'vxe-checkbox--icon vxe-checkbox--indeterminate-icon'
- })].concat(slots && slots.default ? slots.default.call($table, params, h) : labelField ? [h('span', {
- class: 'vxe-checkbox--label'
- }, ctor_amd_xe_utils_default.a.get(row, labelField))] : []))];
- },
- renderTreeSelectionCellByProp: function renderTreeSelectionCellByProp(h, params) {
- return Cell.renderTreeIcon(h, params, Cell.renderSelectionCellByProp(h, params));
- },
- /**
- * 展开行
- */
- renderExpandCell: function renderExpandCell(h, params) {
- var $table = params.$table,
- isHidden = params.isHidden,
- row = params.row,
- column = params.column;
- var expandOpts = $table.expandOpts,
- rowExpandeds = $table.rowExpandeds,
- expandLazyLoadeds = $table.expandLazyLoadeds;
- var lazy = expandOpts.lazy,
- labelField = expandOpts.labelField,
- iconLoaded = expandOpts.iconLoaded,
- showIcon = expandOpts.showIcon,
- iconOpen = expandOpts.iconOpen,
- iconClose = expandOpts.iconClose,
- visibleMethod = expandOpts.visibleMethod;
- var slots = column.slots;
- var isAceived = false;
- var isLazyLoaded = false;
- if (slots && slots.icon) {
- return slots.icon.call($table, params, h);
- }
- if (!isHidden) {
- isAceived = rowExpandeds.indexOf(params.row) > -1;
- if (lazy) {
- isLazyLoaded = expandLazyLoadeds.indexOf(row) > -1;
- }
- }
- return [showIcon && (!visibleMethod || visibleMethod(params)) ? h('span', {
- class: ['vxe-table--expanded', {
- 'is--active': isAceived
- }],
- on: {
- click: function click(evnt) {
- $table.triggerRowExpandEvent(evnt, params);
- }
- }
- }, [h('i', {
- class: ['vxe-table--expand-btn', isLazyLoaded ? iconLoaded || conf.icon.TABLE_EXPAND_LOADED : isAceived ? iconOpen || conf.icon.TABLE_EXPAND_OPEN : iconClose || conf.icon.TABLE_EXPAND_CLOSE]
- })]) : null, slots && slots.default || labelField ? h('span', {
- class: 'vxe-table--expand-label'
- }, slots.default ? slots.default.call($table, params, h) : ctor_amd_xe_utils_default.a.get(row, labelField)) : null];
- },
- renderExpandData: function renderExpandData(h, params) {
- var $table = params.$table,
- column = params.column;
- var slots = column.slots,
- contentRender = column.contentRender;
- if (slots) {
- if (slots.content) {
- return slots.content.call($table, params, h);
- } // 在 v3.0 中严格支持 content
- if (slots.default) {
- return slots.default.call($table, params, h);
- }
- }
- if (contentRender) {
- var compConf = v_x_e_table.renderer.get(contentRender.name);
- if (compConf && compConf.renderExpand) {
- return compConf.renderExpand.call($table, h, contentRender, params, {
- $grid: $table.$xegrid,
- $table: $table
- });
- }
- }
- return [];
- },
- /**
- * HTML 标签
- */
- renderHTMLCell: function renderHTMLCell(h, params) {
- var $table = params.$table,
- column = params.column;
- var slots = column.slots;
- if (slots && slots.default) {
- return slots.default.call($table, params, h);
- }
- return [h('span', {
- class: 'vxe-cell--html',
- domProps: {
- innerHTML: getDefaultCellLabel(params)
- }
- })];
- },
- renderTreeHTMLCell: function renderTreeHTMLCell(h, params) {
- return Cell.renderTreeIcon(h, params, Cell.renderHTMLCell(h, params));
- },
- /**
- * 排序和筛选
- */
- renderSortAndFilterHeader: function renderSortAndFilterHeader(h, params) {
- return Cell.renderDefaultHeader(h, params).concat(Cell.renderSortIcon(h, params)).concat(Cell.renderFilterIcon(h, params));
- },
- /**
- * 排序
- */
- renderSortHeader: function renderSortHeader(h, params) {
- return Cell.renderDefaultHeader(h, params).concat(Cell.renderSortIcon(h, params));
- },
- renderSortIcon: function renderSortIcon(h, params) {
- var $table = params.$table,
- column = params.column;
- var _$table$sortOpts = $table.sortOpts,
- showIcon = _$table$sortOpts.showIcon,
- iconAsc = _$table$sortOpts.iconAsc,
- iconDesc = _$table$sortOpts.iconDesc;
- return showIcon ? [h('span', {
- class: 'vxe-cell--sort'
- }, [h('i', {
- class: ['vxe-sort--asc-btn', iconAsc || conf.icon.TABLE_SORT_ASC, {
- 'sort--active': column.order === 'asc'
- }],
- attrs: {
- title: conf.i18n('vxe.table.sortAsc')
- },
- on: {
- click: function click(evnt) {
- $table.triggerSortEvent(evnt, column, 'asc');
- }
- }
- }), h('i', {
- class: ['vxe-sort--desc-btn', iconDesc || conf.icon.TABLE_SORT_DESC, {
- 'sort--active': column.order === 'desc'
- }],
- attrs: {
- title: conf.i18n('vxe.table.sortDesc')
- },
- on: {
- click: function click(evnt) {
- $table.triggerSortEvent(evnt, column, 'desc');
- }
- }
- })])] : [];
- },
- /**
- * 筛选
- */
- renderFilterHeader: function renderFilterHeader(h, params) {
- return Cell.renderDefaultHeader(h, params).concat(Cell.renderFilterIcon(h, params));
- },
- renderFilterIcon: function renderFilterIcon(h, params) {
- var $table = params.$table,
- column = params.column,
- hasFilter = params.hasFilter;
- var filterStore = $table.filterStore,
- filterOpts = $table.filterOpts;
- var showIcon = filterOpts.showIcon,
- iconNone = filterOpts.iconNone,
- iconMatch = filterOpts.iconMatch;
- return showIcon ? [h('span', {
- class: ['vxe-cell--filter', {
- 'is--active': filterStore.visible && filterStore.column === column
- }]
- }, [h('i', {
- class: ['vxe-filter--btn', hasFilter ? iconMatch || conf.icon.TABLE_FILTER_MATCH : iconNone || conf.icon.TABLE_FILTER_NONE],
- attrs: {
- title: conf.i18n('vxe.table.filter')
- },
- on: {
- click: function click(evnt) {
- $table.triggerFilterEvent(evnt, params.column, params);
- }
- }
- })])] : [];
- },
- /**
- * 可编辑
- */
- renderEditHeader: function renderEditHeader(h, params) {
- var $table = params.$table,
- column = params.column;
- var editRules = $table.editRules,
- editOpts = $table.editOpts;
- var sortable = column.sortable,
- remoteSort = column.remoteSort,
- editRender = column.editRender,
- filters = column.filters;
- var isRequired;
- if (editRules) {
- var columnRules = ctor_amd_xe_utils_default.a.get(editRules, params.column.property);
- if (columnRules) {
- isRequired = columnRules.some(function (rule) {
- return rule.required;
- });
- }
- }
- return [isRequired && editOpts.showAsterisk ? h('i', {
- class: 'vxe-cell--required-icon'
- }) : null, UtilTools.isEnableConf(editRender) && editOpts.showIcon ? h('i', {
- class: ['vxe-cell--edit-icon', editOpts.icon || conf.icon.TABLE_EDIT]
- }) : null].concat(Cell.renderDefaultHeader(h, params)).concat(sortable || remoteSort ? Cell.renderSortIcon(h, params) : []).concat(filters ? Cell.renderFilterIcon(h, params) : []);
- },
- // 行格编辑模式
- renderRowEdit: function renderRowEdit(h, params) {
- var $table = params.$table,
- column = params.column;
- var editRender = column.editRender;
- var actived = $table.editStore.actived;
- return Cell.runRenderer(h, params, this, UtilTools.isEnableConf(editRender) && actived && actived.row === params.row);
- },
- renderTreeRowEdit: function renderTreeRowEdit(h, params) {
- return Cell.renderTreeIcon(h, params, Cell.renderRowEdit(h, params));
- },
- // 单元格编辑模式
- renderCellEdit: function renderCellEdit(h, params) {
- var $table = params.$table,
- column = params.column;
- var editRender = column.editRender;
- var actived = $table.editStore.actived;
- return Cell.runRenderer(h, params, this, UtilTools.isEnableConf(editRender) && actived && actived.row === params.row && actived.column === params.column);
- },
- renderTreeCellEdit: function renderTreeCellEdit(h, params) {
- return Cell.renderTreeIcon(h, params, Cell.renderCellEdit(h, params));
- },
- runRenderer: function runRenderer(h, params, _vm, isEdit) {
- var $table = params.$table,
- column = params.column;
- var slots = column.slots,
- editRender = column.editRender,
- formatter = column.formatter;
- var compConf = v_x_e_table.renderer.get(editRender.name);
- if (editRender.type === 'visible' || isEdit) {
- if (slots && slots.edit) {
- return slots.edit.call($table, params, h);
- }
- return compConf && compConf.renderEdit ? compConf.renderEdit.call($table, h, editRender, Object.assign({
- $type: 'edit',
- isEdit: true
- }, params), {
- $type: 'edit',
- $grid: $table.$xegrid,
- $excel: $table.$parent,
- $table: $table
- }) : [];
- }
- if (slots && slots.default) {
- return slots.default.call($table, params, h);
- }
- if (formatter) {
- return [h('span', {
- class: 'vxe-cell--label'
- }, [getDefaultCellLabel(params)])];
- }
- return Cell.renderDefaultCell.call(_vm, h, params);
- }
- };
- /* harmony default export */ var src_cell = (Cell);
- // CONCATENATED MODULE: ./packages/cell/index.js
- /* harmony default export */ var packages_cell = (src_cell);
- // CONCATENATED MODULE: ./packages/table/src/methods.js
- var methods_getRowid = UtilTools.getRowid,
- getRowkey = UtilTools.getRowkey,
- methods_setCellValue = UtilTools.setCellValue,
- hasChildrenList = UtilTools.hasChildrenList;
- var methods_browse = DomTools.browse,
- methods_calcHeight = DomTools.calcHeight,
- hasClass = DomTools.hasClass,
- addClass = DomTools.addClass,
- removeClass = DomTools.removeClass,
- getEventTargetNode = DomTools.getEventTargetNode;
- var isWebkit = methods_browse['-webkit'] && !methods_browse.edge;
- var debounceScrollYDuration = methods_browse.msie ? 40 : 20;
- var resizableStorageKey = 'VXE_TABLE_CUSTOM_COLUMN_WIDTH';
- var visibleStorageKey = 'VXE_TABLE_CUSTOM_COLUMN_VISIBLE';
- /**
- * 生成行的唯一主键
- */
- function getRowUniqueId() {
- return ctor_amd_xe_utils_default.a.uniqueId('row_');
- }
- function eqCellNull(cellValue) {
- return cellValue === '' || ctor_amd_xe_utils_default.a.eqNull(cellValue);
- }
- function eqCellValue(row1, row2, field) {
- var val1 = ctor_amd_xe_utils_default.a.get(row1, field);
- var val2 = ctor_amd_xe_utils_default.a.get(row2, field);
- if (eqCellNull(val1) && eqCellNull(val2)) {
- return true;
- }
- if (ctor_amd_xe_utils_default.a.isString(val1) || ctor_amd_xe_utils_default.a.isNumber(val1)) {
- /* eslint-disable eqeqeq */
- return val1 == val2;
- }
- return ctor_amd_xe_utils_default.a.isEqual(val1, val2);
- }
- function getNextSortOrder(_vm, column) {
- var orders = _vm.sortOpts.orders;
- var currOrder = column.order || null;
- var oIndex = orders.indexOf(currOrder) + 1;
- return orders[oIndex < orders.length ? oIndex : 0];
- }
- function getCustomStorageMap(key) {
- var version = conf.version;
- var rest = ctor_amd_xe_utils_default.a.toStringJSON(localStorage.getItem(key));
- return rest && rest._v === version ? rest : {
- _v: version
- };
- }
- function getRecoverRow(_vm, list) {
- var fullAllDataRowMap = _vm.fullAllDataRowMap;
- return list.filter(function (row) {
- return fullAllDataRowMap.has(row);
- });
- }
- function handleReserveRow(_vm, reserveRowMap) {
- var fullDataRowIdData = _vm.fullDataRowIdData;
- var reserveList = [];
- ctor_amd_xe_utils_default.a.each(reserveRowMap, function (item, rowid) {
- if (fullDataRowIdData[rowid] && reserveList.indexOf(fullDataRowIdData[rowid].row) === -1) {
- reserveList.push(fullDataRowIdData[rowid].row);
- }
- });
- return reserveList;
- }
- function setMerges(_vm, merges, mList, rowList) {
- if (merges) {
- var treeConfig = _vm.treeConfig,
- visibleColumn = _vm.visibleColumn;
- if (treeConfig) {
- throw new Error(UtilTools.getLog('vxe.error.noTree', ['merge-footer-items']));
- }
- if (!ctor_amd_xe_utils_default.a.isArray(merges)) {
- merges = [merges];
- }
- merges.forEach(function (item) {
- var row = item.row,
- col = item.col,
- rowspan = item.rowspan,
- colspan = item.colspan;
- if (rowList && ctor_amd_xe_utils_default.a.isNumber(row)) {
- row = rowList[row];
- }
- if (ctor_amd_xe_utils_default.a.isNumber(col)) {
- col = visibleColumn[col];
- }
- if ((rowList ? row : ctor_amd_xe_utils_default.a.isNumber(row)) && col && (rowspan || colspan)) {
- rowspan = ctor_amd_xe_utils_default.a.toNumber(rowspan) || 1;
- colspan = ctor_amd_xe_utils_default.a.toNumber(colspan) || 1;
- if (rowspan > 1 || colspan > 1) {
- var mcIndex = ctor_amd_xe_utils_default.a.findIndexOf(mList, function (item) {
- return item._row === row && item._col === col;
- });
- var mergeItem = mList[mcIndex];
- if (mergeItem) {
- mergeItem.rowspan = rowspan;
- mergeItem.colspan = colspan;
- mergeItem._rowspan = rowspan;
- mergeItem._colspan = colspan;
- } else {
- var mergeRowIndex = rowList ? rowList.indexOf(row) : row;
- var mergeColIndex = visibleColumn.indexOf(col);
- mList.push({
- row: mergeRowIndex,
- col: mergeColIndex,
- rowspan: rowspan,
- colspan: colspan,
- _row: row,
- _col: col,
- _rowspan: rowspan,
- _colspan: colspan
- });
- }
- }
- }
- });
- }
- }
- function removeMerges(_vm, merges, mList, rowList) {
- var rest = [];
- if (merges) {
- var treeConfig = _vm.treeConfig,
- visibleColumn = _vm.visibleColumn;
- if (treeConfig) {
- throw new Error(UtilTools.getLog('vxe.error.noTree', ['merge-cells']));
- }
- if (!ctor_amd_xe_utils_default.a.isArray(merges)) {
- merges = [merges];
- }
- merges.forEach(function (item) {
- var row = item.row,
- col = item.col;
- if (rowList && ctor_amd_xe_utils_default.a.isNumber(row)) {
- row = rowList[row];
- }
- if (ctor_amd_xe_utils_default.a.isNumber(col)) {
- col = visibleColumn[col];
- }
- var mcIndex = ctor_amd_xe_utils_default.a.findIndexOf(mList, function (item) {
- return item._row === row && item._col === col;
- });
- if (mcIndex > -1) {
- var rItems = mList.splice(mcIndex, 1);
- rest.push(rItems[0]);
- }
- });
- }
- return rest;
- }
- function getOrderField(_vm, column) {
- var sortBy = column.sortBy,
- sortType = column.sortType;
- if (sortBy && ctor_amd_xe_utils_default.a.isArray(sortBy)) {
- return sortBy;
- }
- return function (row) {
- var cellValue;
- if (sortBy) {
- cellValue = ctor_amd_xe_utils_default.a.isFunction(sortBy) ? sortBy({
- row: row,
- column: column
- }) : ctor_amd_xe_utils_default.a.get(row, sortBy);
- } else {
- cellValue = _vm.getCellLabel(row, column);
- }
- if (!sortType || sortType === 'auto') {
- return isNaN(cellValue) ? cellValue : ctor_amd_xe_utils_default.a.toNumber(cellValue);
- } else if (sortType === 'number') {
- return ctor_amd_xe_utils_default.a.toNumber(cellValue);
- } else if (sortType === 'string') {
- return ctor_amd_xe_utils_default.a.toValueString(cellValue);
- }
- return cellValue;
- };
- }
- var Methods = {
- /**
- * 获取父容器元素
- */
- getParentElem: function getParentElem() {
- return this.$xegrid ? this.$xegrid.$el.parentNode : this.$el.parentNode;
- },
- /**
- * 获取父容器的高度
- */
- getParentHeight: function getParentHeight() {
- return this.$xegrid ? this.$xegrid.getParentHeight() : this.getParentElem().clientHeight;
- },
- /**
- * 获取需要排除的高度
- * 但渲染表格高度时,需要排除工具栏或分页等相关组件的高度
- * 如果存在表尾合计滚动条,则需要排除滚动条高度
- */
- getExcludeHeight: function getExcludeHeight() {
- return this.$xegrid ? this.$xegrid.getExcludeHeight() : 0;
- },
- /**
- * 重置表格的一切数据状态
- */
- clearAll: function clearAll() {
- this.inited = false;
- this.clearSort();
- this.clearCurrentRow();
- this.clearCurrentColumn();
- this.clearRadioRow();
- this.clearRadioReserve();
- this.clearCheckboxRow();
- this.clearCheckboxReserve();
- this.clearRowExpand();
- this.clearRowExpandReserve();
- this.clearTreeExpand();
- this.clearTreeExpandReserve();
- if (v_x_e_table._edit) {
- this.clearActived();
- }
- if (v_x_e_table._filter) {
- this.clearFilter();
- }
- if (this.keyboardConfig || this.mouseConfig) {
- this.clearIndexChecked();
- this.clearHeaderChecked();
- this.clearChecked();
- this.clearSelected();
- this.clearCopyed();
- }
- if (this.mouseConfig) {
- this.clearCellAreas();
- this.clearCopyCellArea();
- }
- return this.clearScroll();
- },
- refreshData: function refreshData() {
- UtilTools.warn('vxe.error.delFunc', ['refreshData', 'syncData']);
- return this.syncData();
- },
- /**
- * 同步 data 数据
- * 如果用了该方法,那么组件将不再记录增删改的状态,只能自行实现对应逻辑
- * 对于某些特殊的场景,比如深层树节点元素发生变动时可能会用到
- */
- syncData: function syncData() {
- var _this = this;
- return this.$nextTick().then(function () {
- _this.tableData = [];
- return _this.$nextTick().then(function () {
- return _this.loadTableData(_this.tableFullData);
- });
- });
- },
- /**
- * 手动处理数据
- * 对于手动更改了排序、筛选...等条件后需要重新处理数据时可能会用到
- */
- updateData: function updateData() {
- return this.handleTableData(true).then(this.updateFooter).then(this.recalculate);
- },
- handleTableData: function handleTableData(force) {
- var scrollYLoad = this.scrollYLoad,
- scrollYStore = this.scrollYStore;
- var fullData = force ? this.updateAfterFullData() : this.afterFullData;
- this.tableData = scrollYLoad ? fullData.slice(scrollYStore.startIndex, Math.max(scrollYStore.startIndex + scrollYStore.renderSize, 1)) : fullData.slice(0);
- return this.$nextTick();
- },
- /**
- * 加载表格数据
- * @param {Array} datas 数据
- */
- loadTableData: function loadTableData(datas) {
- var _this2 = this;
- var keepSource = this.keepSource,
- treeConfig = this.treeConfig,
- editStore = this.editStore,
- sYOpts = this.sYOpts,
- scrollYStore = this.scrollYStore;
- var tableFullData = datas ? datas.slice(0) : [];
- var scrollYLoad = !treeConfig && sYOpts.enabled && sYOpts.gt > -1 && sYOpts.gt < tableFullData.length;
- scrollYStore.startIndex = 0;
- scrollYStore.visibleIndex = 0;
- scrollYStore.renderSize = 1;
- editStore.insertList = [];
- editStore.removeList = []; // 全量数据
- this.tableFullData = tableFullData; // 缓存数据
- this.updateCache(true); // 原始数据
- this.tableSynchData = datas;
- if (keepSource) {
- this.tableSourceData = ctor_amd_xe_utils_default.a.clone(tableFullData, true);
- }
- this.scrollYLoad = scrollYLoad;
- if (scrollYLoad) {
- if (!(this.height || this.maxHeight)) {
- UtilTools.error('vxe.error.reqProp', ['height | max-height']);
- }
- if (!this.showOverflow) {
- UtilTools.warn('vxe.error.reqProp', ['show-overflow']);
- }
- if (this.spanMethod) {
- UtilTools.warn('vxe.error.scrollErrProp', ['span-method']);
- }
- }
- this.clearMergeCells();
- this.clearMergeFooterItems();
- this.handleTableData(true);
- this.updateFooter();
- return this.computeScrollLoad().then(function () {
- // 是否加载了数据
- _this2.isLoadData = true;
- _this2.computeRowHeight();
- _this2.handleReserveStatus();
- _this2.checkSelectionStatus();
- return _this2.$nextTick().then(_this2.recalculate).then(_this2.refreshScroll);
- });
- },
- /**
- * 重新加载数据,不会清空表格状态
- * @param {Array} datas 数据
- */
- loadData: function loadData(datas) {
- this.inited = true;
- return this.loadTableData(datas).then(this.recalculate);
- },
- /**
- * 重新加载数据,会清空表格状态
- * @param {Array} datas 数据
- */
- reloadData: function reloadData(datas) {
- var _this3 = this;
- return this.clearAll().then(function () {
- _this3.inited = true;
- return _this3.loadTableData(datas);
- }).then(this.handleDefaults);
- },
- /**
- * 局部加载行数据并恢复到初始状态
- * 对于行数据需要局部更改的场景中可能会用到
- * @param {Row} row 行对象
- * @param {Object} record 新数据
- * @param {String} field 字段名
- */
- reloadRow: function reloadRow(row, record, field) {
- var tableSourceData = this.tableSourceData,
- tableData = this.tableData; // 在 v3 中必须要开启 keep-source
- if (!this.keepSource) {
- UtilTools.warn('vxe.error.reqProp', ['keep-source']);
- return this.$nextTick();
- }
- var rowIndex = this.getRowIndex(row);
- var oRow = tableSourceData[rowIndex];
- if (oRow && row) {
- if (field) {
- ctor_amd_xe_utils_default.a.set(oRow, field, ctor_amd_xe_utils_default.a.get(record || row, field));
- } else {
- if (record) {
- tableSourceData[rowIndex] = record;
- ctor_amd_xe_utils_default.a.clear(row, undefined);
- Object.assign(row, this.defineField(Object.assign({}, record)));
- this.updateCache(true);
- } else {
- ctor_amd_xe_utils_default.a.destructuring(oRow, ctor_amd_xe_utils_default.a.clone(row, true));
- }
- }
- }
- this.tableData = tableData.slice(0);
- return this.$nextTick();
- },
- /**
- * 加载列配置
- * 对于表格列需要重载、局部递增场景下可能会用到
- * @param {ColumnInfo} columns 列配置
- */
- loadColumn: function loadColumn(columns) {
- var _this4 = this;
- this.collectColumn = ctor_amd_xe_utils_default.a.mapTree(columns, function (column) {
- return packages_cell.createColumn(_this4, column);
- });
- return this.$nextTick();
- },
- /**
- * 加载列配置并恢复到初始状态
- * 对于表格列需要重载、局部递增场景下可能会用到
- * @param {ColumnInfo} columns 列配置
- */
- reloadColumn: function reloadColumn(columns) {
- var _this5 = this;
- return this.clearAll().then(function () {
- return _this5.loadColumn(columns);
- });
- },
- /**
- * 更新数据行的 Map
- * 牺牲数据组装的耗时,用来换取使用过程中的流畅
- */
- updateCache: function updateCache(source) {
- var _this6 = this;
- var treeConfig = this.treeConfig,
- treeOpts = this.treeOpts,
- tableFullData = this.tableFullData,
- fullDataRowMap = this.fullDataRowMap,
- fullAllDataRowMap = this.fullAllDataRowMap;
- var fullDataRowIdData = this.fullDataRowIdData,
- fullAllDataRowIdData = this.fullAllDataRowIdData;
- var rowkey = getRowkey(this);
- var isLazy = treeConfig && treeOpts.lazy;
- var handleCache = function handleCache(row, index, items, path, parent) {
- var rowid = methods_getRowid(_this6, row);
- if (UtilTools.eqEmptyValue(rowid)) {
- rowid = getRowUniqueId();
- ctor_amd_xe_utils_default.a.set(row, rowkey, rowid);
- }
- if (isLazy && row[treeOpts.hasChild] && ctor_amd_xe_utils_default.a.isUndefined(row[treeOpts.children])) {
- row[treeOpts.children] = null;
- }
- var rest = {
- row: row,
- rowid: rowid,
- index: treeConfig && parent ? -1 : index,
- items: items,
- parent: parent
- };
- if (source) {
- fullDataRowIdData[rowid] = rest;
- fullDataRowMap.set(row, rest);
- }
- fullAllDataRowIdData[rowid] = rest;
- fullAllDataRowMap.set(row, rest);
- };
- if (source) {
- fullDataRowIdData = this.fullDataRowIdData = {};
- fullDataRowMap.clear();
- }
- fullAllDataRowIdData = this.fullAllDataRowIdData = {};
- fullAllDataRowMap.clear();
- if (treeConfig) {
- ctor_amd_xe_utils_default.a.eachTree(tableFullData, handleCache, treeOpts);
- } else {
- tableFullData.forEach(handleCache);
- }
- },
- loadChildren: function loadChildren(row, childRecords) {
- var _this7 = this;
- return this.createData(childRecords).then(function (rows) {
- var keepSource = _this7.keepSource,
- tableSourceData = _this7.tableSourceData,
- treeOpts = _this7.treeOpts,
- fullDataRowIdData = _this7.fullDataRowIdData,
- fullDataRowMap = _this7.fullDataRowMap,
- fullAllDataRowMap = _this7.fullAllDataRowMap,
- fullAllDataRowIdData = _this7.fullAllDataRowIdData;
- var children = treeOpts.children;
- if (keepSource) {
- var rowid = methods_getRowid(_this7, row);
- var matchObj = ctor_amd_xe_utils_default.a.findTree(tableSourceData, function (item) {
- return rowid === methods_getRowid(_this7, item);
- }, treeOpts);
- if (matchObj) {
- matchObj.item[children] = ctor_amd_xe_utils_default.a.clone(rows, true);
- }
- }
- ctor_amd_xe_utils_default.a.eachTree(rows, function (childRow, index, items, path, parent) {
- var rowid = methods_getRowid(_this7, childRow);
- var rest = {
- row: childRow,
- rowid: rowid,
- index: -1,
- items: items,
- parent: parent
- };
- fullDataRowIdData[rowid] = rest;
- fullDataRowMap.set(childRow, rest);
- fullAllDataRowIdData[rowid] = rest;
- fullAllDataRowMap.set(childRow, rest);
- }, treeOpts);
- row[children] = rows;
- return rows;
- });
- },
- /**
- * 更新数据列的 Map
- * 牺牲数据组装的耗时,用来换取使用过程中的流畅
- */
- cacheColumnMap: function cacheColumnMap() {
- var isGroup = this.isGroup,
- tableFullColumn = this.tableFullColumn,
- collectColumn = this.collectColumn,
- fullColumnMap = this.fullColumnMap;
- var fullColumnIdData = this.fullColumnIdData = {};
- var fullColumnFieldData = this.fullColumnFieldData = {};
- var expandColumn;
- var treeNodeColumn;
- var checkboxColumn;
- var radioColumn;
- var hasFixed;
- var handleFunc = function handleFunc(column, index, items, path, parent) {
- var colid = column.id,
- property = column.property,
- fixed = column.fixed,
- type = column.type,
- treeNode = column.treeNode;
- var rest = {
- column: column,
- colid: colid,
- index: index,
- items: items,
- parent: parent
- };
- if (property) {
- if (fullColumnFieldData[property]) {
- UtilTools.warn('vxe.error.colRepet', ['field', property]);
- }
- fullColumnFieldData[property] = rest;
- }
- if (!hasFixed && fixed) {
- hasFixed = fixed;
- }
- if (treeNode) {
- if (treeNodeColumn) {
- UtilTools.warn('vxe.error.colRepet', ['tree-node', treeNode]);
- }
- if (!treeNodeColumn) {
- treeNodeColumn = column;
- }
- } else if (type === 'expand') {
- if (expandColumn) {
- UtilTools.warn('vxe.error.colRepet', ['type', type]);
- }
- if (!expandColumn) {
- expandColumn = column;
- }
- }
- if (type === 'checkbox') {
- if (checkboxColumn) {
- UtilTools.warn('vxe.error.colRepet', ['type', type]);
- }
- if (!checkboxColumn) {
- checkboxColumn = column;
- }
- } else if (type === 'radio') {
- if (radioColumn) {
- UtilTools.warn('vxe.error.colRepet', ['type', type]);
- }
- if (!radioColumn) {
- radioColumn = column;
- }
- }
- if (fullColumnIdData[colid]) {
- UtilTools.error('vxe.error.colRepet', ['colId', colid]);
- }
- fullColumnIdData[colid] = rest;
- fullColumnMap.set(column, rest);
- };
- fullColumnMap.clear();
- if (isGroup) {
- ctor_amd_xe_utils_default.a.eachTree(collectColumn, function (column, index, items, path, parent, nodes) {
- column.level = nodes.length;
- handleFunc(column, index, items, path, parent);
- });
- } else {
- tableFullColumn.forEach(handleFunc);
- }
- if (expandColumn && hasFixed) {
- UtilTools.warn('vxe.error.errConflicts', ['column.fixed', 'column.type=expand']);
- }
- if (expandColumn && this.mouseOpts.area) {
- UtilTools.error('vxe.error.errConflicts', ['mouse-config.area', 'column.type=expand']);
- }
- this.treeNodeColumn = treeNodeColumn;
- this.expandColumn = expandColumn;
- },
- /**
- * 根据 tr 元素获取对应的 row 信息
- * @param {Element} tr 元素
- */
- getRowNode: function getRowNode(tr) {
- if (tr) {
- var fullAllDataRowIdData = this.fullAllDataRowIdData;
- var rowid = tr.getAttribute('data-rowid');
- var rest = fullAllDataRowIdData[rowid];
- if (rest) {
- return {
- rowid: rest.rowid,
- item: rest.row,
- index: rest.index,
- items: rest.items,
- parent: rest.parent
- };
- }
- }
- return null;
- },
- /**
- * 根据 th/td 元素获取对应的 column 信息
- * @param {Element} cell 元素
- */
- getColumnNode: function getColumnNode(cell) {
- if (cell) {
- var fullColumnIdData = this.fullColumnIdData;
- var colid = cell.getAttribute('data-colid');
- var rest = fullColumnIdData[colid];
- if (rest) {
- return {
- colid: rest.colid,
- item: rest.column,
- index: rest.index,
- items: rest.items,
- parent: rest.parent
- };
- }
- }
- return null;
- },
- /**
- * 根据 row 获取相对于 data 中的索引
- * @param {Row} row 行对象
- */
- getRowIndex: function getRowIndex(row) {
- return this.fullDataRowMap.has(row) ? this.fullDataRowMap.get(row).index : -1;
- },
- /**
- * 根据 row 获取相对于当前数据中的索引
- * @param {Row} row 行对象
- */
- getVTRowIndex: function getVTRowIndex(row) {
- return this.afterFullData.indexOf(row);
- },
- // 在 v3 中废弃
- _getRowIndex: function _getRowIndex(row) {
- UtilTools.warn('vxe.error.delFunc', ['_getRowIndex', 'getVTRowIndex']);
- return this.getVTRowIndex(row);
- },
- /**
- * 根据 row 获取渲染中的虚拟索引
- * @param {Row} row 行对象
- */
- getVMRowIndex: function getVMRowIndex(row) {
- return this.tableData.indexOf(row);
- },
- // 在 v3 中废弃
- $getRowIndex: function $getRowIndex(row) {
- UtilTools.warn('vxe.error.delFunc', ['$getRowIndex', 'getVMRowIndex']);
- return this.getVMRowIndex(row);
- },
- /**
- * 根据 column 获取相对于 columns 中的索引
- * @param {ColumnInfo} column 列配置
- */
- getColumnIndex: function getColumnIndex(column) {
- return this.fullColumnMap.has(column) ? this.fullColumnMap.get(column).index : -1;
- },
- /**
- * 根据 column 获取相对于当前表格列中的索引
- * @param {ColumnInfo} column 列配置
- */
- getVTColumnIndex: function getVTColumnIndex(column) {
- return this.visibleColumn.indexOf(column);
- },
- // 在 v3 中废弃
- _getColumnIndex: function _getColumnIndex(column) {
- UtilTools.warn('vxe.error.delFunc', ['_getColumnIndex', 'getVTColumnIndex']);
- return this.getVTColumnIndex(column);
- },
- /**
- * 根据 column 获取渲染中的虚拟索引
- * @param {ColumnInfo} column 列配置
- */
- getVMColumnIndex: function getVMColumnIndex(column) {
- return this.tableColumn.indexOf(column);
- },
- // 在 v3 中废弃
- $getColumnIndex: function $getColumnIndex(column) {
- UtilTools.warn('vxe.error.delFunc', ['$getColumnIndex', 'getVMColumnIndex']);
- return this.getVMColumnIndex(column);
- },
- /**
- * 判断是否为索引列
- * @param {ColumnInfo} column 列配置
- */
- isSeqColumn: function isSeqColumn(column) {
- return column && (column.type === 'seq' || column.type === 'index');
- },
- /**
- * 定义行数据中的列属性,如果不存在则定义
- * @param {Row} record 行数据
- */
- defineField: function defineField(record) {
- var radioOpts = this.radioOpts,
- checkboxOpts = this.checkboxOpts,
- treeConfig = this.treeConfig,
- treeOpts = this.treeOpts,
- expandOpts = this.expandOpts;
- var rowkey = getRowkey(this);
- this.visibleColumn.forEach(function (_ref) {
- var property = _ref.property,
- editRender = _ref.editRender;
- if (property && !ctor_amd_xe_utils_default.a.has(record, property)) {
- ctor_amd_xe_utils_default.a.set(record, property, editRender && !ctor_amd_xe_utils_default.a.isUndefined(editRender.defaultValue) ? editRender.defaultValue : null);
- }
- });
- var ohterFields = [radioOpts.labelField, checkboxOpts.checkField, checkboxOpts.labelField, expandOpts.labelField];
- ohterFields.forEach(function (key) {
- if (key && UtilTools.eqEmptyValue(ctor_amd_xe_utils_default.a.get(record, key))) {
- ctor_amd_xe_utils_default.a.set(record, key, null);
- }
- });
- if (treeConfig && treeOpts.lazy && ctor_amd_xe_utils_default.a.isUndefined(record[treeOpts.children])) {
- record[treeOpts.children] = null;
- } // 必须有行数据的唯一主键,可以自行设置;也可以默认生成一个随机数
- if (UtilTools.eqEmptyValue(ctor_amd_xe_utils_default.a.get(record, rowkey))) {
- ctor_amd_xe_utils_default.a.set(record, rowkey, getRowUniqueId());
- }
- return record;
- },
- /**
- * 创建 data 对象
- * 对于某些特殊场景可能会用到,会自动对数据的字段名进行检测,如果不存在就自动定义
- * @param {Array} records 新数据
- */
- createData: function createData(records) {
- var _this8 = this;
- var treeConfig = this.treeConfig,
- treeOpts = this.treeOpts;
- var handleRrecord = function handleRrecord(record) {
- return _this8.defineField(Object.assign({}, record));
- };
- var rows = treeConfig ? ctor_amd_xe_utils_default.a.mapTree(records, handleRrecord, treeOpts) : records.map(handleRrecord);
- return this.$nextTick().then(function () {
- return rows;
- });
- },
- /**
- * 创建 Row|Rows 对象
- * 对于某些特殊场景需要对数据进行手动插入时可能会用到
- * @param {Array/Object} records 新数据
- */
- createRow: function createRow(records) {
- var _this9 = this;
- var isArr = ctor_amd_xe_utils_default.a.isArray(records);
- if (!isArr) {
- records = [records];
- }
- return this.$nextTick().then(function () {
- return _this9.createData(records).then(function (rows) {
- return isArr ? rows : rows[0];
- });
- });
- },
- revert: function revert() {
- UtilTools.warn('vxe.error.delFunc', ['revert', 'revertData']);
- return this.revertData.apply(this, arguments);
- },
- /**
- * 还原数据
- * 如果不传任何参数,则还原整个表格
- * 如果传 row 则还原一行
- * 如果传 rows 则还原多行
- * 如果还额外传了 field 则还原指定的单元格数据
- */
- revertData: function revertData(rows, field) {
- var _this10 = this;
- var tableSourceData = this.tableSourceData,
- treeConfig = this.treeConfig; // 在 v3 中必须要开启 keep-source
- if (!this.keepSource) {
- UtilTools.warn('vxe.error.reqProp', ['keep-source']);
- return this.$nextTick();
- }
- var targetRows = rows;
- if (rows) {
- if (!ctor_amd_xe_utils_default.a.isArray(rows)) {
- targetRows = [rows];
- }
- } else {
- targetRows = ctor_amd_xe_utils_default.a.toArray(this.getUpdateRecords());
- }
- if (targetRows.length) {
- targetRows.forEach(function (row) {
- if (!_this10.isInsertByRow(row)) {
- var rowIndex = _this10.getRowIndex(row);
- if (treeConfig && rowIndex === -1) {
- throw new Error(UtilTools.getLog('vxe.error.noTree', ['revertData']));
- }
- var oRow = tableSourceData[rowIndex];
- if (oRow && row) {
- if (field) {
- ctor_amd_xe_utils_default.a.set(row, field, ctor_amd_xe_utils_default.a.clone(ctor_amd_xe_utils_default.a.get(oRow, field), true));
- } else {
- ctor_amd_xe_utils_default.a.destructuring(row, ctor_amd_xe_utils_default.a.clone(oRow, true));
- }
- }
- }
- });
- }
- if (rows) {
- return this.$nextTick();
- }
- return this.reloadData(tableSourceData);
- },
- /**
- * 清空单元格内容
- * 如果不创参数,则清空整个表格内容
- * 如果传 row 则清空一行内容
- * 如果传 rows 则清空多行内容
- * 如果还额外传了 field 则清空指定单元格内容
- * @param {Array/Row} rows 行数据
- * @param {String} field 字段名
- */
- clearData: function clearData(rows, field) {
- var tableFullData = this.tableFullData,
- visibleColumn = this.visibleColumn;
- if (!arguments.length) {
- rows = tableFullData;
- } else if (rows && !ctor_amd_xe_utils_default.a.isArray(rows)) {
- rows = [rows];
- }
- if (field) {
- rows.forEach(function (row) {
- return ctor_amd_xe_utils_default.a.set(row, field, null);
- });
- } else {
- rows.forEach(function (row) {
- visibleColumn.forEach(function (column) {
- if (column.property) {
- methods_setCellValue(row, column, null);
- }
- });
- });
- }
- return this.$nextTick();
- },
- /**
- * 检查是否为临时行数据
- * @param {Row} row 行对象
- */
- isInsertByRow: function isInsertByRow(row) {
- return this.editStore.insertList.indexOf(row) > -1;
- },
- // 在 v3.0 中废弃 hasRowChange
- hasRowChange: function hasRowChange(row, field) {
- UtilTools.warn('vxe.error.delFunc', ['hasRowChange', 'isUpdateByRow']);
- return this.isUpdateByRow(row, field);
- },
- /**
- * 检查行或列数据是否发生改变
- * @param {Row} row 行对象
- * @param {String} field 字段名
- */
- isUpdateByRow: function isUpdateByRow(row, field) {
- var _this11 = this;
- var visibleColumn = this.visibleColumn,
- keepSource = this.keepSource,
- treeConfig = this.treeConfig,
- treeOpts = this.treeOpts,
- tableSourceData = this.tableSourceData,
- fullDataRowIdData = this.fullDataRowIdData;
- if (keepSource) {
- var oRow, property;
- var rowid = methods_getRowid(this, row); // 新增的数据不需要检测
- if (!fullDataRowIdData[rowid]) {
- return false;
- }
- if (treeConfig) {
- var children = treeOpts.children;
- var matchObj = ctor_amd_xe_utils_default.a.findTree(tableSourceData, function (item) {
- return rowid === methods_getRowid(_this11, item);
- }, treeOpts);
- row = Object.assign({}, row, _defineProperty({}, children, null));
- if (matchObj) {
- oRow = Object.assign({}, matchObj.item, _defineProperty({}, children, null));
- }
- } else {
- var oRowIndex = fullDataRowIdData[rowid].index;
- oRow = tableSourceData[oRowIndex];
- }
- if (oRow) {
- if (arguments.length > 1) {
- return !eqCellValue(oRow, row, field);
- }
- for (var index = 0, len = visibleColumn.length; index < len; index++) {
- property = visibleColumn[index].property;
- if (property && !eqCellValue(oRow, row, property)) {
- return true;
- }
- }
- }
- }
- return false;
- },
- /**
- * 获取表格的可视列,也可以指定索引获取列
- * @param {Number} columnIndex 索引
- */
- getColumns: function getColumns(columnIndex) {
- var columns = this.visibleColumn;
- return arguments.length ? columns[columnIndex] : columns.slice(0);
- },
- /**
- * 根据列的唯一主键获取列
- * @param {String} colid 列主键
- */
- getColumnById: function getColumnById(colid) {
- var fullColumnIdData = this.fullColumnIdData;
- return fullColumnIdData[colid] ? fullColumnIdData[colid].column : null;
- },
- /**
- * 根据列的字段名获取列
- * @param {String} field 字段名
- */
- getColumnByField: function getColumnByField(field) {
- var fullColumnFieldData = this.fullColumnFieldData;
- return fullColumnFieldData[field] ? fullColumnFieldData[field].column : null;
- },
- /**
- * 获取当前表格的列
- * 收集到的全量列、全量表头列、处理条件之后的全量表头列、当前渲染中的表头列
- */
- getTableColumn: function getTableColumn() {
- return {
- collectColumn: this.collectColumn.slice(0),
- fullColumn: this.tableFullColumn.slice(0),
- visibleColumn: this.visibleColumn.slice(0),
- tableColumn: this.tableColumn.slice(0)
- };
- },
- // 在 v3.0 中废弃 getRecords
- getRecords: function getRecords() {
- UtilTools.warn('vxe.error.delFunc', ['getRecords', 'getData']);
- return this.getData.apply(this, arguments);
- },
- /**
- * 获取数据,和 data 的行为一致,也可以指定索引获取数据
- */
- getData: function getData(rowIndex) {
- var tableSynchData = this.data || this.tableSynchData;
- return arguments.length ? tableSynchData[rowIndex] : tableSynchData.slice(0);
- },
- // 在 v3.0 中废弃 getAllRecords
- getAllRecords: function getAllRecords() {
- UtilTools.warn('vxe.error.delFunc', ['getAllRecords', 'getRecordset']);
- return this.getRecordset();
- },
- // 在 v3.0 中废弃 getSelectRecords
- getSelectRecords: function getSelectRecords() {
- UtilTools.warn('vxe.error.delFunc', ['getSelectRecords', 'getCheckboxRecords']);
- return this.getCheckboxRecords();
- },
- /**
- * 用于多选行,获取已选中的数据
- */
- getCheckboxRecords: function getCheckboxRecords() {
- var tableFullData = this.tableFullData,
- treeConfig = this.treeConfig,
- treeOpts = this.treeOpts,
- checkboxOpts = this.checkboxOpts;
- var property = checkboxOpts.checkField;
- var rowList = [];
- if (property) {
- if (treeConfig) {
- rowList = ctor_amd_xe_utils_default.a.filterTree(tableFullData, function (row) {
- return ctor_amd_xe_utils_default.a.get(row, property);
- }, treeOpts);
- } else {
- rowList = tableFullData.filter(function (row) {
- return ctor_amd_xe_utils_default.a.get(row, property);
- });
- }
- } else {
- var selection = this.selection;
- if (treeConfig) {
- rowList = ctor_amd_xe_utils_default.a.filterTree(tableFullData, function (row) {
- return selection.indexOf(row) > -1;
- }, treeOpts);
- } else {
- rowList = tableFullData.filter(function (row) {
- return selection.indexOf(row) > -1;
- });
- }
- }
- return rowList;
- },
- /**
- * 获取处理后全量的表格数据
- * 如果存在筛选条件,继续处理
- */
- updateAfterFullData: function updateAfterFullData() {
- var _this12 = this;
- var tableFullColumn = this.tableFullColumn,
- tableFullData = this.tableFullData,
- remoteSort = this.remoteSort,
- remoteFilter = this.remoteFilter,
- filterOpts = this.filterOpts,
- sortOpts = this.sortOpts;
- var tableData = tableFullData.slice(0);
- var column = ctor_amd_xe_utils_default.a.find(tableFullColumn, function (column) {
- return column.order;
- });
- var filterColumns = [];
- var orderColumns = [];
- tableFullColumn.forEach(function (column) {
- if (column.filters && column.filters.length) {
- var valueList = [];
- var itemList = [];
- column.filters.forEach(function (item) {
- if (item.checked) {
- itemList.push(item);
- valueList.push(item.value);
- }
- });
- filterColumns.push({
- column: column,
- valueList: valueList,
- itemList: itemList
- });
- }
- if (column.sortable && column.order) {
- orderColumns.push({
- column: column,
- sortBy: column.sortBy,
- property: column.property,
- order: column.order
- });
- }
- });
- if (filterColumns.length) {
- tableData = tableData.filter(function (row) {
- return filterColumns.every(function (_ref2) {
- var column = _ref2.column,
- valueList = _ref2.valueList,
- itemList = _ref2.itemList;
- if (valueList.length && !(filterOpts.remote || remoteFilter)) {
- var filterRender = column.filterRender,
- property = column.property;
- var filterMethod = column.filterMethod;
- var allFilterMethod = filterOpts.filterMethod;
- var compConf = filterRender ? v_x_e_table.renderer.get(filterRender.name) : null;
- var compFilterMethod = compConf && compConf.renderFilter ? compConf.filterMethod : null;
- var defaultFilterMethod = compConf ? compConf.defaultFilterMethod : null;
- var cellValue = UtilTools.getCellValue(row, column);
- if (filterMethod) {
- return itemList.some(function (item) {
- return filterMethod({
- value: item.value,
- option: item,
- cellValue: cellValue,
- row: row,
- column: column,
- $table: _this12
- });
- });
- } else if (compFilterMethod) {
- return itemList.some(function (item) {
- return compFilterMethod({
- value: item.value,
- option: item,
- cellValue: cellValue,
- row: row,
- column: column,
- $table: _this12
- });
- });
- } else if (allFilterMethod) {
- return allFilterMethod({
- options: itemList,
- values: valueList,
- cellValue: cellValue,
- row: row,
- column: column
- });
- } else if (defaultFilterMethod) {
- return itemList.some(function (item) {
- return defaultFilterMethod({
- value: item.value,
- option: item,
- cellValue: cellValue,
- row: row,
- column: column,
- $table: _this12
- });
- });
- }
- return valueList.indexOf(ctor_amd_xe_utils_default.a.get(row, property)) > -1;
- }
- return true;
- });
- });
- }
- if (column && column.order) {
- var allSortMethod = sortOpts.sortMethod || this.sortMethod;
- var isRemote = ctor_amd_xe_utils_default.a.isBoolean(column.remoteSort) ? column.remoteSort : sortOpts.remote || remoteSort;
- if (!isRemote) {
- if (allSortMethod) {
- tableData = allSortMethod({
- data: tableData,
- column: column,
- property: column.property,
- order: column.order,
- sortList: orderColumns,
- $table: this
- }) || tableData;
- } else {
- var rest = column.sortMethod ? tableData.sort(column.sortMethod) : ctor_amd_xe_utils_default.a.orderBy(tableData, getOrderField(this, column));
- tableData = column.order === 'desc' ? rest.reverse() : rest;
- }
- }
- }
- this.afterFullData = tableData;
- return tableData;
- },
- /**
- * 根据行的唯一主键获取行
- * @param {String/Number} rowid 行主键
- */
- getRowById: function getRowById(rowid) {
- var fullDataRowIdData = this.fullDataRowIdData;
- return fullDataRowIdData[rowid] ? fullDataRowIdData[rowid].row : null;
- },
- /**
- * 根据行获取行的唯一主键
- * @param {Row} row 行对象
- */
- getRowid: function getRowid(row) {
- var fullAllDataRowMap = this.fullAllDataRowMap;
- return fullAllDataRowMap.has(row) ? fullAllDataRowMap.get(row).rowid : null;
- },
- /**
- * 获取处理后的表格数据
- * 如果存在筛选条件,继续处理
- * 如果存在排序,继续处理
- */
- getTableData: function getTableData() {
- var tableFullData = this.tableFullData,
- afterFullData = this.afterFullData,
- tableData = this.tableData,
- footerTableData = this.footerTableData;
- return {
- fullData: tableFullData.slice(0),
- visibleData: afterFullData.slice(0),
- tableData: tableData.slice(0),
- footerData: footerTableData.slice(0)
- };
- },
- /**
- * 默认行为只允许执行一次
- */
- handleDefaults: function handleDefaults() {
- var _this13 = this;
- // 在 v3.0 中废弃 selectConfig
- var checkboxConfig = this.checkboxConfig || this.selectConfig;
- if (checkboxConfig) {
- this.handleDefaultSelectionChecked();
- }
- if (this.radioConfig) {
- this.handleDefaultRadioChecked();
- }
- if (this.sortConfig) {
- this.handleDefaultSort();
- }
- if (this.expandConfig) {
- this.handleDefaultRowExpand();
- }
- if (this.treeConfig) {
- this.handleDefaultTreeExpand();
- }
- if (this.mergeCells) {
- this.handleDefaultMergeCells();
- }
- if (this.mergeFooterItems) {
- this.handleDefaultMergeFooterItems();
- }
- this.$nextTick(function () {
- return setTimeout(_this13.recalculate);
- });
- },
- /**
- * 动态列处理
- */
- mergeCustomColumn: function mergeCustomColumn(customColumns) {
- var tableFullColumn = this.tableFullColumn;
- this.isUpdateCustoms = true;
- if (customColumns.length) {
- tableFullColumn.forEach(function (column) {
- // 在 v3.0 中废弃 prop
- var item = ctor_amd_xe_utils_default.a.find(customColumns, function (item) {
- return column.property && (item.field || item.prop) === column.property;
- });
- if (item) {
- if (ctor_amd_xe_utils_default.a.isNumber(item.resizeWidth)) {
- column.resizeWidth = item.resizeWidth;
- }
- if (ctor_amd_xe_utils_default.a.isBoolean(item.visible)) {
- column.visible = item.visible;
- }
- }
- });
- }
- this.emitEvent('update:customs', tableFullColumn);
- },
- /**
- * 手动重置列的所有操作,还原到初始状态
- * 如果已关联工具栏,则会同步更新
- */
- resetAll: function resetAll() {
- UtilTools.warn('vxe.error.delFunc', ['resetAll', 'resetColumn']);
- this.resetColumn(true);
- },
- /**
- * 隐藏指定列
- * @param {ColumnInfo} column 列配置
- */
- hideColumn: function hideColumn(column) {
- column.visible = false;
- return this.handleCustom();
- },
- /**
- * 显示指定列
- * @param {ColumnInfo} column 列配置
- */
- showColumn: function showColumn(column) {
- column.visible = true;
- return this.handleCustom();
- },
- /**
- * 手动重置列的显示隐藏、列宽拖动的状态;
- * 如果为 true 则重置所有状态
- * 如果已关联工具栏,则会同步更新
- */
- resetColumn: function resetColumn(options) {
- var customOpts = this.customOpts;
- var checkMethod = customOpts.checkMethod;
- var opts = Object.assign({
- visible: true,
- resizable: options === true
- }, options);
- this.tableFullColumn.forEach(function (column) {
- if (opts.resizable) {
- column.resizeWidth = 0;
- }
- if (!checkMethod || checkMethod({
- column: column
- })) {
- column.visible = column.defaultVisible;
- }
- });
- if (opts.resizable) {
- this.saveCustomResizable(true);
- }
- return this.handleCustom();
- },
- handleCustom: function handleCustom() {
- this.saveCustomVisible();
- this.analyColumnWidth();
- return this.refreshColumn();
- },
- resetResizable: function resetResizable() {
- UtilTools.warn('vxe.error.delFunc', ['resetResizable', 'resetColumn']);
- return this.resetColumn();
- },
- /**
- * 已废弃的方法
- */
- reloadCustoms: function reloadCustoms(customColumns) {
- var _this14 = this;
- UtilTools.warn('vxe.error.delFunc', ['reloadCustoms', 'column.visible & refreshColumn']);
- return this.$nextTick().then(function () {
- _this14.mergeCustomColumn(customColumns);
- return _this14.refreshColumn().then(function () {
- return _this14.tableFullColumn;
- });
- });
- },
- /**
- * 还原自定义列操作状态
- */
- restoreCustomStorage: function restoreCustomStorage() {
- var $toolbar = this.$toolbar,
- collectColumn = this.collectColumn,
- customConfig = this.customConfig,
- customOpts = this.customOpts;
- var storage = customOpts.storage;
- var isAllStorage = customOpts.storage === true;
- var isResizable = isAllStorage || storage && storage.resizable || $toolbar && $toolbar.resizableOpts.storage;
- var isVisible = isAllStorage || storage && storage.visible || $toolbar && $toolbar.customOpts.storage; // 在 v3.0 中废弃 $toolbar 方式
- if ((customConfig || $toolbar) && (isResizable || isVisible)) {
- // 在 v3.0 中废弃 toolbar.id
- var id = customConfig ? this.id : $toolbar ? $toolbar.id : null;
- var customMap = {};
- if (!id) {
- UtilTools.error('vxe.error.reqProp', ['id']);
- return;
- }
- if (isResizable) {
- var columnWidthStorage = getCustomStorageMap(resizableStorageKey)[id];
- if (columnWidthStorage) {
- ctor_amd_xe_utils_default.a.each(columnWidthStorage, function (resizeWidth, field) {
- customMap[field] = {
- field: field,
- resizeWidth: resizeWidth
- };
- });
- }
- }
- if (isVisible) {
- var columnVisibleStorage = getCustomStorageMap(visibleStorageKey)[id];
- if (columnVisibleStorage) {
- var colVisibles = columnVisibleStorage.split('|');
- var colHides = colVisibles[0] ? colVisibles[0].split(',') : [];
- var colShows = colVisibles[1] ? colVisibles[1].split(',') : [];
- colHides.forEach(function (field) {
- if (customMap[field]) {
- customMap[field].visible = false;
- } else {
- customMap[field] = {
- field: field,
- visible: false
- };
- }
- });
- colShows.forEach(function (field) {
- if (customMap[field]) {
- customMap[field].visible = true;
- } else {
- customMap[field] = {
- field: field,
- visible: true
- };
- }
- });
- }
- }
- var keyMap = {};
- ctor_amd_xe_utils_default.a.eachTree(collectColumn, function (column) {
- var colKey = column.getKey();
- if (colKey) {
- keyMap[colKey] = column;
- }
- });
- ctor_amd_xe_utils_default.a.each(customMap, function (_ref3, field) {
- var visible = _ref3.visible,
- resizeWidth = _ref3.resizeWidth;
- var column = keyMap[field];
- if (column) {
- if (ctor_amd_xe_utils_default.a.isNumber(resizeWidth)) {
- column.resizeWidth = resizeWidth;
- }
- if (ctor_amd_xe_utils_default.a.isBoolean(visible)) {
- column.visible = visible;
- }
- }
- });
- }
- },
- saveCustomVisible: function saveCustomVisible() {
- var $toolbar = this.$toolbar,
- collectColumn = this.collectColumn,
- customConfig = this.customConfig,
- customOpts = this.customOpts;
- var checkMethod = customOpts.checkMethod,
- storage = customOpts.storage;
- var isAllStorage = customOpts.storage === true;
- var isVisible = isAllStorage || storage && storage.visible || $toolbar && $toolbar.customOpts.storage; // 在 v3.0 中废弃 $toolbar 方式
- if ((customConfig || $toolbar) && isVisible) {
- // 在 v3.0 中废弃 toolbar.id
- var id = customConfig ? this.id : $toolbar ? $toolbar.id : null;
- var columnVisibleStorageMap = getCustomStorageMap(visibleStorageKey);
- var colHides = [];
- var colShows = [];
- if (!id) {
- UtilTools.error('vxe.error.reqProp', ['id']);
- return;
- }
- ctor_amd_xe_utils_default.a.eachTree(collectColumn, function (column) {
- if (!checkMethod || checkMethod({
- column: column
- })) {
- if (!column.visible && column.defaultVisible) {
- var colKey = column.getKey();
- if (colKey) {
- colHides.push(colKey);
- }
- } else if (column.visible && !column.defaultVisible) {
- var _colKey = column.getKey();
- if (_colKey) {
- colShows.push(_colKey);
- }
- }
- }
- });
- columnVisibleStorageMap[id] = [colHides.join(',')].concat(colShows.length ? [colShows.join(',')] : []).join('|') || undefined;
- localStorage.setItem(visibleStorageKey, ctor_amd_xe_utils_default.a.toJSONString(columnVisibleStorageMap));
- }
- },
- saveCustomResizable: function saveCustomResizable(isReset) {
- var $toolbar = this.$toolbar,
- collectColumn = this.collectColumn,
- customConfig = this.customConfig,
- customOpts = this.customOpts;
- var storage = customOpts.storage;
- var isAllStorage = customOpts.storage === true;
- var isResizable = isAllStorage || storage && storage.resizable || $toolbar && $toolbar.resizableOpts.storage; // 在 v3.0 中废弃 $toolbar 方式
- if ((customConfig || $toolbar) && isResizable) {
- // 在 v3.0 中废弃 toolbar.id
- var id = customConfig ? this.id : $toolbar ? $toolbar.id : null;
- var columnWidthStorageMap = getCustomStorageMap(resizableStorageKey);
- var columnWidthStorage;
- if (!id) {
- UtilTools.error('vxe.error.reqProp', ['id']);
- return;
- }
- if (!isReset) {
- columnWidthStorage = ctor_amd_xe_utils_default.a.isPlainObject(columnWidthStorageMap[id]) ? columnWidthStorageMap[id] : {};
- ctor_amd_xe_utils_default.a.eachTree(collectColumn, function (column) {
- if (column.resizeWidth) {
- var colKey = column.getKey();
- if (colKey) {
- columnWidthStorage[colKey] = column.renderWidth;
- }
- }
- });
- }
- columnWidthStorageMap[id] = ctor_amd_xe_utils_default.a.isEmpty(columnWidthStorage) ? undefined : columnWidthStorage;
- localStorage.setItem(resizableStorageKey, ctor_amd_xe_utils_default.a.toJSONString(columnWidthStorageMap));
- }
- },
- /**
- * 刷新列信息
- * 将固定的列左边、右边分别靠边
- */
- refreshColumn: function refreshColumn() {
- var _this15 = this;
- var leftList = [];
- var centerList = [];
- var rightList = [];
- var collectColumn = this.collectColumn,
- tableFullColumn = this.tableFullColumn,
- isGroup = this.isGroup,
- columnStore = this.columnStore,
- sXOpts = this.sXOpts,
- scrollXStore = this.scrollXStore; // 如果是分组表头,如果子列全部被隐藏,则根列也隐藏
- if (isGroup) {
- var leftGroupList = [];
- var centerGroupList = [];
- var rightGroupList = [];
- ctor_amd_xe_utils_default.a.eachTree(collectColumn, function (column, index, items, path, parent) {
- var isColGroup = hasChildrenList(column); // 如果是分组,必须按组设置固定列,不允许给子列设置固定
- if (parent && parent.fixed) {
- column.fixed = parent.fixed;
- }
- if (parent && column.fixed !== parent.fixed) {
- UtilTools.error('vxe.error.groupFixed');
- }
- if (isColGroup) {
- column.visible = !!ctor_amd_xe_utils_default.a.findTree(column.children, function (subColumn) {
- return hasChildrenList(subColumn) ? null : subColumn.visible;
- });
- } else if (column.visible) {
- if (column.fixed === 'left') {
- leftList.push(column);
- } else if (column.fixed === 'right') {
- rightList.push(column);
- } else {
- centerList.push(column);
- }
- }
- });
- collectColumn.forEach(function (column) {
- if (column.visible) {
- if (column.fixed === 'left') {
- leftGroupList.push(column);
- } else if (column.fixed === 'right') {
- rightGroupList.push(column);
- } else {
- centerGroupList.push(column);
- }
- }
- });
- this.tableGroupColumn = leftGroupList.concat(centerGroupList).concat(rightGroupList);
- } else {
- // 重新分配列
- tableFullColumn.forEach(function (column) {
- if (column.visible) {
- if (column.fixed === 'left') {
- leftList.push(column);
- } else if (column.fixed === 'right') {
- rightList.push(column);
- } else {
- centerList.push(column);
- }
- }
- });
- }
- var visibleColumn = leftList.concat(centerList).concat(rightList);
- var tableColumn = visibleColumn;
- var scrollXLoad = sXOpts.enabled && sXOpts.gt > -1 && sXOpts.gt < tableFullColumn.length;
- Object.assign(columnStore, {
- leftList: leftList,
- centerList: centerList,
- rightList: rightList
- });
- if (scrollXLoad && isGroup) {
- scrollXLoad = false;
- UtilTools.warn('vxe.error.scrollXNotGroup');
- }
- if (scrollXLoad) {
- if (this.showHeader && !this.showHeaderOverflow) {
- UtilTools.warn('vxe.error.reqProp', ['show-header-overflow']);
- }
- if (this.showFooter && !this.showFooterOverflow) {
- UtilTools.warn('vxe.error.reqProp', ['show-footer-overflow']);
- }
- if (this.spanMethod) {
- UtilTools.warn('vxe.error.scrollErrProp', ['span-method']);
- }
- if (this.footerSpanMethod) {
- UtilTools.warn('vxe.error.scrollErrProp', ['footer-span-method']);
- }
- Object.assign(scrollXStore, {
- startIndex: 0,
- visibleIndex: 0
- });
- tableColumn = visibleColumn.slice(scrollXStore.startIndex, scrollXStore.startIndex + scrollXStore.renderSize);
- } // 如果列被显示/隐藏,则清除合并状态
- // 如果列被设置为固定,则清除合并状态
- if (visibleColumn.length !== this.visibleColumn.length || !this.visibleColumn.every(function (column, index) {
- return column === visibleColumn[index];
- })) {
- this.clearMergeCells();
- this.clearMergeFooterItems();
- }
- this.scrollXLoad = scrollXLoad;
- this.tableColumn = tableColumn;
- this.visibleColumn = visibleColumn;
- return this.$nextTick().then(function () {
- _this15.updateFooter();
- return _this15.recalculate(true);
- }).then(function () {
- _this15.updateCellAreas();
- return _this15.$nextTick().then(function () {
- return _this15.recalculate();
- });
- });
- },
- /**
- * 指定列宽的列进行拆分
- */
- analyColumnWidth: function analyColumnWidth() {
- var columnWidth = this.columnWidth,
- columnMinWidth = this.columnMinWidth,
- columnOpts = this.columnOpts; // 在 v3.0 中废弃 columnWidth
- var defaultWidth = columnOpts.width || columnWidth; // 在 v3.0 中废弃 columnMinWidth
- var defaultMinWidth = columnOpts.minWidth || columnMinWidth;
- var resizeList = [];
- var pxList = [];
- var pxMinList = [];
- var scaleList = [];
- var scaleMinList = [];
- var autoList = [];
- this.tableFullColumn.forEach(function (column) {
- if (defaultWidth && !column.width) {
- column.width = defaultWidth;
- }
- if (defaultMinWidth && !column.minWidth) {
- column.minWidth = defaultMinWidth;
- }
- if (column.visible) {
- if (column.resizeWidth) {
- resizeList.push(column);
- } else if (DomTools.isPx(column.width)) {
- pxList.push(column);
- } else if (DomTools.isScale(column.width)) {
- scaleList.push(column);
- } else if (DomTools.isPx(column.minWidth)) {
- pxMinList.push(column);
- } else if (DomTools.isScale(column.minWidth)) {
- scaleMinList.push(column);
- } else {
- autoList.push(column);
- }
- }
- });
- Object.assign(this.columnStore, {
- resizeList: resizeList,
- pxList: pxList,
- pxMinList: pxMinList,
- scaleList: scaleList,
- scaleMinList: scaleMinList,
- autoList: autoList
- });
- },
- /**
- * 刷新滚动操作,手动同步滚动相关位置(对于某些特殊的操作,比如滚动条错位、固定列不同步)
- */
- refreshScroll: function refreshScroll() {
- var _this16 = this;
- var lastScrollLeft = this.lastScrollLeft,
- lastScrollTop = this.lastScrollTop;
- return this.clearScroll().then(function () {
- if (lastScrollLeft || lastScrollTop) {
- // 重置最后滚动状态
- _this16.lastScrollLeft = 0;
- _this16.lastScrollTop = 0; // 还原滚动状态
- return _this16.scrollTo(lastScrollLeft, lastScrollTop);
- }
- });
- },
- /**
- * 计算单元格列宽,动态分配可用剩余空间
- * 支持 width=? width=?px width=?% min-width=? min-width=?px min-width=?%
- */
- recalculate: function recalculate(refull) {
- var _this17 = this;
- var $refs = this.$refs;
- var tableBody = $refs.tableBody,
- tableHeader = $refs.tableHeader,
- tableFooter = $refs.tableFooter;
- var bodyElem = tableBody ? tableBody.$el : null;
- var headerElem = tableHeader ? tableHeader.$el : null;
- var footerElem = tableFooter ? tableFooter.$el : null;
- if (bodyElem) {
- this.autoCellWidth(headerElem, bodyElem, footerElem);
- if (refull === true) {
- // 初始化时需要在列计算之后再执行优化运算,达到最优显示效果
- return this.computeScrollLoad().then(function () {
- _this17.autoCellWidth(headerElem, bodyElem, footerElem);
- _this17.computeScrollLoad();
- });
- }
- }
- return this.computeScrollLoad();
- },
- /**
- * 列宽算法
- * 支持 px、%、固定 混合分配
- * 支持动态列表调整分配
- * 支持自动分配偏移量
- * @param {Element} headerElem
- * @param {Element} bodyElem
- * @param {Element} footerElem
- * @param {Number} bodyWidth
- */
- autoCellWidth: function autoCellWidth(headerElem, bodyElem, footerElem) {
- var tableWidth = 0;
- var minCellWidth = 40; // 列宽最少限制 40px
- var bodyWidth = bodyElem.clientWidth;
- var remainWidth = bodyWidth;
- var meanWidth = remainWidth / 100;
- var fit = this.fit,
- columnStore = this.columnStore;
- var resizeList = columnStore.resizeList,
- pxMinList = columnStore.pxMinList,
- pxList = columnStore.pxList,
- scaleList = columnStore.scaleList,
- scaleMinList = columnStore.scaleMinList,
- autoList = columnStore.autoList; // 最小宽
- pxMinList.forEach(function (column) {
- var minWidth = parseInt(column.minWidth);
- tableWidth += minWidth;
- column.renderWidth = minWidth;
- }); // 最小百分比
- scaleMinList.forEach(function (column) {
- var scaleWidth = Math.floor(parseInt(column.minWidth) * meanWidth);
- tableWidth += scaleWidth;
- column.renderWidth = scaleWidth;
- }); // 固定百分比
- scaleList.forEach(function (column) {
- var scaleWidth = Math.floor(parseInt(column.width) * meanWidth);
- tableWidth += scaleWidth;
- column.renderWidth = scaleWidth;
- }); // 固定宽
- pxList.forEach(function (column) {
- var width = parseInt(column.width);
- tableWidth += width;
- column.renderWidth = width;
- }); // 调整了列宽
- resizeList.forEach(function (column) {
- var width = parseInt(column.resizeWidth);
- tableWidth += width;
- column.renderWidth = width;
- });
- remainWidth -= tableWidth;
- meanWidth = remainWidth > 0 ? Math.floor(remainWidth / (scaleMinList.length + pxMinList.length + autoList.length)) : 0;
- if (fit) {
- if (remainWidth > 0) {
- scaleMinList.concat(pxMinList).forEach(function (column) {
- tableWidth += meanWidth;
- column.renderWidth += meanWidth;
- });
- }
- } else {
- meanWidth = minCellWidth;
- } // 自适应
- autoList.forEach(function (column) {
- var width = Math.max(meanWidth, minCellWidth);
- column.renderWidth = width;
- tableWidth += width;
- });
- if (fit) {
- /**
- * 偏移量算法
- * 如果所有列足够放的情况下,从最后动态列开始分配
- */
- var dynamicList = scaleList.concat(scaleMinList).concat(pxMinList).concat(autoList);
- var dynamicSize = dynamicList.length - 1;
- if (dynamicSize > 0) {
- var odiffer = bodyWidth - tableWidth;
- if (odiffer > 0) {
- while (odiffer > 0 && dynamicSize >= 0) {
- odiffer--;
- dynamicList[dynamicSize--].renderWidth++;
- }
- tableWidth = bodyWidth;
- }
- }
- }
- var tableHeight = bodyElem.offsetHeight;
- var overflowY = bodyElem.scrollHeight > bodyElem.clientHeight;
- this.scrollbarWidth = overflowY ? bodyElem.offsetWidth - bodyWidth : 0;
- this.overflowY = overflowY;
- this.tableWidth = tableWidth;
- this.tableHeight = tableHeight;
- if (headerElem) {
- this.headerHeight = headerElem.clientHeight; // 检测是否同步滚动
- if (headerElem.scrollLeft !== bodyElem.scrollLeft) {
- headerElem.scrollLeft = bodyElem.scrollLeft;
- }
- } else {
- this.headerHeight = 0;
- }
- if (footerElem) {
- var footerHeight = footerElem.offsetHeight;
- this.scrollbarHeight = Math.max(footerHeight - footerElem.clientHeight, 0);
- this.overflowX = tableWidth > footerElem.clientWidth;
- this.footerHeight = footerHeight;
- } else {
- this.footerHeight = 0;
- this.scrollbarHeight = Math.max(tableHeight - bodyElem.clientHeight, 0);
- this.overflowX = tableWidth > bodyWidth;
- }
- this.customHeight = methods_calcHeight(this, 'height');
- this.customMaxHeight = methods_calcHeight(this, 'maxHeight');
- this.parentHeight = Math.max(this.headerHeight + this.footerHeight + 20, this.getParentHeight());
- if (this.overflowX) {
- this.checkScrolling();
- }
- },
- updateStyle: function updateStyle() {
- var _this18 = this;
- var $refs = this.$refs,
- isGroup = this.isGroup,
- fullColumnIdData = this.fullColumnIdData,
- tableColumn = this.tableColumn,
- customHeight = this.customHeight,
- customMaxHeight = this.customMaxHeight,
- border = this.border,
- headerHeight = this.headerHeight,
- showFooter = this.showFooter,
- allColumnOverflow = this.showOverflow,
- allColumnHeaderOverflow = this.showHeaderOverflow,
- allColumnFooterOverflow = this.showFooterOverflow,
- footerHeight = this.footerHeight,
- tableHeight = this.tableHeight,
- tableWidth = this.tableWidth,
- scrollbarHeight = this.scrollbarHeight,
- scrollbarWidth = this.scrollbarWidth,
- scrollXLoad = this.scrollXLoad,
- scrollYLoad = this.scrollYLoad,
- cellOffsetWidth = this.cellOffsetWidth,
- columnStore = this.columnStore,
- elemStore = this.elemStore,
- editStore = this.editStore,
- currentRow = this.currentRow,
- mouseConfig = this.mouseConfig;
- var containerList = ['main', 'left', 'right'];
- var emptyPlaceholderElem = $refs.emptyPlaceholder;
- var bodyWrapperElem = elemStore['main-body-wrapper'];
- if (emptyPlaceholderElem) {
- emptyPlaceholderElem.style.top = "".concat(headerHeight, "px");
- emptyPlaceholderElem.style.height = bodyWrapperElem ? "".concat(bodyWrapperElem.offsetHeight - scrollbarHeight, "px") : '';
- }
- if (customHeight > 0) {
- if (showFooter) {
- customHeight += scrollbarHeight;
- }
- }
- containerList.forEach(function (name, index) {
- var fixedType = index > 0 ? name : '';
- var layoutList = ['header', 'body', 'footer'];
- var fixedColumn = columnStore["".concat(fixedType, "List")];
- var fixedWrapperElem = $refs["".concat(fixedType, "Container")];
- layoutList.forEach(function (layout) {
- var wrapperElem = elemStore["".concat(name, "-").concat(layout, "-wrapper")];
- var tableElem = elemStore["".concat(name, "-").concat(layout, "-table")];
- if (layout === 'header') {
- // 表头体样式处理
- // 横向滚动渲染
- var tWidth = tableWidth;
- if (scrollXLoad) {
- if (fixedType) {
- tableColumn = fixedColumn;
- }
- tWidth = tableColumn.reduce(function (previous, column) {
- return previous + column.renderWidth;
- }, 0);
- }
- if (tableElem) {
- tableElem.style.width = tWidth ? "".concat(tWidth + scrollbarWidth, "px") : ''; // 修复 IE 中高度无法自适应问题
- if (methods_browse.msie) {
- ctor_amd_xe_utils_default.a.arrayEach(tableElem.querySelectorAll('.vxe-resizable'), function (resizeElem) {
- resizeElem.style.height = "".concat(resizeElem.parentNode.offsetHeight, "px");
- });
- }
- }
- var repairElem = elemStore["".concat(name, "-").concat(layout, "-repair")];
- if (repairElem) {
- repairElem.style.width = "".concat(tableWidth, "px");
- }
- var listElem = elemStore["".concat(name, "-").concat(layout, "-list")];
- if (isGroup && listElem) {
- // XEUtils.arrayEach(listElem.querySelectorAll(`.col--gutter`), thElem => {
- // thElem.style.width = `${scrollbarWidth}px`
- // })
- ctor_amd_xe_utils_default.a.arrayEach(listElem.querySelectorAll('.col--group'), function (thElem) {
- var colNode = _this18.getColumnNode(thElem);
- if (colNode) {
- var column = colNode.item;
- var showHeaderOverflow = column.showHeaderOverflow;
- var cellOverflow = ctor_amd_xe_utils_default.a.isBoolean(showHeaderOverflow) ? showHeaderOverflow : allColumnHeaderOverflow;
- var showEllipsis = cellOverflow === 'ellipsis';
- var showTitle = cellOverflow === 'title';
- var showTooltip = cellOverflow === true || cellOverflow === 'tooltip';
- var hasEllipsis = showTitle || showTooltip || showEllipsis;
- var childWidth = 0;
- var countChild = 0;
- if (hasEllipsis) {
- ctor_amd_xe_utils_default.a.eachTree(column.children, function (item) {
- if (!item.children || !column.children.length) {
- countChild++;
- }
- childWidth += item.renderWidth;
- });
- }
- thElem.style.width = hasEllipsis ? "".concat(childWidth - countChild - (border ? 2 : 0), "px") : '';
- }
- });
- }
- } else if (layout === 'body') {
- var emptyBlockElem = elemStore["".concat(name, "-").concat(layout, "-emptyBlock")];
- if (wrapperElem) {
- if (customMaxHeight > 0) {
- wrapperElem.style.maxHeight = "".concat(fixedType ? customMaxHeight - headerHeight - (showFooter ? 0 : scrollbarHeight) : customMaxHeight - headerHeight, "px");
- } else {
- if (customHeight > 0) {
- wrapperElem.style.height = "".concat(fixedType ? (customHeight > 0 ? customHeight - headerHeight - footerHeight : tableHeight) - (showFooter ? 0 : scrollbarHeight) : customHeight - headerHeight - footerHeight, "px");
- } else {
- wrapperElem.style.height = '';
- }
- }
- } // 如果是固定列
- if (fixedWrapperElem) {
- var isRightFixed = fixedType === 'right';
- var _fixedColumn = columnStore["".concat(fixedType, "List")];
- if (wrapperElem) {
- wrapperElem.style.top = "".concat(headerHeight, "px");
- }
- fixedWrapperElem.style.height = "".concat((customHeight > 0 ? customHeight - headerHeight - footerHeight : tableHeight) + headerHeight + footerHeight - scrollbarHeight * (showFooter ? 2 : 1), "px");
- fixedWrapperElem.style.width = "".concat(_fixedColumn.reduce(function (previous, column) {
- return previous + column.renderWidth;
- }, isRightFixed ? scrollbarWidth : 0), "px");
- }
- var _tWidth = tableWidth; // 如果是固定列与设置了超出隐藏
- if (fixedType && allColumnOverflow) {
- tableColumn = fixedColumn;
- _tWidth = tableColumn.reduce(function (previous, column) {
- return previous + column.renderWidth;
- }, 0);
- } else if (scrollXLoad) {
- if (fixedType) {
- tableColumn = fixedColumn;
- }
- _tWidth = tableColumn.reduce(function (previous, column) {
- return previous + column.renderWidth;
- }, 0);
- }
- if (tableElem) {
- tableElem.style.width = _tWidth ? "".concat(_tWidth, "px") : ''; // 兼容性处理
- tableElem.style.paddingRight = scrollbarWidth && fixedType && (methods_browse['-moz'] || methods_browse.safari) ? "".concat(scrollbarWidth, "px") : '';
- }
- if (emptyBlockElem) {
- emptyBlockElem.style.width = _tWidth ? "".concat(_tWidth, "px") : '';
- }
- } else if (layout === 'footer') {
- // 如果是使用优化模式
- var _tWidth2 = tableWidth;
- if (fixedType && allColumnOverflow) {
- tableColumn = fixedColumn;
- _tWidth2 = tableColumn.reduce(function (previous, column) {
- return previous + column.renderWidth;
- }, 0);
- } else if (scrollXLoad) {
- if (fixedType) {
- tableColumn = fixedColumn;
- }
- _tWidth2 = tableColumn.reduce(function (previous, column) {
- return previous + column.renderWidth;
- }, 0);
- }
- if (wrapperElem) {
- // 如果是固定列
- if (fixedWrapperElem) {
- wrapperElem.style.top = "".concat(customHeight > 0 ? customHeight - footerHeight : tableHeight + headerHeight, "px");
- }
- wrapperElem.style.marginTop = "".concat(-scrollbarHeight, "px");
- }
- if (tableElem) {
- tableElem.style.width = _tWidth2 ? "".concat(_tWidth2 + scrollbarWidth, "px") : '';
- } // const listElem = elemStore[`${name}-${layout}-list`]
- // if (listElem) {
- // XEUtils.arrayEach(listElem.querySelectorAll(`.col--gutter`), thElem => {
- // thElem.style.width = `${scrollbarWidth}px`
- // })
- // }
- }
- var colgroupElem = elemStore["".concat(name, "-").concat(layout, "-colgroup")];
- if (colgroupElem) {
- ctor_amd_xe_utils_default.a.arrayEach(colgroupElem.children, function (colElem) {
- var colid = colElem.getAttribute('name');
- if (colid === 'col_gutter') {
- colElem.style.width = "".concat(scrollbarWidth, "px");
- }
- if (fullColumnIdData[colid]) {
- var column = fullColumnIdData[colid].column;
- var showHeaderOverflow = column.showHeaderOverflow,
- showFooterOverflow = column.showFooterOverflow,
- showOverflow = column.showOverflow;
- var cellOverflow;
- colElem.style.width = "".concat(column.renderWidth, "px");
- if (layout === 'header') {
- cellOverflow = ctor_amd_xe_utils_default.a.isUndefined(showHeaderOverflow) || ctor_amd_xe_utils_default.a.isNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow;
- } else if (layout === 'footer') {
- cellOverflow = ctor_amd_xe_utils_default.a.isUndefined(showFooterOverflow) || ctor_amd_xe_utils_default.a.isNull(showFooterOverflow) ? allColumnFooterOverflow : showFooterOverflow;
- } else {
- cellOverflow = ctor_amd_xe_utils_default.a.isUndefined(showOverflow) || ctor_amd_xe_utils_default.a.isNull(showOverflow) ? allColumnOverflow : showOverflow;
- }
- var showEllipsis = cellOverflow === 'ellipsis';
- var showTitle = cellOverflow === 'title';
- var showTooltip = cellOverflow === true || cellOverflow === 'tooltip';
- var hasEllipsis = showTitle || showTooltip || showEllipsis;
- var _listElem = elemStore["".concat(name, "-").concat(layout, "-list")]; // 滚动的渲染不支持动态行高
- if (layout === 'header' || layout === 'footer') {
- if (scrollXLoad && !hasEllipsis) {
- hasEllipsis = true;
- }
- } else {
- if ((scrollXLoad || scrollYLoad) && !hasEllipsis) {
- hasEllipsis = true;
- }
- }
- if (_listElem) {
- ctor_amd_xe_utils_default.a.arrayEach(_listElem.querySelectorAll(".".concat(column.id)), function (elem) {
- var colspan = parseInt(elem.getAttribute('colspan') || 1);
- var cellElem = elem.querySelector('.vxe-cell');
- var colWidth = column.renderWidth;
- if (cellElem) {
- if (colspan > 1) {
- var columnIndex = _this18.getColumnIndex(column);
- for (var _index = 1; _index < colspan; _index++) {
- var nextColumn = _this18.getColumns(columnIndex + _index);
- if (nextColumn) {
- colWidth += nextColumn.renderWidth;
- }
- }
- }
- cellElem.style.width = hasEllipsis ? "".concat(colWidth - cellOffsetWidth * colspan, "px") : '';
- }
- });
- }
- }
- });
- }
- });
- });
- if (currentRow) {
- this.setCurrentRow(currentRow);
- }
- if (mouseConfig && mouseConfig.selected && editStore.selected.row && editStore.selected.column) {
- this.addColSdCls();
- }
- return this.$nextTick();
- },
- /**
- * 处理固定列的显示状态
- */
- checkScrolling: function checkScrolling() {
- var _this$$refs = this.$refs,
- tableBody = _this$$refs.tableBody,
- leftContainer = _this$$refs.leftContainer,
- rightContainer = _this$$refs.rightContainer;
- var bodyElem = tableBody ? tableBody.$el : null;
- if (bodyElem) {
- if (leftContainer) {
- DomTools[bodyElem.scrollLeft > 0 ? 'addClass' : 'removeClass'](leftContainer, 'scrolling--middle');
- }
- if (rightContainer) {
- DomTools[bodyElem.clientWidth < bodyElem.scrollWidth - Math.ceil(bodyElem.scrollLeft) ? 'addClass' : 'removeClass'](rightContainer, 'scrolling--middle');
- }
- }
- },
- preventEvent: function preventEvent(evnt, type, args, next, end) {
- var _this19 = this;
- var evntList = v_x_e_table.interceptor.get(type);
- var rest;
- if (!evntList.some(function (func) {
- return func(Object.assign({
- $grid: _this19.$xegrid,
- $table: _this19,
- $event: evnt
- }, args), evnt, _this19) === false;
- })) {
- if (next) {
- rest = next();
- }
- }
- if (end) {
- end();
- }
- return rest;
- },
- /**
- * 全局按下事件处理
- */
- handleGlobalMousedownEvent: function handleGlobalMousedownEvent(evnt) {
- var _this20 = this;
- var $el = this.$el,
- $refs = this.$refs,
- $xegrid = this.$xegrid,
- $toolbar = this.$toolbar,
- mouseConfig = this.mouseConfig,
- mouseOpts = this.mouseOpts,
- editStore = this.editStore,
- ctxMenuStore = this.ctxMenuStore,
- editOpts = this.editOpts,
- filterStore = this.filterStore,
- getRowNode = this.getRowNode;
- var actived = editStore.actived;
- var filterWrapper = $refs.filterWrapper,
- validTip = $refs.validTip; // 在 v3.0 中废弃 mouse-config.checked
- var isMouseChecked = mouseConfig && mouseOpts.checked;
- if (filterWrapper) {
- if (getEventTargetNode(evnt, $el, 'vxe-cell--filter').flag) {// 如果点击了筛选按钮
- } else if (getEventTargetNode(evnt, filterWrapper.$el).flag) {// 如果点击筛选容器
- } else {
- if (!getEventTargetNode(evnt, document.body, 'vxe-table--ignore-clear').flag) {
- this.preventEvent(evnt, 'event.clearFilter', filterStore.args, this.closeFilter);
- }
- }
- } // 如果已激活了编辑状态
- if (actived.row) {
- if (!(editOpts.autoClear === false)) {
- // 如果是激活状态,点击了单元格之外
- var cell = actived.args.cell;
- if (!cell || !getEventTargetNode(evnt, cell).flag) {
- if (validTip && getEventTargetNode(evnt, validTip.$el).flag) {// 如果是激活状态,且点击了校验提示框
- } else if (!this.lastCallTime || this.lastCallTime + 50 < Date.now()) {
- if (!getEventTargetNode(evnt, document.body, 'vxe-table--ignore-clear').flag) {
- // 如果手动调用了激活单元格,避免触发源被移除后导致重复关闭
- this.preventEvent(evnt, 'event.clearActived', actived.args, function () {
- var isClearActived;
- if (editOpts.mode === 'row') {
- var rowNode = getEventTargetNode(evnt, $el, 'vxe-body--row'); // row 方式,如果点击了不同行
- isClearActived = rowNode.flag ? getRowNode(rowNode.targetElem).item !== actived.args.row : false;
- } else {
- // cell 方式,如果是非编辑列
- isClearActived = !getEventTargetNode(evnt, $el, 'col--edit').flag;
- }
- if (!isClearActived) {
- isClearActived = getEventTargetNode(evnt, $el, 'vxe-header--row').flag;
- }
- if (!isClearActived) {
- isClearActived = getEventTargetNode(evnt, $el, 'vxe-footer--row').flag;
- } // 如果固定了高度且点击了行之外的空白处,则清除激活状态
- if (!isClearActived && _this20.height && !_this20.overflowY) {
- var bodyWrapperElem = evnt.target;
- if (hasClass(bodyWrapperElem, 'vxe-table--body-wrapper')) {
- isClearActived = evnt.offsetY < bodyWrapperElem.clientHeight;
- }
- }
- if (isClearActived || // 如果点击了当前表格之外
- !getEventTargetNode(evnt, $el).flag) {
- // this.triggerValidate('blur').then(a => {
- // 保证 input 的 change 事件能先触发之后再清除
- setTimeout(function () {
- return _this20.clearActived(evnt);
- }); // }).catch(e => e)
- }
- });
- }
- }
- }
- }
- } else if (mouseConfig) {
- if (!getEventTargetNode(evnt, $el).flag && !($xegrid && getEventTargetNode(evnt, $xegrid.$el).flag) && !getEventTargetNode(evnt, $refs.tableWrapper).flag && !($toolbar && getEventTargetNode(evnt, $toolbar.$el).flag)) {
- if (isMouseChecked) {
- this.clearIndexChecked();
- this.clearHeaderChecked();
- this.clearChecked();
- }
- this.clearSelected();
- if (!getEventTargetNode(evnt, document.body, 'vxe-table--ignore-areas-clear').flag) {
- this.preventEvent(evnt, 'event.clearAreas', {}, function () {
- _this20.clearCellAreas();
- _this20.clearCopyCellArea();
- });
- }
- }
- } // 如果配置了快捷菜单且,点击了其他地方则关闭
- if (ctxMenuStore.visible && this.$refs.ctxWrapper && !getEventTargetNode(evnt, this.$refs.ctxWrapper.$el).flag) {
- this.closeMenu();
- } // 最后激活的表格
- this.isActivated = getEventTargetNode(evnt, ($xegrid || this).$el).flag;
- },
- /**
- * 窗口失焦事件处理
- */
- handleGlobalBlurEvent: function handleGlobalBlurEvent() {
- this.closeFilter();
- this.closeMenu();
- },
- /**
- * 全局滚动事件
- */
- handleGlobalMousewheelEvent: function handleGlobalMousewheelEvent() {
- this.closeTooltip();
- this.closeMenu();
- },
- /**
- * 全局键盘事件
- */
- handleGlobalKeydownEvent: function handleGlobalKeydownEvent(evnt) {
- var _this21 = this;
- // 该行为只对当前激活的表格有效
- if (this.isActivated) {
- this.preventEvent(evnt, 'event.keydown', null, function () {
- var filterStore = _this21.filterStore,
- isCtxMenu = _this21.isCtxMenu,
- ctxMenuStore = _this21.ctxMenuStore,
- editStore = _this21.editStore,
- editOpts = _this21.editOpts,
- editConfig = _this21.editConfig,
- mouseConfig = _this21.mouseConfig,
- mouseOpts = _this21.mouseOpts,
- keyboardConfig = _this21.keyboardConfig,
- keyboardOpts = _this21.keyboardOpts,
- treeConfig = _this21.treeConfig,
- treeOpts = _this21.treeOpts,
- highlightCurrentRow = _this21.highlightCurrentRow,
- currentRow = _this21.currentRow,
- bodyCtxMenu = _this21.bodyCtxMenu;
- var selected = editStore.selected,
- actived = editStore.actived;
- var keyCode = evnt.keyCode;
- var isBack = keyCode === 8;
- var isTab = keyCode === 9;
- var isEnter = keyCode === 13;
- var isEsc = keyCode === 27;
- var isSpacebar = keyCode === 32;
- var isLeftArrow = keyCode === 37;
- var isUpArrow = keyCode === 38;
- var isRightArrow = keyCode === 39;
- var isDwArrow = keyCode === 40;
- var isDel = keyCode === 46;
- var isA = keyCode === 65;
- var isF2 = keyCode === 113;
- var isContextMenu = keyCode === 93;
- var hasMetaKey = evnt.metaKey;
- var hasCtrlKey = evnt.ctrlKey;
- var hasShiftKey = evnt.shiftKey;
- var operArrow = isLeftArrow || isUpArrow || isRightArrow || isDwArrow;
- var operCtxMenu = isCtxMenu && ctxMenuStore.visible && (isEnter || isSpacebar || operArrow);
- var isEditStatus = editConfig && actived.column && actived.row;
- var params;
- if (filterStore.visible) {
- if (isEsc) {
- _this21.closeFilter();
- }
- return;
- }
- if (operCtxMenu) {
- // 如果配置了右键菜单; 支持方向键操作、回车
- evnt.preventDefault();
- if (ctxMenuStore.showChild && hasChildrenList(ctxMenuStore.selected)) {
- _this21.moveCtxMenu(evnt, keyCode, ctxMenuStore, 'selectChild', 37, false, ctxMenuStore.selected.children);
- } else {
- _this21.moveCtxMenu(evnt, keyCode, ctxMenuStore, 'selected', 39, true, _this21.ctxMenuList);
- }
- } else if (keyboardConfig && mouseConfig && mouseOpts.area && _this21.handleKeyboardEvent) {
- _this21.handleKeyboardEvent(evnt);
- } else if (isSpacebar && keyboardConfig && keyboardOpts.isChecked && selected.row && selected.column && (selected.column.type === 'checkbox' || selected.column.type === 'selection' || selected.column.type === 'radio')) {
- // 在 v3.0 中废弃 type=selection
- // 空格键支持选中复选框
- evnt.preventDefault(); // 在 v3.0 中废弃 type=selection
- if (selected.column.type === 'checkbox' || selected.column.type === 'selection') {
- _this21.handleToggleCheckRowEvent(evnt, selected.args);
- } else {
- _this21.triggerRadioRowEvent(evnt, selected.args);
- }
- } else if (isEsc) {
- // 如果按下了 Esc 键,关闭快捷菜单、筛选
- _this21.closeMenu();
- _this21.closeFilter(); // 如果是激活编辑状态,则取消编辑
- if (actived.row) {
- params = actived.args;
- _this21.clearActived(evnt); // 如果配置了选中功能,则为选中状态
- if (mouseConfig && mouseOpts.selected) {
- _this21.$nextTick(function () {
- return _this21.handleSelected(params, evnt);
- });
- }
- }
- } else if (isF2) {
- if (!isEditStatus) {
- // 如果按下了 F2 键
- if (selected.row && selected.column) {
- evnt.preventDefault();
- _this21.handleActived(selected.args, evnt);
- }
- }
- } else if (isContextMenu) {
- // 如果按下上下文键
- _this21._keyCtx = selected.row && selected.column && bodyCtxMenu.length;
- clearTimeout(_this21.keyCtxTimeout);
- _this21.keyCtxTimeout = setTimeout(function () {
- _this21._keyCtx = false;
- }, 1000);
- } else if (isEnter && keyboardConfig && keyboardOpts.isEnter && (selected.row || actived.row || treeConfig && highlightCurrentRow && currentRow)) {
- // 退出选中
- if (hasCtrlKey) {
- // 如果是激活编辑状态,则取消编辑
- if (actived.row) {
- params = actived.args;
- _this21.clearActived(evnt); // 如果配置了选中功能,则为选中状态
- if (mouseConfig && mouseOpts.selected) {
- _this21.$nextTick(function () {
- return _this21.handleSelected(params, evnt);
- });
- }
- }
- } else {
- // 如果是激活状态,退则出到上一行/下一行
- if (selected.row || actived.row) {
- var targetArgs = selected.row ? selected.args : actived.args;
- if (hasShiftKey) {
- if (keyboardOpts.enterToTab) {
- _this21.moveTabSelected(targetArgs, hasShiftKey, evnt);
- } else {
- _this21.moveSelected(targetArgs, isLeftArrow, true, isRightArrow, false, evnt);
- }
- } else {
- if (keyboardOpts.enterToTab) {
- _this21.moveTabSelected(targetArgs, hasShiftKey, evnt);
- } else {
- _this21.moveSelected(targetArgs, isLeftArrow, false, isRightArrow, true, evnt);
- }
- }
- } else if (treeConfig && highlightCurrentRow && currentRow) {
- // 如果是树形表格当前行回车移动到子节点
- var childrens = currentRow[treeOpts.children];
- if (childrens && childrens.length) {
- evnt.preventDefault();
- var targetRow = childrens[0];
- params = {
- $table: _this21,
- row: targetRow
- };
- _this21.setTreeExpand(currentRow, true).then(function () {
- return _this21.scrollToRow(targetRow);
- }).then(function () {
- return _this21.triggerCurrentRowEvent(evnt, params);
- });
- }
- }
- }
- } else if (operArrow && keyboardConfig && keyboardOpts.isArrow) {
- if (!isEditStatus) {
- // 如果按下了方向键
- if (selected.row && selected.column) {
- _this21.moveSelected(selected.args, isLeftArrow, isUpArrow, isRightArrow, isDwArrow, evnt);
- } else if ((isUpArrow || isDwArrow) && highlightCurrentRow) {
- // 当前行按键上下移动
- _this21.moveCurrentRow(isUpArrow, isDwArrow, evnt);
- }
- }
- } else if (isTab && keyboardConfig && keyboardOpts.isTab) {
- // 如果按下了 Tab 键切换
- if (selected.row || selected.column) {
- _this21.moveTabSelected(selected.args, hasShiftKey, evnt);
- } else if (actived.row || actived.column) {
- _this21.moveTabSelected(actived.args, hasShiftKey, evnt);
- }
- } else if (keyboardConfig && (isDel || (treeConfig && highlightCurrentRow && currentRow ? isBack && keyboardOpts.isArrow : isBack))) {
- if (!isEditStatus) {
- var delMethod = keyboardOpts.delMethod,
- backMethod = keyboardOpts.backMethod; // 如果是删除键
- if (keyboardOpts.isDel && (selected.row || selected.column)) {
- if (delMethod) {
- delMethod({
- row: selected.row,
- rowIndex: _this21.getRowIndex(selected.row),
- column: selected.column,
- columnIndex: _this21.getColumnIndex(selected.column),
- $table: _this21
- });
- } else {
- methods_setCellValue(selected.row, selected.column, null);
- }
- if (isBack) {
- if (backMethod) {
- backMethod({
- row: selected.row,
- rowIndex: _this21.getRowIndex(selected.row),
- column: selected.column,
- columnIndex: _this21.getColumnIndex(selected.column),
- $table: _this21
- });
- } else {
- _this21.handleActived(selected.args, evnt);
- }
- } else if (isDel) {
- // 如果按下 del 键,更新表尾数据
- _this21.updateFooter();
- }
- } else if (isBack && keyboardOpts.isArrow && treeConfig && highlightCurrentRow && currentRow) {
- // 如果树形表格回退键关闭当前行返回父节点
- var _XEUtils$findTree = ctor_amd_xe_utils_default.a.findTree(_this21.afterFullData, function (item) {
- return item === currentRow;
- }, treeOpts),
- parentRow = _XEUtils$findTree.parent;
- if (parentRow) {
- evnt.preventDefault();
- params = {
- $table: _this21,
- row: parentRow
- };
- _this21.setTreeExpand(parentRow, false).then(function () {
- return _this21.scrollToRow(parentRow);
- }).then(function () {
- return _this21.triggerCurrentRowEvent(evnt, params);
- });
- }
- }
- }
- } else if (keyboardConfig && hasCtrlKey && isA) {
- if (!isEditStatus) {
- // 如果开启复制功能
- if (keyboardOpts.isCut && mouseConfig && mouseOpts.checked) {
- _this21.handleAllChecked(evnt);
- }
- }
- } 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)) {
- var editMethod = keyboardOpts.editMethod; // 启用编辑后,空格键功能将失效
- // if (isSpacebar) {
- // evnt.preventDefault()
- // }
- // 如果是按下非功能键之外允许直接编辑
- if (selected.column && selected.row && UtilTools.isEnableConf(selected.column.editRender)) {
- if (!editOpts.activeMethod || editOpts.activeMethod(selected.args)) {
- if (editMethod) {
- editMethod({
- row: selected.row,
- rowIndex: _this21.getRowIndex(selected.row),
- column: selected.column,
- columnIndex: _this21.getColumnIndex(selected.column),
- $table: _this21
- });
- } else {
- methods_setCellValue(selected.row, selected.column, null);
- _this21.handleActived(selected.args, evnt);
- }
- }
- }
- }
- _this21.emitEvent('keydown', {}, evnt);
- });
- }
- },
- handleGlobalPasteEvent: function handleGlobalPasteEvent(evnt) {
- var isActivated = this.isActivated,
- keyboardConfig = this.keyboardConfig,
- keyboardOpts = this.keyboardOpts,
- mouseConfig = this.mouseConfig,
- mouseOpts = this.mouseOpts,
- editStore = this.editStore,
- filterStore = this.filterStore;
- var actived = editStore.actived;
- if (isActivated && !filterStore.visible) {
- if (!(actived.row || actived.column)) {
- if (keyboardConfig && keyboardOpts.isClip && mouseConfig && mouseOpts.area && this.handlePasteCellAreaEvent) {
- this.handlePasteCellAreaEvent(evnt);
- } else if (keyboardConfig && keyboardOpts.isCut && mouseConfig && mouseOpts.checked) {
- this.handlePaste(evnt);
- }
- }
- this.emitEvent('paste', {}, evnt);
- }
- },
- handleGlobalCopyEvent: function handleGlobalCopyEvent(evnt) {
- var isActivated = this.isActivated,
- keyboardConfig = this.keyboardConfig,
- keyboardOpts = this.keyboardOpts,
- mouseConfig = this.mouseConfig,
- mouseOpts = this.mouseOpts,
- editStore = this.editStore,
- filterStore = this.filterStore;
- var actived = editStore.actived;
- if (isActivated && !filterStore.visible) {
- if (!(actived.row || actived.column)) {
- if (keyboardConfig && keyboardOpts.isClip && mouseConfig && mouseOpts.area && this.handleCopyCellAreaEvent) {
- this.handleCopyCellAreaEvent(evnt);
- } else if (keyboardConfig && keyboardOpts.isCut && mouseConfig && mouseOpts.checked) {
- this.handleCopyed(false, evnt);
- }
- }
- this.emitEvent('copy', {}, evnt);
- }
- },
- handleGlobalCutEvent: function handleGlobalCutEvent(evnt) {
- var isActivated = this.isActivated,
- keyboardConfig = this.keyboardConfig,
- keyboardOpts = this.keyboardOpts,
- mouseConfig = this.mouseConfig,
- mouseOpts = this.mouseOpts,
- editStore = this.editStore,
- filterStore = this.filterStore;
- var actived = editStore.actived;
- if (isActivated && !filterStore.visible) {
- if (!(actived.row || actived.column)) {
- if (keyboardConfig && keyboardOpts.isClip && mouseConfig && mouseOpts.area && this.handleCutCellAreaEvent) {
- this.handleCutCellAreaEvent(evnt);
- } else if (keyboardConfig && keyboardOpts.isCut && mouseConfig && mouseOpts.checked) {
- this.handleCopyed(true, evnt);
- }
- }
- this.emitEvent('cut', {}, evnt);
- }
- },
- handleGlobalResizeEvent: function handleGlobalResizeEvent() {
- this.closeMenu();
- this.recalculate(true);
- this.updateCellAreas();
- },
- handleTooltipLeaveEvent: function handleTooltipLeaveEvent() {
- var _this22 = this;
- var tooltipOpts = this.tooltipOpts;
- setTimeout(function () {
- if (!_this22.tooltipActive) {
- _this22.closeTooltip();
- }
- }, tooltipOpts.leaveDelay);
- },
- handleTargetEnterEvent: function handleTargetEnterEvent() {
- clearTimeout(this.tooltipTimeout);
- this.tooltipActive = true;
- this.closeTooltip();
- },
- handleTargetLeaveEvent: function handleTargetLeaveEvent() {
- var _this23 = this;
- var tooltipOpts = this.tooltipOpts;
- this.tooltipActive = false;
- if (tooltipOpts.enterable) {
- this.tooltipTimeout = setTimeout(function () {
- var tooltip = _this23.$refs.tooltip;
- if (tooltip && !tooltip.isHover) {
- _this23.closeTooltip();
- }
- }, tooltipOpts.leaveDelay);
- } else {
- this.closeTooltip();
- }
- },
- triggerHeaderHelpEvent: function triggerHeaderHelpEvent(evnt, params) {
- var column = params.column;
- var titleHelp = column.titleHelp;
- if (titleHelp.content || titleHelp.message) {
- var $refs = this.$refs,
- tooltipStore = this.tooltipStore;
- var tooltip = $refs.tooltip;
- var content = UtilTools.getFuncText(titleHelp.content || titleHelp.message);
- this.handleTargetEnterEvent();
- tooltipStore.visible = true;
- if (tooltip) {
- tooltip.open(evnt.currentTarget, content);
- }
- }
- },
- /**
- * 触发表头 tooltip 事件
- */
- triggerHeaderTooltipEvent: function triggerHeaderTooltipEvent(evnt, params) {
- var tooltipStore = this.tooltipStore;
- var column = params.column;
- var titleElem = evnt.currentTarget;
- this.handleTargetEnterEvent();
- if (tooltipStore.column !== column || !tooltipStore.visible) {
- this.handleTooltip(evnt, titleElem, titleElem, null, params);
- }
- },
- /**
- * 触发单元格 tooltip 事件
- */
- triggerBodyTooltipEvent: function triggerBodyTooltipEvent(evnt, params) {
- var editConfig = this.editConfig,
- editOpts = this.editOpts,
- editStore = this.editStore,
- tooltipStore = this.tooltipStore;
- var actived = editStore.actived;
- var row = params.row,
- column = params.column;
- var cell = evnt.currentTarget;
- this.handleTargetEnterEvent();
- if (editConfig) {
- if (editOpts.mode === 'row' && actived.row === row || actived.row === row && actived.column === column) {
- return;
- }
- }
- if (tooltipStore.column !== column || tooltipStore.row !== row || !tooltipStore.visible) {
- var overflowElem;
- var tipElem;
- if (column.treeNode) {
- overflowElem = cell.querySelector('.vxe-tree-cell');
- if (column.type === 'html') {
- tipElem = cell.querySelector('.vxe-cell--html');
- }
- } else {
- tipElem = cell.querySelector(column.type === 'html' ? '.vxe-cell--html' : '.vxe-cell--label');
- }
- this.handleTooltip(evnt, cell, overflowElem || cell.children[0], tipElem, params);
- }
- },
- /**
- * 触发表尾 tooltip 事件
- */
- triggerFooterTooltipEvent: function triggerFooterTooltipEvent(evnt, params) {
- var tooltipStore = this.tooltipStore;
- var column = params.column;
- var cell = evnt.currentTarget;
- this.handleTargetEnterEvent();
- if (tooltipStore.column !== column || !tooltipStore.visible) {
- this.handleTooltip(evnt, cell, cell.querySelector('.vxe-cell--item') || cell.children[0], null, params);
- }
- },
- /**
- * 处理显示 tooltip
- * @param {Event} evnt 事件
- * @param {ColumnInfo} column 列配置
- * @param {Row} row 行对象
- */
- handleTooltip: function handleTooltip(evnt, cell, overflowElem, tipElem, params) {
- params.cell = cell;
- var $refs = this.$refs,
- tooltipOpts = this.tooltipOpts,
- tooltipStore = this.tooltipStore;
- var column = params.column,
- row = params.row;
- var showAll = tooltipOpts.showAll,
- enabled = tooltipOpts.enabled,
- contentMethod = tooltipOpts.contentMethod;
- var tooltip = $refs.tooltip;
- var customContent = contentMethod ? contentMethod(params) : null;
- var useCustom = contentMethod && !ctor_amd_xe_utils_default.a.eqNull(customContent);
- var content = useCustom ? customContent : (column.type === 'html' ? overflowElem.innerText : overflowElem.textContent).trim();
- var isCellOverflow = overflowElem.scrollWidth > overflowElem.clientWidth;
- if (content && (showAll || enabled || useCustom || isCellOverflow)) {
- Object.assign(tooltipStore, {
- row: row,
- column: column,
- visible: true
- });
- if (tooltip) {
- tooltip.open(isCellOverflow ? overflowElem : tipElem || overflowElem, UtilTools.formatText(content));
- }
- }
- return this.$nextTick();
- },
- openTooltip: function openTooltip(target, message) {
- var $refs = this.$refs;
- var commTip = $refs.commTip;
- if (commTip) {
- return commTip.open(target, message);
- }
- return this.$nextTick();
- },
- /**
- * 关闭 tooltip
- */
- closeTooltip: function closeTooltip() {
- var tooltip = this.$refs.tooltip;
- var commTip = this.$refs.commTip;
- Object.assign(this.tooltipStore, {
- row: null,
- column: null,
- content: null,
- visible: false
- });
- if (tooltip) {
- tooltip.close();
- }
- if (commTip) {
- commTip.close();
- }
- return this.$nextTick();
- },
- /**
- * 判断列头复选框是否被选中
- */
- isAllCheckboxChecked: function isAllCheckboxChecked() {
- return this.isAllSelected;
- },
- /**
- * 判断列头复选框是否被半选
- */
- isAllCheckboxIndeterminate: function isAllCheckboxIndeterminate() {
- return !this.isAllSelected && this.isIndeterminate;
- },
- isCheckboxIndeterminate: function isCheckboxIndeterminate() {
- UtilTools.warn('vxe.error.delFunc', ['isCheckboxIndeterminate', 'isAllCheckboxIndeterminate']);
- return this.isAllCheckboxIndeterminate();
- },
- /**
- * 获取复选框半选状态的行数据
- */
- getCheckboxIndeterminateRecords: function getCheckboxIndeterminateRecords() {
- var treeConfig = this.treeConfig,
- treeIndeterminates = this.treeIndeterminates;
- if (treeConfig) {
- return treeIndeterminates.slice(0);
- }
- return [];
- },
- /**
- * 处理默认勾选
- */
- handleDefaultSelectionChecked: function handleDefaultSelectionChecked() {
- var fullDataRowIdData = this.fullDataRowIdData,
- checkboxOpts = this.checkboxOpts;
- var checkAll = checkboxOpts.checkAll,
- checkRowKeys = checkboxOpts.checkRowKeys;
- if (checkAll) {
- this.setAllCheckboxRow(true);
- } else if (checkRowKeys) {
- var defSelection = [];
- checkRowKeys.forEach(function (rowid) {
- if (fullDataRowIdData[rowid]) {
- defSelection.push(fullDataRowIdData[rowid].row);
- }
- });
- this.setCheckboxRow(defSelection, true);
- }
- },
- // 在 v3.0 中废弃 setSelection
- setSelection: function setSelection(rows, value) {
- UtilTools.warn('vxe.error.delFunc', ['setSelection', 'setCheckboxRow']);
- return this.setCheckboxRow(rows, value);
- },
- /**
- * 用于多选行,设置行为选中状态,第二个参数为选中与否
- * @param {Array/Row} rows 行数据
- * @param {Boolean} value 是否选中
- */
- setCheckboxRow: function setCheckboxRow(rows, value) {
- var _this24 = this;
- if (rows && !ctor_amd_xe_utils_default.a.isArray(rows)) {
- rows = [rows];
- }
- rows.forEach(function (row) {
- return _this24.handleSelectRow({
- row: row
- }, !!value);
- });
- return this.$nextTick();
- },
- isCheckedByRow: function isCheckedByRow(row) {
- UtilTools.warn('vxe.error.delFunc', ['isCheckedByRow', 'isCheckedByCheckboxRow']);
- return this.isCheckedByCheckboxRow(row);
- },
- isCheckedByCheckboxRow: function isCheckedByCheckboxRow(row) {
- var property = this.checkboxOpts.checkField;
- if (property) {
- return ctor_amd_xe_utils_default.a.get(row, property);
- }
- return this.selection.indexOf(row) > -1;
- },
- /**
- * 多选,行选中事件
- * value 选中true 不选false 不确定-1
- */
- handleSelectRow: function handleSelectRow(_ref4, value) {
- var _this25 = this;
- var row = _ref4.row;
- var selection = this.selection,
- afterFullData = this.afterFullData,
- treeConfig = this.treeConfig,
- treeOpts = this.treeOpts,
- treeIndeterminates = this.treeIndeterminates,
- checkboxOpts = this.checkboxOpts;
- var property = checkboxOpts.checkField,
- checkStrictly = checkboxOpts.checkStrictly,
- checkMethod = checkboxOpts.checkMethod;
- if (property) {
- if (treeConfig && !checkStrictly) {
- if (value === -1) {
- if (treeIndeterminates.indexOf(row) === -1) {
- treeIndeterminates.push(row);
- }
- ctor_amd_xe_utils_default.a.set(row, property, false);
- } else {
- // 更新子节点状态
- ctor_amd_xe_utils_default.a.eachTree([row], function (item) {
- if (row === item || !checkMethod || checkMethod({
- row: item
- })) {
- ctor_amd_xe_utils_default.a.set(item, property, value);
- ctor_amd_xe_utils_default.a.remove(treeIndeterminates, function (half) {
- return half === item;
- });
- _this25.handleCheckboxReserveRow(row, value);
- }
- }, treeOpts);
- } // 如果存在父节点,更新父节点状态
- var matchObj = ctor_amd_xe_utils_default.a.findTree(afterFullData, function (item) {
- return item === row;
- }, treeOpts);
- if (matchObj && matchObj.parent) {
- var parentStatus;
- var vItems = checkMethod ? matchObj.items.filter(function (item) {
- return checkMethod({
- row: item
- });
- }) : matchObj.items;
- var indeterminatesItem = ctor_amd_xe_utils_default.a.find(matchObj.items, function (item) {
- return treeIndeterminates.indexOf(item) > -1;
- });
- if (indeterminatesItem) {
- parentStatus = -1;
- } else {
- var selectItems = matchObj.items.filter(function (item) {
- return ctor_amd_xe_utils_default.a.get(item, property);
- });
- parentStatus = selectItems.filter(function (item) {
- return vItems.indexOf(item) > -1;
- }).length === vItems.length ? true : selectItems.length || value === -1 ? -1 : false;
- }
- return this.handleSelectRow({
- row: matchObj.parent
- }, parentStatus);
- }
- } else {
- if (!checkMethod || checkMethod({
- row: row
- })) {
- ctor_amd_xe_utils_default.a.set(row, property, value);
- this.handleCheckboxReserveRow(row, value);
- }
- }
- } else {
- if (treeConfig && !checkStrictly) {
- if (value === -1) {
- if (treeIndeterminates.indexOf(row) === -1) {
- treeIndeterminates.push(row);
- }
- ctor_amd_xe_utils_default.a.remove(selection, function (item) {
- return item === row;
- });
- } else {
- // 更新子节点状态
- ctor_amd_xe_utils_default.a.eachTree([row], function (item) {
- if (row === item || !checkMethod || checkMethod({
- row: item
- })) {
- if (value) {
- selection.push(item);
- } else {
- ctor_amd_xe_utils_default.a.remove(selection, function (select) {
- return select === item;
- });
- }
- ctor_amd_xe_utils_default.a.remove(treeIndeterminates, function (half) {
- return half === item;
- });
- _this25.handleCheckboxReserveRow(row, value);
- }
- }, treeOpts);
- } // 如果存在父节点,更新父节点状态
- var _matchObj = ctor_amd_xe_utils_default.a.findTree(afterFullData, function (item) {
- return item === row;
- }, treeOpts);
- if (_matchObj && _matchObj.parent) {
- var _parentStatus;
- var _vItems = checkMethod ? _matchObj.items.filter(function (item) {
- return checkMethod({
- row: item
- });
- }) : _matchObj.items;
- var _indeterminatesItem = ctor_amd_xe_utils_default.a.find(_matchObj.items, function (item) {
- return treeIndeterminates.indexOf(item) > -1;
- });
- if (_indeterminatesItem) {
- _parentStatus = -1;
- } else {
- var _selectItems = _matchObj.items.filter(function (item) {
- return selection.indexOf(item) > -1;
- });
- _parentStatus = _selectItems.filter(function (item) {
- return _vItems.indexOf(item) > -1;
- }).length === _vItems.length ? true : _selectItems.length || value === -1 ? -1 : false;
- }
- return this.handleSelectRow({
- row: _matchObj.parent
- }, _parentStatus);
- }
- } else {
- if (!checkMethod || checkMethod({
- row: row
- })) {
- if (value) {
- if (selection.indexOf(row) === -1) {
- selection.push(row);
- }
- } else {
- ctor_amd_xe_utils_default.a.remove(selection, function (item) {
- return item === row;
- });
- }
- this.handleCheckboxReserveRow(row, value);
- }
- }
- }
- this.checkSelectionStatus();
- },
- handleToggleCheckRowEvent: function handleToggleCheckRowEvent(evnt, params) {
- var selection = this.selection,
- checkboxOpts = this.checkboxOpts;
- var property = checkboxOpts.checkField;
- var row = params.row;
- var value = property ? !ctor_amd_xe_utils_default.a.get(row, property) : selection.indexOf(row) === -1;
- if (evnt) {
- this.triggerCheckRowEvent(evnt, params, value);
- } else {
- this.handleSelectRow(params, value);
- }
- },
- triggerCheckRowEvent: function triggerCheckRowEvent(evnt, params, value) {
- var checkMethod = this.checkboxOpts.checkMethod;
- if (!checkMethod || checkMethod({
- row: params.row
- })) {
- this.handleSelectRow(params, value);
- var records = this.getCheckboxRecords(); // 在 v3.0 中废弃 select-change
- if (this.$listeners['select-change']) {
- UtilTools.warn('vxe.error.delEvent', ['select-change', 'checkbox-change']);
- this.emitEvent('select-change', Object.assign({
- records: records,
- selection: records,
- reserves: this.getCheckboxReserveRecords(),
- checked: value
- }, params), evnt);
- } else {
- this.emitEvent('checkbox-change', Object.assign({
- records: records,
- selection: records,
- reserves: this.getCheckboxReserveRecords(),
- indeterminates: this.getCheckboxIndeterminateRecords(),
- checked: value
- }, params), evnt);
- }
- }
- },
- // 在 v3.0 中废弃 toggleRowSelection
- toggleRowSelection: function toggleRowSelection(row) {
- UtilTools.warn('vxe.error.delFunc', ['toggleRowSelection', 'toggleCheckboxRow']);
- return this.toggleCheckboxRow(row);
- },
- /**
- * 多选,切换某一行的选中状态
- */
- toggleCheckboxRow: function toggleCheckboxRow(row) {
- this.handleToggleCheckRowEvent(null, {
- row: row
- });
- return this.$nextTick();
- },
- // 在 v3.0 中废弃 setAllSelection
- setAllSelection: function setAllSelection(value) {
- UtilTools.warn('vxe.error.delFunc', ['setAllSelection', 'setAllCheckboxRow']);
- return this.setAllCheckboxRow(value);
- },
- /**
- * 用于多选行,设置所有行的选中状态
- * @param {Boolean} value 是否选中
- */
- setAllCheckboxRow: function setAllCheckboxRow(value) {
- var _this26 = this;
- var afterFullData = this.afterFullData,
- treeConfig = this.treeConfig,
- treeOpts = this.treeOpts,
- selection = this.selection,
- checkboxReserveRowMap = this.checkboxReserveRowMap,
- checkboxOpts = this.checkboxOpts;
- var property = checkboxOpts.checkField,
- reserve = checkboxOpts.reserve,
- checkStrictly = checkboxOpts.checkStrictly,
- checkMethod = checkboxOpts.checkMethod;
- var selectRows = [];
- var beforeSelection = treeConfig ? [] : selection.filter(function (row) {
- return afterFullData.indexOf(row) === -1;
- });
- if (checkStrictly) {
- this.isAllSelected = value;
- } else {
- /**
- * 绑定属性方式(高性能,有污染)
- * 必须在行数据存在对应的属性,否则将不响应
- */
- if (property) {
- var checkValFn = function checkValFn(row) {
- if (!checkMethod || checkMethod({
- row: row
- })) {
- if (value) {
- selectRows.push(row);
- }
- ctor_amd_xe_utils_default.a.set(row, property, value);
- }
- }; // 如果存在选中方法
- // 如果方法成立,则更新值,否则忽略该数据
- if (treeConfig) {
- ctor_amd_xe_utils_default.a.eachTree(afterFullData, checkValFn, treeOpts);
- } else {
- afterFullData.forEach(checkValFn);
- }
- } else {
- /**
- * 默认方式(低性能,无污染)
- * 无需任何属性,直接绑定
- */
- if (treeConfig) {
- if (value) {
- /**
- * 如果是树勾选
- * 如果方法成立,则添加到临时集合中
- */
- ctor_amd_xe_utils_default.a.eachTree(afterFullData, function (row) {
- if (!checkMethod || checkMethod({
- row: row
- })) {
- selectRows.push(row);
- }
- }, treeOpts);
- } else {
- /**
- * 如果是树取消
- * 如果方法成立,则不添加到临时集合中
- */
- if (checkMethod) {
- ctor_amd_xe_utils_default.a.eachTree(afterFullData, function (row) {
- if (checkMethod({
- row: row
- }) ? 0 : selection.indexOf(row) > -1) {
- selectRows.push(row);
- }
- }, treeOpts);
- }
- }
- } else {
- if (value) {
- /**
- * 如果是行勾选
- * 如果存在选中方法且成立或者本身已勾选,则添加到临时集合中
- * 如果不存在选中方法,则添加所有数据到临时集合中
- */
- if (checkMethod) {
- selectRows = afterFullData.filter(function (row) {
- return selection.indexOf(row) > -1 || checkMethod({
- row: row
- });
- });
- } else {
- selectRows = afterFullData.slice(0);
- }
- } else {
- /**
- * 如果是行取消
- * 如果方法成立,则不添加到临时集合中;如果方法不成立则判断当前是否已勾选,如果已被勾选则添加到新集合中
- * 如果不存在选中方法,无需处理,临时集合默认为空
- */
- if (checkMethod) {
- selectRows = afterFullData.filter(function (row) {
- return checkMethod({
- row: row
- }) ? 0 : selection.indexOf(row) > -1;
- });
- }
- }
- }
- }
- if (reserve) {
- if (value) {
- selectRows.forEach(function (row) {
- checkboxReserveRowMap[methods_getRowid(_this26, row)] = row;
- });
- } else {
- afterFullData.forEach(function (row) {
- return _this26.handleCheckboxReserveRow(row, false);
- });
- }
- }
- this.selection = property ? [] : beforeSelection.concat(selectRows);
- }
- this.treeIndeterminates = [];
- this.checkSelectionStatus();
- },
- checkSelectionStatus: function checkSelectionStatus() {
- var afterFullData = this.afterFullData,
- selection = this.selection,
- treeIndeterminates = this.treeIndeterminates,
- checkboxOpts = this.checkboxOpts,
- treeConfig = this.treeConfig;
- var checkField = checkboxOpts.checkField,
- halfField = checkboxOpts.halfField,
- checkStrictly = checkboxOpts.checkStrictly,
- checkMethod = checkboxOpts.checkMethod;
- if (!checkStrictly) {
- var isAllSelected = false;
- var isIndeterminate = false;
- if (checkField) {
- isAllSelected = afterFullData.length && afterFullData.every(checkMethod ? function (row) {
- return !checkMethod({
- row: row
- }) || ctor_amd_xe_utils_default.a.get(row, checkField);
- } : function (row) {
- return ctor_amd_xe_utils_default.a.get(row, checkField);
- });
- if (treeConfig) {
- if (halfField) {
- isIndeterminate = !isAllSelected && afterFullData.some(function (row) {
- return ctor_amd_xe_utils_default.a.get(row, checkField) || ctor_amd_xe_utils_default.a.get(row, halfField) || treeIndeterminates.indexOf(row) > -1;
- });
- } else {
- isIndeterminate = !isAllSelected && afterFullData.some(function (row) {
- return ctor_amd_xe_utils_default.a.get(row, checkField) || treeIndeterminates.indexOf(row) > -1;
- });
- }
- } else {
- if (halfField) {
- isIndeterminate = !isAllSelected && afterFullData.some(function (row) {
- return ctor_amd_xe_utils_default.a.get(row, checkField) || ctor_amd_xe_utils_default.a.get(row, halfField);
- });
- } else {
- isIndeterminate = !isAllSelected && afterFullData.some(function (row) {
- return ctor_amd_xe_utils_default.a.get(row, checkField);
- });
- }
- }
- } else {
- isAllSelected = afterFullData.length && afterFullData.every(checkMethod ? function (row) {
- return !checkMethod({
- row: row
- }) || selection.indexOf(row) > -1;
- } : function (row) {
- return selection.indexOf(row) > -1;
- });
- if (treeConfig) {
- isIndeterminate = !isAllSelected && afterFullData.some(function (row) {
- return treeIndeterminates.indexOf(row) > -1 || selection.indexOf(row) > -1;
- });
- } else {
- isIndeterminate = !isAllSelected && afterFullData.some(function (row) {
- return selection.indexOf(row) > -1;
- });
- }
- }
- this.isAllSelected = isAllSelected;
- this.isIndeterminate = isIndeterminate;
- }
- },
- // 还原展开、选中等相关状态
- handleReserveStatus: function handleReserveStatus() {
- var expandColumn = this.expandColumn,
- treeOpts = this.treeOpts,
- treeConfig = this.treeConfig,
- fullDataRowIdData = this.fullDataRowIdData,
- fullAllDataRowMap = this.fullAllDataRowMap,
- currentRow = this.currentRow,
- selectRow = this.selectRow,
- radioReserveRow = this.radioReserveRow,
- radioOpts = this.radioOpts,
- checkboxOpts = this.checkboxOpts,
- selection = this.selection,
- rowExpandeds = this.rowExpandeds,
- treeExpandeds = this.treeExpandeds,
- expandOpts = this.expandOpts; // 单选框
- if (selectRow && !fullAllDataRowMap.has(selectRow)) {
- this.selectRow = null; // 刷新单选行状态
- } // 还原保留选中状态
- if (radioOpts.reserve && radioReserveRow) {
- var rowid = methods_getRowid(this, radioReserveRow);
- if (fullDataRowIdData[rowid]) {
- this.setRadioRow(fullDataRowIdData[rowid].row);
- }
- } // 复选框
- this.selection = getRecoverRow(this, selection); // 刷新多选行状态
- // 还原保留选中状态
- if (checkboxOpts.reserve) {
- this.setCheckboxRow(handleReserveRow(this, this.checkboxReserveRowMap), true);
- }
- if (currentRow && !fullAllDataRowMap.has(currentRow)) {
- this.currentRow = null; // 刷新当前行状态
- } // 行展开
- this.rowExpandeds = expandColumn ? getRecoverRow(this, rowExpandeds) : []; // 刷新行展开状态
- // 还原保留状态
- if (expandColumn && expandOpts.reserve) {
- this.setRowExpand(handleReserveRow(this, this.rowExpandedReserveRowMap), true);
- } // 树展开
- this.treeExpandeds = treeConfig ? getRecoverRow(this, treeExpandeds) : []; // 刷新树展开状态
- if (treeConfig && treeOpts.reserve) {
- this.setTreeExpand(handleReserveRow(this, this.treeExpandedReserveRowMap), true);
- }
- },
- /**
- * 获取单选框保留选中的行
- */
- getRadioReserveRecord: function getRadioReserveRecord() {
- var fullDataRowIdData = this.fullDataRowIdData,
- radioReserveRow = this.radioReserveRow,
- radioOpts = this.radioOpts;
- if (radioOpts.reserve && radioReserveRow) {
- if (!fullDataRowIdData[methods_getRowid(this, radioReserveRow)]) {
- return radioReserveRow;
- }
- }
- return null;
- },
- clearRadioReserve: function clearRadioReserve() {
- this.radioReserveRow = null;
- return this.$nextTick();
- },
- handleRadioReserveRow: function handleRadioReserveRow(row) {
- var radioOpts = this.radioOpts;
- if (radioOpts.reserve) {
- this.radioReserveRow = row;
- }
- },
- // 在 v3.0 中废弃 getSelectReserveRecords
- getSelectReserveRecords: function getSelectReserveRecords() {
- UtilTools.warn('vxe.error.delFunc', ['getSelectReserveRecords', 'getCheckboxReserveRecords']);
- return this.getCheckboxReserveRecords();
- },
- /**
- * 获取保留选中的行
- */
- getCheckboxReserveRecords: function getCheckboxReserveRecords() {
- var fullDataRowIdData = this.fullDataRowIdData,
- checkboxReserveRowMap = this.checkboxReserveRowMap,
- checkboxOpts = this.checkboxOpts;
- var reserveSelection = [];
- if (checkboxOpts.reserve) {
- Object.keys(checkboxReserveRowMap).forEach(function (rowid) {
- if (!fullDataRowIdData[rowid]) {
- reserveSelection.push(checkboxReserveRowMap[rowid]);
- }
- });
- }
- return reserveSelection;
- },
- // 在 v3.0 中废弃 clearSelectReserve
- clearSelectReserve: function clearSelectReserve() {
- UtilTools.warn('vxe.error.delFunc', ['clearSelectReserve', 'clearCheckboxReserve']);
- return this.clearCheckboxReserve();
- },
- clearCheckboxReserve: function clearCheckboxReserve() {
- this.checkboxReserveRowMap = {};
- return this.$nextTick();
- },
- handleCheckboxReserveRow: function handleCheckboxReserveRow(row, checked) {
- var checkboxReserveRowMap = this.checkboxReserveRowMap,
- checkboxOpts = this.checkboxOpts;
- if (checkboxOpts.reserve) {
- var rowid = methods_getRowid(this, row);
- if (checked) {
- checkboxReserveRowMap[rowid] = row;
- } else if (checkboxReserveRowMap[rowid]) {
- delete checkboxReserveRowMap[rowid];
- }
- }
- },
- /**
- * 多选,选中所有事件
- */
- triggerCheckAllEvent: function triggerCheckAllEvent(evnt, value) {
- this.setAllCheckboxRow(value);
- var records = this.getCheckboxRecords(); // 在 v3.0 中废弃 select-all
- if (this.$listeners['select-all']) {
- UtilTools.warn('vxe.error.delEvent', ['select-all', 'checkbox-all']);
- this.emitEvent('select-all', {
- records: records,
- selection: records,
- reserves: this.getCheckboxReserveRecords(),
- checked: value
- }, evnt);
- } else {
- this.emitEvent('checkbox-all', {
- records: records,
- selection: records,
- reserves: this.getCheckboxReserveRecords(),
- indeterminates: this.getCheckboxIndeterminateRecords(),
- checked: value
- }, evnt);
- }
- },
- // 在 v3.0 中废弃 toggleAllSelection
- toggleAllSelection: function toggleAllSelection() {
- UtilTools.warn('vxe.error.delFunc', ['toggleAllSelection', 'toggleAllCheckboxRow']);
- return this.toggleAllCheckboxRow();
- },
- /**
- * 多选,切换所有行的选中状态
- */
- toggleAllCheckboxRow: function toggleAllCheckboxRow() {
- this.triggerCheckAllEvent(null, !this.isAllSelected);
- return this.$nextTick();
- },
- // 在 v3.0 中废弃 clearSelection
- clearSelection: function clearSelection() {
- UtilTools.warn('vxe.error.delFunc', ['clearSelection', 'clearCheckboxRow']);
- return this.clearCheckboxRow();
- },
- /**
- * 用于多选行,手动清空用户的选择
- * 清空行为不管是否被禁用还是保留记录,都将彻底清空选中状态
- */
- clearCheckboxRow: function clearCheckboxRow() {
- var _this27 = this;
- var tableFullData = this.tableFullData,
- treeConfig = this.treeConfig,
- treeOpts = this.treeOpts,
- checkboxOpts = this.checkboxOpts;
- var property = checkboxOpts.checkField,
- reserve = checkboxOpts.reserve;
- if (property) {
- if (treeConfig) {
- ctor_amd_xe_utils_default.a.eachTree(tableFullData, function (item) {
- return ctor_amd_xe_utils_default.a.set(item, property, false);
- }, treeOpts);
- } else {
- tableFullData.forEach(function (item) {
- return ctor_amd_xe_utils_default.a.set(item, property, false);
- });
- }
- }
- if (reserve) {
- tableFullData.forEach(function (row) {
- return _this27.handleCheckboxReserveRow(row, false);
- });
- }
- this.isAllSelected = false;
- this.isIndeterminate = false;
- this.selection = [];
- this.treeIndeterminates = [];
- return this.$nextTick();
- },
- /**
- * 处理单选框默认勾选
- */
- handleDefaultRadioChecked: function handleDefaultRadioChecked() {
- var radioOpts = this.radioOpts,
- fullDataRowIdData = this.fullDataRowIdData;
- var rowid = radioOpts.checkRowKey,
- reserve = radioOpts.reserve;
- if (rowid) {
- if (fullDataRowIdData[rowid]) {
- this.setRadioRow(fullDataRowIdData[rowid].row);
- }
- if (reserve) {
- var rowkey = getRowkey(this);
- this.radioReserveRow = _defineProperty({}, rowkey, rowid);
- }
- }
- },
- /**
- * 单选,行选中事件
- */
- triggerRadioRowEvent: function triggerRadioRowEvent(evnt, params) {
- var isChange = this.selectRow !== params.row;
- this.setRadioRow(params.row);
- if (isChange) {
- this.emitEvent('radio-change', params, evnt);
- }
- },
- triggerCurrentRowEvent: function triggerCurrentRowEvent(evnt, params) {
- var isChange = this.currentRow !== params.row;
- this.setCurrentRow(params.row);
- if (isChange) {
- this.emitEvent('current-change', params, evnt);
- }
- },
- /**
- * 用于当前行,设置某一行为高亮状态
- * @param {Row} row 行对象
- */
- setCurrentRow: function setCurrentRow(row) {
- this.clearCurrentRow();
- this.clearCurrentColumn();
- this.currentRow = row;
- if (this.highlightCurrentRow) {
- ctor_amd_xe_utils_default.a.arrayEach(this.$el.querySelectorAll("[data-rowid=\"".concat(methods_getRowid(this, row), "\"]")), function (elem) {
- return addClass(elem, 'row--current');
- });
- }
- return this.$nextTick();
- },
- isCheckedByRadioRow: function isCheckedByRadioRow(row) {
- return this.selectRow === row;
- },
- /**
- * 用于单选行,设置某一行为选中状态
- * @param {Row} row 行对象
- */
- setRadioRow: function setRadioRow(row) {
- var radioOpts = this.radioOpts;
- var checkMethod = radioOpts.checkMethod;
- if (row && (!checkMethod || checkMethod({
- row: row
- }))) {
- this.selectRow = row;
- this.handleRadioReserveRow(row);
- }
- return this.$nextTick();
- },
- /**
- * 用于当前行,手动清空当前高亮的状态
- */
- clearCurrentRow: function clearCurrentRow() {
- this.currentRow = null;
- this.hoverRow = null;
- ctor_amd_xe_utils_default.a.arrayEach(this.$el.querySelectorAll('.row--current'), function (elem) {
- return removeClass(elem, 'row--current');
- });
- return this.$nextTick();
- },
- /**
- * 用于单选行,手动清空用户的选择
- */
- clearRadioRow: function clearRadioRow() {
- this.selectRow = null;
- return this.$nextTick();
- },
- // 在 v3.0 中废弃 getCurrentRow
- getCurrentRow: function getCurrentRow() {
- UtilTools.warn('vxe.error.delFunc', ['getCurrentRow', 'getCurrentRecord']);
- return this.getCurrentRecord();
- },
- /**
- * 用于当前行,获取当前行的数据
- */
- getCurrentRecord: function getCurrentRecord() {
- return this.highlightCurrentRow ? this.currentRow : null;
- },
- // 在 v3.0 中废弃 getRadioRow
- getRadioRow: function getRadioRow() {
- UtilTools.warn('vxe.error.delFunc', ['getRadioRow', 'getRadioRecord']);
- return this.getRadioRecord();
- },
- /**
- * 用于单选行,获取当已选中的数据
- */
- getRadioRecord: function getRadioRecord() {
- return this.selectRow;
- },
- /**
- * 行 hover 事件
- */
- triggerHoverEvent: function triggerHoverEvent(evnt, _ref5) {
- var row = _ref5.row;
- this.setHoverRow(row);
- },
- setHoverRow: function setHoverRow(row) {
- var rowid = methods_getRowid(this, row);
- this.clearHoverRow();
- ctor_amd_xe_utils_default.a.arrayEach(this.$el.querySelectorAll("[data-rowid=\"".concat(rowid, "\"]")), function (elem) {
- return addClass(elem, 'row--hover');
- });
- this.hoverRow = row;
- },
- clearHoverRow: function clearHoverRow() {
- ctor_amd_xe_utils_default.a.arrayEach(this.$el.querySelectorAll('.vxe-body--row.row--hover'), function (elem) {
- return removeClass(elem, 'row--hover');
- });
- this.hoverRow = null;
- },
- triggerHeaderCellClickEvent: function triggerHeaderCellClickEvent(evnt, params) {
- var _lastResizeTime = this._lastResizeTime,
- sortOpts = this.sortOpts;
- var column = params.column;
- var cell = evnt.currentTarget;
- var triggerResizable = _lastResizeTime && _lastResizeTime > Date.now() - 300;
- var triggerSort = getEventTargetNode(evnt, cell, 'vxe-cell--sort').flag;
- var triggerFilter = getEventTargetNode(evnt, cell, 'vxe-cell--filter').flag;
- if (sortOpts.trigger === 'cell' && !(triggerResizable || triggerSort || triggerFilter)) {
- this.triggerSortEvent(evnt, column, getNextSortOrder(this, column));
- }
- this.emitEvent('header-cell-click', Object.assign({
- triggerResizable: triggerResizable,
- triggerSort: triggerSort,
- triggerFilter: triggerFilter,
- cell: cell
- }, params), evnt);
- if (this.highlightCurrentColumn) {
- return this.setCurrentColumn(column);
- }
- return this.$nextTick();
- },
- triggerHeaderCellDBLClickEvent: function triggerHeaderCellDBLClickEvent(evnt, params) {
- this.emitEvent('header-cell-dblclick', Object.assign({
- cell: evnt.currentTarget
- }, params), evnt);
- },
- getCurrentColumn: function getCurrentColumn() {
- return this.highlightCurrentColumn ? this.currentColumn : null;
- },
- /**
- * 用于当前列,设置某列行为高亮状态
- * @param {ColumnInfo} column 列配置
- */
- setCurrentColumn: function setCurrentColumn(column) {
- this.clearCurrentRow();
- this.clearCurrentColumn();
- this.currentColumn = column;
- return this.$nextTick();
- },
- /**
- * 用于当前列,手动清空当前高亮的状态
- */
- clearCurrentColumn: function clearCurrentColumn() {
- this.currentColumn = null;
- return this.$nextTick();
- },
- checkValidate: function checkValidate(type) {
- if (v_x_e_table._valid) {
- return this.triggerValidate(type);
- }
- return this.$nextTick();
- },
- /**
- * 当单元格发生改变时
- * 如果存在规则,则校验
- */
- handleChangeCell: function handleChangeCell(evnt, params) {
- var _this28 = this;
- this.checkValidate('blur').catch(function (e) {
- return e;
- }).then(function () {
- _this28.handleActived(params, evnt).then(function () {
- return _this28.checkValidate('change');
- }).catch(function (e) {
- return e;
- });
- });
- },
- /**
- * 列点击事件
- * 如果是单击模式,则激活为编辑状态
- * 如果是双击模式,则单击后选中状态
- */
- triggerCellClickEvent: function triggerCellClickEvent(evnt, params) {
- var highlightCurrentRow = this.highlightCurrentRow,
- editStore = this.editStore,
- radioOpts = this.radioOpts,
- expandOpts = this.expandOpts,
- treeOpts = this.treeOpts,
- editConfig = this.editConfig,
- editOpts = this.editOpts,
- checkboxOpts = this.checkboxOpts,
- mouseConfig = this.mouseConfig,
- mouseOpts = this.mouseOpts;
- var actived = editStore.actived;
- var _params = params,
- row = _params.row,
- column = _params.column;
- var type = column.type,
- treeNode = column.treeNode;
- var isRadioType = type === 'radio'; // 在 v3.0 中废弃 selection
- var isCheckboxType = type === 'checkbox' || type === 'selection';
- var isExpandType = type === 'expand';
- var cell = evnt.currentTarget;
- var triggerRadio = isRadioType && getEventTargetNode(evnt, cell, 'vxe-cell--radio').flag;
- var triggerCheckbox = isCheckboxType && getEventTargetNode(evnt, cell, 'vxe-cell--checkbox').flag;
- var triggerTreeNode = treeNode && getEventTargetNode(evnt, cell, 'vxe-tree--btn-wrapper').flag;
- var triggerExpandNode = isExpandType && getEventTargetNode(evnt, cell, 'vxe-table--expanded').flag;
- params = Object.assign({
- cell: cell,
- triggerRadio: triggerRadio,
- triggerCheckbox: triggerCheckbox,
- triggerTreeNode: triggerTreeNode,
- triggerExpandNode: triggerExpandNode
- }, params); // 在 v3.0 中废弃 mouse-config.checked
- var isMouseChecked = mouseConfig && mouseOpts.checked; // 如果是展开行
- if (!triggerExpandNode && (expandOpts.trigger === 'row' || isExpandType && expandOpts.trigger === 'cell')) {
- this.triggerRowExpandEvent(evnt, params);
- } // 如果是树形表格
- if (treeOpts.trigger === 'row' || treeNode && treeOpts.trigger === 'cell') {
- this.triggerTreeExpandEvent(evnt, params);
- } // 如果点击了树节点
- if (!triggerTreeNode) {
- if (!triggerExpandNode) {
- // 如果是高亮行
- if (highlightCurrentRow) {
- if (!triggerCheckbox && !triggerRadio) {
- this.triggerCurrentRowEvent(evnt, params);
- }
- } // 如果是单选框
- if (!triggerRadio && (radioOpts.trigger === 'row' || isRadioType && radioOpts.trigger === 'cell')) {
- this.triggerRadioRowEvent(evnt, params);
- } // 如果是复选框
- if (!triggerCheckbox && (checkboxOpts.trigger === 'row' || isCheckboxType && checkboxOpts.trigger === 'cell')) {
- this.handleToggleCheckRowEvent(evnt, params);
- }
- } // 如果设置了单元格选中功能,则不会使用点击事件去处理(只能支持双击模式)
- if (!isMouseChecked) {
- if (editConfig) {
- if (editOpts.trigger === 'manual') {
- if (actived.args && actived.row === row && column !== actived.column) {
- this.handleChangeCell(evnt, params);
- }
- } else if (!actived.args || row !== actived.row || column !== actived.column) {
- if (editOpts.trigger === 'click') {
- this.handleChangeCell(evnt, params);
- } else if (editOpts.trigger === 'dblclick') {
- if (editOpts.mode === 'row' && actived.row === row) {
- this.handleChangeCell(evnt, params);
- }
- }
- }
- }
- }
- }
- this.emitEvent('cell-click', params, evnt);
- },
- /**
- * 列双击点击事件
- * 如果是双击模式,则激活为编辑状态
- */
- triggerCellDBLClickEvent: function triggerCellDBLClickEvent(evnt, params) {
- var _this29 = this;
- var editStore = this.editStore,
- editConfig = this.editConfig,
- editOpts = this.editOpts;
- var actived = editStore.actived;
- var cell = evnt.currentTarget;
- params.cell = cell;
- if (editConfig && editOpts.trigger === 'dblclick') {
- if (!actived.args || evnt.currentTarget !== actived.args.cell) {
- if (editOpts.mode === 'row') {
- this.checkValidate('blur').catch(function (e) {
- return e;
- }).then(function () {
- _this29.handleActived(params, evnt).then(function () {
- return _this29.checkValidate('change');
- }).catch(function (e) {
- return e;
- });
- });
- } else if (editOpts.mode === 'cell') {
- this.handleActived(params, evnt).then(function () {
- return _this29.checkValidate('change');
- }).catch(function (e) {
- return e;
- });
- }
- }
- }
- this.emitEvent('cell-dblclick', params, evnt);
- },
- handleDefaultSort: function handleDefaultSort() {
- var defaultSort = this.sortOpts.defaultSort;
- if (defaultSort) {
- var field = defaultSort.field,
- order = defaultSort.order;
- if (field && order) {
- var column = ctor_amd_xe_utils_default.a.find(this.tableFullColumn, function (item) {
- return item.property === field;
- });
- if (column && !column.order) {
- this.sort(field, order);
- }
- }
- }
- },
- /**
- * 点击排序事件
- */
- triggerSortEvent: function triggerSortEvent(evnt, column, order) {
- var property = column.property;
- if (column.sortable || column.remoteSort) {
- if (!order || column.order === order) {
- this.clearSort();
- } else {
- this.sort(property, order);
- }
- var params = {
- column: column,
- property: property,
- order: column.order,
- sortBy: column.sortBy,
- sortList: this.getSortColumns()
- };
- this.emitEvent('sort-change', params, evnt);
- }
- },
- sort: function sort(field, order) {
- var tableFullColumn = this.tableFullColumn,
- sortOpts = this.sortOpts;
- var column = this.getColumnByField(field);
- if (column) {
- var isRemote = ctor_amd_xe_utils_default.a.isBoolean(column.remoteSort) ? column.remoteSort : sortOpts.remote;
- if (column.sortable || column.remoteSort) {
- if (arguments.length <= 1) {
- order = getNextSortOrder(this, column);
- }
- if (column.order !== order) {
- tableFullColumn.forEach(function (column) {
- column.order = null;
- });
- column.order = order; // 如果是服务端排序,则跳过本地排序处理
- if (!isRemote) {
- this.handleTableData(true);
- }
- }
- return this.$nextTick().then(this.updateStyle);
- }
- }
- return this.$nextTick();
- },
- /**
- * 手动清空排序条件,数据会恢复成未排序的状态
- */
- clearSort: function clearSort() {
- this.tableFullColumn.forEach(function (column) {
- column.order = null;
- });
- return this.handleTableData(true);
- },
- // 在 v3 中废弃
- getSortColumn: function getSortColumn() {
- // UtilTools.warn('vxe.error.delFunc', ['getSortColumn', 'getSortColumns'])
- return ctor_amd_xe_utils_default.a.find(this.tableFullColumn, function (column) {
- return (column.sortable || column.remoteSort) && column.order;
- });
- },
- isSort: function isSort(field) {
- if (field) {
- var column = this.getColumnByField(field);
- return column && (column.sortable || column.remoteSort) && column.order;
- }
- return this.getSortColumns().length > 0;
- },
- getSortColumns: function getSortColumns() {
- var sortList = [];
- this.tableFullColumn.forEach(function (column) {
- var order = column.order;
- if ((column.sortable || column.remoteSort) && order) {
- sortList.push({
- column: column,
- sortBy: column.sortBy,
- property: column.property,
- order: order
- });
- }
- });
- return sortList;
- },
- /**
- * 关闭筛选
- * @param {Event} evnt 事件
- */
- closeFilter: function closeFilter() {
- Object.assign(this.filterStore, {
- isAllSelected: false,
- isIndeterminate: false,
- options: [],
- visible: false
- });
- return this.$nextTick();
- },
- /**
- * 判断指定列是否为筛选状态,如果为空则判断所有列
- * @param {String} fieldOrColumn 字段名或列
- */
- isFilter: function isFilter(fieldOrColumn) {
- var column = ctor_amd_xe_utils_default.a.isString(fieldOrColumn) ? this.getColumnByField(fieldOrColumn) : fieldOrColumn;
- if (column) {
- return column.filters && column.filters.some(function (option) {
- return option.checked;
- });
- }
- return this.visibleColumn.some(function (column) {
- return column.filters && column.filters.some(function (option) {
- return option.checked;
- });
- });
- },
- /**
- * 判断展开行是否懒加载完成
- * @param {Row} row 行对象
- */
- isRowExpandLoaded: function isRowExpandLoaded(row) {
- var rest = this.fullAllDataRowMap.get(row);
- return rest && rest.expandLoaded;
- },
- clearRowExpandLoaded: function clearRowExpandLoaded(row) {
- var expandOpts = this.expandOpts,
- expandLazyLoadeds = this.expandLazyLoadeds,
- fullAllDataRowMap = this.fullAllDataRowMap;
- var lazy = expandOpts.lazy;
- var rest = fullAllDataRowMap.get(row);
- if (lazy && rest) {
- rest.expandLoaded = false;
- ctor_amd_xe_utils_default.a.remove(expandLazyLoadeds, function (item) {
- return row === item;
- });
- }
- return this.$nextTick();
- },
- /**
- * 重新加载展开行的内容
- * @param {Row} row 行对象
- */
- reloadExpandContent: function reloadExpandContent(row) {
- var _this30 = this;
- var expandOpts = this.expandOpts,
- expandLazyLoadeds = this.expandLazyLoadeds;
- var lazy = expandOpts.lazy;
- if (lazy && expandLazyLoadeds.indexOf(row) === -1) {
- this.clearRowExpandLoaded(row).then(function () {
- return _this30.handleAsyncRowExpand(row);
- });
- }
- return this.$nextTick();
- },
- /**
- * 展开行事件
- */
- triggerRowExpandEvent: function triggerRowExpandEvent(evnt, params) {
- var $listeners = this.$listeners,
- expandOpts = this.expandOpts,
- expandLazyLoadeds = this.expandLazyLoadeds,
- column = this.expandColumn;
- var row = params.row;
- var lazy = expandOpts.lazy;
- if (!lazy || expandLazyLoadeds.indexOf(row) === -1) {
- var expanded = !this.isExpandByRow(row);
- var columnIndex = this.getColumnIndex(column);
- var $columnIndex = this.getVMColumnIndex(column);
- this.setRowExpand(row, expanded); // 在 v3.0 中废弃 toggle-expand-change
- if ($listeners['toggle-expand-change']) {
- UtilTools.warn('vxe.error.delEvent', ['toggle-expand-change', 'toggle-row-expand']);
- this.emitEvent('toggle-expand-change', {
- expanded: expanded,
- column: column,
- columnIndex: columnIndex,
- $columnIndex: $columnIndex,
- row: row,
- rowIndex: this.getRowIndex(row),
- $rowIndex: this.getVMRowIndex(row)
- }, evnt);
- } else {
- this.emitEvent('toggle-row-expand', {
- expanded: expanded,
- column: column,
- columnIndex: columnIndex,
- $columnIndex: $columnIndex,
- row: row,
- rowIndex: this.getRowIndex(row),
- $rowIndex: this.getVMRowIndex(row)
- }, evnt);
- }
- }
- },
- toggleRowExpansion: function toggleRowExpansion(row) {
- UtilTools.warn('vxe.error.delFunc', ['toggleRowExpansion', 'toggleRowExpand']);
- return this.toggleRowExpand(row);
- },
- /**
- * 切换展开行
- */
- toggleRowExpand: function toggleRowExpand(row) {
- return this.setRowExpand(row, !this.isExpandByRow(row));
- },
- /**
- * 处理默认展开行
- */
- handleDefaultRowExpand: function handleDefaultRowExpand() {
- var expandOpts = this.expandOpts,
- fullDataRowIdData = this.fullDataRowIdData;
- var expandAll = expandOpts.expandAll,
- expandRowKeys = expandOpts.expandRowKeys;
- if (expandAll) {
- this.setAllRowExpand(true);
- } else if (expandRowKeys) {
- var defExpandeds = [];
- expandRowKeys.forEach(function (rowid) {
- if (fullDataRowIdData[rowid]) {
- defExpandeds.push(fullDataRowIdData[rowid].row);
- }
- });
- this.setRowExpand(defExpandeds, true);
- }
- },
- setAllRowExpansion: function setAllRowExpansion(expanded) {
- UtilTools.warn('vxe.error.delFunc', ['setAllRowExpansion', 'setAllRowExpand']);
- return this.setAllRowExpand(expanded);
- },
- /**
- * 设置所有行的展开与否
- * @param {Boolean} expanded 是否展开
- */
- setAllRowExpand: function setAllRowExpand(expanded) {
- return this.setRowExpand(this.expandOpts.lazy ? this.tableData : this.tableFullData, expanded);
- },
- handleAsyncRowExpand: function handleAsyncRowExpand(row) {
- var _this31 = this;
- var rest = this.fullAllDataRowMap.get(row);
- return new Promise(function (resolve) {
- _this31.expandLazyLoadeds.push(row);
- _this31.expandOpts.loadMethod({
- $table: _this31,
- row: row,
- rowIndex: _this31.getRowIndex(row),
- $rowIndex: _this31.getVMRowIndex(row)
- }).catch(function (e) {
- return e;
- }).then(function () {
- rest.expandLoaded = true;
- ctor_amd_xe_utils_default.a.remove(_this31.expandLazyLoadeds, function (item) {
- return item === row;
- });
- _this31.rowExpandeds.push(row);
- resolve(_this31.$nextTick().then(_this31.recalculate));
- });
- });
- },
- setRowExpansion: function setRowExpansion(rows, expanded) {
- UtilTools.warn('vxe.error.delFunc', ['setRowExpansion', 'setRowExpand']);
- return this.setRowExpand(rows, expanded);
- },
- /**
- * 设置展开行,二个参数设置这一行展开与否
- * 支持单行
- * 支持多行
- * @param {Array/Row} rows 行数据
- * @param {Boolean} expanded 是否展开
- */
- setRowExpand: function setRowExpand(rows, expanded) {
- var _this32 = this;
- var fullAllDataRowMap = this.fullAllDataRowMap,
- expandLazyLoadeds = this.expandLazyLoadeds,
- expandOpts = this.expandOpts,
- column = this.expandColumn;
- var rowExpandeds = this.rowExpandeds;
- var reserve = expandOpts.reserve,
- lazy = expandOpts.lazy,
- accordion = expandOpts.accordion,
- toggleMethod = expandOpts.toggleMethod;
- var lazyRests = [];
- var columnIndex = this.getColumnIndex(column);
- var $columnIndex = this.getVMColumnIndex(column);
- if (rows) {
- if (!ctor_amd_xe_utils_default.a.isArray(rows)) {
- rows = [rows];
- }
- if (accordion) {
- // 只能同时展开一个
- rowExpandeds = [];
- rows = rows.slice(rows.length - 1, rows.length);
- }
- var validRows = toggleMethod ? rows.filter(function (row) {
- return toggleMethod({
- expanded: expanded,
- column: column,
- columnIndex: columnIndex,
- $columnIndex: $columnIndex,
- row: row,
- rowIndex: _this32.getRowIndex(row),
- $rowIndex: _this32.getVMRowIndex(row)
- });
- }) : rows;
- if (expanded) {
- validRows.forEach(function (row) {
- if (rowExpandeds.indexOf(row) === -1) {
- var rest = fullAllDataRowMap.get(row);
- var isLoad = lazy && !rest.expandLoaded && expandLazyLoadeds.indexOf(row) === -1;
- if (isLoad) {
- lazyRests.push(_this32.handleAsyncRowExpand(row));
- } else {
- rowExpandeds.push(row);
- }
- }
- });
- } else {
- ctor_amd_xe_utils_default.a.remove(rowExpandeds, function (row) {
- return validRows.indexOf(row) > -1;
- });
- }
- if (reserve) {
- validRows.forEach(function (row) {
- return _this32.handleRowExpandReserve(row, expanded);
- });
- }
- }
- this.rowExpandeds = rowExpandeds;
- return Promise.all(lazyRests).then(this.recalculate);
- },
- // 在 v3.0 中废弃 getRecords
- hasRowExpand: function hasRowExpand(row) {
- UtilTools.warn('vxe.error.delFunc', ['hasRowExpand', 'isExpandByRow']);
- return this.isExpandByRow(row);
- },
- /**
- * 判断行是否为展开状态
- * @param {Row} row 行对象
- */
- isExpandByRow: function isExpandByRow(row) {
- return this.rowExpandeds.indexOf(row) > -1;
- },
- /**
- * 手动清空展开行状态,数据会恢复成未展开的状态
- */
- clearRowExpand: function clearRowExpand() {
- var _this33 = this;
- var expandOpts = this.expandOpts,
- rowExpandeds = this.rowExpandeds,
- tableFullData = this.tableFullData;
- var reserve = expandOpts.reserve;
- var isExists = rowExpandeds.length;
- this.rowExpandeds = [];
- if (reserve) {
- tableFullData.forEach(function (row) {
- return _this33.handleRowExpandReserve(row, false);
- });
- }
- return this.$nextTick().then(function () {
- if (isExists) {
- _this33.recalculate();
- }
- });
- },
- clearRowExpandReserve: function clearRowExpandReserve() {
- this.rowExpandedReserveRowMap = {};
- return this.$nextTick();
- },
- handleRowExpandReserve: function handleRowExpandReserve(row, expanded) {
- var rowExpandedReserveRowMap = this.rowExpandedReserveRowMap,
- expandOpts = this.expandOpts;
- if (expandOpts.reserve) {
- var rowid = methods_getRowid(this, row);
- if (expanded) {
- rowExpandedReserveRowMap[rowid] = row;
- } else if (rowExpandedReserveRowMap[rowid]) {
- delete rowExpandedReserveRowMap[rowid];
- }
- }
- },
- getRowExpandRecords: function getRowExpandRecords() {
- return this.rowExpandeds.slice(0);
- },
- getTreeExpandRecords: function getTreeExpandRecords() {
- return this.treeExpandeds.slice(0);
- },
- /**
- * 获取数表格状态
- */
- getTreeStatus: function getTreeStatus() {
- if (this.treeConfig) {
- return {
- config: this.treeOpts,
- rowExpandeds: this.getTreeExpandRecords()
- };
- }
- return null;
- },
- /**
- * 判断树节点是否懒加载完成
- * @param {Row} row 行对象
- */
- isTreeExpandLoaded: function isTreeExpandLoaded(row) {
- var rest = this.fullAllDataRowMap.get(row);
- return rest && rest.treeLoaded;
- },
- clearTreeExpandLoaded: function clearTreeExpandLoaded(row) {
- var treeOpts = this.treeOpts,
- treeExpandeds = this.treeExpandeds,
- fullAllDataRowMap = this.fullAllDataRowMap;
- var lazy = treeOpts.lazy;
- var rest = fullAllDataRowMap.get(row);
- if (lazy && rest) {
- rest.treeLoaded = false;
- ctor_amd_xe_utils_default.a.remove(treeExpandeds, function (item) {
- return row === item;
- });
- }
- return this.$nextTick();
- },
- /**
- * 重新加载树的子节点
- * @param {Row} row 行对象
- */
- reloadTreeChilds: function reloadTreeChilds(row) {
- var _this34 = this;
- var treeOpts = this.treeOpts,
- treeLazyLoadeds = this.treeLazyLoadeds;
- var lazy = treeOpts.lazy,
- hasChild = treeOpts.hasChild;
- if (lazy && row[hasChild] && treeLazyLoadeds.indexOf(row) === -1) {
- this.clearTreeExpandLoaded(row).then(function () {
- return _this34.handleAsyncTreeExpandChilds(row);
- });
- }
- return this.$nextTick();
- },
- /**
- * 展开树节点事件
- */
- triggerTreeExpandEvent: function triggerTreeExpandEvent(evnt, params) {
- var $listeners = this.$listeners,
- treeOpts = this.treeOpts,
- treeLazyLoadeds = this.treeLazyLoadeds;
- var row = params.row,
- column = params.column;
- var lazy = treeOpts.lazy;
- if (!lazy || treeLazyLoadeds.indexOf(row) === -1) {
- var expanded = !this.isTreeExpandByRow(row);
- var columnIndex = this.getColumnIndex(column);
- var $columnIndex = this.getVMColumnIndex(column);
- this.setTreeExpand(row, expanded); // 在 v3.0 中废弃 toggle-tree-change
- if ($listeners['toggle-tree-change']) {
- UtilTools.warn('vxe.error.delEvent', ['toggle-tree-change', 'toggle-tree-expand']);
- this.emitEvent('toggle-tree-change', {
- expanded: expanded,
- column: column,
- columnIndex: columnIndex,
- $columnIndex: $columnIndex,
- row: row
- }, evnt);
- } else {
- this.emitEvent('toggle-tree-expand', {
- expanded: expanded,
- column: column,
- columnIndex: columnIndex,
- $columnIndex: $columnIndex,
- row: row
- }, evnt);
- }
- }
- },
- toggleTreeExpansion: function toggleTreeExpansion(row) {
- UtilTools.warn('vxe.error.delFunc', ['toggleTreeExpansion', 'toggleTreeExpand']);
- return this.toggleTreeExpand(row);
- },
- /**
- * 切换/展开树节点
- */
- toggleTreeExpand: function toggleTreeExpand(row) {
- return this.setTreeExpand(row, !this.isTreeExpandByRow(row));
- },
- /**
- * 处理默认展开树节点
- */
- handleDefaultTreeExpand: function handleDefaultTreeExpand() {
- var treeConfig = this.treeConfig,
- treeOpts = this.treeOpts,
- tableFullData = this.tableFullData;
- if (treeConfig) {
- var expandAll = treeOpts.expandAll,
- expandRowKeys = treeOpts.expandRowKeys;
- if (expandAll) {
- this.setAllTreeExpand(true);
- } else if (expandRowKeys) {
- var defExpandeds = [];
- var rowkey = getRowkey(this);
- expandRowKeys.forEach(function (rowid) {
- var matchObj = ctor_amd_xe_utils_default.a.findTree(tableFullData, function (item) {
- return rowid === ctor_amd_xe_utils_default.a.get(item, rowkey);
- }, treeOpts);
- if (matchObj) {
- defExpandeds.push(matchObj.item);
- }
- });
- this.setTreeExpand(defExpandeds, true);
- }
- }
- },
- handleAsyncTreeExpandChilds: function handleAsyncTreeExpandChilds(row) {
- var _this35 = this;
- var fullAllDataRowMap = this.fullAllDataRowMap,
- treeExpandeds = this.treeExpandeds,
- treeOpts = this.treeOpts,
- treeLazyLoadeds = this.treeLazyLoadeds,
- checkboxOpts = this.checkboxOpts;
- var loadMethod = treeOpts.loadMethod;
- var checkStrictly = checkboxOpts.checkStrictly;
- var rest = fullAllDataRowMap.get(row);
- return new Promise(function (resolve) {
- treeLazyLoadeds.push(row);
- loadMethod({
- $table: _this35,
- row: row
- }).catch(function () {
- return [];
- }).then(function (childRecords) {
- rest.treeLoaded = true;
- ctor_amd_xe_utils_default.a.remove(treeLazyLoadeds, function (item) {
- return item === row;
- });
- if (!ctor_amd_xe_utils_default.a.isArray(childRecords)) {
- childRecords = [];
- }
- if (childRecords) {
- _this35.loadChildren(row, childRecords).then(function (childRows) {
- if (childRows.length && treeExpandeds.indexOf(row) === -1) {
- treeExpandeds.push(row);
- } // 如果当前节点已选中,则展开后子节点也被选中
- if (!checkStrictly && _this35.isCheckedByCheckboxRow(row)) {
- _this35.setCheckboxRow(childRows, true);
- }
- });
- }
- resolve(_this35.$nextTick().then(_this35.recalculate));
- });
- });
- },
- setAllTreeExpansion: function setAllTreeExpansion(expanded) {
- UtilTools.warn('vxe.error.delFunc', ['setAllTreeExpansion', 'setAllTreeExpand']);
- return this.setAllTreeExpand(expanded);
- },
- /**
- * 设置所有树节点的展开与否
- * @param {Boolean} expanded 是否展开
- */
- setAllTreeExpand: function setAllTreeExpand(expanded) {
- var tableFullData = this.tableFullData,
- treeOpts = this.treeOpts;
- var lazy = treeOpts.lazy,
- children = treeOpts.children;
- var expandeds = [];
- ctor_amd_xe_utils_default.a.eachTree(tableFullData, function (row) {
- var rowChildren = row[children];
- if (lazy || rowChildren && rowChildren.length) {
- expandeds.push(row);
- }
- }, treeOpts);
- return this.setTreeExpand(expandeds, expanded);
- },
- setTreeExpansion: function setTreeExpansion(rows, expanded) {
- UtilTools.warn('vxe.error.delFunc', ['setTreeExpansion', 'setTreeExpand']);
- return this.setTreeExpand(rows, expanded);
- },
- /**
- * 设置展开树形节点,二个参数设置这一行展开与否
- * 支持单行
- * 支持多行
- * @param {Array/Row} rows 行数据
- * @param {Boolean} expanded 是否展开
- */
- setTreeExpand: function setTreeExpand(rows, expanded) {
- var _this36 = this;
- var fullAllDataRowMap = this.fullAllDataRowMap,
- tableFullData = this.tableFullData,
- treeExpandeds = this.treeExpandeds,
- treeOpts = this.treeOpts,
- treeLazyLoadeds = this.treeLazyLoadeds,
- treeNodeColumn = this.treeNodeColumn;
- var reserve = treeOpts.reserve,
- lazy = treeOpts.lazy,
- hasChild = treeOpts.hasChild,
- children = treeOpts.children,
- accordion = treeOpts.accordion,
- toggleMethod = treeOpts.toggleMethod;
- var result = [];
- var columnIndex = this.getColumnIndex(treeNodeColumn);
- var $columnIndex = this.getVMColumnIndex(treeNodeColumn);
- if (rows) {
- if (!ctor_amd_xe_utils_default.a.isArray(rows)) {
- rows = [rows];
- }
- if (rows.length) {
- var validRows = toggleMethod ? rows.filter(function (row) {
- return toggleMethod({
- expanded: expanded,
- column: treeNodeColumn,
- columnIndex: columnIndex,
- $columnIndex: $columnIndex,
- row: row
- });
- }) : rows;
- if (accordion) {
- validRows = validRows.length ? [validRows[validRows.length - 1]] : []; // 同一级只能展开一个
- var matchObj = ctor_amd_xe_utils_default.a.findTree(tableFullData, function (item) {
- return item === validRows[0];
- }, treeOpts);
- if (matchObj) {
- ctor_amd_xe_utils_default.a.remove(treeExpandeds, function (item) {
- return matchObj.items.indexOf(item) > -1;
- });
- }
- }
- if (expanded) {
- validRows.forEach(function (row) {
- if (treeExpandeds.indexOf(row) === -1) {
- var rest = fullAllDataRowMap.get(row);
- var isLoad = lazy && row[hasChild] && !rest.treeLoaded && treeLazyLoadeds.indexOf(row) === -1; // 是否使用懒加载
- if (isLoad) {
- result.push(_this36.handleAsyncTreeExpandChilds(row));
- } else {
- if (row[children] && row[children].length) {
- treeExpandeds.push(row);
- }
- }
- }
- });
- } else {
- ctor_amd_xe_utils_default.a.remove(treeExpandeds, function (row) {
- return validRows.indexOf(row) > -1;
- });
- }
- if (reserve) {
- validRows.forEach(function (row) {
- return _this36.handleTreeExpandReserve(row, expanded);
- });
- }
- return Promise.all(result).then(this.recalculate);
- }
- }
- return this.$nextTick();
- },
- // 在 v3.0 中废弃 hasTreeExpand
- hasTreeExpand: function hasTreeExpand(row) {
- UtilTools.warn('vxe.error.delFunc', ['hasTreeExpand', 'isTreeExpandByRow']);
- return this.isTreeExpandByRow(row);
- },
- /**
- * 判断行是否为树形节点展开状态
- * @param {Row} row 行对象
- */
- isTreeExpandByRow: function isTreeExpandByRow(row) {
- return this.treeExpandeds.indexOf(row) > -1;
- },
- /**
- * 手动清空树形节点的展开状态,数据会恢复成未展开的状态
- */
- clearTreeExpand: function clearTreeExpand() {
- var _this37 = this;
- var treeOpts = this.treeOpts,
- treeExpandeds = this.treeExpandeds,
- tableFullData = this.tableFullData;
- var reserve = treeOpts.reserve;
- var isExists = treeExpandeds.length;
- this.treeExpandeds = [];
- if (reserve) {
- ctor_amd_xe_utils_default.a.eachTree(tableFullData, function (row) {
- return _this37.handleTreeExpandReserve(row, false);
- }, treeOpts);
- }
- return this.$nextTick().then(function () {
- if (isExists) {
- _this37.recalculate();
- }
- });
- },
- clearTreeExpandReserve: function clearTreeExpandReserve() {
- this.treeExpandedReserveRowMap = {};
- return this.$nextTick();
- },
- handleTreeExpandReserve: function handleTreeExpandReserve(row, expanded) {
- var treeExpandedReserveRowMap = this.treeExpandedReserveRowMap,
- treeOpts = this.treeOpts;
- if (treeOpts.reserve) {
- var rowid = methods_getRowid(this, row);
- if (expanded) {
- treeExpandedReserveRowMap[rowid] = row;
- } else if (treeExpandedReserveRowMap[rowid]) {
- delete treeExpandedReserveRowMap[rowid];
- }
- }
- },
- getVirtualScroller: function getVirtualScroller() {
- UtilTools.warn('vxe.error.delFunc', ['getVirtualScroller', 'getScroll']);
- return this.getScroll();
- },
- getTableScroll: function getTableScroll() {
- UtilTools.warn('vxe.error.delFunc', ['getTableScroll', 'getScroll']);
- return this.getScroll();
- },
- /**
- * 获取表格的滚动状态
- */
- getScroll: function getScroll() {
- var $refs = this.$refs,
- scrollXLoad = this.scrollXLoad,
- scrollYLoad = this.scrollYLoad;
- var bodyElem = $refs.tableBody.$el;
- return {
- virtualX: scrollXLoad,
- virtualY: scrollYLoad,
- scrollTop: bodyElem.scrollTop,
- scrollLeft: bodyElem.scrollLeft
- };
- },
- /**
- * 横向 X 可视渲染事件处理
- */
- triggerScrollXEvent: function triggerScrollXEvent() {
- this.loadScrollXData();
- },
- loadScrollXData: function loadScrollXData(force) {
- var $refs = this.$refs,
- visibleColumn = this.visibleColumn,
- scrollXStore = this.scrollXStore;
- var startIndex = scrollXStore.startIndex,
- renderSize = scrollXStore.renderSize,
- offsetSize = scrollXStore.offsetSize,
- visibleSize = scrollXStore.visibleSize;
- var scrollBodyElem = $refs.tableBody.$el;
- var scrollLeft = scrollBodyElem.scrollLeft;
- var toVisibleIndex = 0;
- var width = 0;
- var preload = force || false;
- var colLen = visibleColumn.length;
- for (var colIndex = 0; colIndex < colLen; colIndex++) {
- width += visibleColumn[colIndex].renderWidth;
- if (scrollLeft < width) {
- toVisibleIndex = colIndex;
- break;
- }
- }
- if (force || scrollXStore.visibleIndex !== toVisibleIndex) {
- var marginSize = Math.min(Math.floor((renderSize - visibleSize) / 2), visibleSize);
- if (scrollXStore.visibleIndex === toVisibleIndex) {
- scrollXStore.startIndex = toVisibleIndex;
- } else if (scrollXStore.visibleIndex > toVisibleIndex) {
- // 向左
- preload = toVisibleIndex - offsetSize <= startIndex;
- if (preload) {
- scrollXStore.startIndex = Math.max(0, Math.max(0, toVisibleIndex - marginSize));
- }
- } else {
- // 向右
- preload = toVisibleIndex + visibleSize + offsetSize >= startIndex + renderSize;
- if (preload) {
- scrollXStore.startIndex = Math.max(0, Math.min(visibleColumn.length - renderSize, toVisibleIndex - marginSize));
- }
- }
- if (preload) {
- this.updateScrollXData();
- }
- scrollXStore.visibleIndex = toVisibleIndex;
- }
- this.closeTooltip();
- },
- /**
- * 纵向 Y 可视渲染事件处理
- */
- triggerScrollYEvent: function triggerScrollYEvent(evnt) {
- var scrollYStore = this.scrollYStore;
- var adaptive = scrollYStore.adaptive,
- offsetSize = scrollYStore.offsetSize,
- visibleSize = scrollYStore.visibleSize; // webkit 浏览器使用最佳的渲染方式
- if (isWebkit && adaptive && offsetSize * 2 + visibleSize <= 80) {
- this.loadScrollYData(evnt);
- } else {
- this.debounceScrollY(evnt);
- }
- },
- debounceScrollY: ctor_amd_xe_utils_default.a.debounce(function (evnt) {
- this.loadScrollYData(evnt);
- }, debounceScrollYDuration, {
- leading: false,
- trailing: true
- }),
- /**
- * 纵向 Y 可视渲染处理
- */
- loadScrollYData: function loadScrollYData(evnt) {
- var afterFullData = this.afterFullData,
- scrollYStore = this.scrollYStore,
- isLoadData = this.isLoadData;
- var startIndex = scrollYStore.startIndex,
- renderSize = scrollYStore.renderSize,
- offsetSize = scrollYStore.offsetSize,
- visibleSize = scrollYStore.visibleSize,
- rowHeight = scrollYStore.rowHeight;
- var scrollBodyElem = evnt.target;
- var scrollTop = scrollBodyElem.scrollTop;
- var toVisibleIndex = Math.ceil(scrollTop / rowHeight);
- var preload = false;
- if (isLoadData || scrollYStore.visibleIndex !== toVisibleIndex) {
- var marginSize = Math.min(Math.floor((renderSize - visibleSize) / 2), visibleSize);
- if (scrollYStore.visibleIndex > toVisibleIndex) {
- // 向上
- preload = toVisibleIndex - offsetSize <= startIndex;
- if (preload) {
- scrollYStore.startIndex = Math.max(0, toVisibleIndex - Math.max(marginSize, renderSize - visibleSize));
- }
- } else {
- // 向下
- preload = toVisibleIndex + visibleSize + offsetSize >= startIndex + renderSize;
- if (preload) {
- scrollYStore.startIndex = Math.max(0, Math.min(afterFullData.length - renderSize, toVisibleIndex - marginSize));
- }
- }
- if (preload) {
- this.updateScrollYData();
- }
- scrollYStore.visibleIndex = toVisibleIndex;
- this.isLoadData = false;
- }
- },
- computeRowHeight: function computeRowHeight() {
- var tableBody = this.$refs.tableBody;
- var tableBodyElem = tableBody ? tableBody.$el : null;
- var tableHeader = this.$refs.tableHeader;
- var rowHeight;
- if (tableBodyElem) {
- var firstTrElem = tableBodyElem.querySelector('tbody>tr');
- if (!firstTrElem && tableHeader) {
- firstTrElem = tableHeader.$el.querySelector('thead>tr');
- }
- if (firstTrElem) {
- rowHeight = firstTrElem.clientHeight;
- }
- } // 默认的行高
- if (!rowHeight) {
- rowHeight = this.rowHeightMaps[this.vSize || 'default'];
- }
- this.rowHeight = rowHeight;
- },
- // 计算可视渲染相关数据
- computeScrollLoad: function computeScrollLoad() {
- var _this38 = this;
- return this.$nextTick().then(function () {
- var vSize = _this38.vSize,
- scrollXLoad = _this38.scrollXLoad,
- scrollYLoad = _this38.scrollYLoad,
- sYOpts = _this38.sYOpts,
- scrollYStore = _this38.scrollYStore,
- sXOpts = _this38.sXOpts,
- scrollXStore = _this38.scrollXStore,
- visibleColumn = _this38.visibleColumn,
- rowHeightMaps = _this38.rowHeightMaps;
- var tableBody = _this38.$refs.tableBody;
- var tableBodyElem = tableBody ? tableBody.$el : null;
- var tableHeader = _this38.$refs.tableHeader;
- if (tableBodyElem) {
- // 计算 X 逻辑
- if (scrollXLoad) {
- var bodyWidth = tableBodyElem.clientWidth;
- var visibleXSize = ctor_amd_xe_utils_default.a.toNumber(sXOpts.vSize);
- if (!sXOpts.vSize) {
- var len = visibleXSize = visibleColumn.length;
- var countWidth = 0;
- var column;
- for (var colIndex = 0; colIndex < len; colIndex++) {
- column = visibleColumn[colIndex];
- countWidth += column.renderWidth;
- if (countWidth > bodyWidth) {
- visibleXSize = colIndex + 1;
- break;
- }
- }
- }
- scrollXStore.visibleSize = visibleXSize; // 自动优化
- if (!sXOpts.oSize) {
- scrollXStore.offsetSize = visibleXSize;
- }
- if (!sXOpts.rSize) {
- scrollXStore.renderSize = Math.max(8, visibleXSize + 6);
- }
- _this38.updateScrollXData();
- } else {
- _this38.updateScrollXSpace();
- } // 计算 Y 逻辑
- if (scrollYLoad) {
- var rHeight;
- if (sYOpts.rHeight) {
- rHeight = sYOpts.rHeight;
- } else {
- var firstTrElem = tableBodyElem.querySelector('tbody>tr');
- if (!firstTrElem && tableHeader) {
- firstTrElem = tableHeader.$el.querySelector('thead>tr');
- }
- if (firstTrElem) {
- rHeight = firstTrElem.clientHeight;
- }
- } // 默认的行高
- if (!rHeight) {
- rHeight = rowHeightMaps[vSize || 'default'];
- }
- var visibleYSize = ctor_amd_xe_utils_default.a.toNumber(sYOpts.vSize || Math.ceil(tableBodyElem.clientHeight / rHeight));
- scrollYStore.visibleSize = visibleYSize;
- scrollYStore.rowHeight = rHeight; // 自动优化
- if (!sYOpts.oSize) {
- scrollYStore.offsetSize = visibleYSize;
- }
- if (!sYOpts.rSize) {
- scrollYStore.renderSize = Math.max(6, methods_browse.edge ? visibleYSize * 10 : isWebkit ? visibleYSize + 2 : visibleYSize * 6);
- }
- _this38.updateScrollYData();
- } else {
- _this38.updateScrollYSpace();
- }
- }
- _this38.$nextTick(_this38.updateStyle);
- });
- },
- updateScrollXData: function updateScrollXData() {
- var visibleColumn = this.visibleColumn,
- scrollXStore = this.scrollXStore;
- this.tableColumn = visibleColumn.slice(scrollXStore.startIndex, scrollXStore.startIndex + scrollXStore.renderSize);
- this.updateScrollXSpace();
- },
- // 更新横向 X 可视渲染上下剩余空间大小
- updateScrollXSpace: function updateScrollXSpace() {
- var $refs = this.$refs,
- elemStore = this.elemStore,
- visibleColumn = this.visibleColumn,
- scrollXStore = this.scrollXStore,
- scrollXLoad = this.scrollXLoad,
- tableWidth = this.tableWidth,
- scrollbarWidth = this.scrollbarWidth;
- var tableHeader = $refs.tableHeader,
- tableBody = $refs.tableBody,
- tableFooter = $refs.tableFooter;
- var headerElem = tableHeader ? tableHeader.$el.querySelector('.vxe-table--header') : null;
- var bodyElem = tableBody.$el.querySelector('.vxe-table--body');
- var footerElem = tableFooter ? tableFooter.$el.querySelector('.vxe-table--footer') : null;
- var leftSpaceWidth = visibleColumn.slice(0, scrollXStore.startIndex).reduce(function (previous, column) {
- return previous + column.renderWidth;
- }, 0);
- var marginLeft = '';
- if (scrollXLoad) {
- marginLeft = "".concat(leftSpaceWidth, "px");
- }
- if (headerElem) {
- headerElem.style.marginLeft = marginLeft;
- }
- bodyElem.style.marginLeft = marginLeft;
- if (footerElem) {
- footerElem.style.marginLeft = marginLeft;
- }
- var containerList = ['main'];
- containerList.forEach(function (name) {
- var layoutList = ['header', 'body', 'footer'];
- layoutList.forEach(function (layout) {
- var xSpaceElem = elemStore["".concat(name, "-").concat(layout, "-xSpace")];
- if (xSpaceElem) {
- xSpaceElem.style.width = scrollXLoad ? "".concat(tableWidth + (layout === 'header' ? scrollbarWidth : 0), "px") : '';
- }
- });
- });
- this.$nextTick(this.updateStyle);
- },
- updateScrollYData: function updateScrollYData() {
- this.handleTableData();
- this.updateScrollYSpace();
- },
- // 更新纵向 Y 可视渲染上下剩余空间大小
- updateScrollYSpace: function updateScrollYSpace() {
- var elemStore = this.elemStore,
- scrollYStore = this.scrollYStore,
- scrollYLoad = this.scrollYLoad,
- afterFullData = this.afterFullData;
- var bodyHeight = afterFullData.length * scrollYStore.rowHeight;
- var topSpaceHeight = Math.max(scrollYStore.startIndex * scrollYStore.rowHeight, 0);
- var containerList = ['main', 'left', 'right'];
- var marginTop = '';
- var ySpaceHeight = '';
- if (scrollYLoad) {
- marginTop = "".concat(topSpaceHeight, "px");
- ySpaceHeight = "".concat(bodyHeight, "px");
- }
- containerList.forEach(function (name) {
- var layoutList = ['header', 'body', 'footer'];
- var tableElem = elemStore["".concat(name, "-body-table")];
- if (tableElem) {
- tableElem.style.marginTop = marginTop;
- }
- layoutList.forEach(function (layout) {
- var ySpaceElem = elemStore["".concat(name, "-").concat(layout, "-ySpace")];
- if (ySpaceElem) {
- ySpaceElem.style.height = ySpaceHeight;
- }
- });
- });
- this.$nextTick(this.updateStyle);
- },
- /**
- * 如果有滚动条,则滚动到对应的位置
- * @param {Number} scrollLeft 左距离
- * @param {Number} scrollTop 上距离
- */
- scrollTo: function scrollTo(scrollLeft, scrollTop) {
- var _this39 = this;
- var $refs = this.$refs;
- var tableBody = $refs.tableBody,
- rightBody = $refs.rightBody,
- tableFooter = $refs.tableFooter;
- var tableBodyElem = tableBody ? tableBody.$el : null;
- var rightBodyElem = rightBody ? rightBody.$el : null;
- var bodyTargetElem = rightBodyElem || tableBodyElem;
- var tableFooterElem = tableFooter ? tableFooter.$el : null;
- var footerTargetElem = tableFooterElem || tableBodyElem;
- if (ctor_amd_xe_utils_default.a.isNumber(scrollLeft)) {
- footerTargetElem.scrollLeft = scrollLeft;
- }
- if (ctor_amd_xe_utils_default.a.isNumber(scrollTop)) {
- bodyTargetElem.scrollTop = scrollTop;
- }
- if (this.scrollXLoad || this.scrollYLoad) {
- return new Promise(function (resolve) {
- return setTimeout(function () {
- return resolve(_this39.$nextTick());
- }, 50);
- });
- }
- return this.$nextTick();
- },
- /**
- * 如果有滚动条,则滚动到对应的行
- * @param {Row} row 行对象
- * @param {ColumnInfo} column 列配置
- */
- scrollToRow: function scrollToRow(row, column) {
- var rest = [];
- if (row) {
- if (this.treeConfig) {
- rest.push(this.scrollToTreeRow(row));
- } else {
- rest.push(DomTools.rowToVisible(this, row));
- }
- }
- if (column) {
- rest.push(this.scrollToColumn(column));
- }
- return Promise.all(rest);
- },
- /**
- * 如果有滚动条,则滚动到对应的列
- * @param {ColumnInfo} column 列配置
- */
- scrollToColumn: function scrollToColumn(column) {
- if (column && this.fullColumnMap.has(column)) {
- return DomTools.colToVisible(this, column);
- }
- return this.$nextTick();
- },
- /**
- * 对于树形结构中,可以直接滚动到指定深层节点中
- * 对于某些特定的场景可能会用到,比如定位到某一节点
- * @param {Row} row 行对象
- */
- scrollToTreeRow: function scrollToTreeRow(row) {
- var _this40 = this;
- var tableFullData = this.tableFullData,
- treeConfig = this.treeConfig,
- treeOpts = this.treeOpts;
- var rests = [];
- if (treeConfig) {
- var matchObj = ctor_amd_xe_utils_default.a.findTree(tableFullData, function (item) {
- return item === row;
- }, treeOpts);
- if (matchObj) {
- var nodes = matchObj.nodes;
- nodes.forEach(function (row, index) {
- if (index < nodes.length - 1 && !_this40.isTreeExpandByRow(row)) {
- rests.push(_this40.setTreeExpand(row, true));
- }
- });
- }
- }
- return Promise.all(rests).then(function () {
- return DomTools.rowToVisible(_this40, row);
- });
- },
- /**
- * 手动清除滚动相关信息,还原到初始状态
- */
- clearScroll: function clearScroll() {
- var $refs = this.$refs;
- var tableBody = $refs.tableBody,
- rightBody = $refs.rightBody,
- tableFooter = $refs.tableFooter;
- var tableBodyElem = tableBody ? tableBody.$el : null;
- var rightBodyElem = rightBody ? rightBody.$el : null;
- var tableFooterElem = tableFooter ? tableFooter.$el : null;
- if (rightBodyElem) {
- rightBodyElem.scrollTop = 0;
- }
- if (tableFooterElem) {
- tableFooterElem.scrollLeft = 0;
- }
- if (tableBodyElem) {
- tableBodyElem.scrollTop = 0;
- tableBodyElem.scrollLeft = 0;
- }
- return this.$nextTick();
- },
- /**
- * 更新表尾合计
- */
- updateFooter: function updateFooter() {
- var showFooter = this.showFooter,
- visibleColumn = this.visibleColumn,
- footerMethod = this.footerMethod;
- if (showFooter && footerMethod) {
- this.footerTableData = visibleColumn.length ? footerMethod({
- columns: visibleColumn,
- data: this.afterFullData,
- $table: this,
- $grid: this.$xegrid
- }) : [];
- }
- return this.$nextTick();
- },
- /**
- * 更新列状态
- * 如果组件值 v-model 发生 change 时,调用改函数用于更新某一列编辑状态
- * 如果单元格配置了校验规则,则会进行校验
- */
- updateStatus: function updateStatus(scope, cellValue) {
- var _this41 = this;
- var customVal = !ctor_amd_xe_utils_default.a.isUndefined(cellValue);
- return this.$nextTick().then(function () {
- var $refs = _this41.$refs,
- editRules = _this41.editRules,
- validStore = _this41.validStore;
- if (scope && $refs.tableBody && editRules) {
- var row = scope.row,
- column = scope.column;
- var type = 'change';
- if (_this41.hasCellRules(type, row, column)) {
- var cell = _this41.getCell(row, column);
- if (cell) {
- return _this41.validCellRules(type, row, column, cellValue).then(function () {
- if (customVal && validStore.visible) {
- methods_setCellValue(row, column, cellValue);
- }
- _this41.clearValidate();
- }).catch(function (_ref6) {
- var rule = _ref6.rule;
- if (customVal) {
- methods_setCellValue(row, column, cellValue);
- }
- _this41.showValidTooltip({
- rule: rule,
- row: row,
- column: column,
- cell: cell
- });
- });
- }
- }
- }
- });
- },
- handleDefaultMergeCells: function handleDefaultMergeCells() {
- this.setMergeCells(this.mergeCells);
- },
- /**
- * 设置合并单元格
- * @param {MergeOptions[]} merges { row: Row|number, column: ColumnInfo|number, rowspan: number, colspan: number }
- */
- setMergeCells: function setMergeCells(merges) {
- var _this42 = this;
- if (this.spanMethod) {
- UtilTools.error('vxe.error.errConflicts', ['merge-cells', 'span-method']);
- }
- setMerges(this, merges, this.mergeList, this.afterFullData);
- return this.$nextTick().then(function () {
- return _this42.updateCellAreas();
- });
- },
- /**
- * 移除单元格合并
- * @param {MergeOptions[]} merges 多个或数组 [{row:Row|number, col:ColumnInfo|number}]
- */
- removeMergeCells: function removeMergeCells(merges) {
- var _this43 = this;
- if (this.spanMethod) {
- UtilTools.error('vxe.error.errConflicts', ['merge-cells', 'span-method']);
- }
- var rest = removeMerges(this, merges, this.mergeList, this.afterFullData);
- return this.$nextTick().then(function () {
- _this43.updateCellAreas();
- return rest;
- });
- },
- /**
- * 获取所有被合并的单元格
- */
- getMergeCells: function getMergeCells() {
- return this.mergeList.slice(0);
- },
- /**
- * 清除所有单元格合并
- */
- clearMergeCells: function clearMergeCells() {
- this.mergeList = [];
- return this.$nextTick();
- },
- handleDefaultMergeFooterItems: function handleDefaultMergeFooterItems() {
- this.setMergeFooterItems(this.mergeFooterItems);
- },
- setMergeFooterItems: function setMergeFooterItems(merges) {
- var _this44 = this;
- if (this.footerSpanMethod) {
- UtilTools.error('vxe.error.errConflicts', ['merge-footer-items', 'footer-span-method']);
- }
- setMerges(this, merges, this.mergeFooterList, null);
- return this.$nextTick().then(function () {
- return _this44.updateCellAreas();
- });
- },
- removeMergeFooterItems: function removeMergeFooterItems(merges) {
- var _this45 = this;
- if (this.footerSpanMethod) {
- UtilTools.error('vxe.error.errConflicts', ['merge-footer-items', 'footer-span-method']);
- }
- var rest = removeMerges(this, merges, this.mergeFooterList, null);
- return this.$nextTick().then(function () {
- _this45.updateCellAreas();
- return rest;
- });
- },
- /**
- * 获取所有被合并的表尾
- */
- getMergeFooterItems: function getMergeFooterItems() {
- return this.mergeFooterList.slice(0);
- },
- /**
- * 清除所有表尾合并
- */
- clearMergeFooterItems: function clearMergeFooterItems() {
- this.mergeFooterList = [];
- return this.$nextTick();
- },
- updateZindex: function updateZindex() {
- if (this.zIndex) {
- this.tZindex = this.zIndex;
- } else if (this.tZindex < UtilTools.getLastZIndex()) {
- this.tZindex = UtilTools.nextZIndex();
- }
- },
- updateCellAreas: function updateCellAreas() {
- if (this.mouseConfig && this.mouseOpts.area && this.handleUpdateCellAreas) {
- this.handleUpdateCellAreas();
- }
- },
- emitEvent: function emitEvent(type, params, evnt) {
- this.$emit(type, Object.assign({
- $table: this,
- $grid: this.$xegrid,
- $event: evnt
- }, params), evnt);
- },
- focus: function focus() {
- this.isActivated = true;
- return this.$nextTick();
- },
- blur: function blur() {
- this.isActivated = false;
- return this.$nextTick();
- },
- // 与工具栏对接
- connect: function connect($toolbar) {
- if ($toolbar && $toolbar.syncUpdate) {
- $toolbar.syncUpdate({
- collectColumn: this.collectColumn,
- $table: this
- });
- this.$toolbar = $toolbar;
- } else {
- UtilTools.error('vxe.error.barUnableLink');
- }
- return this.$nextTick();
- },
- // 检查触发源是否属于目标节点
- getEventTargetNode: getEventTargetNode,
- /*************************
- * Publish methods
- *************************/
- getCell: function getCell(row, column) {
- var $refs = this.$refs;
- var rowid = methods_getRowid(this, row);
- var bodyElem = $refs["".concat(column.fixed || 'table', "Body")] || $refs.tableBody;
- if (bodyElem && bodyElem.$el) {
- return bodyElem.$el.querySelector(".vxe-body--row[data-rowid=\"".concat(rowid, "\"] .").concat(column.id));
- }
- return null;
- },
- getCellLabel: function getCellLabel(row, column) {
- var formatter = column.formatter;
- var cellValue = UtilTools.getCellValue(row, column);
- var cellLabel = cellValue;
- if (formatter) {
- var rest, formatData;
- var colid = column.id;
- var fullAllDataRowMap = this.fullAllDataRowMap;
- var cacheFormat = fullAllDataRowMap.has(row);
- if (cacheFormat) {
- rest = fullAllDataRowMap.get(row);
- formatData = rest.formatData;
- if (!formatData) {
- formatData = fullAllDataRowMap.get(row).formatData = {};
- }
- if (rest && formatData[colid]) {
- if (formatData[colid].value === cellValue) {
- return formatData[colid].label;
- }
- }
- }
- var formatParams = {
- cellValue: cellValue,
- row: row,
- rowIndex: this.getRowIndex(row),
- column: column,
- columnIndex: this.getColumnIndex(column)
- };
- if (ctor_amd_xe_utils_default.a.isString(formatter)) {
- if (ctor_amd_xe_utils_default.a[formatter]) {
- cellLabel = ctor_amd_xe_utils_default.a[formatter](cellValue);
- } else if (src_formats.get(formatter)) {
- cellLabel = src_formats.get(formatter)(formatParams);
- } else {
- cellLabel = '';
- }
- } else if (ctor_amd_xe_utils_default.a.isArray(formatter)) {
- if (ctor_amd_xe_utils_default.a[formatter[0]]) {
- cellLabel = ctor_amd_xe_utils_default.a[formatter[0]].apply(ctor_amd_xe_utils_default.a, [cellValue].concat(_toConsumableArray(formatter.slice(1))));
- } else if (src_formats.get(formatter[0])) {
- cellLabel = src_formats.get(formatter[0]).apply(void 0, [formatParams].concat(_toConsumableArray(formatter.slice(1))));
- } else {
- cellLabel = '';
- }
- } else {
- cellLabel = formatter(formatParams);
- }
- if (formatData) {
- formatData[colid] = {
- value: cellValue,
- label: cellLabel
- };
- }
- }
- return cellLabel;
- }
- /*************************
- * Publish methods
- *************************/
- }; // Module methods
- var funcs = 'setFilter,filter,clearFilter,getCheckedFilters,closeMenu,setActiveCellArea,getActiveCellArea,getCellAreas,clearCellAreas,copyCellArea,cutCellArea,pasteCellArea,getCopyCellArea,clearCopyCellArea,setCellAreas,openFind,openReplace,getMouseSelecteds,getMouseCheckeds,getSelectedCell,getSelectedRanges,clearCopyed,clearChecked,clearHeaderChecked,clearIndexChecked,clearSelected,insert,insertAt,remove,removeSelecteds,removeCheckboxRow,removeRadioRow,removeCurrentRow,getRecordset,getInsertRecords,getRemoveRecords,getUpdateRecords,clearActived,getActiveRecord,getActiveRow,hasActiveRow,isActiveByRow,setActiveRow,setActiveCell,setSelectCell,clearValidate,fullValidate,validate,exportCsv,openExport,exportData,openImport,importData,saveFile,readFile,importByFile,print'.split(',');
- funcs.forEach(function (name) {
- Methods[name] = function () {
- return this["_".concat(name)] ? this["_".concat(name)].apply(this, arguments) : null;
- };
- });
- /* harmony default export */ var methods = (Methods);
- // CONCATENATED MODULE: ./packages/table/src/table.js
- /**
- * 渲染浮固定列
- * 分别渲染左边固定列和右边固定列
- * 如果宽度足够情况下,则不需要渲染固定列
- * @param {Function} h 创建 VNode 函数
- * @param {Object} $xetable 表格实例
- * @param {String} fixedType 固定列类型
- */
- function renderFixed(h, $xetable, fixedType) {
- var tableData = $xetable.tableData,
- tableColumn = $xetable.tableColumn,
- visibleColumn = $xetable.visibleColumn,
- tableGroupColumn = $xetable.tableGroupColumn,
- isGroup = $xetable.isGroup,
- vSize = $xetable.vSize,
- showHeader = $xetable.showHeader,
- showFooter = $xetable.showFooter,
- columnStore = $xetable.columnStore,
- footerTableData = $xetable.footerTableData;
- var fixedColumn = columnStore["".concat(fixedType, "List")];
- return h('div', {
- class: "vxe-table--fixed-".concat(fixedType, "-wrapper"),
- ref: "".concat(fixedType, "Container")
- }, [showHeader ? h('vxe-table-header', {
- props: {
- fixedType: fixedType,
- tableData: tableData,
- tableColumn: tableColumn,
- visibleColumn: visibleColumn,
- tableGroupColumn: tableGroupColumn,
- size: vSize,
- fixedColumn: fixedColumn,
- isGroup: isGroup
- },
- ref: "".concat(fixedType, "Header")
- }) : null, h('vxe-table-body', {
- props: {
- fixedType: fixedType,
- tableData: tableData,
- tableColumn: tableColumn,
- visibleColumn: visibleColumn,
- fixedColumn: fixedColumn,
- size: vSize,
- isGroup: isGroup
- },
- ref: "".concat(fixedType, "Body")
- }), showFooter && footerTableData ? h('vxe-table-footer', {
- props: {
- footerTableData: footerTableData,
- tableColumn: tableColumn,
- visibleColumn: visibleColumn,
- fixedColumn: fixedColumn,
- fixedType: fixedType,
- size: vSize
- },
- ref: "".concat(fixedType, "Footer")
- }) : null]);
- }
- /* harmony default export */ var table = ({
- name: 'VxeTable',
- props: {
- /** 基本属性 */
- id: String,
- // 数据
- data: Array,
- // (v3.0 废弃)
- customs: Array,
- // 表格的高度
- height: [Number, String],
- // 表格的最大高度
- maxHeight: [Number, String],
- // 所有列是否允许拖动列宽调整大小
- resizable: {
- type: Boolean,
- default: function _default() {
- return conf.table.resizable;
- }
- },
- // 是否带有斑马纹
- stripe: {
- type: Boolean,
- default: function _default() {
- return conf.table.stripe;
- }
- },
- // 是否带有边框
- border: {
- type: [Boolean, String],
- default: function _default() {
- return conf.table.border;
- }
- },
- // 是否圆角边框
- round: {
- type: Boolean,
- default: function _default() {
- return conf.table.round;
- }
- },
- // 表格的尺寸
- size: {
- type: String,
- default: function _default() {
- return conf.table.size || conf.size;
- }
- },
- // 列的宽度是否自撑开(可能会被废弃的参数,不要使用)
- fit: {
- type: Boolean,
- default: function _default() {
- return conf.table.fit;
- }
- },
- // 表格是否加载中
- loading: Boolean,
- // 所有的列对其方式
- align: {
- type: String,
- default: function _default() {
- return conf.table.align;
- }
- },
- // 所有的表头列的对齐方式
- headerAlign: {
- type: String,
- default: function _default() {
- return conf.table.headerAlign;
- }
- },
- // 所有的表尾列的对齐方式
- footerAlign: {
- type: String,
- default: function _default() {
- return conf.table.footerAlign;
- }
- },
- // 是否显示表头
- showHeader: {
- type: Boolean,
- default: function _default() {
- return conf.table.showHeader;
- }
- },
- // (v3.0 废弃)
- startIndex: {
- type: Number,
- default: 0
- },
- // 是否要高亮当前选中行
- highlightCurrentRow: {
- type: Boolean,
- default: function _default() {
- return conf.table.highlightCurrentRow;
- }
- },
- // 鼠标移到行是否要高亮显示
- highlightHoverRow: {
- type: Boolean,
- default: function _default() {
- return conf.table.highlightHoverRow;
- }
- },
- // 是否要高亮当前选中列
- highlightCurrentColumn: {
- type: Boolean,
- default: function _default() {
- return conf.table.highlightCurrentColumn;
- }
- },
- // 鼠标移到列是否要高亮显示
- highlightHoverColumn: {
- type: Boolean,
- default: function _default() {
- return conf.table.highlightHoverColumn;
- }
- },
- // 激活单元格编辑时是否高亮显示
- highlightCell: Boolean,
- // 是否显示表尾合计
- showFooter: Boolean,
- // 表尾合计的计算方法
- footerMethod: {
- type: Function,
- default: conf.table.footerMethod
- },
- // 给行附加 className
- rowClassName: [String, Function],
- // 给单元格附加 className
- cellClassName: [String, Function],
- // 给表头的行附加 className
- headerRowClassName: [String, Function],
- // 给表头的单元格附加 className
- headerCellClassName: [String, Function],
- // 给表尾的行附加 className
- footerRowClassName: [String, Function],
- // 给表尾的单元格附加 className
- footerCellClassName: [String, Function],
- // 给单元格附加样式
- cellStyle: [Object, Function],
- // 给表头单元格附加样式
- headerCellStyle: [Object, Function],
- // 给表尾单元格附加样式
- footerCellStyle: [Object, Function],
- // 给行附加样式
- rowStyle: [Object, Function],
- // 给表头行附加样式
- headerRowStyle: [Object, Function],
- // 给表尾行附加样式
- footerRowStyle: [Object, Function],
- // 合并指定单元格
- mergeCells: Array,
- // 合并指定的表尾数据
- mergeFooterItems: Array,
- // 自定义合并行或列的方法
- spanMethod: Function,
- // 表尾合并行或列
- footerSpanMethod: Function,
- // 设置所有内容过长时显示为省略号
- showOverflow: {
- type: [Boolean, String],
- default: function _default() {
- return conf.table.showOverflow;
- }
- },
- // 设置表头所有内容过长时显示为省略号
- showHeaderOverflow: {
- type: [Boolean, String],
- default: function _default() {
- return conf.table.showHeaderOverflow;
- }
- },
- // 设置表尾所有内容过长时显示为省略号
- showFooterOverflow: {
- type: [Boolean, String],
- default: function _default() {
- return conf.table.showFooterOverflow;
- }
- },
- // 是否所有服务端筛选
- remoteFilter: Boolean,
- // 是否所有服务端排序
- remoteSort: Boolean,
- // 自定义所有列的排序方法
- sortMethod: Function,
- // 所有列宽度
- columnWidth: [Number, String],
- // 所有列最小宽度,把剩余宽度按比例分配
- columnMinWidth: [Number, String],
- /** 高级属性 */
- // 主键配置
- columnKey: Boolean,
- rowKey: Boolean,
- rowId: {
- type: String,
- default: function _default() {
- return conf.table.rowId;
- }
- },
- zIndex: Number,
- emptyText: {
- type: String,
- default: function _default() {
- return conf.table.emptyText;
- }
- },
- keepSource: {
- type: Boolean,
- default: function _default() {
- return conf.table.keepSource;
- }
- },
- // 是否自动监听父容器变化去更新响应式表格宽高
- autoResize: {
- type: Boolean,
- default: function _default() {
- return conf.table.autoResize;
- }
- },
- // 是否自动根据状态属性去更新响应式表格宽高
- syncResize: [Boolean, String, Number],
- // 设置列的默认参数,仅对部分支持的属性有效
- columnConfig: Object,
- resizableConfig: Object,
- // 序号配置项
- seqConfig: Object,
- // 排序配置项
- sortConfig: Object,
- // 筛选配置项
- filterConfig: Object,
- // 单选框配置
- radioConfig: Object,
- // (v3.0 废弃)
- selectConfig: Object,
- // 复选框配置项
- checkboxConfig: Object,
- // tooltip 配置项
- tooltipConfig: Object,
- // 导出配置项
- exportConfig: [Boolean, Object],
- // 导入配置项
- importConfig: [Boolean, Object],
- // 打印配置项
- printConfig: Object,
- // 展开行配置项
- expandConfig: Object,
- // 树形结构配置项
- treeConfig: [Boolean, Object],
- // 快捷菜单配置项
- menuConfig: [Boolean, Object],
- // 在 v3 中废弃
- contextMenu: [Boolean, Object],
- // 鼠标配置项
- mouseConfig: Object,
- // 区域配置项
- areaConfig: Object,
- // 按键配置项
- keyboardConfig: Object,
- // 复制/粘贴配置项
- clipConfig: Object,
- // 查找/替换配置项
- fnrConfig: Object,
- // 编辑配置项
- editConfig: [Boolean, Object],
- // 校验配置项
- validConfig: Object,
- // 校验规则配置项
- editRules: Object,
- // 空内容渲染配置项
- emptyRender: [Boolean, Object],
- // 自定义列配置项
- customConfig: [Boolean, Object],
- // 横向虚拟滚动配置项
- scrollX: Object,
- // 纵向虚拟滚动配置项
- scrollY: Object,
- // 优化相关
- cloak: {
- type: Boolean,
- default: function _default() {
- return conf.table.cloak;
- }
- },
- animat: {
- type: Boolean,
- default: function _default() {
- return conf.table.animat;
- }
- },
- delayHover: {
- type: Number,
- default: function _default() {
- return conf.table.delayHover;
- }
- },
- // 优化配置项
- optimization: Object,
- // 额外的参数
- params: Object
- },
- components: {
- VxeTableBody: packages_body
- },
- provide: function provide() {
- return {
- $xetable: this,
- xecolgroup: null
- };
- },
- inject: {
- $xegrid: {
- default: null
- }
- },
- mixins: [],
- data: function data() {
- return {
- tId: "".concat(ctor_amd_xe_utils_default.a.uniqueId()),
- isCloak: false,
- // 列分组配置
- collectColumn: [],
- // 渲染的列分组
- tableGroupColumn: [],
- // 完整所有列
- tableFullColumn: [],
- // 渲染所有列
- visibleColumn: [],
- // 可视区渲染的列
- tableColumn: [],
- // 渲染中的数据
- tableData: [],
- // 是否启用了横向 X 可视渲染方式加载
- scrollXLoad: false,
- // 是否启用了纵向 Y 可视渲染方式加载
- scrollYLoad: false,
- // 是否存在纵向滚动条
- overflowY: true,
- // 是否存在横向滚动条
- overflowX: false,
- // 纵向滚动条的宽度
- scrollbarWidth: 0,
- // 横向滚动条的高度
- scrollbarHeight: 0,
- // 行高
- rowHeight: 0,
- // 表格父容器的高度
- parentHeight: 0,
- // 复选框属性,是否全选
- isAllSelected: false,
- // 复选框属性,有选中且非全选状态
- isIndeterminate: false,
- // 复选框属性,已选中的行
- selection: [],
- // 当前行
- currentRow: null,
- // 单选框属性,选中列
- currentColumn: null,
- // 单选框属性,选中行
- selectRow: null,
- // 表尾合计数据
- footerTableData: [],
- // 展开列信息
- expandColumn: null,
- // 树节点列信息
- treeNodeColumn: null,
- // 已展开的行
- rowExpandeds: [],
- // 懒加载中的展开行的列表
- expandLazyLoadeds: [],
- // 已展开树节点
- treeExpandeds: [],
- // 懒加载中的树节点的列表
- treeLazyLoadeds: [],
- // 树节点不确定状态的列表
- treeIndeterminates: [],
- // 合并单元格的对象集
- mergeList: [],
- // 合并表尾数据的对象集
- mergeFooterList: [],
- // 是否已经加载了筛选
- hasFilterPanel: false,
- // 当前选中的筛选列
- filterStore: {
- isAllSelected: false,
- isIndeterminate: false,
- style: null,
- options: [],
- column: null,
- multiple: false,
- visible: false
- },
- // 存放列相关的信息
- columnStore: {
- leftList: [],
- centerList: [],
- rightList: [],
- resizeList: [],
- pxList: [],
- pxMinList: [],
- scaleList: [],
- scaleMinList: [],
- autoList: []
- },
- // 存放快捷菜单的信息
- ctxMenuStore: {
- selected: null,
- visible: false,
- showChild: false,
- selectChild: null,
- list: [],
- style: null
- },
- // 存放可编辑相关信息
- editStore: {
- indexs: {
- columns: []
- },
- titles: {
- columns: []
- },
- // 所有选中
- checked: {
- rows: [],
- columns: [],
- tRows: [],
- tColumns: []
- },
- // 选中源
- selected: {
- row: null,
- column: null
- },
- // 已复制源
- copyed: {
- cut: false,
- rows: [],
- columns: []
- },
- // 激活
- actived: {
- row: null,
- column: null
- },
- insertList: [],
- removeList: []
- },
- // 存放数据校验相关信息
- validStore: {
- visible: false,
- row: null,
- column: null,
- content: '',
- rule: null,
- isArrow: false
- },
- // 导入相关信息
- importStore: {
- file: null,
- type: '',
- modeList: [],
- typeList: [],
- filename: '',
- visible: false
- },
- importParams: {
- mode: '',
- types: null,
- message: true
- },
- // 导出相关信息
- exportStore: {
- name: '',
- modeList: [],
- typeList: [],
- columns: [],
- hasFooter: false,
- visible: false
- },
- exportParams: {
- filename: '',
- sheetName: '',
- mode: '',
- type: '',
- original: false,
- message: true,
- isHeader: false,
- isFooter: false
- }
- };
- },
- computed: {
- vSize: function vSize() {
- return this.size || this.$parent.size || this.$parent.vSize;
- },
- validOpts: function validOpts() {
- return Object.assign({
- message: 'default'
- }, conf.table.validConfig, this.validConfig);
- },
- sXOpts: function sXOpts() {
- return Object.assign({}, conf.table.scrollX, this.optimizeOpts.scrollX, this.scrollX);
- },
- sYOpts: function sYOpts() {
- return Object.assign({}, conf.table.scrollY, this.optimizeOpts.scrollY, this.scrollY);
- },
- optimizeOpts: function optimizeOpts() {
- return Object.assign({}, conf.table.optimization, this.optimization);
- },
- rowHeightMaps: function rowHeightMaps() {
- return {
- default: 48,
- medium: 44,
- small: 40,
- mini: 36
- };
- },
- columnOpts: function columnOpts() {
- return Object.assign({}, this.columnConfig);
- },
- resizableOpts: function resizableOpts() {
- return Object.assign({}, conf.table.resizableConfig, this.resizableConfig);
- },
- seqOpts: function seqOpts() {
- return Object.assign({
- startIndex: 0
- }, conf.table.seqConfig, this.seqConfig);
- },
- radioOpts: function radioOpts() {
- return Object.assign({}, conf.table.radioConfig, this.radioConfig);
- },
- checkboxOpts: function checkboxOpts() {
- return Object.assign({}, conf.table.checkboxConfig, this.checkboxConfig || this.selectConfig);
- },
- tooltipOpts: function tooltipOpts() {
- return Object.assign({
- size: this.vSize,
- leaveDelay: 300
- }, conf.table.tooltipConfig, this.tooltipConfig);
- },
- validTipOpts: function validTipOpts() {
- return Object.assign({
- isArrow: false
- }, this.tooltipOpts);
- },
- editOpts: function editOpts() {
- return Object.assign({}, conf.table.editConfig, this.editConfig);
- },
- sortOpts: function sortOpts() {
- return Object.assign({
- orders: ['asc', 'desc', null]
- }, conf.table.sortConfig, this.sortConfig);
- },
- filterOpts: function filterOpts() {
- return Object.assign({}, conf.table.filterConfig, this.filterConfig);
- },
- mouseOpts: function mouseOpts() {
- return Object.assign({}, conf.table.mouseConfig, this.mouseConfig);
- },
- areaOpts: function areaOpts() {
- return Object.assign({}, conf.table.areaConfig, this.areaConfig);
- },
- keyboardOpts: function keyboardOpts() {
- return Object.assign({}, conf.table.keyboardConfig, this.keyboardConfig);
- },
- clipOpts: function clipOpts() {
- return Object.assign({}, conf.table.clipConfig, this.clipConfig);
- },
- fnrOpts: function fnrOpts() {
- return Object.assign({}, conf.table.fnrConfig, this.fnrConfig);
- },
- // 是否使用了分组表头
- isGroup: function isGroup() {
- return this.collectColumn.some(UtilTools.hasChildrenList);
- },
- hasTip: function hasTip() {
- return v_x_e_table._tooltip;
- },
- isResizable: function isResizable() {
- return this.resizable || this.tableFullColumn.some(function (column) {
- return column.resizable;
- });
- },
- headerCtxMenu: function headerCtxMenu() {
- var headerOpts = this.ctxMenuOpts.header;
- return headerOpts && headerOpts.options ? headerOpts.options : [];
- },
- bodyCtxMenu: function bodyCtxMenu() {
- var bodyOpts = this.ctxMenuOpts.body;
- return bodyOpts && bodyOpts.options ? bodyOpts.options : [];
- },
- footerCtxMenu: function footerCtxMenu() {
- var footerOpts = this.ctxMenuOpts.footer;
- return footerOpts && footerOpts.options ? footerOpts.options : [];
- },
- isCtxMenu: function isCtxMenu() {
- return (this.contextMenu || this.menuConfig) && UtilTools.isEnableConf(this.ctxMenuOpts) && (this.headerCtxMenu.length || this.bodyCtxMenu.length || this.footerCtxMenu.length);
- },
- ctxMenuOpts: function ctxMenuOpts() {
- return Object.assign({}, conf.table.contextMenu, conf.table.menuConfig, this.contextMenu, this.menuConfig);
- },
- ctxMenuList: function ctxMenuList() {
- var rest = [];
- this.ctxMenuStore.list.forEach(function (list) {
- list.forEach(function (item) {
- rest.push(item);
- });
- });
- return rest;
- },
- exportOpts: function exportOpts() {
- return Object.assign({}, conf.table.exportConfig, this.exportConfig);
- },
- importOpts: function importOpts() {
- return Object.assign({}, conf.table.importConfig, this.importConfig);
- },
- printOpts: function printOpts() {
- return Object.assign({}, conf.table.printConfig, this.printConfig);
- },
- expandOpts: function expandOpts() {
- return Object.assign({}, conf.table.expandConfig, this.expandConfig);
- },
- treeOpts: function treeOpts() {
- return Object.assign({}, conf.table.treeConfig, this.treeConfig);
- },
- emptyOpts: function emptyOpts() {
- return Object.assign({}, conf.table.emptyRender, this.emptyRender);
- },
- cellOffsetWidth: function cellOffsetWidth() {
- return this.border ? Math.max(2, Math.ceil(this.scrollbarWidth / this.tableColumn.length)) : 1;
- },
- customOpts: function customOpts() {
- return Object.assign({}, conf.table.customConfig, this.customConfig);
- },
- tableBorder: function tableBorder() {
- var border = this.border;
- if (border === true) {
- return 'full';
- }
- if (border) {
- return border;
- }
- return 'default';
- },
- /**
- * 判断列全选的复选框是否禁用
- */
- isAllCheckboxDisabled: function isAllCheckboxDisabled() {
- var tableFullData = this.tableFullData,
- treeConfig = this.treeConfig,
- checkboxOpts = this.checkboxOpts;
- var strict = checkboxOpts.strict,
- checkMethod = checkboxOpts.checkMethod;
- if (strict) {
- if (tableFullData.length) {
- if (checkMethod) {
- if (treeConfig) {// 暂时不支持树形结构
- } // 如果所有行都被禁用
- return tableFullData.every(function (row) {
- return !checkMethod({
- row: row
- });
- });
- }
- return false;
- }
- return true;
- }
- return false;
- }
- },
- watch: {
- data: function data(value) {
- var _this = this;
- this.loadTableData(value).then(function () {
- if (!_this.inited) {
- _this.inited = true;
- _this.handleDefaults();
- }
- if ((_this.scrollXLoad || _this.scrollYLoad) && _this.expandColumn) {
- UtilTools.warn('vxe.error.scrollErrProp', ['column.type=expand']);
- }
- });
- },
- customs: function customs(value) {
- if (!this.isUpdateCustoms) {
- this.mergeCustomColumn(value);
- }
- this.isUpdateCustoms = false;
- },
- collectColumn: function collectColumn(value) {
- var _this2 = this;
- var tableFullColumn = UtilTools.getColumnList(value);
- this.tableFullColumn = tableFullColumn;
- this.clearMergeCells();
- this.clearMergeFooterItems();
- this.cacheColumnMap();
- if (this.customs) {
- this.mergeCustomColumn(this.customs);
- }
- if (this.customConfig) {
- this.restoreCustomStorage();
- }
- this.refreshColumn().then(function () {
- if (_this2.scrollXLoad) {
- _this2.loadScrollXData(true);
- }
- });
- this.handleTableData(true);
- if ((this.scrollXLoad || this.scrollYLoad) && this.expandColumn) {
- UtilTools.warn('vxe.error.scrollErrProp', ['column.type=expand']);
- }
- if (this.isGroup && this.mouseConfig && this.mouseOpts.checked) {
- UtilTools.error('vxe.error.groupMouseRange', ['mouse-config.checked']);
- }
- this.$nextTick(function () {
- if (_this2.$toolbar) {
- _this2.$toolbar.syncUpdate({
- collectColumn: value,
- $table: _this2
- }); // 在 v3.0 中废弃 toolbar 方式
- if (!_this2.customConfig) {
- _this2.restoreCustomStorage();
- _this2.analyColumnWidth();
- _this2.refreshColumn();
- }
- }
- });
- },
- tableColumn: function tableColumn() {
- this.analyColumnWidth();
- },
- showHeader: function showHeader() {
- var _this3 = this;
- this.$nextTick(function () {
- _this3.recalculate(true).then(function () {
- return _this3.refreshScroll();
- });
- });
- },
- showFooter: function showFooter() {
- var _this4 = this;
- this.$nextTick(function () {
- _this4.recalculate(true).then(function () {
- return _this4.refreshScroll();
- });
- });
- },
- height: function height() {
- var _this5 = this;
- this.$nextTick(function () {
- return _this5.recalculate(true);
- });
- },
- maxHeight: function maxHeight() {
- var _this6 = this;
- this.$nextTick(function () {
- return _this6.recalculate(true);
- });
- },
- syncResize: function syncResize(value) {
- var _this7 = this;
- if (value) {
- var $el = this.$el; // 只在可视状态下才去更新
- if ($el.clientWidth && $el.clientHeight) {
- this.recalculate();
- }
- this.$nextTick(function () {
- setTimeout(function () {
- if ($el.clientWidth && $el.clientHeight) {
- _this7.recalculate(true);
- }
- });
- });
- }
- },
- mergeCells: function mergeCells(value) {
- this.clearMergeCells();
- this.setMergeCells(value);
- },
- mergeFooterItems: function mergeFooterItems(value) {
- this.clearMergeFooterItems();
- this.setMergeFooterItems(value);
- }
- },
- created: function created() {
- var _this8 = this;
- var _Object$assign = Object.assign(this, {
- tZindex: 0,
- elemStore: {},
- // 存放横向 X 虚拟滚动相关的信息
- scrollXStore: {},
- // 存放纵向 Y 虚拟滚动相关信息
- scrollYStore: {},
- // 存放 tooltip 相关信息
- tooltipStore: {},
- // 表格宽度
- tableWidth: 0,
- // 表格高度
- tableHeight: 0,
- // 表头高度
- headerHeight: 0,
- // 表尾高度
- footerHeight: 0,
- // 当前 hover 行
- // hoverRow: null,
- // 最后滚动位置
- lastScrollLeft: 0,
- lastScrollTop: 0,
- // 单选框属性,已选中保留的行
- radioReserveRow: null,
- // 复选框属性,已选中保留的行
- checkboxReserveRowMap: {},
- // 行数据,已展开保留的行
- rowExpandedReserveRowMap: {},
- // 树结构数据,已展开保留的行
- treeExpandedReserveRowMap: {},
- // 完整数据、条件处理后
- tableFullData: [],
- afterFullData: [],
- // 缓存数据集
- fullAllDataRowMap: new Map(),
- fullAllDataRowIdData: {},
- fullDataRowMap: new Map(),
- fullDataRowIdData: {},
- fullColumnMap: new Map(),
- fullColumnIdData: {},
- fullColumnFieldData: {}
- }),
- sXOpts = _Object$assign.sXOpts,
- scrollXStore = _Object$assign.scrollXStore,
- sYOpts = _Object$assign.sYOpts,
- scrollYStore = _Object$assign.scrollYStore,
- mouseOpts = _Object$assign.mouseOpts,
- data = _Object$assign.data,
- editOpts = _Object$assign.editOpts,
- treeOpts = _Object$assign.treeOpts,
- treeConfig = _Object$assign.treeConfig,
- showOverflow = _Object$assign.showOverflow;
- if (!this.rowId && (this.checkboxOpts.reserve || this.checkboxOpts.checkRowKeys || this.radioOpts.reserve || this.radioOpts.checkRowKey || this.expandOpts.expandRowKeys || this.treeOpts.expandRowKeys)) {
- UtilTools.warn('vxe.error.reqProp', ['row-id']);
- } // 在 v3.0 中废弃 column-width
- if (this.columnWidth) {
- UtilTools.warn('vxe.error.delProp', ['column-width', 'column-config.width']);
- } // 在 v3.0 中废弃 column-min-width
- if (this.columnMinWidth) {
- UtilTools.warn('vxe.error.delProp', ['column-min-width', 'column-config.minWidth']);
- } // 在 v3.0 中废弃 start-index
- if (this.startIndex) {
- UtilTools.warn('vxe.error.delProp', ['start-index', 'seq-config.startIndex']);
- } // 在 v3.0 中废弃 select-config
- if (this.selectConfig) {
- UtilTools.warn('vxe.error.delProp', ['select-config', 'checkbox-config']);
- }
- if (this.editConfig && editOpts.showStatus && !this.keepSource) {
- UtilTools.warn('vxe.error.reqProp', ['keep-source']);
- }
- if (treeConfig && treeOpts.line && (!this.rowKey || !showOverflow)) {
- UtilTools.warn('vxe.error.reqProp', ['row-key | show-overflow']);
- }
- if (this.showFooter && !this.footerMethod) {
- UtilTools.warn('vxe.error.reqProp', ['footer-method']);
- } // 在 v3.0 中废弃 customs
- if (this.customs) {
- UtilTools.warn('vxe.error.removeProp', ['customs']);
- } // 在 v3.0 中废弃 sort-method
- if (this.sortMethod) {
- UtilTools.warn('vxe.error.delProp', ['sort-method', 'sort-config.sortMethod']);
- } // 在 v3.0 中废弃 remote-sort
- if (this.remoteSort) {
- UtilTools.warn('vxe.error.delProp', ['remote-sort', 'sort-config.remote']);
- } // 在 v3.0 中废弃 remote-filter
- if (this.remoteFilter) {
- UtilTools.warn('vxe.error.delProp', ['remote-filter', 'filter-config.remote']);
- }
- if (!this.handleUpdateCellAreas) {
- if (this.clipConfig) {
- UtilTools.warn('vxe.error.notProp', ['clip-config']);
- }
- if (this.fnrConfig) {
- UtilTools.warn('vxe.error.notProp', ['fnr-config']);
- }
- if (this.mouseOpts.area) {
- UtilTools.error('vxe.error.notProp', ['mouse-config.area']);
- return;
- }
- }
- if (mouseOpts.selected && mouseOpts.area) {
- UtilTools.error('vxe.error.errConflicts', ['mouse-config.area', 'mouse-config.selected']);
- }
- if (mouseOpts.checked && mouseOpts.area) {
- UtilTools.error('vxe.error.errConflicts', ['mouse-config.checked', 'mouse-config.area']);
- } // v3 中只支持对象类型
- // 在 v3.0 中废弃 context-menu
- if (this.contextMenu) {
- UtilTools.warn('vxe.error.delProp', ['context-menu', 'menu-config']);
- if (!ctor_amd_xe_utils_default.a.isObject(this.contextMenu)) {
- UtilTools.warn('vxe.error.errProp', ["table.context-menu=".concat(this.contextMenu), 'table.context-menu={}']);
- }
- }
- if (this.menuConfig && !ctor_amd_xe_utils_default.a.isObject(this.menuConfig)) {
- UtilTools.warn('vxe.error.errProp', ["table.menu-config=".concat(this.menuConfig), 'table.menu-config={}']);
- }
- if (this.exportConfig && !ctor_amd_xe_utils_default.a.isObject(this.exportConfig)) {
- UtilTools.warn('vxe.error.errProp', ["table.export-config=".concat(this.exportConfig), 'table.export-config={}']);
- }
- if (this.importConfig && !ctor_amd_xe_utils_default.a.isObject(this.importConfig)) {
- UtilTools.warn('vxe.error.errProp', ["table.import-config=".concat(this.importConfig), 'table.import-config={}']);
- }
- if (this.printConfig && !ctor_amd_xe_utils_default.a.isObject(this.printConfig)) {
- UtilTools.warn('vxe.error.errProp', ["table.print-config=".concat(this.printConfig), 'table.print-config={}']);
- }
- if (this.treeConfig && !ctor_amd_xe_utils_default.a.isObject(this.treeConfig)) {
- UtilTools.warn('vxe.error.errProp', ["table.tree-config=".concat(this.treeConfig), 'table.tree-config={}']);
- }
- if (this.customConfig && !ctor_amd_xe_utils_default.a.isObject(this.customConfig)) {
- UtilTools.warn('vxe.error.errProp', ["table.custom-config=".concat(this.customConfig), 'table.custom-config={}']);
- }
- if (this.editConfig && !ctor_amd_xe_utils_default.a.isObject(this.editConfig)) {
- UtilTools.warn('vxe.error.errProp', ["table.edit-config=".concat(this.editConfig), 'table.edit-config={}']);
- }
- if (this.emptyRender && !ctor_amd_xe_utils_default.a.isObject(this.emptyRender)) {
- UtilTools.warn('vxe.error.errProp', ["table.empty-render=".concat(this.emptyRender), 'table.empty-render={}']);
- }
- if (this.mouseConfig && this.editConfig) {
- if (mouseOpts.checked && editOpts.trigger !== 'dblclick') {
- UtilTools.warn('vxe.error.errProp', ['mouse-config.checked', 'edit-config.trigger=dblclick']);
- }
- }
- if (this.mouseOpts.area && this.checkboxOpts.range) {
- UtilTools.error('vxe.error.errConflicts', ['mouse-config.area', 'checkbox-config.range']);
- }
- if (treeConfig && this.stripe) {
- UtilTools.warn('vxe.error.noTree', ['stripe']);
- } // 在 v3.0 中废弃 optimization
- if (this.optimization) {
- UtilTools.warn('vxe.error.removeProp', ['optimization']);
- } // 废弃 optimization.cloak
- if (this.optimizeOpts.cloak) {
- UtilTools.warn('vxe.error.delProp', ['optimization.cloak', 'cloak']);
- } // 废弃 optimization.animat
- if (this.optimizeOpts.animat) {
- UtilTools.warn('vxe.error.delProp', ['optimization.animat', 'animat']);
- } // 废弃 optimization.delayHover
- if (this.optimizeOpts.delayHover) {
- UtilTools.warn('vxe.error.delProp', ['optimization.delayHover', 'delay-hover']);
- } // 废弃 optimization.scrollX
- if (this.optimizeOpts.scrollX) {
- UtilTools.warn('vxe.error.delProp', ['optimization.scrollX', 'scroll-x']);
- } // 废弃 optimization.scrollY
- if (this.optimizeOpts.scrollY) {
- UtilTools.warn('vxe.error.delProp', ['optimization.scrollY', 'scroll-y']);
- }
- var customOpts = this.customOpts;
- if (!this.id && this.customConfig && (customOpts.storage === true || customOpts.storage && customOpts.storage.resizable || customOpts.storage && customOpts.storage.visible)) {
- UtilTools.error('vxe.error.reqProp', ['id']);
- }
- if (this.treeConfig && this.checkboxOpts.range) {
- UtilTools.error('vxe.error.noTree', ['checkbox-config.range']);
- }
- if (this.treeConfig && this.mouseOpts.area) {
- UtilTools.error('vxe.error.noTree', ['mouse-config.area']);
- } // 检查是否有安装需要的模块
- var errorModuleName;
- if (!v_x_e_table._edit && this.editConfig) {
- errorModuleName = 'Edit';
- } else if (!v_x_e_table._valid && this.editRules) {
- errorModuleName = 'Validator';
- } else if (!v_x_e_table._keyboard && (this.checkboxOpts.range || this.keyboardConfig || this.mouseConfig)) {
- errorModuleName = 'Keyboard';
- } else if (!v_x_e_table._export && (this.importConfig || this.exportConfig)) {
- errorModuleName = 'Export';
- }
- if (errorModuleName) {
- throw new Error(UtilTools.getLog('vxe.error.reqModule', [errorModuleName]));
- }
- Object.assign(scrollYStore, {
- startIndex: 0,
- visibleIndex: 0,
- adaptive: sYOpts.adaptive !== false,
- renderSize: ctor_amd_xe_utils_default.a.toNumber(sYOpts.rSize),
- offsetSize: ctor_amd_xe_utils_default.a.toNumber(sYOpts.oSize)
- });
- Object.assign(scrollXStore, {
- startIndex: 0,
- visibleIndex: 0,
- renderSize: ctor_amd_xe_utils_default.a.toNumber(sXOpts.rSize),
- offsetSize: ctor_amd_xe_utils_default.a.toNumber(sXOpts.oSize)
- });
- if (this.cloak) {
- this.isCloak = true;
- setTimeout(function () {
- _this8.isCloak = false;
- }, DomTools.browse ? 500 : 300);
- }
- this.loadTableData(data).then(function () {
- if (data && data.length) {
- _this8.inited = true;
- _this8.handleDefaults();
- }
- _this8.updateStyle();
- _this8.recalculate();
- });
- GlobalEvent.on(this, 'paste', this.handleGlobalPasteEvent);
- GlobalEvent.on(this, 'copy', this.handleGlobalCopyEvent);
- GlobalEvent.on(this, 'cut', this.handleGlobalCutEvent);
- GlobalEvent.on(this, 'mousedown', this.handleGlobalMousedownEvent);
- GlobalEvent.on(this, 'blur', this.handleGlobalBlurEvent);
- GlobalEvent.on(this, 'mousewheel', this.handleGlobalMousewheelEvent);
- GlobalEvent.on(this, 'keydown', this.handleGlobalKeydownEvent);
- GlobalEvent.on(this, 'resize', this.handleGlobalResizeEvent);
- GlobalEvent.on(this, 'contextmenu', this.handleGlobalContextmenuEvent);
- this.preventEvent(null, 'created');
- },
- mounted: function mounted() {
- var _this9 = this;
- var $listeners = this.$listeners;
- if (!this.menuConfig && ($listeners['menu-click'] || $listeners['cell-menu'] || $listeners['header-cell-menu'] || $listeners['footer-cell-menu'])) {
- UtilTools.warn('vxe.error.reqProp', ['menu-config']);
- }
- if (!this.tooltipConfig && ($listeners['cell-mouseenter'] || $listeners['cell-mouseleave'])) {
- UtilTools.warn('vxe.error.reqProp', ['tooltip-config']);
- }
- if (!this.tooltipConfig && (this.$listeners['cell-mouseenter'] || this.$listeners['cell-mouseleave'])) {
- UtilTools.warn('vxe.error.reqProp', ['tooltip-config']);
- }
- if (this.autoResize) {
- var resizeObserver = new ResizeEvent(function () {
- return _this9.recalculate(true);
- });
- resizeObserver.observe(this.$el);
- resizeObserver.observe(this.getParentElem());
- this.$resize = resizeObserver;
- }
- if (!this.$xegrid && this.customs) {
- UtilTools.warn('vxe.error.removeProp', ['customs']);
- }
- document.body.appendChild(this.$refs.tableWrapper);
- this.preventEvent(null, 'mounted');
- },
- activated: function activated() {
- var _this10 = this;
- this.recalculate().then(function () {
- return _this10.refreshScroll();
- });
- this.preventEvent(null, 'activated');
- },
- deactivated: function deactivated() {
- this.preventEvent(null, 'deactivated');
- },
- beforeDestroy: function beforeDestroy() {
- var tableWrapper = this.$refs.tableWrapper;
- if (tableWrapper && tableWrapper.parentNode) {
- tableWrapper.parentNode.removeChild(tableWrapper);
- }
- if (this.$resize) {
- this.$resize.disconnect();
- }
- this.closeFilter();
- this.closeMenu();
- this.preventEvent(null, 'beforeDestroy');
- },
- destroyed: function destroyed() {
- GlobalEvent.off(this, 'paste');
- GlobalEvent.off(this, 'copy');
- GlobalEvent.off(this, 'cut');
- GlobalEvent.off(this, 'mousedown');
- GlobalEvent.off(this, 'blur');
- GlobalEvent.off(this, 'mousewheel');
- GlobalEvent.off(this, 'keydown');
- GlobalEvent.off(this, 'resize');
- GlobalEvent.off(this, 'contextmenu');
- this.preventEvent(null, 'destroyed');
- },
- render: function render(h) {
- var _e = this._e,
- $scopedSlots = this.$scopedSlots,
- tId = this.tId,
- tableData = this.tableData,
- tableColumn = this.tableColumn,
- visibleColumn = this.visibleColumn,
- tableGroupColumn = this.tableGroupColumn,
- isGroup = this.isGroup,
- isResizable = this.isResizable,
- isCtxMenu = this.isCtxMenu,
- loading = this.loading,
- isCloak = this.isCloak,
- stripe = this.stripe,
- showHeader = this.showHeader,
- height = this.height,
- tableBorder = this.tableBorder,
- treeOpts = this.treeOpts,
- treeConfig = this.treeConfig,
- mouseConfig = this.mouseConfig,
- mouseOpts = this.mouseOpts,
- vSize = this.vSize,
- validOpts = this.validOpts,
- editRules = this.editRules,
- showFooter = this.showFooter,
- overflowX = this.overflowX,
- overflowY = this.overflowY,
- scrollXLoad = this.scrollXLoad,
- scrollYLoad = this.scrollYLoad,
- scrollbarHeight = this.scrollbarHeight,
- highlightCell = this.highlightCell,
- highlightHoverRow = this.highlightHoverRow,
- highlightHoverColumn = this.highlightHoverColumn,
- editConfig = this.editConfig,
- checkboxOpts = this.checkboxOpts,
- validTipOpts = this.validTipOpts,
- tooltipOpts = this.tooltipOpts,
- columnStore = this.columnStore,
- filterStore = this.filterStore,
- ctxMenuStore = this.ctxMenuStore,
- ctxMenuOpts = this.ctxMenuOpts,
- footerTableData = this.footerTableData,
- hasTip = this.hasTip,
- emptyRender = this.emptyRender,
- emptyOpts = this.emptyOpts;
- var leftList = columnStore.leftList,
- rightList = columnStore.rightList;
- var emptyContent;
- if ($scopedSlots.empty) {
- emptyContent = $scopedSlots.empty.call(this, {
- $table: this
- }, h);
- } else {
- var compConf = emptyRender ? v_x_e_table.renderer.get(emptyOpts.name) : null;
- if (compConf) {
- emptyContent = compConf.renderEmpty.call(this, h, emptyOpts, {
- $table: this
- }, {
- $table: this
- });
- } else {
- emptyContent = this.emptyText || conf.i18n('vxe.table.emptyText');
- }
- }
- return h('div', {
- class: ['vxe-table', 'vxe-table--render-default', "tid_".concat(tId), vSize ? "size--".concat(vSize) : '', "border--".concat(tableBorder), {
- 'vxe-editable': !!editConfig,
- 'show--head': showHeader,
- 'show--foot': showFooter,
- 'is--group': isGroup,
- 'has--height': height,
- 'has--tree-line': treeConfig && treeOpts.line,
- 'fixed--left': leftList.length,
- 'fixed--right': rightList.length,
- 'c--highlight': highlightCell,
- 't--animat': !!this.animat,
- 'is--round': this.round,
- 't--stripe': !treeConfig && stripe,
- 't--selected': mouseConfig && mouseOpts.selected,
- // 在 v3.0 中废弃 mouse-config.checked
- 't--checked': mouseConfig && mouseOpts.checked,
- 'is--area': mouseConfig && mouseOpts.area,
- 'row--highlight': highlightHoverRow,
- 'column--highlight': highlightHoverColumn,
- 'is--loading': isCloak || loading,
- 'is--empty': !loading && !tableData.length,
- 'scroll--y': overflowY,
- 'scroll--x': overflowX,
- 'virtual--x': scrollXLoad,
- 'virtual--y': scrollYLoad
- }],
- attrs: {
- 'x-cloak': isCloak
- }
- }, [
- /**
- * 隐藏列
- */
- h('div', {
- class: 'vxe-table-slots',
- ref: 'hideColumn'
- }, this.$slots.default), h('div', {
- class: 'vxe-table--main-wrapper'
- }, [
- /**
- * 主头部
- */
- showHeader ? h('vxe-table-header', {
- ref: 'tableHeader',
- props: {
- tableData: tableData,
- tableColumn: tableColumn,
- visibleColumn: visibleColumn,
- tableGroupColumn: tableGroupColumn,
- size: vSize,
- isGroup: isGroup
- }
- }) : _e(),
- /**
- * 主内容
- */
- h('vxe-table-body', {
- ref: 'tableBody',
- props: {
- tableData: tableData,
- tableColumn: tableColumn,
- visibleColumn: visibleColumn,
- size: vSize,
- isGroup: isGroup
- }
- }),
- /**
- * 底部
- */
- showFooter ? h('vxe-table-footer', {
- props: {
- footerTableData: footerTableData,
- tableColumn: tableColumn,
- visibleColumn: visibleColumn,
- size: vSize
- },
- ref: 'tableFooter'
- }) : null]),
- /**
- * 左侧固定列
- */
- leftList && leftList.length && overflowX ? renderFixed(h, this, 'left') : _e(),
- /**
- * 右侧固定列
- */
- rightList && rightList.length && overflowX ? renderFixed(h, this, 'right') : _e(),
- /**
- * 空数据
- */
- h('div', {
- ref: 'emptyPlaceholder',
- class: 'vxe-table--empty-placeholder'
- }, [h('div', {
- class: 'vxe-table--empty-content'
- }, emptyContent)]),
- /**
- * 边框线
- */
- h('div', {
- class: 'vxe-table--border-line'
- }),
- /**
- * 列宽线
- */
- isResizable ? h('div', {
- class: 'vxe-table--resizable-bar',
- style: overflowX ? {
- 'padding-bottom': "".concat(scrollbarHeight, "px")
- } : null,
- ref: 'resizeBar'
- }) : _e(),
- /**
- * 加载中
- */
- h('div', {
- class: ['vxe-table--loading vxe-loading', {
- 'is--visible': isCloak || loading
- }]
- }, [h('div', {
- class: 'vxe-loading--spinner'
- })]),
- /**
- * 筛选
- */
- this.hasFilterPanel ? h('vxe-table-filter', {
- props: {
- filterStore: filterStore
- },
- ref: 'filterWrapper'
- }) : _e(),
- /**
- * 导入
- */
- this.importConfig ? h('vxe-import-panel', {
- props: {
- defaultOptions: this.importParams,
- storeData: this.importStore
- }
- }) : _e(),
- /**
- * 导出/打印
- */
- this.exportConfig || this.printConfig ? h('vxe-export-panel', {
- props: {
- defaultOptions: this.exportParams,
- storeData: this.exportStore
- }
- }) : _e(), h('div', {
- class: "vxe-table".concat(tId, "-wrapper ").concat(this.$vnode.data.staticClass || ''),
- ref: 'tableWrapper'
- }, [
- /**
- * 复选框-范围选择
- */
- checkboxOpts.range ? h('div', {
- class: 'vxe-table--checkbox-range',
- ref: 'checkboxRange'
- }) : _e(),
- /**
- * 快捷菜单
- */
- isCtxMenu ? h('vxe-table-context-menu', {
- props: {
- ctxMenuStore: ctxMenuStore,
- ctxMenuOpts: ctxMenuOpts
- },
- ref: 'ctxWrapper'
- }) : _e(),
- /**
- * 公用提示
- */
- hasTip ? h('vxe-tooltip', {
- key: 'cTip',
- ref: 'commTip',
- props: {
- isArrow: false,
- enterable: false
- }
- }) : _e(),
- /**
- * 单元格溢出的提示
- */
- hasTip ? h('vxe-tooltip', {
- ref: 'tooltip',
- props: tooltipOpts,
- on: tooltipOpts.enterable ? {
- leave: this.handleTooltipLeaveEvent
- } : null
- }) : _e(),
- /**
- * 单元格校验不通过的提示
- * 仅用于一行数据时有效,多行数据使用内部的提示框
- */
- hasTip && editRules && validOpts.showMessage && (validOpts.message === 'default' ? !height : validOpts.message === 'tooltip') ? h('vxe-tooltip', {
- class: 'vxe-table--valid-error',
- props: validOpts.message === 'tooltip' || tableData.length === 1 ? validTipOpts : null,
- ref: 'validTip'
- }) : _e()])]);
- },
- methods: methods
- });
- // CONCATENATED MODULE: ./packages/table/index.js
- table.install = function (Vue) {
- if (typeof window !== 'undefined' && window.VXETableMixin) {
- table.mixins.push(window.VXETableMixin);
- delete window.VXETableMixin;
- }
- v_x_e_table.Vue = Vue;
- v_x_e_table.Table = table;
- v_x_e_table.TableComponent = table;
- if (!Vue.prototype.$vxe) {
- Vue.prototype.$vxe = {
- t: v_x_e_table.t,
- _t: v_x_e_table._t
- };
- } else {
- Vue.prototype.$vxe.t = v_x_e_table.t;
- Vue.prototype.$vxe._t = v_x_e_table._t;
- }
- Vue.component(table.name, table);
- };
- var Table = table;
- /* harmony default export */ var packages_table = (table);
- // CONCATENATED MODULE: ./packages/column/src/column.js
- var column_props = {
- // 列唯一主键
- colId: [String, Number],
- // 渲染类型 seq,radio,checkbox,expand
- type: String,
- // 在 v3.0 中废弃 prop
- prop: String,
- // 在 v3.0 中废弃 label
- label: String,
- // 列字段名
- field: String,
- // 列标题
- title: String,
- // 列宽度
- width: [Number, String],
- // 列最小宽度,把剩余宽度按比例分配
- minWidth: [Number, String],
- // 是否允许拖动列宽调整大小
- resizable: {
- type: Boolean,
- default: null
- },
- // 将列固定在左侧或者右侧
- fixed: String,
- // 列对其方式
- align: String,
- // 表头对齐方式
- headerAlign: String,
- // 表尾列的对齐方式
- footerAlign: String,
- // 当内容过长时显示为省略号
- showOverflow: {
- type: [Boolean, String],
- default: null
- },
- // 当表头内容过长时显示为省略号
- showHeaderOverflow: {
- type: [Boolean, String],
- default: null
- },
- // 当表尾内容过长时显示为省略号
- showFooterOverflow: {
- type: [Boolean, String],
- default: null
- },
- // 给单元格附加 className
- className: [String, Function],
- // 给表头单元格附加 className
- headerClassName: [String, Function],
- // 给表尾单元格附加 className
- footerClassName: [String, Function],
- // 格式化显示内容
- formatter: [Function, Array, String],
- // 自定义索引方法
- seqMethod: Function,
- // 在 v3.0 中废弃 indexMethod
- indexMethod: Function,
- // 是否允许排序
- sortable: Boolean,
- // 在 v3 中废弃
- remoteSort: {
- type: Boolean,
- default: null
- },
- // 在 v3 中只支持字符串类型
- sortBy: [String, Array],
- // 排序的字段类型,比如字符串转数值等
- sortType: String,
- // 在 v3 中废弃
- sortMethod: Function,
- // 配置筛选条件数组
- filters: {
- type: Array,
- default: null
- },
- // 筛选是否允许多选
- filterMultiple: {
- type: Boolean,
- default: true
- },
- // 自定义筛选方法
- filterMethod: Function,
- // 筛选重置方法
- filterResetMethod: Function,
- // 筛选复原方法
- filterRecoverMethod: Function,
- // 筛选模板配置项
- filterRender: Object,
- // 指定为树节点
- treeNode: Boolean,
- // 是否可视
- visible: {
- type: Boolean,
- default: null
- },
- // 单元格数据导出方法
- exportMethod: Function,
- // 表尾单元格数据导出方法
- footerExportMethod: Function,
- // 标题帮助图标配置项
- titleHelp: Object,
- // 单元格值类型
- cellType: String,
- // 单元格渲染配置项
- cellRender: Object,
- // 单元格编辑渲染配置项
- editRender: Object,
- // 内容渲染配置项
- contentRender: Object,
- // 额外的参数
- params: Object
- };
- var watch = {};
- Object.keys(column_props).forEach(function (name) {
- watch[name] = function (value) {
- this.columnConfig.update(name, value);
- };
- });
- /* harmony default export */ var src_column = ({
- name: 'VxeColumn',
- props: column_props,
- provide: function provide() {
- return {
- $xecolumn: this
- };
- },
- inject: {
- $xetable: {
- default: null
- },
- $xecolumn: {
- default: null
- }
- },
- watch: watch,
- created: function created() {
- this.$xetable.isSC = true;
- this.columnConfig = this.createColumn(this.$xetable, this);
- },
- mounted: function mounted() {
- UtilTools.assemColumn(this);
- if (this.type === 'expand' && !this.$scopedSlots.content && this.$scopedSlots.default) {
- UtilTools.warn('vxe.error.expandContent');
- }
- },
- destroyed: function destroyed() {
- UtilTools.destroyColumn(this);
- },
- render: function render(h) {
- return h('div', this.$slots.default);
- },
- methods: packages_cell
- });
- // CONCATENATED MODULE: ./packages/column/src/group.js
- /* harmony default export */ var src_group = ({
- name: 'VxeColgroup',
- extends: src_column,
- provide: function provide() {
- return {
- xecolgroup: this
- };
- }
- });
- // CONCATENATED MODULE: ./packages/column/index.js
- src_column.install = function (Vue) {
- Vue.component(src_column.name, src_column);
- Vue.component('VxeTableColumn', src_column);
- Vue.component(src_group.name, src_group);
- Vue.component('VxeTableColgroup', src_group);
- };
- var Column = src_column;
- /* harmony default export */ var packages_column = (src_column);
- // CONCATENATED MODULE: ./packages/header/src/util.js
- var util_getAllColumns = function getAllColumns(columns, parentColumn) {
- var result = [];
- columns.forEach(function (column) {
- column.parentId = parentColumn ? parentColumn.id : null;
- if (column.visible) {
- if (column.children && column.children.length && column.children.some(function (column) {
- return column.visible;
- })) {
- result.push(column);
- result.push.apply(result, _toConsumableArray(getAllColumns(column.children, column)));
- } else {
- result.push(column);
- }
- }
- });
- return result;
- };
- var convertToRows = function convertToRows(originColumns) {
- var maxLevel = 1;
- var traverse = function traverse(column, parent) {
- if (parent) {
- column.level = parent.level + 1;
- if (maxLevel < column.level) {
- maxLevel = column.level;
- }
- }
- if (column.children && column.children.length && column.children.some(function (column) {
- return column.visible;
- })) {
- var colSpan = 0;
- column.children.forEach(function (subColumn) {
- if (subColumn.visible) {
- traverse(subColumn, column);
- colSpan += subColumn.colSpan;
- }
- });
- column.colSpan = colSpan;
- } else {
- column.colSpan = 1;
- }
- };
- originColumns.forEach(function (column) {
- column.level = 1;
- traverse(column);
- });
- var rows = [];
- for (var i = 0; i < maxLevel; i++) {
- rows.push([]);
- }
- var allColumns = util_getAllColumns(originColumns);
- allColumns.forEach(function (column) {
- if (column.children && column.children.length && column.children.some(function (column) {
- return column.visible;
- })) {
- column.rowSpan = 1;
- } else {
- column.rowSpan = maxLevel - column.level + 1;
- }
- rows[column.level - 1].push(column);
- });
- return rows;
- };
- // CONCATENATED MODULE: ./packages/header/src/header.js
- var header_cellType = 'header';
- /* harmony default export */ var header = ({
- name: 'VxeTableHeader',
- props: {
- tableData: Array,
- tableColumn: Array,
- visibleColumn: Array,
- tableGroupColumn: Array,
- fixedColumn: Array,
- size: String,
- fixedType: String,
- isGroup: Boolean
- },
- data: function data() {
- return {
- headerColumn: []
- };
- },
- watch: {
- tableColumn: function tableColumn() {
- this.uploadColumn();
- }
- },
- created: function created() {
- this.uploadColumn();
- },
- mounted: function mounted() {
- var $xetable = this.$parent,
- $el = this.$el,
- $refs = this.$refs,
- fixedType = this.fixedType;
- var elemStore = $xetable.elemStore;
- var prefix = "".concat(fixedType || 'main', "-header-");
- elemStore["".concat(prefix, "wrapper")] = $el;
- elemStore["".concat(prefix, "table")] = $refs.table;
- elemStore["".concat(prefix, "colgroup")] = $refs.colgroup;
- elemStore["".concat(prefix, "list")] = $refs.thead;
- elemStore["".concat(prefix, "xSpace")] = $refs.xSpace;
- elemStore["".concat(prefix, "repair")] = $refs.repair;
- },
- render: function render(h) {
- var _this = this;
- var _e = this._e,
- $xetable = this.$parent,
- fixedType = this.fixedType,
- headerColumn = this.headerColumn,
- fixedColumn = this.fixedColumn;
- var tableColumn = this.tableColumn;
- var tableListeners = $xetable.$listeners,
- tId = $xetable.tId,
- resizable = $xetable.resizable,
- border = $xetable.border,
- columnKey = $xetable.columnKey,
- headerRowClassName = $xetable.headerRowClassName,
- headerCellClassName = $xetable.headerCellClassName,
- headerRowStyle = $xetable.headerRowStyle,
- headerCellStyle = $xetable.headerCellStyle,
- allColumnHeaderOverflow = $xetable.showHeaderOverflow,
- allHeaderAlign = $xetable.headerAlign,
- allAlign = $xetable.align,
- highlightCurrentColumn = $xetable.highlightCurrentColumn,
- currentColumn = $xetable.currentColumn,
- mouseConfig = $xetable.mouseConfig,
- scrollXLoad = $xetable.scrollXLoad,
- overflowX = $xetable.overflowX,
- scrollbarWidth = $xetable.scrollbarWidth,
- getColumnIndex = $xetable.getColumnIndex,
- sortOpts = $xetable.sortOpts; // 横向滚动渲染
- if (scrollXLoad) {
- if (fixedType) {
- tableColumn = fixedColumn;
- }
- }
- return h('div', {
- class: ['vxe-table--header-wrapper', fixedType ? "fixed-".concat(fixedType, "--wrapper") : 'body--wrapper'],
- attrs: {
- 'data-tid': tId
- }
- }, [fixedType ? _e() : h('div', {
- class: 'vxe-body--x-space',
- ref: 'xSpace'
- }), h('table', {
- class: 'vxe-table--header',
- attrs: {
- 'data-tid': tId,
- cellspacing: 0,
- cellpadding: 0,
- border: 0
- },
- ref: 'table'
- }, [
- /**
- * 列宽
- */
- h('colgroup', {
- ref: 'colgroup'
- }, tableColumn.map(function (column, $columnIndex) {
- return h('col', {
- attrs: {
- name: column.id
- },
- key: $columnIndex
- });
- }).concat(scrollbarWidth ? [h('col', {
- attrs: {
- name: 'col_gutter'
- }
- })] : [])),
- /**
- * 头部
- */
- h('thead', {
- ref: 'thead'
- }, headerColumn.map(function (cols, $rowIndex) {
- return h('tr', {
- class: ['vxe-header--row', headerRowClassName ? ctor_amd_xe_utils_default.a.isFunction(headerRowClassName) ? headerRowClassName({
- $table: $xetable,
- $rowIndex: $rowIndex,
- fixed: fixedType,
- type: header_cellType
- }) : headerRowClassName : ''],
- style: headerRowStyle ? ctor_amd_xe_utils_default.a.isFunction(headerRowStyle) ? headerRowStyle({
- $table: $xetable,
- $rowIndex: $rowIndex,
- fixed: fixedType,
- type: header_cellType
- }) : headerRowStyle : null
- }, cols.map(function (column, $columnIndex) {
- var _ref;
- var showHeaderOverflow = column.showHeaderOverflow,
- headerAlign = column.headerAlign,
- align = column.align,
- headerClassName = column.headerClassName;
- var isColGroup = column.children && column.children.length;
- var fixedHiddenColumn = fixedType ? column.fixed !== fixedType && !isColGroup : column.fixed && overflowX;
- var headOverflow = ctor_amd_xe_utils_default.a.isUndefined(showHeaderOverflow) || ctor_amd_xe_utils_default.a.isNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow;
- var headAlign = headerAlign || align || allHeaderAlign || allAlign;
- var showEllipsis = headOverflow === 'ellipsis';
- var showTitle = headOverflow === 'title';
- var showTooltip = headOverflow === true || headOverflow === 'tooltip';
- var hasEllipsis = showTitle || showTooltip || showEllipsis;
- var thOns = {};
- var hasFilter = column.filters && column.filters.some(function (item) {
- return item.checked;
- }); // 确保任何情况下 columnIndex 都精准指向真实列索引
- var columnIndex = getColumnIndex(column);
- var _columnIndex = $xetable.getVTColumnIndex(column);
- var params = {
- $table: $xetable,
- $rowIndex: $rowIndex,
- column: column,
- columnIndex: columnIndex,
- $columnIndex: $columnIndex,
- _columnIndex: _columnIndex,
- fixed: fixedType,
- type: header_cellType,
- isHidden: fixedHiddenColumn,
- hasFilter: hasFilter
- }; // 虚拟滚动不支持动态高度
- if (scrollXLoad && !hasEllipsis) {
- showEllipsis = hasEllipsis = true;
- }
- if (highlightCurrentColumn || tableListeners['header-cell-click'] || mouseConfig || sortOpts.trigger === 'cell') {
- thOns.click = function (evnt) {
- return $xetable.triggerHeaderCellClickEvent(evnt, params);
- };
- }
- if (tableListeners['header-cell-dblclick']) {
- thOns.dblclick = function (evnt) {
- return $xetable.triggerHeaderCellDBLClickEvent(evnt, params);
- };
- } // 按下事件处理
- if (mouseConfig) {
- thOns.mousedown = function (evnt) {
- return $xetable.triggerHeaderCellMousedownEvent(evnt, params);
- };
- }
- var type = column.type === 'seq' || column.type === 'index' ? 'seq' : column.type;
- return h('th', {
- class: ['vxe-header--column', column.id, (_ref = {}, _defineProperty(_ref, "col--".concat(headAlign), headAlign), _defineProperty(_ref, "col--".concat(type), type), _defineProperty(_ref, 'col--last', $columnIndex === cols.length - 1), _defineProperty(_ref, 'col--fixed', column.fixed), _defineProperty(_ref, 'col--group', isColGroup), _defineProperty(_ref, 'col--ellipsis', hasEllipsis), _defineProperty(_ref, 'fixed--hidden', fixedHiddenColumn), _defineProperty(_ref, 'is--sortable', column.sortable), _defineProperty(_ref, 'is--filter', !!column.filters), _defineProperty(_ref, 'filter--active', hasFilter), _defineProperty(_ref, 'col--current', currentColumn === column), _ref), UtilTools.getClass(headerClassName, params), UtilTools.getClass(headerCellClassName, params)],
- attrs: {
- 'data-colid': column.id,
- colspan: column.colSpan > 1 ? column.colSpan : null,
- rowspan: column.rowSpan > 1 ? column.rowSpan : null
- },
- style: headerCellStyle ? ctor_amd_xe_utils_default.a.isFunction(headerCellStyle) ? headerCellStyle(params) : headerCellStyle : null,
- on: thOns,
- key: columnKey || isColGroup ? column.id : $columnIndex
- }, [h('div', {
- class: ['vxe-cell', {
- 'c--title': showTitle,
- 'c--tooltip': showTooltip,
- 'c--ellipsis': showEllipsis
- }]
- }, column.renderHeader(h, params)),
- /**
- * 列宽拖动
- */
- !fixedHiddenColumn && !isColGroup && (ctor_amd_xe_utils_default.a.isBoolean(column.resizable) ? column.resizable : resizable) ? h('div', {
- class: ['vxe-resizable', {
- 'is--line': !border || border === 'none'
- }],
- on: {
- mousedown: function mousedown(evnt) {
- return _this.resizeMousedown(evnt, params);
- }
- }
- }) : null]);
- }).concat(scrollbarWidth ? [h('th', {
- class: 'vxe-header--gutter col--gutter'
- })] : []));
- }))]),
- /**
- * 其他
- */
- h('div', {
- class: 'vxe-table--header-border-line',
- ref: 'repair'
- })]);
- },
- methods: {
- uploadColumn: function uploadColumn() {
- this.headerColumn = this.isGroup ? convertToRows(this.tableGroupColumn) : [this.$parent.scrollXLoad && this.fixedType ? this.fixedColumn : this.tableColumn];
- },
- resizeMousedown: function resizeMousedown(evnt, params) {
- var column = params.column;
- var $xetable = this.$parent,
- $el = this.$el,
- fixedType = this.fixedType;
- var _$xetable$$refs = $xetable.$refs,
- tableBody = _$xetable$$refs.tableBody,
- leftContainer = _$xetable$$refs.leftContainer,
- rightContainer = _$xetable$$refs.rightContainer,
- resizeBarElem = _$xetable$$refs.resizeBar;
- var dragBtnElem = evnt.target,
- dragClientX = evnt.clientX;
- var cell = params.cell = dragBtnElem.parentNode;
- var dragLeft = 0;
- var tableBodyElem = tableBody.$el;
- var pos = DomTools.getOffsetPos(dragBtnElem, $el);
- var dragBtnWidth = dragBtnElem.clientWidth;
- var dragBtnOffsetWidth = Math.floor(dragBtnWidth / 2);
- var minInterval = UtilTools.getColMinWidth(params) - dragBtnOffsetWidth; // 列之间的最小间距
- var dragMinLeft = pos.left - cell.clientWidth + dragBtnWidth + minInterval;
- var dragPosLeft = pos.left + dragBtnOffsetWidth;
- var domMousemove = document.onmousemove;
- var domMouseup = document.onmouseup;
- var isLeftFixed = fixedType === 'left';
- var isRightFixed = fixedType === 'right'; // 计算左右侧固定列偏移量
- var fixedOffsetWidth = 0;
- if (isLeftFixed || isRightFixed) {
- var siblingProp = isLeftFixed ? 'nextElementSibling' : 'previousElementSibling';
- var tempCellElem = cell[siblingProp];
- while (tempCellElem) {
- if (DomTools.hasClass(tempCellElem, 'fixed--hidden')) {
- break;
- } else if (!DomTools.hasClass(tempCellElem, 'col--group')) {
- fixedOffsetWidth += tempCellElem.offsetWidth;
- }
- tempCellElem = tempCellElem[siblingProp];
- }
- if (isRightFixed && rightContainer) {
- dragPosLeft = rightContainer.offsetLeft + fixedOffsetWidth;
- }
- } // 处理拖动事件
- var updateEvent = function updateEvent(evnt) {
- evnt.stopPropagation();
- evnt.preventDefault();
- var offsetX = evnt.clientX - dragClientX;
- var left = dragPosLeft + offsetX;
- var scrollLeft = fixedType ? 0 : tableBodyElem.scrollLeft;
- if (isLeftFixed) {
- // 左固定列(不允许超过右侧固定列、不允许超过右边距)
- left = Math.min(left, (rightContainer ? rightContainer.offsetLeft : tableBodyElem.clientWidth) - fixedOffsetWidth - minInterval);
- } else if (isRightFixed) {
- // 右侧固定列(不允许超过左侧固定列、不允许超过左边距)
- dragMinLeft = (leftContainer ? leftContainer.clientWidth : 0) + fixedOffsetWidth + minInterval;
- left = Math.min(left, dragPosLeft + cell.clientWidth - minInterval);
- } else {
- dragMinLeft = Math.max(tableBodyElem.scrollLeft, dragMinLeft); // left = Math.min(left, tableBodyElem.clientWidth + tableBodyElem.scrollLeft - 40)
- }
- dragLeft = Math.max(left, dragMinLeft);
- resizeBarElem.style.left = "".concat(dragLeft - scrollLeft, "px");
- };
- $xetable._isResize = true;
- DomTools.addClass($xetable.$el, 'drag--resize');
- resizeBarElem.style.display = 'block';
- document.onmousemove = updateEvent;
- document.onmouseup = function () {
- document.onmousemove = domMousemove;
- document.onmouseup = domMouseup;
- column.resizeWidth = column.renderWidth + (isRightFixed ? dragPosLeft - dragLeft : dragLeft - dragPosLeft);
- resizeBarElem.style.display = 'none';
- $xetable._isResize = false;
- $xetable._lastResizeTime = Date.now();
- $xetable.analyColumnWidth();
- $xetable.recalculate(true).then(function () {
- $xetable.saveCustomResizable();
- $xetable.updateCellAreas();
- $xetable.emitEvent('resizable-change', params, evnt);
- });
- DomTools.removeClass($xetable.$el, 'drag--resize');
- };
- updateEvent(evnt);
- $xetable.closeMenu();
- }
- }
- });
- // CONCATENATED MODULE: ./packages/header/index.js
- header.install = function (Vue) {
- Vue.component(header.name, header);
- };
- var Header = header;
- /* harmony default export */ var packages_header = (header);
- // CONCATENATED MODULE: ./packages/footer/src/footer.js
- var footer_cellType = 'footer';
- function mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex) {
- for (var mIndex = 0; mIndex < mergeFooterList.length; mIndex++) {
- var _mergeFooterList$mInd = mergeFooterList[mIndex],
- mergeRowIndex = _mergeFooterList$mInd.row,
- mergeColIndex = _mergeFooterList$mInd.col,
- mergeRowspan = _mergeFooterList$mInd.rowspan,
- mergeColspan = _mergeFooterList$mInd.colspan;
- if (mergeColIndex > -1 && mergeRowIndex > -1 && mergeRowspan && mergeColspan) {
- if (mergeRowIndex === _rowIndex && mergeColIndex === _columnIndex) {
- return {
- rowspan: mergeRowspan,
- colspan: mergeColspan
- };
- }
- if (_rowIndex >= mergeRowIndex && _rowIndex < mergeRowIndex + mergeRowspan && _columnIndex >= mergeColIndex && _columnIndex < mergeColIndex + mergeColspan) {
- return {
- rowspan: 0,
- colspan: 0
- };
- }
- }
- }
- }
- /* harmony default export */ var footer = ({
- name: 'VxeTableFooter',
- props: {
- footerTableData: Array,
- tableColumn: Array,
- visibleColumn: Array,
- fixedColumn: Array,
- size: String,
- fixedType: String
- },
- mounted: function mounted() {
- var $xetable = this.$parent,
- $el = this.$el,
- $refs = this.$refs,
- fixedType = this.fixedType;
- var elemStore = $xetable.elemStore;
- var prefix = "".concat(fixedType || 'main', "-footer-");
- elemStore["".concat(prefix, "wrapper")] = $el;
- elemStore["".concat(prefix, "table")] = $refs.table;
- elemStore["".concat(prefix, "colgroup")] = $refs.colgroup;
- elemStore["".concat(prefix, "list")] = $refs.tfoot;
- elemStore["".concat(prefix, "xSpace")] = $refs.xSpace;
- },
- render: function render(h) {
- var _e = this._e,
- $xetable = this.$parent,
- fixedType = this.fixedType,
- fixedColumn = this.fixedColumn,
- tableColumn = this.tableColumn,
- footerTableData = this.footerTableData;
- var tableListeners = $xetable.$listeners,
- tId = $xetable.tId,
- footerRowClassName = $xetable.footerRowClassName,
- footerCellClassName = $xetable.footerCellClassName,
- footerRowStyle = $xetable.footerRowStyle,
- footerCellStyle = $xetable.footerCellStyle,
- allFooterAlign = $xetable.footerAlign,
- mergeFooterList = $xetable.mergeFooterList,
- footerSpanMethod = $xetable.footerSpanMethod,
- allAlign = $xetable.align,
- scrollXLoad = $xetable.scrollXLoad,
- columnKey = $xetable.columnKey,
- allColumnFooterOverflow = $xetable.showFooterOverflow,
- currentColumn = $xetable.currentColumn,
- overflowX = $xetable.overflowX,
- scrollbarWidth = $xetable.scrollbarWidth,
- tooltipOpts = $xetable.tooltipOpts; // 如果是使用优化模式
- if (!mergeFooterList.length || !footerSpanMethod) {
- if (fixedType && allColumnFooterOverflow) {
- tableColumn = fixedColumn;
- } else if (scrollXLoad) {
- if (fixedType) {
- tableColumn = fixedColumn;
- }
- }
- }
- return h('div', {
- class: ['vxe-table--footer-wrapper', fixedType ? "fixed-".concat(fixedType, "--wrapper") : 'body--wrapper'],
- attrs: {
- 'data-tid': tId
- },
- on: {
- scroll: this.scrollEvent
- }
- }, [fixedType ? _e() : h('div', {
- class: 'vxe-body--x-space',
- ref: 'xSpace'
- }), h('table', {
- class: 'vxe-table--footer',
- attrs: {
- 'data-tid': tId,
- cellspacing: 0,
- cellpadding: 0,
- border: 0
- },
- ref: 'table'
- }, [
- /**
- * 列宽
- */
- h('colgroup', {
- ref: 'colgroup'
- }, tableColumn.map(function (column, columnIndex) {
- return h('col', {
- attrs: {
- name: column.id
- },
- key: columnIndex
- });
- }).concat(scrollbarWidth ? [h('col', {
- attrs: {
- name: 'col_gutter'
- }
- })] : [])),
- /**
- * 底部
- */
- h('tfoot', {
- ref: 'tfoot'
- }, footerTableData.map(function (list, _rowIndex) {
- var $rowIndex = _rowIndex;
- return h('tr', {
- class: ['vxe-footer--row', footerRowClassName ? ctor_amd_xe_utils_default.a.isFunction(footerRowClassName) ? footerRowClassName({
- $table: $xetable,
- _rowIndex: _rowIndex,
- $rowIndex: $rowIndex,
- fixed: fixedType,
- type: footer_cellType
- }) : footerRowClassName : ''],
- style: footerRowStyle ? ctor_amd_xe_utils_default.a.isFunction(footerRowStyle) ? footerRowStyle({
- $table: $xetable,
- _rowIndex: _rowIndex,
- $rowIndex: $rowIndex,
- fixed: fixedType,
- type: footer_cellType
- }) : footerRowStyle : null
- }, tableColumn.map(function (column, $columnIndex) {
- var _ref2;
- var showFooterOverflow = column.showFooterOverflow,
- footerAlign = column.footerAlign,
- align = column.align,
- footerClassName = column.footerClassName;
- var showAllTip = tooltipOpts.showAll || tooltipOpts.enabled;
- var isColGroup = column.children && column.children.length;
- var fixedHiddenColumn = fixedType ? column.fixed !== fixedType && !isColGroup : column.fixed && overflowX;
- var footOverflow = ctor_amd_xe_utils_default.a.isUndefined(showFooterOverflow) || ctor_amd_xe_utils_default.a.isNull(showFooterOverflow) ? allColumnFooterOverflow : showFooterOverflow;
- var footAlign = footerAlign || align || allFooterAlign || allAlign;
- var showEllipsis = footOverflow === 'ellipsis';
- var showTitle = footOverflow === 'title';
- var showTooltip = footOverflow === true || footOverflow === 'tooltip';
- var hasEllipsis = showTitle || showTooltip || showEllipsis;
- var attrs = {
- 'data-colid': column.id
- };
- var tfOns = {};
- var columnIndex = $xetable.getColumnIndex(column);
- var _columnIndex = $xetable.getVTColumnIndex(column);
- var itemIndex = _columnIndex;
- var params = {
- $table: $xetable,
- _rowIndex: _rowIndex,
- $rowIndex: $rowIndex,
- column: column,
- columnIndex: columnIndex,
- $columnIndex: $columnIndex,
- _columnIndex: _columnIndex,
- itemIndex: itemIndex,
- items: list,
- fixed: fixedType,
- type: footer_cellType,
- data: footerTableData
- }; // 虚拟滚动不支持动态高度
- if (scrollXLoad && !hasEllipsis) {
- showEllipsis = hasEllipsis = true;
- }
- if (showTitle || showTooltip || showAllTip) {
- tfOns.mouseenter = function (evnt) {
- if (showTitle) {
- DomTools.updateCellTitle(evnt.currentTarget, column);
- } else if (showTooltip || showAllTip) {
- $xetable.triggerFooterTooltipEvent(evnt, params);
- }
- };
- }
- if (showTooltip || showAllTip) {
- tfOns.mouseleave = function (evnt) {
- if (showTooltip || showAllTip) {
- $xetable.handleTargetLeaveEvent(evnt);
- }
- };
- }
- if (tableListeners['footer-cell-click']) {
- tfOns.click = function (evnt) {
- $xetable.emitEvent('footer-cell-click', Object.assign({
- cell: evnt.currentTarget
- }, params), evnt);
- };
- }
- if (tableListeners['footer-cell-dblclick']) {
- tfOns.dblclick = function (evnt) {
- $xetable.emitEvent('footer-cell-dblclick', Object.assign({
- cell: evnt.currentTarget
- }, params), evnt);
- };
- } // 合并行或列
- if (mergeFooterList.length) {
- var spanRest = mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex);
- if (spanRest) {
- var rowspan = spanRest.rowspan,
- colspan = spanRest.colspan;
- if (!rowspan || !colspan) {
- return null;
- }
- if (rowspan > 1) {
- attrs.rowspan = rowspan;
- }
- if (colspan > 1) {
- attrs.colspan = colspan;
- }
- }
- } else if (footerSpanMethod) {
- // 自定义合并函数
- var _ref = footerSpanMethod(params) || {},
- _ref$rowspan = _ref.rowspan,
- _rowspan = _ref$rowspan === void 0 ? 1 : _ref$rowspan,
- _ref$colspan = _ref.colspan,
- _colspan = _ref$colspan === void 0 ? 1 : _ref$colspan;
- if (!_rowspan || !_colspan) {
- return null;
- }
- if (_rowspan > 1) {
- attrs.rowspan = _rowspan;
- }
- if (_colspan > 1) {
- attrs.colspan = _colspan;
- }
- }
- var type = column.type === 'seq' || column.type === 'index' ? 'seq' : column.type;
- return h('td', {
- class: ['vxe-footer--column', column.id, (_ref2 = {}, _defineProperty(_ref2, "col--".concat(footAlign), footAlign), _defineProperty(_ref2, "col--".concat(type), type), _defineProperty(_ref2, 'col--last', $columnIndex === tableColumn.length - 1), _defineProperty(_ref2, 'fixed--hidden', fixedHiddenColumn), _defineProperty(_ref2, 'col--ellipsis', hasEllipsis), _defineProperty(_ref2, 'col--current', currentColumn === column), _ref2), UtilTools.getClass(footerClassName, params), UtilTools.getClass(footerCellClassName, params)],
- attrs: attrs,
- style: footerCellStyle ? ctor_amd_xe_utils_default.a.isFunction(footerCellStyle) ? footerCellStyle(params) : footerCellStyle : null,
- on: tfOns,
- key: columnKey ? column.id : $columnIndex
- }, [h('div', {
- class: ['vxe-cell', {
- 'c--title': showTitle,
- 'c--tooltip': showTooltip,
- 'c--ellipsis': showEllipsis
- }]
- }, column.renderFooter(h, params))]);
- }).concat(scrollbarWidth ? [h('td', {
- class: 'vxe-footer--gutter col--gutter'
- })] : []));
- }))])]);
- },
- methods: {
- /**
- * 滚动处理
- * 如果存在列固定左侧,同步更新滚动状态
- * 如果存在列固定右侧,同步更新滚动状态
- */
- scrollEvent: function scrollEvent(evnt) {
- var $xetable = this.$parent,
- fixedType = this.fixedType;
- var $refs = $xetable.$refs,
- scrollXLoad = $xetable.scrollXLoad,
- triggerScrollXEvent = $xetable.triggerScrollXEvent,
- lastScrollLeft = $xetable.lastScrollLeft;
- var tableHeader = $refs.tableHeader,
- tableBody = $refs.tableBody,
- tableFooter = $refs.tableFooter,
- validTip = $refs.validTip;
- var headerElem = tableHeader ? tableHeader.$el : null;
- var footerElem = tableFooter ? tableFooter.$el : null;
- var bodyElem = tableBody.$el;
- var scrollLeft = footerElem.scrollLeft;
- var isX = scrollLeft !== lastScrollLeft;
- $xetable.lastScrollLeft = scrollLeft;
- $xetable.lastScrollTime = Date.now();
- if (headerElem) {
- headerElem.scrollLeft = scrollLeft;
- }
- if (bodyElem) {
- bodyElem.scrollLeft = scrollLeft;
- }
- if (scrollXLoad && isX) {
- triggerScrollXEvent(evnt);
- }
- if (isX && validTip && validTip.visible) {
- validTip.updatePlacement();
- }
- $xetable.emitEvent('scroll', {
- type: footer_cellType,
- fixed: fixedType,
- scrollTop: bodyElem.scrollTop,
- scrollLeft: scrollLeft,
- isX: isX,
- isY: false
- }, evnt);
- }
- }
- });
- // CONCATENATED MODULE: ./packages/footer/index.js
- footer.install = function (Vue) {
- Vue.component(footer.name, footer);
- };
- var Footer = footer;
- /* harmony default export */ var packages_footer = (footer);
- // CONCATENATED MODULE: ./packages/filter/src/panel.js
- /* harmony default export */ var panel = ({
- name: 'VxeTableFilter',
- props: {
- filterStore: Object
- },
- computed: {
- hasCheckOption: function hasCheckOption() {
- var filterStore = this.filterStore;
- return filterStore && filterStore.options.some(function (option) {
- return option.checked;
- });
- }
- },
- render: function render(h) {
- var $xetable = this.$parent,
- filterStore = this.filterStore;
- var column = filterStore.column;
- var filterRender = column ? column.filterRender : null;
- var compConf = filterRender ? v_x_e_table.renderer.get(filterRender.name) : null;
- return h('div', {
- class: ['vxe-table--filter-wrapper', 'filter--prevent-default', compConf && compConf.className ? compConf.className : '', {
- 't--animat': $xetable.animat,
- 'is--multiple': filterStore.multiple,
- 'filter--active': filterStore.visible
- }],
- style: filterStore.style
- }, filterStore.visible ? this.renderOptions(h, filterRender, compConf).concat(this.renderFooter(h)) : []);
- },
- methods: {
- renderOptions: function renderOptions(h, filterRender, compConf) {
- var _this = this;
- var $xetable = this.$parent,
- filterStore = this.filterStore;
- var args = filterStore.args,
- column = filterStore.column,
- multiple = filterStore.multiple;
- var slots = column.slots;
- if (slots && slots.filter) {
- return [h('div', {
- class: 'vxe-table--filter-template'
- }, slots.filter.call($xetable, Object.assign({
- $panel: this,
- context: this
- }, args), h))];
- } else if (compConf && compConf.renderFilter) {
- return [h('div', {
- class: 'vxe-table--filter-template'
- }, compConf.renderFilter.call($xetable, h, filterRender, Object.assign({
- $panel: this,
- context: this
- }, args), this))];
- }
- return [h('ul', {
- class: 'vxe-table--filter-header'
- }, [h('li', {
- class: ['vxe-table--filter-option', {
- 'is--checked': multiple ? filterStore.isAllSelected : !filterStore.options.some(function (item) {
- return item._checked;
- }),
- 'is--indeterminate': multiple && filterStore.isIndeterminate
- }],
- attrs: {
- title: conf.i18n(multiple ? 'vxe.table.allTitle' : 'vxe.table.allFilter')
- },
- on: {
- click: function click(evnt) {
- _this.changeAllOption(evnt, !filterStore.isAllSelected);
- }
- }
- }, (multiple ? [h('span', {
- class: 'vxe-checkbox--icon vxe-checkbox--checked-icon'
- }), h('span', {
- class: 'vxe-checkbox--icon vxe-checkbox--unchecked-icon'
- }), h('span', {
- class: 'vxe-checkbox--icon vxe-checkbox--indeterminate-icon'
- })] : []).concat([h('span', {
- class: 'vxe-checkbox--label'
- }, conf.i18n('vxe.table.allFilter'))]))]), h('ul', {
- class: 'vxe-table--filter-body'
- }, filterStore.options.map(function (item) {
- return h('li', {
- class: ['vxe-table--filter-option', {
- 'is--checked': item._checked
- }],
- attrs: {
- title: item.label
- },
- on: {
- click: function click(evnt) {
- _this.changeOption(evnt, !item._checked, item);
- }
- }
- }, (multiple ? [h('span', {
- class: 'vxe-checkbox--icon vxe-checkbox--checked-icon'
- }), h('span', {
- class: 'vxe-checkbox--icon vxe-checkbox--unchecked-icon'
- }), h('span', {
- class: 'vxe-checkbox--icon vxe-checkbox--indeterminate-icon'
- })] : []).concat([h('span', {
- class: 'vxe-checkbox--label'
- }, UtilTools.formatText(item.label, 1))]));
- }))];
- },
- renderFooter: function renderFooter(h) {
- var hasCheckOption = this.hasCheckOption,
- filterStore = this.filterStore;
- var column = filterStore.column,
- multiple = filterStore.multiple;
- var filterRender = column.filterRender;
- var compConf = filterRender ? v_x_e_table.renderer.get(filterRender.name) : null;
- var isDisabled = !hasCheckOption && !filterStore.isAllSelected && !filterStore.isIndeterminate;
- return multiple && (!compConf || (ctor_amd_xe_utils_default.a.isBoolean(compConf.showFilterFooter) ? compConf.showFilterFooter !== false : compConf.isFooter !== false)) ? [h('div', {
- class: 'vxe-table--filter-footer'
- }, [h('button', {
- class: {
- 'is--disabled': isDisabled
- },
- attrs: {
- disabled: isDisabled
- },
- on: {
- click: this.confirmFilter
- }
- }, conf.i18n('vxe.table.confirmFilter')), h('button', {
- on: {
- click: this.resetFilter
- }
- }, conf.i18n('vxe.table.resetFilter'))])] : [];
- },
- // 全部筛选事件
- filterCheckAllEvent: function filterCheckAllEvent(evnt, value) {
- var filterStore = this.filterStore;
- filterStore.options.forEach(function (option) {
- option._checked = value;
- option.checked = value;
- });
- filterStore.isAllSelected = value;
- filterStore.isIndeterminate = false;
- },
- /*************************
- * Publish methods
- *************************/
- // (单选)筛选发生改变
- changeRadioOption: function changeRadioOption(evnt, checked, item) {
- var $xetable = this.$parent,
- filterStore = this.filterStore;
- filterStore.options.forEach(function (option) {
- option._checked = false;
- });
- item._checked = checked;
- $xetable.checkFilterOptions();
- this.confirmFilter(evnt);
- },
- // (多选)筛选发生改变
- changeMultipleOption: function changeMultipleOption(evnt, checked, item) {
- var $xetable = this.$parent;
- item._checked = checked;
- $xetable.checkFilterOptions();
- },
- changeAllOption: function changeAllOption(evnt, checked) {
- if (this.filterStore.multiple) {
- this.filterCheckAllEvent(evnt, checked);
- } else {
- this.resetFilter(evnt);
- }
- },
- // 筛选发生改变
- changeOption: function changeOption(evnt, checked, item) {
- if (this.filterStore.multiple) {
- this.changeMultipleOption(evnt, checked, item);
- } else {
- this.changeRadioOption(evnt, checked, item);
- }
- },
- // 确认筛选
- confirmFilter: function confirmFilter(evnt) {
- var $xetable = this.$parent,
- filterStore = this.filterStore;
- filterStore.options.forEach(function (option) {
- option.checked = option._checked;
- });
- $xetable.confirmFilterEvent(evnt);
- },
- // 重置筛选
- resetFilter: function resetFilter(evnt) {
- var $xetable = this.$parent;
- $xetable.resetFilterEvent(evnt);
- }
- /*************************
- * Publish methods
- *************************/
- }
- });
- // CONCATENATED MODULE: ./packages/filter/src/mixin.js
- /* harmony default export */ var src_mixin = ({
- methods: {
- /**
- * v3 废弃 filter 方法,被 setFilter 取代
- * 手动调用筛选的方法
- * 如果不传回调则返回一个选项列表的 Promise 对象
- * 如果传回调则通过回调返回的值更新选项列表,并返回一个新选项列表的 Promise 对象
- * @param {String} field 字段名
- * @param {Function} callback 重置列表的回调函数,返回新的选项列表
- */
- _filter: function _filter(field, callback) {
- UtilTools.warn('vxe.error.delFunc', ['filter', 'setFilter']);
- var column = this.getColumnByField(field);
- if (column) {
- var options = column.filters;
- if (options && callback) {
- var rest = callback(options);
- if (ctor_amd_xe_utils_default.a.isArray(rest)) {
- column.filters = UtilTools.getFilters(rest);
- }
- return this.$nextTick().then(function () {
- return options;
- });
- }
- }
- return this.$nextTick();
- },
- /**
- * 修改筛选条件列表
- * @param {ColumnInfo} column 列
- * @param {Array} options 选项
- */
- _setFilter: function _setFilter(column, options) {
- if (column.filters && options) {
- column.filters = UtilTools.getFilters(options);
- }
- return this.$nextTick();
- },
- checkFilterOptions: function checkFilterOptions() {
- var filterStore = this.filterStore;
- filterStore.isAllSelected = filterStore.options.every(function (item) {
- return item._checked;
- });
- filterStore.isIndeterminate = !filterStore.isAllSelected && filterStore.options.some(function (item) {
- return item._checked;
- });
- },
- /**
- * 点击筛选事件
- * 当筛选图标被点击时触发
- * 更新选项是否全部状态
- * 打开筛选面板
- * @param {Event} evnt 事件
- * @param {ColumnInfo} column 列配置
- * @param {Object} params 参数
- */
- triggerFilterEvent: function triggerFilterEvent(evnt, column, params) {
- var _this = this;
- var $refs = this.$refs,
- filterStore = this.filterStore;
- if (filterStore.column === column && filterStore.visible) {
- filterStore.visible = false;
- } else {
- var bodyElem = $refs.tableBody.$el;
- var targetElem = evnt.target,
- pageX = evnt.pageX;
- var filters = column.filters,
- filterMultiple = column.filterMultiple,
- filterRender = column.filterRender;
- var compConf = filterRender ? v_x_e_table.renderer.get(filterRender.name) : null;
- var filterRecoverMethod = column.filterRecoverMethod || (compConf ? compConf.filterRecoverMethod : null);
- var _DomTools$getDomNode = DomTools.getDomNode(),
- visibleWidth = _DomTools$getDomNode.visibleWidth;
- Object.assign(filterStore, {
- args: params,
- multiple: filterMultiple,
- options: filters,
- column: column,
- style: null,
- visible: true
- }); // 复原状态
- filterStore.options.forEach(function (option) {
- var _checked = option._checked,
- checked = option.checked;
- option._checked = checked;
- if (!checked && _checked !== checked) {
- if (filterRecoverMethod) {
- filterRecoverMethod({
- option: option,
- column: column,
- $table: _this
- });
- }
- }
- });
- this.checkFilterOptions();
- this.hasFilterPanel = true;
- this.$nextTick(function () {
- var filterWrapperElem = $refs.filterWrapper.$el;
- var filterWidth = filterWrapperElem.offsetWidth;
- var centerWidth = filterWidth / 2;
- var minMargin = 32;
- var left, right;
- var style = {
- top: "".concat(targetElem.offsetTop + targetElem.offsetParent.offsetTop + targetElem.offsetHeight + 8, "px")
- };
- if (column.fixed === 'left') {
- left = targetElem.offsetLeft + targetElem.offsetParent.offsetLeft - centerWidth;
- } else if (column.fixed === 'right') {
- right = targetElem.offsetParent.offsetWidth - targetElem.offsetLeft + (targetElem.offsetParent.offsetParent.offsetWidth - targetElem.offsetParent.offsetLeft) - column.renderWidth - centerWidth;
- } else {
- left = targetElem.offsetLeft + targetElem.offsetParent.offsetLeft - centerWidth - bodyElem.scrollLeft;
- }
- if (left) {
- var overflowWidth = pageX + filterWidth - centerWidth + minMargin - visibleWidth;
- if (overflowWidth > 0) {
- left -= overflowWidth;
- }
- style.left = "".concat(Math.max(minMargin, left), "px");
- } else if (right) {
- var _overflowWidth = pageX + filterWidth - centerWidth + minMargin - visibleWidth;
- if (_overflowWidth > 0) {
- right += _overflowWidth;
- }
- style.right = "".concat(right, "px");
- }
- filterStore.style = style;
- });
- }
- },
- _getCheckedFilters: function _getCheckedFilters() {
- var tableFullColumn = this.tableFullColumn;
- var filterList = [];
- tableFullColumn.filter(function (column) {
- var property = column.property,
- filters = column.filters;
- var valueList = [];
- var dataList = [];
- if (filters && filters.length) {
- filters.forEach(function (item) {
- if (item.checked) {
- valueList.push(item.value);
- dataList.push(item.data);
- }
- });
- if (valueList.length) {
- filterList.push({
- column: column,
- property: property,
- values: valueList,
- datas: dataList
- });
- }
- }
- });
- return filterList;
- },
- /**
- * 确认筛选
- * 当筛选面板中的确定按钮被按下时触发
- * @param {Event} evnt 事件
- */
- confirmFilterEvent: function confirmFilterEvent(evnt) {
- var _this2 = this;
- var filterStore = this.filterStore,
- remoteFilter = this.remoteFilter,
- filterOpts = this.filterOpts,
- scrollXLoad = this.scrollXLoad,
- scrollYLoad = this.scrollYLoad;
- var column = filterStore.column;
- var property = column.property;
- var values = [];
- var datas = [];
- column.filters.forEach(function (item) {
- if (item.checked) {
- values.push(item.value);
- datas.push(item.data);
- }
- });
- filterStore.visible = false;
- var filterList = this.getCheckedFilters(); // 如果是服务端筛选,则跳过本地筛选处理
- if (!(filterOpts.remote || remoteFilter)) {
- this.handleTableData(true);
- this.checkSelectionStatus();
- } // 在 v3.0 中废弃 prop
- this.emitEvent('filter-change', {
- column: column,
- property: property,
- field: property,
- prop: property,
- values: values,
- datas: datas,
- filters: filterList,
- filterList: filterList
- }, evnt);
- this.updateFooter();
- if (scrollXLoad || scrollYLoad) {
- this.clearScroll();
- if (scrollYLoad) {
- this.updateScrollYSpace();
- }
- }
- this.closeFilter();
- this.$nextTick(function () {
- _this2.recalculate();
- _this2.updateCellAreas();
- });
- },
- handleClearFilter: function handleClearFilter(column) {
- if (column) {
- var filters = column.filters,
- filterRender = column.filterRender;
- if (filters) {
- var compConf = filterRender ? v_x_e_table.renderer.get(filterRender.name) : null;
- var filterResetMethod = column.filterResetMethod || (compConf ? compConf.filterResetMethod : null);
- filters.forEach(function (item) {
- item._checked = false;
- item.checked = false;
- if (!filterResetMethod) {
- item.data = ctor_amd_xe_utils_default.a.clone(item.resetValue, true);
- }
- });
- if (filterResetMethod) {
- filterResetMethod({
- options: filters,
- column: column,
- $table: this
- });
- }
- }
- }
- },
- /**
- * 重置筛选
- * 当筛选面板中的重置按钮被按下时触发
- * @param {Event} evnt 事件
- */
- resetFilterEvent: function resetFilterEvent(evnt) {
- this.handleClearFilter(this.filterStore.column);
- this.confirmFilterEvent(evnt);
- },
- /**
- * 清空指定列的筛选条件
- * 如果为空则清空所有列的筛选条件
- * @param {String} column 列
- */
- _clearFilter: function _clearFilter(column) {
- if (arguments.length && ctor_amd_xe_utils_default.a.isString(column)) {
- column = this.getColumnByField(column);
- }
- var filterStore = this.filterStore;
- if (column) {
- this.handleClearFilter(column);
- } else {
- this.visibleColumn.forEach(this.handleClearFilter);
- }
- if (!column || column !== filterStore.column) {
- Object.assign(filterStore, {
- isAllSelected: false,
- isIndeterminate: false,
- style: null,
- options: [],
- column: null,
- multiple: false,
- visible: false
- });
- }
- return this.updateData();
- }
- }
- });
- // CONCATENATED MODULE: ./packages/filter/index.js
- panel.install = function (Vue) {
- v_x_e_table.reg('filter');
- packages_table.mixins.push(src_mixin);
- Vue.component(panel.name, panel);
- };
- var Filter = panel;
- /* harmony default export */ var filter = (panel);
- // CONCATENATED MODULE: ./packages/loading/index.js
- var VxeLoading = {
- /* eslint-disable @typescript-eslint/no-empty-function */
- install: function install() {}
- };
- var Loading = VxeLoading;
- /* harmony default export */ var packages_loading = (VxeLoading);
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.object.get-own-property-descriptor.js
- var es_object_get_own_property_descriptor = __webpack_require__("e439");
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.object.get-own-property-descriptors.js
- var es_object_get_own_property_descriptors = __webpack_require__("dbb4");
- // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js
- function ownKeys(object, enumerableOnly) {
- var keys = Object.keys(object);
- if (Object.getOwnPropertySymbols) {
- var symbols = Object.getOwnPropertySymbols(object);
- if (enumerableOnly) symbols = symbols.filter(function (sym) {
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
- });
- keys.push.apply(keys, symbols);
- }
- return keys;
- }
- function _objectSpread2(target) {
- for (var i = 1; i < arguments.length; i++) {
- var source = arguments[i] != null ? arguments[i] : {};
- if (i % 2) {
- ownKeys(Object(source), true).forEach(function (key) {
- _defineProperty(target, key, source[key]);
- });
- } else if (Object.getOwnPropertyDescriptors) {
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
- } else {
- ownKeys(Object(source)).forEach(function (key) {
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
- });
- }
- }
- return target;
- }
- // CONCATENATED MODULE: ./packages/grid/src/grid.js
- var grid_methods = {};
- var propKeys = Object.keys(packages_table.props);
- function getOffsetHeight(elem) {
- return elem ? elem.offsetHeight : 0;
- }
- function getPaddingTopBottomSize(elem) {
- var computedStyle = getComputedStyle(elem);
- var paddingTop = ctor_amd_xe_utils_default.a.toNumber(computedStyle.paddingTop);
- var paddingBottom = ctor_amd_xe_utils_default.a.toNumber(computedStyle.paddingBottom);
- return paddingTop + paddingBottom;
- }
- function renderDefaultForm(h, _vm) {
- var proxyConfig = _vm.proxyConfig,
- proxyOpts = _vm.proxyOpts,
- formData = _vm.formData,
- formConfig = _vm.formConfig,
- formOpts = _vm.formOpts;
- if (formOpts.items && formOpts.items.length) {
- if (!formOpts.inited) {
- formOpts.inited = true;
- if (proxyOpts && proxyOpts.beforeItem) {
- formOpts.items.forEach(function (item) {
- proxyOpts.beforeItem.apply(_vm, [{
- $grid: _vm,
- item: item
- }]);
- });
- }
- }
- return [h('vxe-form', {
- props: Object.assign({}, formOpts, {
- data: proxyConfig && proxyOpts.form ? formData : formConfig.data
- }),
- on: {
- submit: _vm.submitEvent,
- reset: _vm.resetEvent,
- 'submit-invalid': _vm.submitInvalidEvent,
- 'toggle-collapse': _vm.togglCollapseEvent
- },
- ref: 'form'
- })];
- }
- return [];
- }
- function getToolbarSlots(_vm) {
- var $scopedSlots = _vm.$scopedSlots,
- toolbarOpts = _vm.toolbarOpts;
- var toolbarOptSlots = toolbarOpts.slots; // v3.0 中废弃 buttons、tools
- var $buttons = $scopedSlots.buttons;
- var $tools = $scopedSlots.tools;
- if ($buttons && (!toolbarOptSlots || toolbarOptSlots.buttons !== 'buttons')) {
- UtilTools.warn('vxe.error.reqProp', ['toolbar-config.slots.buttons']);
- }
- if ($tools && (!toolbarOptSlots || toolbarOptSlots.tools !== 'tools')) {
- UtilTools.warn('vxe.error.reqProp', ['toolbar-config.slots.tools']);
- }
- var slots = {};
- if (toolbarOptSlots) {
- if (!$buttons) {
- $buttons = toolbarOptSlots.buttons;
- }
- if (!$tools) {
- $tools = toolbarOptSlots.tools;
- }
- if ($buttons && $scopedSlots[$buttons]) {
- $buttons = $scopedSlots[$buttons];
- }
- if ($tools && $scopedSlots[$tools]) {
- $tools = $scopedSlots[$tools];
- }
- }
- if ($buttons) {
- slots.buttons = $buttons;
- }
- if ($tools) {
- slots.tools = $tools;
- }
- return slots;
- }
- function getPagerSlots(_vm) {
- var $scopedSlots = _vm.$scopedSlots,
- pagerOpts = _vm.pagerOpts;
- var pagerOptSlots = pagerOpts.slots;
- var slots = {};
- var $left;
- var $right;
- if (pagerOptSlots) {
- $left = pagerOptSlots.left;
- $right = pagerOptSlots.right;
- if ($left && $scopedSlots[$left]) {
- $left = $scopedSlots[$left];
- }
- if ($right && $scopedSlots[$right]) {
- $right = $scopedSlots[$right];
- }
- }
- if ($left) {
- slots.left = $left;
- }
- if ($right) {
- slots.right = $right;
- }
- return slots;
- }
- function getTableOns(_vm) {
- var $listeners = _vm.$listeners,
- proxyConfig = _vm.proxyConfig,
- proxyOpts = _vm.proxyOpts;
- var ons = {};
- ctor_amd_xe_utils_default.a.each($listeners, function (cb, type) {
- ons[type] = function () {
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
- _vm.$emit.apply(_vm, [type].concat(args));
- };
- });
- if (proxyConfig) {
- if (proxyOpts.sort) {
- ons['sort-change'] = _vm.sortChangeEvent;
- }
- if (proxyOpts.filter) {
- ons['filter-change'] = _vm.filterChangeEvent;
- }
- }
- return ons;
- }
- Object.keys(packages_table.methods).forEach(function (name) {
- grid_methods[name] = function () {
- var _this$$refs$xTable;
- return this.$refs.xTable && (_this$$refs$xTable = this.$refs.xTable)[name].apply(_this$$refs$xTable, arguments);
- };
- });
- /* harmony default export */ var grid = ({
- name: 'VxeGrid',
- props: _objectSpread2(_objectSpread2({}, packages_table.props), {}, {
- columns: Array,
- pagerConfig: [Boolean, Object],
- proxyConfig: Object,
- toolbar: [Boolean, Object],
- toolbarConfig: [Boolean, Object],
- formConfig: [Boolean, Object],
- size: {
- type: String,
- default: function _default() {
- return conf.grid.size || conf.size;
- }
- }
- }),
- provide: function provide() {
- return {
- $xegrid: this
- };
- },
- data: function data() {
- return {
- isCloak: false,
- tableLoading: false,
- isZMax: false,
- tableData: [],
- pendingRecords: [],
- filterData: [],
- formData: {},
- sortData: {},
- tZindex: 0,
- tablePage: {
- total: 0,
- pageSize: 10,
- currentPage: 1
- }
- };
- },
- computed: {
- vSize: function vSize() {
- return this.size || this.$parent.size || this.$parent.vSize;
- },
- isMsg: function isMsg() {
- return this.proxyOpts.message !== false;
- },
- proxyOpts: function proxyOpts() {
- return Object.assign({}, conf.grid.proxyConfig, this.proxyConfig);
- },
- pagerOpts: function pagerOpts() {
- return Object.assign({}, conf.grid.pagerConfig, this.pagerConfig);
- },
- formOpts: function formOpts() {
- return Object.assign({}, conf.grid.formConfig, this.formConfig);
- },
- toolbarOpts: function toolbarOpts() {
- return Object.assign({}, conf.grid.toolbarConfig, this.toolbarConfig || this.toolbar);
- },
- zoomOpts: function zoomOpts() {
- return Object.assign({}, conf.grid.zoomConfig, this.zoomConfig);
- },
- renderStyle: function renderStyle() {
- return this.isZMax ? {
- zIndex: this.tZindex
- } : null;
- },
- tableExtendProps: function tableExtendProps() {
- var _this = this;
- var rest = {};
- propKeys.forEach(function (key) {
- rest[key] = _this[key];
- });
- return rest;
- },
- tableProps: function tableProps() {
- var isZMax = this.isZMax,
- seqConfig = this.seqConfig,
- pagerConfig = this.pagerConfig,
- loading = this.loading,
- isCloak = this.isCloak,
- editConfig = this.editConfig,
- proxyConfig = this.proxyConfig,
- proxyOpts = this.proxyOpts,
- tableExtendProps = this.tableExtendProps,
- tableLoading = this.tableLoading,
- tablePage = this.tablePage,
- tableData = this.tableData;
- var props = Object.assign({}, tableExtendProps);
- if (isZMax) {
- if (tableExtendProps.maxHeight) {
- props.maxHeight = 'auto';
- } else {
- props.height = 'auto';
- }
- }
- if (proxyConfig) {
- Object.assign(props, {
- loading: isCloak || loading || tableLoading,
- data: tableData,
- rowClassName: this.handleRowClassName
- });
- if ((proxyOpts.seq || proxyOpts.index) && UtilTools.isEnableConf(pagerConfig)) {
- props.seqConfig = Object.assign({}, seqConfig, {
- startIndex: (tablePage.currentPage - 1) * tablePage.pageSize
- });
- }
- }
- if (editConfig) {
- props.editConfig = Object.assign({}, editConfig, {
- activeMethod: this.handleActiveMethod
- });
- }
- return props;
- },
- pagerProps: function pagerProps() {
- return Object.assign({}, this.pagerOpts, this.proxyConfig ? this.tablePage : {});
- }
- },
- watch: {
- columns: function columns(value) {
- var _this2 = this;
- this.$nextTick(function () {
- return _this2.loadColumn(value);
- });
- },
- toolbar: function toolbar(value) {
- if (value) {
- this.initToolbar();
- }
- },
- toolbarConfig: function toolbarConfig(value) {
- if (value) {
- this.initToolbar();
- }
- },
- proxyConfig: function proxyConfig() {
- this.initProxy();
- },
- pagerConfig: function pagerConfig() {
- this.initPages();
- }
- },
- created: function created() {
- var _this3 = this;
- var customs = this.customs,
- data = this.data,
- formOpts = this.formOpts,
- proxyConfig = this.proxyConfig,
- proxyOpts = this.proxyOpts;
- var props = proxyOpts.props;
- if (customs) {
- UtilTools.warn('vxe.error.removeProp', ['customs']);
- }
- if (proxyConfig && (data || proxyOpts.form && formOpts.data)) {
- console.warn('[vxe-grid] There is a conflict between the props proxy-config and data.');
- } // v3.0 中废弃 proxy-config.index
- if (proxyOpts.index) {
- UtilTools.warn('vxe.error.delProp', ['proxy-config.index', 'proxy-config.seq']);
- } // (v3.0 中废弃 proxyConfig.props.data)
- if (props && props.data) {
- UtilTools.warn('vxe.error.delProp', ['proxy-config.props.data', 'proxy-config.props.result']);
- }
- if (this.cloak) {
- this.isCloak = true;
- setTimeout(function () {
- _this3.isCloak = false;
- }, DomTools.browse ? 500 : 300);
- } // 检查错误使用
- this.$nextTick(function () {
- var xTable = _this3.$refs.xTable;
- if (xTable && xTable.isSC) {
- UtilTools.warn('vxe.error.errProp', ['<vxe-table-column ...>', 'columns']);
- }
- });
- GlobalEvent.on(this, 'keydown', this.handleGlobalKeydownEvent);
- },
- mounted: function mounted() {
- if (this.columns && this.columns.length) {
- this.loadColumn(this.columns);
- }
- this.initToolbar();
- this.initPages();
- this.initProxy();
- },
- destroyed: function destroyed() {
- GlobalEvent.off(this, 'keydown');
- },
- render: function render(h) {
- var _ref;
- var $scopedSlots = this.$scopedSlots,
- vSize = this.vSize,
- isZMax = this.isZMax;
- var hasForm = !!($scopedSlots.form || UtilTools.isEnableConf(this.formConfig));
- var hasToolbar = !!($scopedSlots.toolbar || UtilTools.isEnableConf(this.toolbarConfig) || this.toolbar);
- var hasTop = !!$scopedSlots.top;
- var hasBottom = !!$scopedSlots.bottom;
- var hasPager = !!($scopedSlots.pager || UtilTools.isEnableConf(this.pagerConfig));
- return h('div', {
- class: ['vxe-grid', (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, 't--animat', !!this.animat), _defineProperty(_ref, 'is--round', this.round), _defineProperty(_ref, 'is--maximize', isZMax), _defineProperty(_ref, 'is--loading', this.isCloak || this.loading || this.tableLoading), _ref)],
- style: this.renderStyle
- }, [
- /**
- * 渲染表单
- */
- hasForm ? h('div', {
- ref: 'formWrapper',
- class: 'vxe-grid--form-wrapper'
- }, $scopedSlots.form ? $scopedSlots.form.call(this, {
- $grid: this
- }, h) : renderDefaultForm(h, this)) : null,
- /**
- * 渲染工具栏
- */
- hasToolbar ? h('div', {
- ref: 'toolbarWrapper',
- class: 'vxe-grid--toolbar-wrapper'
- }, $scopedSlots.toolbar ? $scopedSlots.toolbar.call(this, {
- $grid: this
- }, h) : [h('vxe-toolbar', {
- props: this.toolbarOpts,
- ref: 'xToolbar',
- scopedSlots: getToolbarSlots(this)
- })]) : null,
- /**
- * 渲染表格顶部区域
- */
- hasTop ? h('div', {
- ref: 'topWrapper',
- class: 'vxe-grid--top-wrapper'
- }, $scopedSlots.top.call(this, {
- $grid: this
- }, h)) : null,
- /**
- * 渲染表格
- */
- h('vxe-table', {
- props: this.tableProps,
- on: getTableOns(this),
- scopedSlots: $scopedSlots,
- ref: 'xTable'
- }, this.$slots.default),
- /**
- * 渲染表格底部区域
- */
- hasBottom ? h('div', {
- ref: 'bottomWrapper',
- class: 'vxe-grid--bottom-wrapper'
- }, $scopedSlots.bottom.call(this, {
- $grid: this
- }, h)) : null,
- /**
- * 渲染分页
- */
- hasPager ? h('div', {
- ref: 'pagerWrapper',
- class: 'vxe-grid--pager-wrapper'
- }, $scopedSlots.pager ? $scopedSlots.pager.call(this, {
- $grid: this
- }, h) : [h('vxe-pager', {
- props: this.pagerProps,
- on: {
- 'page-change': this.pageChangeEvent
- },
- scopedSlots: getPagerSlots(this)
- })]) : null]);
- },
- methods: _objectSpread2(_objectSpread2({}, grid_methods), {}, {
- getParentHeight: function getParentHeight() {
- return (this.isZMax ? DomTools.getDomNode().visibleHeight : this.$el.parentNode.clientHeight) - this.getExcludeHeight();
- },
- /**
- * 获取需要排除的高度
- */
- getExcludeHeight: function getExcludeHeight() {
- var $refs = this.$refs,
- $el = this.$el,
- isZMax = this.isZMax,
- height = this.height;
- var formWrapper = $refs.formWrapper,
- toolbarWrapper = $refs.toolbarWrapper,
- topWrapper = $refs.topWrapper,
- bottomWrapper = $refs.bottomWrapper,
- pagerWrapper = $refs.pagerWrapper;
- var parentPaddingSize = isZMax || height !== 'auto' ? 0 : getPaddingTopBottomSize($el.parentNode);
- return parentPaddingSize + getPaddingTopBottomSize($el) + getOffsetHeight(formWrapper) + getOffsetHeight(toolbarWrapper) + getOffsetHeight(topWrapper) + getOffsetHeight(bottomWrapper) + getOffsetHeight(pagerWrapper);
- },
- handleRowClassName: function handleRowClassName(params) {
- var rowClassName = this.rowClassName;
- var clss = [];
- if (this.pendingRecords.some(function (item) {
- return item === params.row;
- })) {
- clss.push('row--pending');
- }
- clss.push(rowClassName ? ctor_amd_xe_utils_default.a.isFunction(rowClassName) ? rowClassName(params) : rowClassName : '');
- return clss;
- },
- handleActiveMethod: function handleActiveMethod(params) {
- var activeMethod = this.editConfig.activeMethod;
- return this.pendingRecords.indexOf(params.row) === -1 && (!activeMethod || activeMethod(params));
- },
- loadColumn: function loadColumn(columns) {
- var $scopedSlots = this.$scopedSlots;
- ctor_amd_xe_utils_default.a.eachTree(columns, function (column) {
- if (column.slots) {
- ctor_amd_xe_utils_default.a.each(column.slots, function (func, name, colSlots) {
- if (!ctor_amd_xe_utils_default.a.isFunction(func)) {
- if ($scopedSlots[func]) {
- colSlots[name] = $scopedSlots[func];
- } else {
- colSlots[name] = null;
- UtilTools.error('vxe.error.notSlot', [func]);
- }
- }
- });
- }
- });
- return this.$refs.xTable.loadColumn(columns);
- },
- reloadColumn: function reloadColumn(columns) {
- this.clearAll();
- return this.loadColumn(columns);
- },
- initToolbar: function initToolbar() {
- var _this4 = this;
- this.$nextTick(function () {
- var _this4$$refs = _this4.$refs,
- xTable = _this4$$refs.xTable,
- xToolbar = _this4$$refs.xToolbar;
- if (xTable && xToolbar) {
- xTable.connect(xToolbar);
- }
- });
- },
- initPages: function initPages() {
- var tablePage = this.tablePage,
- pagerConfig = this.pagerConfig,
- pagerOpts = this.pagerOpts;
- var currentPage = pagerOpts.currentPage,
- pageSize = pagerOpts.pageSize;
- if (pagerConfig) {
- if (currentPage) {
- tablePage.currentPage = currentPage;
- }
- if (pageSize) {
- tablePage.pageSize = pageSize;
- }
- }
- },
- initProxy: function initProxy() {
- var _this5 = this;
- var proxyInited = this.proxyInited,
- proxyConfig = this.proxyConfig,
- proxyOpts = this.proxyOpts,
- formConfig = this.formConfig,
- formOpts = this.formOpts;
- if (proxyConfig) {
- if (UtilTools.isEnableConf(formConfig) && proxyOpts.form && formOpts.items) {
- var formData = {};
- formOpts.items.forEach(function (_ref2) {
- var field = _ref2.field,
- itemRender = _ref2.itemRender;
- if (field) {
- formData[field] = itemRender && !ctor_amd_xe_utils_default.a.isUndefined(itemRender.defaultValue) ? itemRender.defaultValue : undefined;
- }
- });
- this.formData = formData;
- }
- if (!proxyInited && proxyOpts.autoLoad !== false) {
- this.proxyInited = true;
- this.$nextTick(function () {
- return _this5.initLoad();
- });
- }
- }
- },
- initLoad: function initLoad() {
- var $refs = this.$refs;
- var $xetable = $refs.xTable;
- var defaultSort = $xetable.sortOpts.defaultSort;
- var sortParams = {}; // 如果使用默认排序
- if (defaultSort) {
- sortParams = {
- property: defaultSort.field,
- order: defaultSort.order
- };
- }
- this.sortData = sortParams;
- this.filterData = [];
- this.pendingRecords = [];
- this.commitProxy('query');
- },
- handleGlobalKeydownEvent: function handleGlobalKeydownEvent(evnt) {
- var isEsc = evnt.keyCode === 27;
- if (isEsc && this.isZMax && this.zoomOpts.escRestore !== false) {
- this.triggerZoomEvent(evnt);
- }
- },
- /**
- * 提交指令,支持 code 或 button
- * @param {String/Object} code 字符串或对象
- */
- commitProxy: function commitProxy(code) {
- var _this6 = this;
- var $refs = this.$refs,
- toolbar = this.toolbar,
- toolbarConfig = this.toolbarConfig,
- toolbarOpts = this.toolbarOpts,
- proxyOpts = this.proxyOpts,
- tablePage = this.tablePage,
- pagerConfig = this.pagerConfig,
- sortData = this.sortData,
- filterData = this.filterData,
- formData = this.formData,
- isMsg = this.isMsg;
- var beforeQuery = proxyOpts.beforeQuery,
- afterQuery = proxyOpts.afterQuery,
- beforeDelete = proxyOpts.beforeDelete,
- afterDelete = proxyOpts.afterDelete,
- beforeSave = proxyOpts.beforeSave,
- afterSave = proxyOpts.afterSave,
- _proxyOpts$ajax = proxyOpts.ajax,
- ajax = _proxyOpts$ajax === void 0 ? {} : _proxyOpts$ajax,
- _proxyOpts$props = proxyOpts.props,
- props = _proxyOpts$props === void 0 ? {} : _proxyOpts$props;
- var $xetable = $refs.xTable;
- var button;
- if (ctor_amd_xe_utils_default.a.isString(code)) {
- var matchObj = toolbarConfig || toolbar ? ctor_amd_xe_utils_default.a.findTree(toolbarOpts.buttons, function (item) {
- return item.code === code;
- }, {
- children: 'dropdowns'
- }) : null;
- button = matchObj ? matchObj.item : null;
- } else {
- button = code;
- code = button.code;
- }
- var btnParams = button ? button.params : null;
- for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
- args[_key2 - 1] = arguments[_key2];
- }
- switch (code) {
- case 'insert':
- this.insert();
- break;
- case 'insert_actived':
- this.insert().then(function (_ref3) {
- var row = _ref3.row;
- return _this6.setActiveRow(row);
- });
- break;
- case 'mark_cancel':
- this.triggerPendingEvent(code);
- break;
- // 在 v3 中废弃 remove_selection
- case 'remove_selection':
- case 'remove':
- this.handleDeleteRow(code, 'vxe.grid.removeSelectRecord', function () {
- return _this6.removeCheckboxRow();
- });
- break;
- case 'import':
- this.importData(btnParams);
- break;
- case 'open_import':
- this.openImport(btnParams);
- break;
- case 'export':
- this.exportData(btnParams);
- break;
- case 'open_export':
- this.openExport(btnParams);
- break;
- case 'reset_custom':
- this.resetColumn(true);
- break;
- case 'init':
- case 'reload':
- case 'query':
- {
- var isInited = code === 'init';
- var isReload = code === 'reload';
- var ajaxMethods = ajax.query;
- if (ajaxMethods) {
- var params = {
- code: code,
- button: button,
- $grid: this,
- sort: sortData,
- sorts: proxyOpts.sort && sortData && (sortData.property || sortData.order) ? [sortData] : [],
- filters: filterData,
- form: formData,
- options: ajaxMethods
- };
- if (pagerConfig) {
- if (isReload) {
- tablePage.currentPage = 1;
- }
- if (UtilTools.isEnableConf(pagerConfig)) {
- params.page = tablePage;
- }
- }
- if (isInited || isReload) {
- var defaultSort = $xetable.sortOpts.defaultSort;
- var sortParams = {};
- if (isReload) {
- tablePage.currentPage = 1;
- } // 如果使用默认排序
- if (defaultSort) {
- sortParams = {
- property: defaultSort.field,
- order: defaultSort.order
- };
- }
- this.sortData = params.sort = sortParams;
- this.filterData = params.filters = [];
- this.pendingRecords = [];
- if (proxyOpts.sort) {
- params.sorts = sortParams && (sortParams.property || sortParams.order) ? [sortParams] : [];
- }
- this.clearAll();
- }
- var applyArgs = [params].concat(args);
- this.tableLoading = true;
- return Promise.resolve((beforeQuery || ajaxMethods).apply(this, applyArgs)).catch(function (e) {
- return e;
- }).then(function (rest) {
- _this6.tableLoading = false;
- if (rest) {
- if (UtilTools.isEnableConf(pagerConfig)) {
- var total = ctor_amd_xe_utils_default.a.get(rest, props.total || 'page.total') || 0;
- tablePage.total = total;
- _this6.tableData = ctor_amd_xe_utils_default.a.get(rest, props.result || props.data || 'result') || []; // 检验当前页码,不能超出当前最大页数
- var pageCount = Math.max(Math.ceil(total / tablePage.pageSize), 1);
- if (tablePage.currentPage > pageCount) {
- tablePage.currentPage = pageCount;
- }
- } else {
- _this6.tableData = (props.list ? ctor_amd_xe_utils_default.a.get(rest, props.list) : rest) || [];
- }
- } else {
- _this6.tableData = [];
- }
- if (afterQuery) {
- afterQuery.apply(void 0, _toConsumableArray(applyArgs));
- }
- });
- } else {
- UtilTools.error('vxe.error.notFunc', ['query']);
- }
- break;
- }
- // 在 v3 中废弃 delete_selection
- case 'delete_selection':
- case 'delete':
- {
- var _ajaxMethods = ajax.delete;
- if (_ajaxMethods) {
- var selectRecords = $xetable.getCheckboxRecords();
- var removeRecords = selectRecords.filter(function (row) {
- return !$xetable.isInsertByRow(row);
- });
- var body = {
- removeRecords: removeRecords
- };
- var _applyArgs = [{
- $grid: this,
- code: code,
- button: button,
- body: body,
- options: _ajaxMethods
- }].concat(args);
- if (selectRecords.length) {
- return this.handleDeleteRow(code, 'vxe.grid.deleteSelectRecord', function () {
- if (!removeRecords.length) {
- return $xetable.remove(selectRecords);
- }
- _this6.tableLoading = true;
- return Promise.resolve((beforeDelete || _ajaxMethods).apply(_this6, _applyArgs)).then(function (rest) {
- _this6.tableLoading = false;
- _this6.pendingRecords = _this6.pendingRecords.filter(function (row) {
- return removeRecords.indexOf(row) === -1;
- });
- if (isMsg) {
- v_x_e_table.modal.message({
- message: _this6.getRespMsg(rest, 'vxe.grid.delSuccess'),
- status: 'success'
- });
- }
- if (afterDelete) {
- afterDelete.apply(void 0, _toConsumableArray(_applyArgs));
- } else {
- _this6.commitProxy('query');
- }
- }).catch(function (rest) {
- _this6.tableLoading = false;
- if (isMsg) {
- v_x_e_table.modal.message({
- id: code,
- message: _this6.getRespMsg(rest, 'vxe.grid.operError'),
- status: 'error'
- });
- }
- });
- });
- } else {
- if (isMsg) {
- v_x_e_table.modal.message({
- id: code,
- message: conf.i18n('vxe.grid.selectOneRecord'),
- status: 'warning'
- });
- }
- }
- } else {
- UtilTools.error('vxe.error.notFunc', [code]);
- }
- break;
- }
- case 'save':
- {
- var _ajaxMethods2 = ajax.save;
- if (_ajaxMethods2) {
- var _body = Object.assign({
- pendingRecords: this.pendingRecords
- }, this.getRecordset());
- var insertRecords = _body.insertRecords,
- _removeRecords = _body.removeRecords,
- updateRecords = _body.updateRecords,
- pendingRecords = _body.pendingRecords;
- var _applyArgs2 = [{
- $grid: this,
- code: code,
- button: button,
- body: _body,
- options: _ajaxMethods2
- }].concat(args); // 排除掉新增且标记为删除的数据
- if (insertRecords.length) {
- _body.pendingRecords = pendingRecords.filter(function (row) {
- return insertRecords.indexOf(row) === -1;
- });
- } // 排除已标记为删除的数据
- if (pendingRecords.length) {
- _body.insertRecords = insertRecords.filter(function (row) {
- return pendingRecords.indexOf(row) === -1;
- });
- } // 只校验新增和修改的数据
- return this.validate(_body.insertRecords.concat(updateRecords)).then(function () {
- if (_body.insertRecords.length || _removeRecords.length || updateRecords.length || _body.pendingRecords.length) {
- _this6.tableLoading = true;
- return Promise.resolve((beforeSave || _ajaxMethods2).apply(_this6, _applyArgs2)).then(function (rest) {
- _this6.tableLoading = false;
- _this6.pendingRecords = [];
- if (isMsg) {
- v_x_e_table.modal.message({
- message: _this6.getRespMsg(rest, 'vxe.grid.saveSuccess'),
- status: 'success'
- });
- }
- if (afterSave) {
- afterSave.apply(void 0, _toConsumableArray(_applyArgs2));
- } else {
- _this6.commitProxy('query');
- }
- }).catch(function (rest) {
- _this6.tableLoading = false;
- if (isMsg) {
- v_x_e_table.modal.message({
- id: code,
- message: _this6.getRespMsg(rest, 'vxe.grid.operError'),
- status: 'error'
- });
- }
- });
- } else {
- if (isMsg) {
- v_x_e_table.modal.message({
- id: code,
- message: conf.i18n('vxe.grid.dataUnchanged'),
- status: 'info'
- });
- }
- }
- }).catch(function (errMap) {
- return errMap;
- });
- } else {
- UtilTools.error('vxe.error.notFunc', [code]);
- }
- break;
- }
- default:
- {
- var btnMethod = v_x_e_table.commands.get(code);
- if (btnMethod) {
- btnMethod.apply(this, [{
- code: code,
- button: button,
- $grid: this,
- $table: $xetable
- }].concat(args));
- }
- }
- }
- return this.$nextTick();
- },
- getRespMsg: function getRespMsg(rest, defaultMsg) {
- var _this$proxyOpts$props = this.proxyOpts.props,
- props = _this$proxyOpts$props === void 0 ? {} : _this$proxyOpts$props;
- var msg;
- if (rest && props.message) {
- msg = ctor_amd_xe_utils_default.a.get(rest, props.message);
- }
- return msg || conf.i18n(defaultMsg);
- },
- handleDeleteRow: function handleDeleteRow(code, alertKey, callback) {
- var selectRecords = this.getCheckboxRecords();
- if (this.isMsg) {
- if (selectRecords.length) {
- return v_x_e_table.modal.confirm({
- id: "cfm_".concat(code),
- message: conf.i18n(alertKey),
- escClosable: true
- }).then(function (type) {
- if (type === 'confirm') {
- callback();
- }
- });
- } else {
- v_x_e_table.modal.message({
- id: "msg_".concat(code),
- message: conf.i18n('vxe.grid.selectOneRecord'),
- status: 'warning'
- });
- }
- } else {
- if (selectRecords.length) {
- callback();
- }
- }
- },
- getFormItems: function getFormItems(index) {
- var formConfig = this.formConfig;
- var items = UtilTools.isEnableConf(formConfig) && formConfig.items ? formConfig.items : [];
- return arguments.length ? items[index] : items;
- },
- getPendingRecords: function getPendingRecords() {
- return this.pendingRecords;
- },
- triggerToolbarBtnEvent: function triggerToolbarBtnEvent(button, evnt) {
- this.commitProxy(button, evnt);
- this.$emit('toolbar-button-click', {
- code: button.code,
- button: button,
- $grid: this,
- $event: evnt
- }, evnt);
- },
- triggerPendingEvent: function triggerPendingEvent(code) {
- var pendingRecords = this.pendingRecords,
- isMsg = this.isMsg;
- var selectRecords = this.getCheckboxRecords();
- if (selectRecords.length) {
- var plus = [];
- var minus = [];
- selectRecords.forEach(function (data) {
- if (pendingRecords.some(function (item) {
- return data === item;
- })) {
- minus.push(data);
- } else {
- plus.push(data);
- }
- });
- if (minus.length) {
- this.pendingRecords = pendingRecords.filter(function (item) {
- return minus.indexOf(item) === -1;
- }).concat(plus);
- } else if (plus.length) {
- this.pendingRecords = pendingRecords.concat(plus);
- }
- this.clearCheckboxRow();
- } else {
- if (isMsg) {
- v_x_e_table.modal.message({
- id: code,
- message: conf.i18n('vxe.grid.selectOneRecord'),
- status: 'warning'
- });
- }
- }
- },
- pageChangeEvent: function pageChangeEvent(params) {
- var proxyConfig = this.proxyConfig,
- tablePage = this.tablePage;
- var currentPage = params.currentPage,
- pageSize = params.pageSize;
- tablePage.currentPage = currentPage;
- tablePage.pageSize = pageSize;
- if (params.type === 'current-change') {
- if (this.$listeners['current-page-change']) {
- UtilTools.warn('vxe.error.delEvent', ['current-page-change', 'page-change']);
- this.$emit('current-page-change', currentPage);
- }
- } else {
- if (this.$listeners['page-size-change']) {
- UtilTools.warn('vxe.error.delEvent', ['page-size-change', 'page-change']);
- this.$emit('page-size-change', pageSize);
- }
- }
- this.$emit('page-change', Object.assign({
- $grid: this
- }, params));
- if (proxyConfig) {
- this.commitProxy('query');
- }
- },
- sortChangeEvent: function sortChangeEvent(params) {
- var remoteSort = this.remoteSort;
- var $table = params.$table,
- column = params.column;
- var isRemote = ctor_amd_xe_utils_default.a.isBoolean(column.remoteSort) ? column.remoteSort : $table.sortOpts.remote || remoteSort;
- var property = params.order ? params.property : null; // 如果是服务端排序
- if (isRemote) {
- this.sortData = property ? {
- property: property,
- field: property,
- // v3 废弃 prop
- prop: property,
- order: params.order,
- sortBy: params.sortBy
- } : {};
- if (this.proxyConfig) {
- this.tablePage.currentPage = 1;
- this.commitProxy('query');
- }
- }
- this.$emit('sort-change', Object.assign({
- $grid: this
- }, params));
- },
- filterChangeEvent: function filterChangeEvent(params) {
- var $table = params.$table,
- filterList = params.filterList; // 如果是服务端过滤
- if ($table.filterOpts.remote || this.remoteFilter) {
- this.filterData = filterList;
- if (this.proxyConfig) {
- this.tablePage.currentPage = 1;
- this.commitProxy('query');
- }
- }
- this.$emit('filter-change', Object.assign({
- $grid: this
- }, params));
- },
- submitEvent: function submitEvent(params, evnt) {
- var proxyConfig = this.proxyConfig;
- if (proxyConfig) {
- this.commitProxy('reload');
- }
- this.$emit('form-submit', Object.assign({
- $grid: this
- }, params), evnt);
- },
- resetEvent: function resetEvent(params, evnt) {
- var proxyConfig = this.proxyConfig;
- if (proxyConfig) {
- this.commitProxy('reload');
- }
- this.$emit('form-reset', Object.assign({
- $grid: this
- }, params), evnt);
- },
- submitInvalidEvent: function submitInvalidEvent(params, evnt) {
- this.$emit('form-submit-invalid', Object.assign({
- $grid: this
- }, params), evnt);
- },
- togglCollapseEvent: function togglCollapseEvent(params, evnt) {
- var _this7 = this;
- this.$nextTick(function () {
- return _this7.recalculate(true);
- });
- this.$emit('form-toggle-collapse', Object.assign({
- $grid: this
- }, params), evnt);
- },
- triggerZoomEvent: function triggerZoomEvent(evnt) {
- this.zoom();
- this.$emit('zoom', {
- $grid: this,
- maximize: this.isZMax,
- type: this.isZMax ? 'max' : 'revert',
- $event: evnt
- });
- },
- zoom: function zoom() {
- return this[this.isZMax ? 'revert' : 'maximize']();
- },
- isMaximized: function isMaximized() {
- return this.isZMax;
- },
- maximize: function maximize() {
- return this.handleZoom(true);
- },
- revert: function revert() {
- return this.handleZoom();
- },
- handleZoom: function handleZoom(isMax) {
- var _this8 = this;
- var isZMax = this.isZMax;
- if (isMax ? !isZMax : isZMax) {
- this.isZMax = !isZMax;
- if (this.tZindex < UtilTools.getLastZIndex()) {
- this.tZindex = UtilTools.nextZIndex();
- }
- }
- return this.$nextTick().then(function () {
- return _this8.recalculate(true);
- }).then(function () {
- return _this8.isZMax;
- });
- },
- getProxyInfo: function getProxyInfo() {
- return this.proxyConfig ? {
- data: this.tableData,
- filter: this.filterData,
- form: this.formData,
- sort: this.sortData,
- sorts: this.proxyOpts.sort ? [this.sortData] : [],
- pager: this.tablePage,
- pendingRecords: this.pendingRecords
- } : null;
- }
- })
- });
- // CONCATENATED MODULE: ./packages/grid/index.js
- grid.install = function (Vue) {
- v_x_e_table.Grid = grid;
- v_x_e_table.GridComponent = grid;
- Vue.component(grid.name, grid);
- };
- var Grid = grid;
- /* harmony default export */ var packages_grid = (grid);
- // CONCATENATED MODULE: ./packages/menu/src/panel.js
- /* harmony default export */ var src_panel = ({
- name: 'VxeTableContextMenu',
- props: {
- ctxMenuStore: Object,
- ctxMenuOpts: Object
- },
- render: function render(h) {
- var $xetable = this.$parent;
- var _e = this._e,
- ctxMenuOpts = this.ctxMenuOpts,
- ctxMenuStore = this.ctxMenuStore;
- return h('div', {
- class: ['vxe-table--context-menu-wrapper', ctxMenuOpts.className, {
- 'is--show': ctxMenuStore.visible
- }],
- style: ctxMenuStore.style
- }, ctxMenuStore.list.map(function (options, gIndex) {
- return options.every(function (item) {
- return item.visible === false;
- }) ? _e() : h('ul', {
- class: 'vxe-context-menu--option-wrapper',
- key: gIndex
- }, options.map(function (item, index) {
- var hasChildMenus = item.children && item.children.some(function (child) {
- return child.visible !== false;
- });
- return item.visible === false ? _e() : h('li', {
- class: [item.className, {
- 'link--disabled': item.disabled,
- 'link--active': item === ctxMenuStore.selected
- }],
- key: "".concat(gIndex, "_").concat(index)
- }, [h('a', {
- class: 'vxe-context-menu--link',
- on: {
- click: function click(evnt) {
- $xetable.ctxMenuLinkEvent(evnt, item);
- },
- mouseover: function mouseover(evnt) {
- $xetable.ctxMenuMouseoverEvent(evnt, item);
- },
- mouseout: function mouseout(evnt) {
- $xetable.ctxMenuMouseoutEvent(evnt, item);
- }
- }
- }, [h('i', {
- class: ['vxe-context-menu--link-prefix', item.prefixIcon]
- }), h('span', {
- class: 'vxe-context-menu--link-content'
- }, UtilTools.getFuncText(item.name)), h('i', {
- class: ['vxe-context-menu--link-suffix', hasChildMenus ? item.suffixIcon || 'suffix--haschild' : item.suffixIcon]
- })]), hasChildMenus ? h('ul', {
- class: ['vxe-table--context-menu-clild-wrapper', {
- 'is--show': item === ctxMenuStore.selected && ctxMenuStore.showChild
- }]
- }, item.children.map(function (child, cIndex) {
- return child.visible === false ? _e() : h('li', {
- class: [child.className, {
- 'link--disabled': child.disabled,
- 'link--active': child === ctxMenuStore.selectChild
- }],
- key: "".concat(gIndex, "_").concat(index, "_").concat(cIndex)
- }, [h('a', {
- class: 'vxe-context-menu--link',
- on: {
- click: function click(evnt) {
- $xetable.ctxMenuLinkEvent(evnt, child);
- },
- mouseover: function mouseover(evnt) {
- $xetable.ctxMenuMouseoverEvent(evnt, item, child);
- },
- mouseout: function mouseout(evnt) {
- $xetable.ctxMenuMouseoutEvent(evnt, item, child);
- }
- }
- }, [h('i', {
- class: ['vxe-context-menu--link-prefix', child.prefixIcon]
- }), h('span', {
- class: 'vxe-context-menu--link-content'
- }, UtilTools.getFuncText(child.name))])]);
- })) : _e()]);
- }));
- }));
- }
- });
- // CONCATENATED MODULE: ./packages/menu/src/mixin.js
- /* harmony default export */ var menu_src_mixin = ({
- methods: {
- /**
- * 关闭快捷菜单
- */
- _closeMenu: function _closeMenu() {
- Object.assign(this.ctxMenuStore, {
- visible: false,
- selected: null,
- selectChild: null,
- showChild: false
- });
- return this.$nextTick();
- },
- // 处理菜单的移动
- moveCtxMenu: function moveCtxMenu(evnt, keyCode, ctxMenuStore, property, operKey, operRest, menuList) {
- var selectItem;
- var selectIndex = ctor_amd_xe_utils_default.a.findIndexOf(menuList, function (item) {
- return ctxMenuStore[property] === item;
- });
- if (keyCode === operKey) {
- if (operRest && UtilTools.hasChildrenList(ctxMenuStore.selected)) {
- ctxMenuStore.showChild = true;
- } else {
- ctxMenuStore.showChild = false;
- ctxMenuStore.selectChild = null;
- }
- } else if (keyCode === 38) {
- for (var len = selectIndex - 1; len >= 0; len--) {
- if (menuList[len].visible !== false) {
- selectItem = menuList[len];
- break;
- }
- }
- ctxMenuStore[property] = selectItem || menuList[menuList.length - 1];
- } else if (keyCode === 40) {
- for (var index = selectIndex + 1; index < menuList.length; index++) {
- if (menuList[index].visible !== false) {
- selectItem = menuList[index];
- break;
- }
- }
- ctxMenuStore[property] = selectItem || menuList[0];
- } else if (ctxMenuStore[property] && (keyCode === 13 || keyCode === 32)) {
- this.ctxMenuLinkEvent(evnt, ctxMenuStore[property]);
- }
- },
- /**
- * 快捷菜单事件处理
- */
- handleGlobalContextmenuEvent: function handleGlobalContextmenuEvent(evnt) {
- var $refs = this.$refs,
- tId = this.tId,
- editStore = this.editStore,
- menuConfig = this.menuConfig,
- contextMenu = this.contextMenu,
- ctxMenuStore = this.ctxMenuStore,
- ctxMenuOpts = this.ctxMenuOpts,
- mouseConfig = this.mouseConfig,
- mouseOpts = this.mouseOpts;
- var selected = editStore.selected;
- var layoutList = ['header', 'body', 'footer'];
- if (menuConfig || contextMenu) {
- if (ctxMenuStore.visible && $refs.ctxWrapper && DomTools.getEventTargetNode(evnt, $refs.ctxWrapper.$el).flag) {
- evnt.preventDefault();
- return;
- }
- if (this._keyCtx) {
- var type = 'body';
- var params = {
- type: type,
- $grid: this.$xegrid,
- $table: this,
- keyboard: true,
- columns: this.visibleColumn.slice(0),
- $event: evnt
- }; // 如果开启单元格区域
- if (mouseConfig && mouseOpts.area) {
- var activeArea = this.getActiveCellArea();
- if (activeArea && activeArea.row && activeArea.column) {
- params.row = activeArea.row;
- params.column = activeArea.column;
- this.openContextMenu(evnt, type, params);
- return;
- }
- } else if (mouseConfig && mouseOpts.selected) {
- // 如果启用键盘导航且已选中单元格
- if (selected.row && selected.column) {
- params.row = selected.row;
- params.column = selected.column;
- this.openContextMenu(evnt, type, params);
- return;
- }
- }
- } // 分别匹配表尾、内容、表尾的快捷菜单
- for (var index = 0; index < layoutList.length; index++) {
- var layout = layoutList[index];
- var columnTargetNode = DomTools.getEventTargetNode(evnt, this.$el, "vxe-".concat(layout, "--column"), function (target) {
- // target=td|th,直接向上找 table 去匹配即可
- return target.parentNode.parentNode.parentNode.getAttribute('data-tid') === tId;
- });
- var _params = {
- type: layout,
- $grid: this.$xegrid,
- $table: this,
- columns: this.visibleColumn.slice(0),
- $event: evnt
- };
- if (columnTargetNode.flag) {
- var cell = columnTargetNode.targetElem;
- var column = this.getColumnNode(cell).item;
- var typePrefix = "".concat(layout, "-");
- Object.assign(_params, {
- column: column,
- columnIndex: this.getColumnIndex(column),
- cell: cell
- });
- if (layout === 'body') {
- var row = this.getRowNode(cell.parentNode).item;
- typePrefix = '';
- _params.row = row;
- _params.rowIndex = this.getRowIndex(row);
- }
- this.openContextMenu(evnt, layout, _params); // 在 v4 中废弃事件 cell-context-menu、header-cell-context-menu、footer-cell-context-menu
- if (this.$listeners["".concat(typePrefix, "cell-context-menu")]) {
- UtilTools.warn('vxe.error.delEvent', ["".concat(typePrefix, "cell-context-menu"), "".concat(typePrefix, "cell-menu")]);
- this.emitEvent("".concat(typePrefix, "cell-context-menu"), _params, evnt);
- } else {
- this.emitEvent("".concat(typePrefix, "cell-menu"), _params, evnt);
- }
- return;
- } else if (DomTools.getEventTargetNode(evnt, this.$el, "vxe-table--".concat(layout, "-wrapper"), function (target) {
- return target.getAttribute('data-tid') === tId;
- }).flag) {
- if (ctxMenuOpts.trigger === 'cell') {
- evnt.preventDefault();
- } else {
- this.openContextMenu(evnt, layout, _params);
- }
- return;
- }
- }
- }
- if ($refs.filterWrapper && !DomTools.getEventTargetNode(evnt, $refs.filterWrapper.$el).flag) {
- this.closeFilter();
- }
- this.closeMenu();
- },
- /**
- * 显示快捷菜单
- */
- openContextMenu: function openContextMenu(evnt, type, params) {
- var _this = this;
- var isCtxMenu = this.isCtxMenu,
- ctxMenuStore = this.ctxMenuStore,
- ctxMenuOpts = this.ctxMenuOpts;
- var config = ctxMenuOpts[type];
- var visibleMethod = ctxMenuOpts.visibleMethod;
- if (config) {
- var options = config.options,
- disabled = config.disabled;
- if (disabled) {
- evnt.preventDefault();
- } else if (isCtxMenu && options && options.length) {
- params.options = options;
- this.preventEvent(evnt, 'event.showMenu', params, function () {
- if (!visibleMethod || visibleMethod(params, evnt)) {
- evnt.preventDefault();
- _this.updateZindex();
- var _DomTools$getDomNode = DomTools.getDomNode(),
- scrollTop = _DomTools$getDomNode.scrollTop,
- scrollLeft = _DomTools$getDomNode.scrollLeft,
- visibleHeight = _DomTools$getDomNode.visibleHeight,
- visibleWidth = _DomTools$getDomNode.visibleWidth;
- var top = evnt.clientY + scrollTop;
- var left = evnt.clientX + scrollLeft;
- var handleVisible = function handleVisible() {
- Object.assign(ctxMenuStore, {
- args: params,
- visible: true,
- list: options,
- selected: null,
- selectChild: null,
- showChild: false,
- style: {
- zIndex: _this.tZindex,
- top: "".concat(top, "px"),
- left: "".concat(left, "px")
- }
- });
- _this.$nextTick(function () {
- var ctxElem = _this.$refs.ctxWrapper.$el;
- var clientHeight = ctxElem.clientHeight;
- var clientWidth = ctxElem.clientWidth;
- var _DomTools$getAbsolute = DomTools.getAbsolutePos(ctxElem),
- boundingTop = _DomTools$getAbsolute.boundingTop,
- boundingLeft = _DomTools$getAbsolute.boundingLeft;
- var offsetTop = boundingTop + clientHeight - visibleHeight;
- var offsetLeft = boundingLeft + clientWidth - visibleWidth;
- if (offsetTop > -10) {
- ctxMenuStore.style.top = "".concat(Math.max(scrollTop + 2, top - clientHeight - 2), "px");
- }
- if (offsetLeft > -10) {
- ctxMenuStore.style.left = "".concat(Math.max(scrollLeft + 2, left - clientWidth - 2), "px");
- }
- });
- };
- var keyboard = params.keyboard,
- row = params.row,
- column = params.column;
- if (keyboard && row && column) {
- _this.scrollToRow(row, column).then(function () {
- var cell = _this.getCell(row, column);
- var _DomTools$getAbsolute2 = DomTools.getAbsolutePos(cell),
- boundingTop = _DomTools$getAbsolute2.boundingTop,
- boundingLeft = _DomTools$getAbsolute2.boundingLeft;
- top = boundingTop + scrollTop + Math.floor(cell.offsetHeight / 2);
- left = boundingLeft + scrollLeft + Math.floor(cell.offsetWidth / 2);
- handleVisible();
- });
- } else {
- handleVisible();
- }
- } else {
- _this.closeMenu();
- }
- });
- }
- }
- this.closeFilter();
- },
- ctxMenuMouseoverEvent: function ctxMenuMouseoverEvent(evnt, item, child) {
- var menuElem = evnt.currentTarget;
- var ctxMenuStore = this.ctxMenuStore;
- evnt.preventDefault();
- evnt.stopPropagation();
- ctxMenuStore.selected = item;
- ctxMenuStore.selectChild = child;
- if (!child) {
- ctxMenuStore.showChild = UtilTools.hasChildrenList(item);
- if (ctxMenuStore.showChild) {
- this.$nextTick(function () {
- var childWrapperElem = menuElem.nextElementSibling;
- if (childWrapperElem) {
- var _DomTools$getAbsolute3 = DomTools.getAbsolutePos(menuElem),
- boundingTop = _DomTools$getAbsolute3.boundingTop,
- boundingLeft = _DomTools$getAbsolute3.boundingLeft,
- visibleHeight = _DomTools$getAbsolute3.visibleHeight,
- visibleWidth = _DomTools$getAbsolute3.visibleWidth;
- var posTop = boundingTop + menuElem.offsetHeight;
- var posLeft = boundingLeft + menuElem.offsetWidth;
- var left = '';
- var right = ''; // 是否超出右侧
- if (posLeft + childWrapperElem.offsetWidth > visibleWidth - 10) {
- left = 'auto';
- right = "".concat(menuElem.offsetWidth, "px");
- } // 是否超出底部
- var top = '';
- var bottom = '';
- if (posTop + childWrapperElem.offsetHeight > visibleHeight - 10) {
- top = 'auto';
- bottom = '0';
- }
- childWrapperElem.style.left = left;
- childWrapperElem.style.right = right;
- childWrapperElem.style.top = top;
- childWrapperElem.style.bottom = bottom;
- }
- });
- }
- }
- },
- ctxMenuMouseoutEvent: function ctxMenuMouseoutEvent(evnt, item) {
- var ctxMenuStore = this.ctxMenuStore;
- if (!item.children) {
- ctxMenuStore.selected = null;
- }
- ctxMenuStore.selectChild = null;
- },
- /**
- * 快捷菜单点击事件
- */
- ctxMenuLinkEvent: function ctxMenuLinkEvent(evnt, menu) {
- // 如果一级菜单有配置 code 则允许点击,否则不能点击
- if (!menu.disabled && (menu.code || !menu.children || !menu.children.length)) {
- var ctxMenuMethod = v_x_e_table.menus.get(menu.code);
- var params = Object.assign({
- menu: menu,
- $grid: this.$xegrid,
- $table: this,
- $event: evnt
- }, this.ctxMenuStore.args);
- if (ctxMenuMethod) {
- ctxMenuMethod.call(this, params, evnt);
- } // 在 v3 中废弃事件 context-menu-click
- if (this.$listeners['context-menu-click']) {
- UtilTools.warn('vxe.error.delEvent', ['context-menu-click', 'menu-click']);
- this.emitEvent('context-menu-click', params, evnt);
- } else {
- this.emitEvent('menu-click', params, evnt);
- }
- this.closeMenu();
- }
- }
- }
- });
- // CONCATENATED MODULE: ./packages/menu/index.js
- src_panel.install = function (Vue) {
- v_x_e_table.reg('menu');
- packages_table.mixins.push(menu_src_mixin);
- Vue.component(src_panel.name, src_panel);
- };
- var Menu = src_panel;
- /* harmony default export */ var packages_menu = (src_panel);
- // CONCATENATED MODULE: ./packages/toolbar/src/toolbar.js
- /**
- * 渲染按钮
- */
- function renderBtns(h, _vm) {
- var _e = _vm._e,
- $scopedSlots = _vm.$scopedSlots,
- $xegrid = _vm.$xegrid,
- $xetable = _vm.$xetable,
- _vm$buttons = _vm.buttons,
- buttons = _vm$buttons === void 0 ? [] : _vm$buttons;
- if ($scopedSlots.buttons) {
- return $scopedSlots.buttons.call(_vm, {
- $grid: $xegrid,
- $table: $xetable
- }, h);
- }
- return buttons.map(function (item) {
- var name = item.name,
- visible = item.visible,
- _dropdowns = item.dropdowns,
- buttonRender = item.buttonRender;
- var compConf = buttonRender ? v_x_e_table.renderer.get(buttonRender.name) : null;
- if (visible === false) {
- return _e();
- }
- if (compConf) {
- var renderToolbarButton = compConf.renderToolbarButton || compConf.renderButton;
- if (renderToolbarButton) {
- return h('span', {
- class: 'vxe-button--item'
- }, renderToolbarButton.call(_vm, h, buttonRender, {
- $grid: $xegrid,
- $table: $xetable,
- button: item
- }, {
- $grid: $xegrid,
- $table: $xetable
- }));
- }
- }
- return h('vxe-button', {
- on: {
- click: function click(evnt) {
- return _vm.btnEvent(evnt, item);
- }
- },
- props: {
- disabled: item.disabled,
- loading: item.loading,
- type: item.type,
- icon: item.icon,
- circle: item.circle,
- round: item.round,
- status: item.status,
- destroyOnClose: item.destroyOnClose,
- placement: item.placement,
- transfer: item.transfer
- },
- scopedSlots: _dropdowns && _dropdowns.length ? {
- default: function _default() {
- return UtilTools.getFuncText(name);
- },
- dropdowns: function dropdowns() {
- return _dropdowns.map(function (child) {
- return child.visible === false ? _e() : h('vxe-button', {
- on: {
- click: function click(evnt) {
- return _vm.btnEvent(evnt, child);
- }
- },
- props: {
- disabled: child.disabled,
- loading: child.loading,
- type: child.type,
- icon: child.icon,
- circle: child.circle,
- round: child.round,
- status: child.status
- }
- }, UtilTools.getFuncText(child.name));
- });
- }
- } : null
- }, UtilTools.getFuncText(name));
- });
- }
- /**
- * 渲染右侧工具
- */
- function renderRightTools(h, _vm) {
- var $scopedSlots = _vm.$scopedSlots,
- $xegrid = _vm.$xegrid,
- $xetable = _vm.$xetable;
- if ($scopedSlots.tools) {
- return $scopedSlots.tools.call(_vm, {
- $grid: $xegrid,
- $table: $xetable
- }, h);
- }
- return [];
- }
- function renderCustoms(h, _vm) {
- var $xetable = _vm.$xetable,
- customStore = _vm.customStore,
- customOpts = _vm.customOpts,
- columns = _vm.columns;
- var cols = [];
- var customBtnOns = {};
- var customWrapperOns = {};
- var checkMethod = ($xetable && $xetable.customOpts ? $xetable.customOpts.checkMethod : null) || customOpts.checkMethod;
- if (customOpts.trigger === 'manual') {// 手动触发
- } else if (customOpts.trigger === 'hover') {
- // hover 触发
- customBtnOns.mouseenter = _vm.handleMouseenterSettingEvent;
- customBtnOns.mouseleave = _vm.handleMouseleaveSettingEvent;
- customWrapperOns.mouseenter = _vm.handleWrapperMouseenterEvent;
- customWrapperOns.mouseleave = _vm.handleWrapperMouseleaveEvent;
- } else {
- // 点击触发
- customBtnOns.click = _vm.handleClickSettingEvent;
- }
- ctor_amd_xe_utils_default.a.eachTree(columns, function (column) {
- var colTitle = UtilTools.formatText(column.getTitle(), 1);
- var colKey = column.getKey();
- var isColGroup = column.children && column.children.length;
- var isDisabled = checkMethod ? !checkMethod({
- column: column
- }) : false;
- if (isColGroup || colKey) {
- cols.push(h('li', {
- class: ['vxe-custom--option', "level--".concat(column.level), {
- 'is--group': isColGroup,
- 'is--checked': column.visible,
- 'is--indeterminate': column.halfVisible,
- 'is--disabled': isDisabled
- }],
- attrs: {
- title: colTitle
- },
- on: {
- click: function click() {
- if (!isDisabled) {
- _vm.changeCustomOption(column);
- }
- }
- }
- }, [h('span', {
- class: 'vxe-checkbox--icon vxe-checkbox--checked-icon'
- }), h('span', {
- class: 'vxe-checkbox--icon vxe-checkbox--unchecked-icon'
- }), h('span', {
- class: 'vxe-checkbox--icon vxe-checkbox--indeterminate-icon'
- }), h('span', {
- class: 'vxe-checkbox--label'
- }, colTitle)]));
- }
- });
- return h('div', {
- class: ['vxe-custom--wrapper', {
- 'is--active': customStore.visible
- }],
- ref: 'customWrapper'
- }, [h('vxe-button', {
- props: {
- circle: true,
- icon: customOpts.icon || conf.icon.TOOLBAR_TOOLS_CUSTOM
- },
- attrs: {
- title: conf.i18n('vxe.toolbar.custom')
- },
- on: customBtnOns
- }), h('div', {
- class: 'vxe-custom--option-wrapper'
- }, [h('ul', {
- class: 'vxe-custom--header'
- }, [h('li', {
- class: ['vxe-custom--option', {
- 'is--checked': customStore.isAll,
- 'is--indeterminate': customStore.isIndeterminate
- }],
- attrs: {
- title: conf.i18n('vxe.table.allTitle')
- },
- on: {
- click: _vm.allCustomEvent
- }
- }, [h('span', {
- class: 'vxe-checkbox--icon vxe-checkbox--checked-icon'
- }), h('span', {
- class: 'vxe-checkbox--icon vxe-checkbox--unchecked-icon'
- }), h('span', {
- class: 'vxe-checkbox--icon vxe-checkbox--indeterminate-icon'
- }), h('span', {
- class: 'vxe-checkbox--label'
- }, conf.i18n('vxe.toolbar.customAll'))])]), h('ul', {
- class: 'vxe-custom--body',
- on: customWrapperOns
- }, cols), customOpts.isFooter === false ? null : h('div', {
- class: 'vxe-custom--footer'
- }, [h('button', {
- class: 'btn--confirm',
- on: {
- click: _vm.confirmCustomEvent
- }
- }, conf.i18n('vxe.toolbar.customConfirm')), h('button', {
- class: 'btn--reset',
- on: {
- click: _vm.resetCustomEvent
- }
- }, conf.i18n('vxe.toolbar.customRestore'))])])]);
- }
- /* harmony default export */ var src_toolbar = ({
- name: 'VxeToolbar',
- props: {
- id: String,
- loading: Boolean,
- resizable: [Boolean, Object],
- refresh: [Boolean, Object],
- import: [Boolean, Object],
- export: [Boolean, Object],
- print: [Boolean, Object],
- zoom: [Boolean, Object],
- setting: [Boolean, Object],
- custom: [Boolean, Object],
- buttons: {
- type: Array,
- default: function _default() {
- return conf.toolbar.buttons;
- }
- },
- perfect: {
- type: Boolean,
- default: function _default() {
- return conf.toolbar.perfect;
- }
- },
- size: {
- type: String,
- default: function _default() {
- return conf.toolbar.size || conf.size;
- }
- }
- },
- inject: {
- $xegrid: {
- default: null
- }
- },
- data: function data() {
- return {
- $xetable: null,
- isRefresh: false,
- columns: [],
- customStore: {
- isAll: false,
- isIndeterminate: false,
- visible: false
- }
- };
- },
- computed: {
- vSize: function vSize() {
- return this.size || this.$parent.size || this.$parent.vSize;
- },
- refreshOpts: function refreshOpts() {
- return Object.assign({}, conf.toolbar.refresh, this.refresh);
- },
- importOpts: function importOpts() {
- return Object.assign({}, conf.toolbar.import, this.import);
- },
- exportOpts: function exportOpts() {
- return Object.assign({}, conf.toolbar.export, this.export);
- },
- printOpts: function printOpts() {
- return Object.assign({}, conf.toolbar.print, this.print);
- },
- // 在 v3.0 中废弃 toolbar.resizable
- resizableOpts: function resizableOpts() {
- return Object.assign({}, conf.toolbar.resizable, this.resizable);
- },
- zoomOpts: function zoomOpts() {
- return Object.assign({}, conf.toolbar.zoom, this.zoom);
- },
- // 在 v3.0 中废弃 toolbar.custom
- customOpts: function customOpts() {
- return Object.assign({}, conf.toolbar.custom, this.custom);
- }
- },
- created: function created() {
- var _this = this;
- var customOpts = this.customOpts,
- refresh = this.refresh,
- resizable = this.resizable,
- setting = this.setting,
- id = this.id,
- refreshOpts = this.refreshOpts;
- if (customOpts.storage && !id) {
- return UtilTools.error('vxe.error.reqProp', ['toolbar.id']);
- }
- if (id) {
- UtilTools.warn('vxe.error.removeProp', ['toolbar.id']);
- } // 在 v3 中废弃 setting
- if (setting) {
- UtilTools.warn('vxe.error.delProp', ['toolbar.setting', 'toolbar.custom']);
- }
- if (!v_x_e_table._export && (this.export || this.import)) {
- UtilTools.error('vxe.error.reqModule', ['Export']);
- }
- if (resizable) {
- UtilTools.warn('vxe.error.delProp', ['toolbar.resizable', 'custom-config.storage']);
- }
- if (customOpts.storage) {
- UtilTools.warn('vxe.error.delProp', ['toolbar.custom.storage', 'custom-config.storage']);
- }
- this.$nextTick(function () {
- var $xetable = _this.fintTable();
- if (refresh && !_this.$xegrid && !refreshOpts.query) {
- UtilTools.warn('vxe.error.notFunc', ['query']);
- }
- if ($xetable) {
- $xetable.connect(_this);
- }
- });
- GlobalEvent.on(this, 'mousedown', this.handleGlobalMousedownEvent);
- GlobalEvent.on(this, 'blur', this.handleGlobalBlurEvent);
- },
- destroyed: function destroyed() {
- GlobalEvent.off(this, 'mousedown');
- GlobalEvent.off(this, 'blur');
- },
- render: function render(h) {
- var _ref;
- var $xegrid = this.$xegrid,
- perfect = this.perfect,
- loading = this.loading,
- importOpts = this.importOpts,
- exportOpts = this.exportOpts,
- refresh = this.refresh,
- refreshOpts = this.refreshOpts,
- zoom = this.zoom,
- zoomOpts = this.zoomOpts,
- custom = this.custom,
- setting = this.setting,
- vSize = this.vSize;
- return h('div', {
- class: ['vxe-toolbar', (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, 'is--perfect', perfect), _defineProperty(_ref, 'is--loading', loading), _ref)]
- }, [h('div', {
- class: 'vxe-buttons--wrapper'
- }, renderBtns(h, this)), h('div', {
- class: 'vxe-tools--wrapper'
- }, renderRightTools(h, this)), h('div', {
- class: 'vxe-tools--operate'
- }, [this.import ? h('vxe-button', {
- props: {
- circle: true,
- icon: importOpts.icon || conf.icon.TOOLBAR_TOOLS_IMPORT
- },
- attrs: {
- title: conf.i18n('vxe.toolbar.import')
- },
- on: {
- click: this.importEvent
- }
- }) : null, this.export ? h('vxe-button', {
- props: {
- circle: true,
- icon: exportOpts.icon || conf.icon.TOOLBAR_TOOLS_EXPORT
- },
- attrs: {
- title: conf.i18n('vxe.toolbar.export')
- },
- on: {
- click: this.exportEvent
- }
- }) : null, this.print ? h('vxe-button', {
- props: {
- circle: true,
- icon: this.printOpts.icon || conf.icon.TOOLBAR_TOOLS_PRINT
- },
- attrs: {
- title: conf.i18n('vxe.toolbar.print')
- },
- on: {
- click: this.printEvent
- }
- }) : null, refresh ? h('vxe-button', {
- props: {
- circle: true,
- icon: this.isRefresh ? refreshOpts.iconLoading || conf.icon.TOOLBAR_TOOLS_REFRESH_LOADING : refreshOpts.icon || conf.icon.TOOLBAR_TOOLS_REFRESH
- },
- attrs: {
- title: conf.i18n('vxe.toolbar.refresh')
- },
- on: {
- click: this.refreshEvent
- }
- }) : null, zoom && $xegrid ? h('vxe-button', {
- props: {
- circle: true,
- icon: $xegrid.isMaximized() ? zoomOpts.iconOut || conf.icon.TOOLBAR_TOOLS_ZOOM_OUT : zoomOpts.iconIn || conf.icon.TOOLBAR_TOOLS_ZOOM_IN
- },
- attrs: {
- title: conf.i18n("vxe.toolbar.zoom".concat($xegrid.isMaximized() ? 'Out' : 'In'))
- },
- on: {
- click: $xegrid.triggerZoomEvent
- }
- }) : null, custom || setting ? renderCustoms(h, this) : null])]);
- },
- methods: {
- syncUpdate: function syncUpdate(params) {
- var collectColumn = params.collectColumn,
- $table = params.$table;
- this.$xetable = $table;
- this.columns = collectColumn;
- },
- fintTable: function fintTable() {
- var $children = this.$parent.$children;
- var selfIndex = $children.indexOf(this);
- return ctor_amd_xe_utils_default.a.find($children, function (comp, index) {
- return comp && comp.refreshColumn && index > selfIndex && comp.$vnode.componentOptions.tag === 'vxe-table';
- });
- },
- checkTable: function checkTable() {
- if (this.$xetable) {
- return true;
- }
- UtilTools.error('vxe.error.barUnableLink');
- },
- showCustom: function showCustom() {
- this.customStore.visible = true;
- this.checkCustomStatus();
- },
- closeCustom: function closeCustom() {
- var custom = this.custom,
- setting = this.setting,
- customStore = this.customStore;
- if (customStore.visible) {
- customStore.visible = false;
- if ((custom || setting) && !customStore.immediate) {
- this.handleCustoms();
- }
- }
- },
- confirmCustomEvent: function confirmCustomEvent(evnt) {
- this.closeCustom();
- this.emitCustomEvent('confirm', evnt);
- },
- customOpenEvent: function customOpenEvent(evnt) {
- var customStore = this.customStore;
- if (this.checkTable()) {
- if (!customStore.visible) {
- this.showCustom();
- this.emitCustomEvent('open', evnt);
- }
- }
- },
- customColseEvent: function customColseEvent(evnt) {
- var customStore = this.customStore;
- if (customStore.visible) {
- this.closeCustom();
- this.emitCustomEvent('close', evnt);
- }
- },
- resetCustomEvent: function resetCustomEvent(evnt) {
- var $xetable = this.$xetable,
- columns = this.columns,
- customOpts = this.customOpts;
- var checkMethod = $xetable.customOpts.checkMethod || customOpts.checkMethod;
- ctor_amd_xe_utils_default.a.eachTree(columns, function (column) {
- if (!checkMethod || checkMethod({
- column: column
- })) {
- column.visible = column.defaultVisible;
- column.halfVisible = false;
- }
- column.resizeWidth = 0;
- });
- $xetable.saveCustomResizable(true);
- this.closeCustom();
- this.emitCustomEvent('reset', evnt);
- },
- emitCustomEvent: function emitCustomEvent(type, evnt) {
- var $xetable = this.$xetable,
- $xegrid = this.$xegrid;
- var comp = $xegrid || $xetable;
- comp.$emit('custom', {
- type: type,
- $table: $xetable,
- $grid: $xegrid,
- $event: evnt
- }, evnt);
- },
- changeCustomOption: function changeCustomOption(column) {
- var isChecked = !column.visible;
- ctor_amd_xe_utils_default.a.eachTree([column], function (item) {
- item.visible = isChecked;
- item.halfVisible = false;
- });
- this.handleOptionCheck(column);
- if (this.custom && this.customOpts.immediate) {
- this.handleCustoms();
- }
- this.checkCustomStatus();
- },
- handleOptionCheck: function handleOptionCheck(column) {
- var matchObj = ctor_amd_xe_utils_default.a.findTree(this.columns, function (item) {
- return item === column;
- });
- if (matchObj && matchObj.parent) {
- var parent = matchObj.parent;
- if (parent.children && parent.children.length) {
- parent.visible = parent.children.every(function (column) {
- return column.visible;
- });
- parent.halfVisible = !parent.visible && parent.children.some(function (column) {
- return column.visible || column.halfVisible;
- });
- this.handleOptionCheck(parent);
- }
- }
- },
- handleCustoms: function handleCustoms() {
- var $xetable = this.$xetable;
- $xetable.saveCustomVisible();
- $xetable.analyColumnWidth();
- $xetable.refreshColumn();
- },
- checkCustomStatus: function checkCustomStatus() {
- var $xetable = this.$xetable,
- columns = this.columns,
- customOpts = this.customOpts;
- var checkMethod = $xetable.customOpts.checkMethod || customOpts.checkMethod;
- this.customStore.isAll = columns.every(function (column) {
- return (checkMethod ? !checkMethod({
- column: column
- }) : false) || column.visible;
- });
- this.customStore.isIndeterminate = !this.customStore.isAll && columns.some(function (column) {
- return (!checkMethod || checkMethod({
- column: column
- })) && (column.visible || column.halfVisible);
- });
- },
- allCustomEvent: function allCustomEvent() {
- var $xetable = this.$xetable,
- columns = this.columns,
- customOpts = this.customOpts,
- customStore = this.customStore;
- var checkMethod = $xetable.customOpts.checkMethod || customOpts.checkMethod;
- var isAll = !customStore.isAll;
- ctor_amd_xe_utils_default.a.eachTree(columns, function (column) {
- if (!checkMethod || checkMethod({
- column: column
- })) {
- column.visible = isAll;
- column.halfVisible = false;
- }
- });
- customStore.isAll = isAll;
- this.checkCustomStatus();
- },
- handleGlobalMousedownEvent: function handleGlobalMousedownEvent(evnt) {
- if (!DomTools.getEventTargetNode(evnt, this.$refs.customWrapper).flag) {
- this.customColseEvent(evnt);
- }
- },
- handleGlobalBlurEvent: function handleGlobalBlurEvent(evnt) {
- this.customColseEvent(evnt);
- },
- handleClickSettingEvent: function handleClickSettingEvent(evnt) {
- if (this.customStore.visible) {
- this.customColseEvent(evnt);
- } else {
- this.customOpenEvent(evnt);
- }
- },
- handleMouseenterSettingEvent: function handleMouseenterSettingEvent(evnt) {
- this.customStore.activeBtn = true;
- this.customOpenEvent(evnt);
- },
- handleMouseleaveSettingEvent: function handleMouseleaveSettingEvent(evnt) {
- var _this2 = this;
- var customStore = this.customStore;
- customStore.activeBtn = false;
- setTimeout(function () {
- if (!customStore.activeBtn && !customStore.activeWrapper) {
- _this2.customColseEvent(evnt);
- }
- }, 300);
- },
- handleWrapperMouseenterEvent: function handleWrapperMouseenterEvent(evnt) {
- this.customStore.activeWrapper = true;
- this.customOpenEvent(evnt);
- },
- handleWrapperMouseleaveEvent: function handleWrapperMouseleaveEvent(evnt) {
- var _this3 = this;
- var customStore = this.customStore;
- customStore.activeWrapper = false;
- setTimeout(function () {
- if (!customStore.activeBtn && !customStore.activeWrapper) {
- _this3.customColseEvent(evnt);
- }
- }, 300);
- },
- refreshEvent: function refreshEvent() {
- var _this4 = this;
- var $xegrid = this.$xegrid,
- refreshOpts = this.refreshOpts,
- isRefresh = this.isRefresh;
- if (!isRefresh) {
- if (refreshOpts.query) {
- this.isRefresh = true;
- try {
- Promise.resolve(refreshOpts.query()).catch(function (e) {
- return e;
- }).then(function () {
- _this4.isRefresh = false;
- });
- } catch (e) {
- this.isRefresh = false;
- }
- } else if ($xegrid) {
- this.isRefresh = true;
- $xegrid.commitProxy('reload').catch(function (e) {
- return e;
- }).then(function () {
- _this4.isRefresh = false;
- });
- }
- }
- },
- btnEvent: function btnEvent(evnt, item) {
- var $xegrid = this.$xegrid,
- $xetable = this.$xetable;
- var code = item.code;
- if (code) {
- if ($xegrid) {
- $xegrid.triggerToolbarBtnEvent(item, evnt);
- } else {
- var commandMethod = v_x_e_table.commands.get(code);
- var params = {
- code: code,
- button: item,
- $xegrid: $xegrid,
- $table: $xetable,
- $event: evnt
- };
- if (commandMethod) {
- commandMethod.call(this, params, evnt);
- }
- this.$emit('button-click', params, evnt);
- }
- }
- },
- importEvent: function importEvent() {
- if (this.checkTable()) {
- this.$xetable.openImport(this.importOpts);
- }
- },
- exportEvent: function exportEvent() {
- if (this.checkTable()) {
- this.$xetable.openExport(this.exportOpts);
- }
- },
- printEvent: function printEvent() {
- if (this.checkTable()) {
- this.$xetable.print(this.printOpts);
- }
- }
- }
- });
- // CONCATENATED MODULE: ./packages/toolbar/index.js
- src_toolbar.install = function (Vue) {
- Vue.component(src_toolbar.name, src_toolbar);
- };
- var Toolbar = src_toolbar;
- /* harmony default export */ var packages_toolbar = (src_toolbar);
- // CONCATENATED MODULE: ./packages/pager/src/pager.js
- /* harmony default export */ var pager = ({
- name: 'VxePager',
- props: {
- size: {
- type: String,
- default: function _default() {
- return conf.pager.size || conf.size;
- }
- },
- // 自定义布局
- layouts: {
- type: Array,
- default: function _default() {
- return conf.pager.layouts || ['PrevJump', 'PrevPage', 'Jump', 'PageCount', 'NextPage', 'NextJump', 'Sizes', 'Total'];
- }
- },
- // 当前页
- currentPage: {
- type: Number,
- default: 1
- },
- // 加载中
- loading: Boolean,
- // 每页大小
- pageSize: {
- type: Number,
- default: function _default() {
- return conf.pager.pageSize || 10;
- }
- },
- // 总条数
- total: {
- type: Number,
- default: 0
- },
- // 显示页码按钮的数量
- pagerCount: {
- type: Number,
- default: function _default() {
- return conf.pager.pagerCount || 7;
- }
- },
- // 每页大小选项列表
- pageSizes: {
- type: Array,
- default: function _default() {
- return conf.pager.pageSizes || [10, 15, 20, 50, 100];
- }
- },
- // 列对其方式
- align: {
- type: String,
- default: function _default() {
- return conf.pager.align;
- }
- },
- // 带边框
- border: {
- type: Boolean,
- default: function _default() {
- return conf.pager.border;
- }
- },
- // 带背景颜色
- background: {
- type: Boolean,
- default: function _default() {
- return conf.pager.background;
- }
- },
- // 配套的样式
- perfect: {
- type: Boolean,
- default: function _default() {
- return conf.pager.perfect;
- }
- },
- // 当只有一页时隐藏
- autoHidden: {
- type: Boolean,
- default: function _default() {
- return conf.pager.autoHidden;
- }
- },
- transfer: {
- type: Boolean,
- default: function _default() {
- return conf.pager.transfer;
- }
- },
- // 自定义图标
- iconPrevPage: String,
- iconJumpPrev: String,
- iconJumpNext: String,
- iconNextPage: String,
- iconJumpMore: String
- },
- inject: {
- $xegrid: {
- default: null
- }
- },
- computed: {
- vSize: function vSize() {
- return this.size || this.$parent.size || this.$parent.vSize;
- },
- isSizes: function isSizes() {
- return this.layouts.some(function (name) {
- return name === 'Sizes';
- });
- },
- pageCount: function pageCount() {
- return this.getPageCount(this.total, this.pageSize);
- },
- numList: function numList() {
- var len = this.pageCount > this.pagerCount ? this.pagerCount - 2 : this.pagerCount;
- var rest = [];
- for (var index = 0; index < len; index++) {
- rest.push(index);
- }
- return rest;
- },
- offsetNumber: function offsetNumber() {
- return Math.floor((this.pagerCount - 2) / 2);
- },
- sizeList: function sizeList() {
- return this.pageSizes.map(function (item) {
- if (ctor_amd_xe_utils_default.a.isNumber(item)) {
- return {
- value: item,
- label: "".concat(conf.i18n('vxe.pager.pagesize', [item]))
- };
- }
- return _objectSpread2({
- value: '',
- label: ''
- }, item);
- });
- }
- },
- render: function render(h) {
- var _this = this,
- _ref;
- var $scopedSlots = this.$scopedSlots,
- $xegrid = this.$xegrid,
- vSize = this.vSize,
- align = this.align;
- var childNodes = [];
- if ($scopedSlots.left) {
- childNodes.push(h('span', {
- class: 'vxe-pager--left-wrapper'
- }, [$scopedSlots.left.call(this, {
- $grid: $xegrid
- })]));
- }
- this.layouts.forEach(function (name) {
- childNodes.push(_this["render".concat(name)](h));
- });
- if ($scopedSlots.right) {
- childNodes.push(h('span', {
- class: 'vxe-pager--right-wrapper'
- }, [$scopedSlots.right.call(this, {
- $grid: $xegrid
- })]));
- }
- return h('div', {
- class: ['vxe-pager', (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, "align--".concat(align), align), _defineProperty(_ref, 'is--border', this.border), _defineProperty(_ref, 'is--background', this.background), _defineProperty(_ref, 'is--perfect', this.perfect), _defineProperty(_ref, 'is--hidden', this.autoHidden && this.pageCount === 1), _defineProperty(_ref, 'is--loading', this.loading), _ref)]
- }, [h('div', {
- class: 'vxe-pager--wrapper'
- }, childNodes)]);
- },
- methods: {
- // 上一页
- renderPrevPage: function renderPrevPage(h) {
- return h('span', {
- class: ['vxe-pager--prev-btn', {
- 'is--disabled': this.currentPage <= 1
- }],
- attrs: {
- title: conf.i18n('vxe.pager.prevPage')
- },
- on: {
- click: this.prevPage
- }
- }, [h('i', {
- class: ['vxe-pager--btn-icon', this.iconPrevPage || conf.icon.PAGER_PREV_PAGE]
- })]);
- },
- // 向上翻页
- renderPrevJump: function renderPrevJump(h, tagName) {
- return h(tagName || 'span', {
- class: ['vxe-pager--jump-prev', {
- 'is--fixed': !tagName,
- 'is--disabled': this.currentPage <= 1
- }],
- attrs: {
- title: conf.i18n('vxe.pager.prevJump')
- },
- on: {
- click: this.prevJump
- }
- }, [tagName ? h('i', {
- class: ['vxe-pager--jump-more-icon', this.iconJumpMore || conf.icon.PAGER_JUMP_MORE]
- }) : null, h('i', {
- class: ['vxe-pager--jump-icon', this.iconJumpPrev || conf.icon.PAGER_JUMP_PREV]
- })]);
- },
- // number
- renderNumber: function renderNumber(h) {
- return h('ul', {
- class: 'vxe-pager--btn-wrapper'
- }, this.renderPageBtn(h));
- },
- // jumpNumber
- renderJumpNumber: function renderJumpNumber(h) {
- return h('ul', {
- class: 'vxe-pager--btn-wrapper'
- }, this.renderPageBtn(h, true));
- },
- // 向下翻页
- renderNextJump: function renderNextJump(h, tagName) {
- return h(tagName || 'span', {
- class: ['vxe-pager--jump-next', {
- 'is--fixed': !tagName,
- 'is--disabled': this.currentPage >= this.pageCount
- }],
- attrs: {
- title: conf.i18n('vxe.pager.nextJump')
- },
- on: {
- click: this.nextJump
- }
- }, [tagName ? h('i', {
- class: ['vxe-pager--jump-more-icon', this.iconJumpMore || conf.icon.PAGER_JUMP_MORE]
- }) : null, h('i', {
- class: ['vxe-pager--jump-icon', this.iconJumpNext || conf.icon.PAGER_JUMP_NEXT]
- })]);
- },
- // 下一页
- renderNextPage: function renderNextPage(h) {
- return h('span', {
- class: ['vxe-pager--next-btn', {
- 'is--disabled': this.currentPage >= this.pageCount
- }],
- attrs: {
- title: conf.i18n('vxe.pager.nextPage')
- },
- on: {
- click: this.nextPage
- }
- }, [h('i', {
- class: ['vxe-pager--btn-icon', this.iconNextPage || conf.icon.PAGER_NEXT_PAGE]
- })]);
- },
- // sizes
- renderSizes: function renderSizes(h) {
- var _this2 = this;
- return h('vxe-select', {
- class: 'vxe-pager--sizes',
- props: {
- value: this.pageSize,
- placement: 'top',
- transfer: this.transfer,
- options: this.sizeList
- },
- on: {
- change: function change(_ref2) {
- var value = _ref2.value;
- _this2.pageSizeEvent(value);
- }
- }
- });
- },
- // FullJump
- renderFullJump: function renderFullJump(h) {
- return this.renderJump(h, true);
- },
- // Jump
- renderJump: function renderJump(h, isFull) {
- return h('span', {
- class: 'vxe-pager--jump'
- }, [isFull ? h('span', {
- class: 'vxe-pager--goto-text'
- }, conf.i18n('vxe.pager.goto')) : null, h('input', {
- class: 'vxe-pager--goto',
- domProps: {
- value: this.currentPage
- },
- attrs: {
- type: 'text',
- autocomplete: 'off'
- },
- on: {
- keydown: this.jumpKeydownEvent,
- blur: this.triggerJumpEvent
- }
- }), isFull ? h('span', {
- class: 'vxe-pager--classifier-text'
- }, conf.i18n('vxe.pager.pageClassifier')) : null]);
- },
- // PageCount
- renderPageCount: function renderPageCount(h) {
- return h('span', {
- class: 'vxe-pager--count'
- }, [h('span', {
- class: 'vxe-pager--separator'
- }), h('span', this.pageCount)]);
- },
- // total
- renderTotal: function renderTotal(h) {
- return h('span', {
- class: 'vxe-pager--total'
- }, conf.i18n('vxe.pager.total', [this.total]));
- },
- // number
- renderPageBtn: function renderPageBtn(h, showJump) {
- var _this3 = this;
- var numList = this.numList,
- currentPage = this.currentPage,
- pageCount = this.pageCount,
- pagerCount = this.pagerCount,
- offsetNumber = this.offsetNumber;
- var nums = [];
- var isOv = pageCount > pagerCount;
- var isLt = isOv && currentPage > offsetNumber + 1;
- var isGt = isOv && currentPage < pageCount - offsetNumber;
- var startNumber = 1;
- if (isOv) {
- if (currentPage >= pageCount - offsetNumber) {
- startNumber = Math.max(pageCount - numList.length + 1, 1);
- } else {
- startNumber = Math.max(currentPage - offsetNumber, 1);
- }
- }
- if (showJump && isLt) {
- nums.push(h('li', {
- class: 'vxe-pager--num-btn',
- on: {
- click: function click() {
- return _this3.jumpPage(1);
- }
- }
- }, 1), this.renderPrevJump(h, 'li'));
- }
- numList.forEach(function (item, index) {
- var number = startNumber + index;
- if (number <= pageCount) {
- nums.push(h('li', {
- class: ['vxe-pager--num-btn', {
- 'is--active': currentPage === number
- }],
- on: {
- click: function click() {
- return _this3.jumpPage(number);
- }
- },
- key: number
- }, number));
- }
- });
- if (showJump && isGt) {
- nums.push(this.renderNextJump(h, 'li'), h('li', {
- class: 'vxe-pager--num-btn',
- on: {
- click: function click() {
- return _this3.jumpPage(pageCount);
- }
- }
- }, pageCount));
- }
- return nums;
- },
- getPageCount: function getPageCount(total, size) {
- return Math.max(Math.ceil(total / size), 1);
- },
- prevPage: function prevPage() {
- var currentPage = this.currentPage,
- pageCount = this.pageCount;
- if (currentPage > 1) {
- this.jumpPage(Math.min(pageCount, Math.max(currentPage - 1, 1)));
- }
- },
- nextPage: function nextPage() {
- var currentPage = this.currentPage,
- pageCount = this.pageCount;
- if (currentPage < pageCount) {
- this.jumpPage(Math.min(pageCount, currentPage + 1));
- }
- },
- prevJump: function prevJump() {
- this.jumpPage(Math.max(this.currentPage - this.numList.length, 1));
- },
- nextJump: function nextJump() {
- this.jumpPage(Math.min(this.currentPage + this.numList.length, this.pageCount));
- },
- jumpPage: function jumpPage(currentPage) {
- if (currentPage !== this.currentPage) {
- this.$emit('update:currentPage', currentPage);
- if (this.$listeners['current-change']) {
- UtilTools.warn('vxe.error.delEvent', ['current-change', 'page-change']);
- this.$emit('current-change', currentPage);
- }
- this.$emit('page-change', {
- type: 'current',
- pageSize: this.pageSize,
- currentPage: currentPage,
- $event: {
- type: 'current'
- }
- });
- }
- },
- pageSizeEvent: function pageSizeEvent(pageSize) {
- this.changePageSize(pageSize);
- },
- changePageSize: function changePageSize(pageSize) {
- if (pageSize !== this.pageSize) {
- this.$emit('update:pageSize', pageSize);
- if (this.$listeners['size-change']) {
- UtilTools.warn('vxe.error.delEvent', ['size-change', 'page-change']);
- this.$emit('size-change', pageSize);
- }
- this.$emit('page-change', {
- type: 'size',
- pageSize: pageSize,
- currentPage: Math.min(this.currentPage, this.getPageCount(this.total, pageSize)),
- $event: {
- type: 'size'
- }
- });
- }
- },
- jumpKeydownEvent: function jumpKeydownEvent(evnt) {
- if (evnt.keyCode === 13) {
- this.triggerJumpEvent(evnt);
- } else if (evnt.keyCode === 38) {
- evnt.preventDefault();
- this.nextPage();
- } else if (evnt.keyCode === 40) {
- evnt.preventDefault();
- this.prevPage();
- }
- },
- triggerJumpEvent: function triggerJumpEvent(evnt) {
- var value = ctor_amd_xe_utils_default.a.toNumber(evnt.target.value);
- var current = value <= 0 ? 1 : value >= this.pageCount ? this.pageCount : value;
- evnt.target.value = current;
- this.jumpPage(current);
- }
- }
- });
- // CONCATENATED MODULE: ./packages/pager/index.js
- pager.install = function (Vue) {
- Vue.component(pager.name, pager);
- };
- var Pager = pager;
- /* harmony default export */ var packages_pager = (pager);
- // CONCATENATED MODULE: ./packages/checkbox/src/checkbox.js
- /* harmony default export */ var src_checkbox = ({
- name: 'VxeCheckbox',
- props: {
- value: [String, Number, Boolean],
- label: [String, Number],
- indeterminate: Boolean,
- title: [String, Number],
- content: [String, Number],
- checkedValue: {
- type: [String, Number, Boolean],
- default: true
- },
- uncheckedValue: {
- type: [String, Number, Boolean],
- default: false
- },
- disabled: Boolean,
- size: {
- type: String,
- default: function _default() {
- return conf.checkbox.size || conf.size;
- }
- }
- },
- inject: {
- $xegroup: {
- default: null
- }
- },
- computed: {
- vSize: function vSize() {
- return this.size || this.$parent.size || this.$parent.vSize;
- },
- isGroup: function isGroup() {
- return this.$xegroup;
- },
- isDisabled: function isDisabled() {
- return this.disabled || this.isGroup && this.$xegroup.disabled;
- }
- },
- render: function render(h) {
- var _ref,
- _this = this;
- var $slots = this.$slots,
- $xegroup = this.$xegroup,
- isGroup = this.isGroup,
- isDisabled = this.isDisabled,
- title = this.title,
- vSize = this.vSize,
- indeterminate = this.indeterminate,
- value = this.value,
- label = this.label,
- content = this.content,
- checkedValue = this.checkedValue,
- uncheckedValue = this.uncheckedValue;
- var attrs = {};
- if (title) {
- attrs.title = title;
- }
- return h('label', {
- class: ['vxe-checkbox', (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, 'is--indeterminate', indeterminate), _defineProperty(_ref, 'is--disabled', isDisabled), _ref)],
- attrs: attrs
- }, [h('input', {
- class: 'vxe-checkbox--input',
- attrs: {
- type: 'checkbox',
- disabled: isDisabled
- },
- domProps: {
- checked: isGroup ? $xegroup.value && $xegroup.value.some(function (item) {
- return item === label;
- }) : value === checkedValue
- },
- on: {
- change: function change(evnt) {
- if (!isDisabled) {
- var checked = evnt.target.checked;
- var _value = checked ? checkedValue : uncheckedValue;
- var params = {
- checked: checked,
- value: _value,
- label: label,
- $event: evnt
- };
- if (isGroup) {
- $xegroup.handleChecked(params, evnt);
- } else {
- _this.$emit('input', _value);
- _this.$emit('change', params, evnt);
- }
- }
- }
- }
- }), h('span', {
- class: 'vxe-checkbox--icon'
- }), h('span', {
- class: 'vxe-checkbox--label'
- }, $slots.default || [UtilTools.getFuncText(content)])]);
- }
- });
- // CONCATENATED MODULE: ./packages/checkbox/src/group.js
- /* harmony default export */ var checkbox_src_group = ({
- name: 'VxeCheckboxGroup',
- props: {
- value: Array,
- disabled: Boolean,
- size: {
- type: String,
- default: function _default() {
- return conf.checkbox.size || conf.size;
- }
- }
- },
- provide: function provide() {
- return {
- $xegroup: this
- };
- },
- computed: {
- vSize: function vSize() {
- return this.size || this.$parent.size || this.$parent.vSize;
- }
- },
- render: function render(h) {
- return h('div', {
- class: 'vxe-checkbox-group'
- }, this.$slots.default);
- },
- methods: {
- handleChecked: function handleChecked(params, evnt) {
- var checked = params.checked,
- label = params.label;
- var checklist = this.value || [];
- var checkIndex = checklist.indexOf(label);
- if (checked) {
- if (checkIndex === -1) {
- checklist.push(label);
- }
- } else {
- checklist.splice(checkIndex, 1);
- }
- this.$emit('input', checklist);
- this.$emit('change', Object.assign({
- checklist: checklist
- }, params), evnt);
- }
- }
- });
- // CONCATENATED MODULE: ./packages/checkbox/index.js
- src_checkbox.install = function (Vue) {
- Vue.component(src_checkbox.name, src_checkbox);
- Vue.component(checkbox_src_group.name, checkbox_src_group);
- };
- var Checkbox = src_checkbox;
- /* harmony default export */ var packages_checkbox = (src_checkbox);
- // CONCATENATED MODULE: ./packages/radio/src/radio.js
- /* harmony default export */ var src_radio = ({
- name: 'VxeRadio',
- props: {
- value: [String, Number],
- label: [String, Number],
- title: [String, Number],
- content: [String, Number],
- disabled: Boolean,
- name: String,
- size: {
- type: String,
- default: function _default() {
- return conf.radio.size || conf.size;
- }
- }
- },
- inject: {
- $xegroup: {
- default: null
- }
- },
- computed: {
- vSize: function vSize() {
- return this.size || this.$parent.size || this.$parent.vSize;
- },
- isGroup: function isGroup() {
- return this.$xegroup;
- },
- isDisabled: function isDisabled() {
- return this.disabled || this.isGroup && this.$xegroup.disabled;
- }
- },
- render: function render(h) {
- var _ref,
- _this = this;
- var $slots = this.$slots,
- $xegroup = this.$xegroup,
- isGroup = this.isGroup,
- isDisabled = this.isDisabled,
- title = this.title,
- vSize = this.vSize,
- value = this.value,
- label = this.label,
- name = this.name,
- content = this.content;
- var attrs = {};
- if (title) {
- attrs.title = title;
- }
- return h('label', {
- class: ['vxe-radio', (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, 'is--disabled', isDisabled), _ref)],
- attrs: attrs
- }, [h('input', {
- class: 'vxe-radio--input',
- attrs: {
- type: 'radio',
- name: isGroup ? $xegroup.name : name,
- disabled: isDisabled
- },
- domProps: {
- checked: isGroup ? $xegroup.value === label : value === label
- },
- on: {
- change: function change(evnt) {
- if (!isDisabled) {
- var params = {
- label: label,
- $event: evnt
- };
- if (isGroup) {
- $xegroup.handleChecked(params, evnt);
- } else {
- _this.$emit('input', label);
- _this.$emit('change', params, evnt);
- }
- }
- }
- }
- }), h('span', {
- class: 'vxe-radio--icon'
- }), h('span', {
- class: 'vxe-radio--label'
- }, $slots.default || [UtilTools.getFuncText(content)])]);
- }
- });
- // CONCATENATED MODULE: ./packages/radio/src/button.js
- /* harmony default export */ var src_button = ({
- name: 'VxeRadioButton',
- props: {
- label: [String, Number],
- title: [String, Number],
- content: [String, Number],
- disabled: Boolean,
- size: {
- type: String,
- default: function _default() {
- return conf.radio.size || conf.size;
- }
- }
- },
- inject: {
- $xegroup: {
- default: null
- }
- },
- computed: {
- vSize: function vSize() {
- return this.size || this.$parent.size || this.$parent.vSize;
- },
- isGroup: function isGroup() {
- return this.$xegroup;
- },
- isDisabled: function isDisabled() {
- return this.disabled || this.isGroup && this.$xegroup.disabled;
- }
- },
- render: function render(h) {
- var _ref;
- var $slots = this.$slots,
- $xegroup = this.$xegroup,
- isGroup = this.isGroup,
- isDisabled = this.isDisabled,
- title = this.title,
- vSize = this.vSize,
- label = this.label,
- content = this.content;
- var attrs = {};
- if (title) {
- attrs.title = title;
- }
- return h('label', {
- class: ['vxe-radio', 'vxe-radio-button', (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, 'is--disabled', isDisabled), _ref)],
- attrs: attrs
- }, [h('input', {
- class: 'vxe-radio--input',
- attrs: {
- type: 'radio',
- name: isGroup ? $xegroup.name : null,
- disabled: isDisabled
- },
- domProps: {
- checked: isGroup && $xegroup.value === label
- },
- on: {
- change: function change(evnt) {
- if (!isDisabled) {
- if (isGroup) {
- $xegroup.handleChecked({
- label: label,
- $event: evnt
- });
- }
- }
- }
- }
- }), h('span', {
- class: 'vxe-radio--label'
- }, $slots.default || [UtilTools.getFuncText(content)])]);
- }
- });
- // CONCATENATED MODULE: ./packages/radio/src/group.js
- /* harmony default export */ var radio_src_group = ({
- name: 'VxeRadioGroup',
- props: {
- value: [String, Number],
- disabled: Boolean,
- size: {
- type: String,
- default: function _default() {
- return conf.radio.size || conf.size;
- }
- }
- },
- provide: function provide() {
- return {
- $xegroup: this
- };
- },
- computed: {
- vSize: function vSize() {
- return this.size || this.$parent.size || this.$parent.vSize;
- }
- },
- data: function data() {
- return {
- name: ctor_amd_xe_utils_default.a.uniqueId('xegroup_')
- };
- },
- render: function render(h) {
- return h('div', {
- class: 'vxe-radio-group'
- }, this.$slots.default);
- },
- methods: {
- handleChecked: function handleChecked(params, evnt) {
- this.$emit('input', params.label);
- this.$emit('change', params, evnt);
- }
- }
- });
- // CONCATENATED MODULE: ./packages/radio/index.js
- src_radio.install = function (Vue) {
- Vue.component(src_radio.name, src_radio);
- Vue.component(src_button.name, src_button);
- Vue.component(radio_src_group.name, radio_src_group);
- };
- var Radio = src_radio;
- /* harmony default export */ var packages_radio = (src_radio);
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.pad-start.js
- var es_string_pad_start = __webpack_require__("4d90");
- // CONCATENATED MODULE: ./packages/input/src/input.js
- var input_browse = DomTools.browse;
- var input_wheelName = input_browse.firefox ? 'DOMMouseScroll' : 'mousewheel';
- var yearSize = 20;
- var monthSize = 20;
- function toStringTime(str) {
- if (str) {
- var rest = new Date();
- var h, m, s;
- if (ctor_amd_xe_utils_default.a.isDate(str)) {
- h = str.getHours();
- m = str.getMinutes();
- s = str.getSeconds();
- } else {
- str = ctor_amd_xe_utils_default.a.toString(str);
- var parses = str.match(/^(\d{1,2})(:(\d{1,2}))?(:(\d{1,2}))?/);
- if (parses) {
- h = parses[1];
- m = parses[3];
- s = parses[5];
- }
- }
- rest.setHours(h || 0);
- rest.setMinutes(m || 0);
- rest.setSeconds(s || 0);
- return rest;
- }
- return new Date('');
- }
- function toFloatValueFixed(inputValue, digitsValue) {
- if (/^-/.test('' + inputValue)) {
- return ctor_amd_xe_utils_default.a.toFixed(ctor_amd_xe_utils_default.a.ceil(inputValue, digitsValue), digitsValue);
- }
- return ctor_amd_xe_utils_default.a.toFixed(ctor_amd_xe_utils_default.a.floor(inputValue, digitsValue), digitsValue);
- }
- function renderDefaultInput(h, _vm) {
- var inpAttrs = _vm.inpAttrs,
- inpEvents = _vm.inpEvents,
- value = _vm.value;
- return h('input', {
- ref: 'input',
- class: 'vxe-input--inner',
- domProps: {
- value: value
- },
- attrs: inpAttrs,
- on: inpEvents
- });
- }
- function renderDateInput(h, _vm) {
- var inpAttrs = _vm.inpAttrs,
- inpEvents = _vm.inpEvents,
- inputValue = _vm.inputValue;
- return h('input', {
- ref: 'input',
- class: 'vxe-input--inner',
- domProps: {
- value: inputValue
- },
- attrs: inpAttrs,
- on: inpEvents
- });
- }
- function renderDateLabel(h, _vm, item, label) {
- var festivalMethod = _vm.festivalMethod;
- if (festivalMethod) {
- var festivalRest = festivalMethod(_objectSpread2({
- $input: _vm,
- type: _vm.datePanelType,
- viewType: _vm.datePanelType
- }, item));
- var festivalItem = festivalRest ? ctor_amd_xe_utils_default.a.isString(festivalRest) ? {
- label: festivalRest
- } : festivalRest : {};
- var extraItem = festivalItem.extra ? ctor_amd_xe_utils_default.a.isString(festivalItem.extra) ? {
- label: festivalItem.extra
- } : festivalItem.extra : null;
- var labels = [h('span', {
- class: ['vxe-input--date-label', {
- 'is-notice': festivalItem.notice
- }]
- }, extraItem && extraItem.label ? [h('span', label), h('span', {
- class: ['vxe-input--date-label--extra', extraItem.important ? 'is-important' : '', extraItem.className],
- style: extraItem.style
- }, ctor_amd_xe_utils_default.a.toString(extraItem.label))] : label)];
- var festivalLabel = festivalItem.label;
- if (festivalLabel) {
- // 默认最多支持3个节日重叠
- var festivalLabels = ctor_amd_xe_utils_default.a.toString(festivalLabel).split(',');
- labels.push(h('span', {
- class: ['vxe-input--date-festival', festivalItem.important ? 'is-important' : '', festivalItem.className],
- style: festivalItem.style
- }, [festivalLabels.length > 1 ? h('span', {
- class: ['vxe-input--date-festival--overlap', "overlap--".concat(festivalLabels.length)]
- }, festivalLabels.map(function (label) {
- return h('span', label.substring(0, 3));
- })) : h('span', {
- class: 'vxe-input--date-festival--label'
- }, festivalLabels[0].substring(0, 3))]));
- }
- return labels;
- }
- return label;
- }
- function isDateDisabled(_vm, item) {
- var disabledMethod = _vm.disabledMethod || _vm.dateOpts.disabledMethod;
- return disabledMethod && disabledMethod({
- $input: _vm,
- type: _vm.datePanelType,
- viewType: _vm.datePanelType,
- date: item.date
- });
- }
- function renderDateDayTable(h, _vm) {
- var datePanelType = _vm.datePanelType,
- dateValue = _vm.dateValue,
- datePanelValue = _vm.datePanelValue,
- dateHeaders = _vm.dateHeaders,
- dayDatas = _vm.dayDatas;
- var matchFormat = 'yyyy-MM-dd';
- return [h('table', {
- class: "vxe-input--date-".concat(datePanelType, "-view"),
- attrs: {
- cellspacing: 0,
- cellpadding: 0,
- border: 0
- }
- }, [h('thead', [h('tr', dateHeaders.map(function (item) {
- return h('th', item.label);
- }))]), h('tbody', dayDatas.map(function (rows) {
- return h('tr', rows.map(function (item) {
- return h('td', {
- class: {
- 'is--prev': item.isPrev,
- 'is--current': item.isCurrent,
- 'is--now': item.isNow,
- 'is--next': item.isNext,
- 'is--disabled': isDateDisabled(_vm, item),
- 'is--selected': ctor_amd_xe_utils_default.a.isDateSame(dateValue, item.date, matchFormat),
- 'is--hover': ctor_amd_xe_utils_default.a.isDateSame(datePanelValue, item.date, matchFormat)
- },
- on: {
- click: function click() {
- return _vm.dateSelectEvent(item);
- },
- mouseenter: function mouseenter() {
- return _vm.dateMouseenterEvent(item);
- }
- }
- }, renderDateLabel(h, _vm, item, item.label));
- }));
- }))])];
- }
- function renderDateWeekTable(h, _vm) {
- var datePanelType = _vm.datePanelType,
- dateValue = _vm.dateValue,
- datePanelValue = _vm.datePanelValue,
- weekHeaders = _vm.weekHeaders,
- weekDates = _vm.weekDates;
- var matchFormat = 'yyyy-MM-dd';
- return [h('table', {
- class: "vxe-input--date-".concat(datePanelType, "-view"),
- attrs: {
- cellspacing: 0,
- cellpadding: 0,
- border: 0
- }
- }, [h('thead', [h('tr', weekHeaders.map(function (item) {
- return h('th', item.label);
- }))]), h('tbody', weekDates.map(function (rows) {
- var isSelected = rows.some(function (item) {
- return ctor_amd_xe_utils_default.a.isDateSame(dateValue, item.date, matchFormat);
- });
- var isHover = rows.some(function (item) {
- return ctor_amd_xe_utils_default.a.isDateSame(datePanelValue, item.date, matchFormat);
- });
- return h('tr', rows.map(function (item) {
- return h('td', {
- class: {
- 'is--prev': item.isPrev,
- 'is--current': item.isCurrent,
- 'is--now': item.isNow,
- 'is--next': item.isNext,
- 'is--disabled': isDateDisabled(_vm, item),
- 'is--selected': isSelected,
- 'is--hover': isHover
- },
- on: {
- click: function click() {
- return _vm.dateSelectEvent(item);
- },
- mouseenter: function mouseenter() {
- return _vm.dateMouseenterEvent(item);
- }
- }
- }, renderDateLabel(h, _vm, item, item.label));
- }));
- }))])];
- }
- function renderDateMonthTable(h, _vm) {
- var dateValue = _vm.dateValue,
- datePanelType = _vm.datePanelType,
- monthDatas = _vm.monthDatas,
- datePanelValue = _vm.datePanelValue;
- var matchFormat = 'yyyy-MM';
- return [h('table', {
- class: "vxe-input--date-".concat(datePanelType, "-view"),
- attrs: {
- cellspacing: 0,
- cellpadding: 0,
- border: 0
- }
- }, [h('tbody', monthDatas.map(function (rows) {
- return h('tr', rows.map(function (item) {
- return h('td', {
- class: {
- 'is--prev': item.isPrev,
- 'is--current': item.isCurrent,
- 'is--now': item.isNow,
- 'is--next': item.isNext,
- 'is--disabled': isDateDisabled(_vm, item),
- 'is--selected': ctor_amd_xe_utils_default.a.isDateSame(dateValue, item.date, matchFormat),
- 'is--hover': ctor_amd_xe_utils_default.a.isDateSame(datePanelValue, item.date, matchFormat)
- },
- on: {
- click: function click() {
- return _vm.dateSelectEvent(item);
- },
- mouseenter: function mouseenter() {
- return _vm.dateMouseenterEvent(item);
- }
- }
- }, renderDateLabel(h, _vm, item, conf.i18n("vxe.input.date.months.m".concat(item.month))));
- }));
- }))])];
- }
- function renderDateYearTable(h, _vm) {
- var dateValue = _vm.dateValue,
- datePanelType = _vm.datePanelType,
- yearDatas = _vm.yearDatas,
- datePanelValue = _vm.datePanelValue;
- var matchFormat = 'yyyy';
- return [h('table', {
- class: "vxe-input--date-".concat(datePanelType, "-view"),
- attrs: {
- cellspacing: 0,
- cellpadding: 0,
- border: 0
- }
- }, [h('tbody', yearDatas.map(function (rows) {
- return h('tr', rows.map(function (item) {
- return h('td', {
- class: {
- 'is--disabled': isDateDisabled(_vm, item),
- 'is--current': item.isCurrent,
- 'is--now': item.isNow,
- 'is--selected': ctor_amd_xe_utils_default.a.isDateSame(dateValue, item.date, matchFormat),
- 'is--hover': ctor_amd_xe_utils_default.a.isDateSame(datePanelValue, item.date, matchFormat)
- },
- on: {
- click: function click() {
- return _vm.dateSelectEvent(item);
- },
- mouseenter: function mouseenter() {
- return _vm.dateMouseenterEvent(item);
- }
- }
- }, renderDateLabel(h, _vm, item, item.year));
- }));
- }))])];
- }
- function renderDateTable(h, _vm) {
- var datePanelType = _vm.datePanelType;
- switch (datePanelType) {
- case 'week':
- return renderDateWeekTable(h, _vm);
- case 'month':
- return renderDateMonthTable(h, _vm);
- case 'year':
- return renderDateYearTable(h, _vm);
- }
- return renderDateDayTable(h, _vm);
- }
- function renderDatePanel(h, _vm) {
- var datePanelType = _vm.datePanelType,
- selectDatePanelLabel = _vm.selectDatePanelLabel,
- isDisabledPrevDateBtn = _vm.isDisabledPrevDateBtn,
- isDisabledNextDateBtn = _vm.isDisabledNextDateBtn;
- return [h('div', {
- class: 'vxe-input--date-picker-header'
- }, [h('div', {
- class: 'vxe-input--date-picker-type-wrapper'
- }, [datePanelType === 'year' ? h('span', {
- class: 'vxe-input--date-picker-label'
- }, selectDatePanelLabel) : h('span', {
- class: 'vxe-input--date-picker-btn',
- on: {
- click: _vm.dateToggleTypeEvent
- }
- }, selectDatePanelLabel)]), h('div', {
- class: 'vxe-input--date-picker-btn-wrapper'
- }, [h('span', {
- class: ['vxe-input--date-picker-btn vxe-input--date-picker-prev-btn', {
- 'is--disabled': isDisabledPrevDateBtn
- }],
- on: {
- click: _vm.datePrevEvent
- }
- }, [h('i', {
- class: 'vxe-icon--caret-left'
- })]), h('span', {
- class: 'vxe-input--date-picker-btn vxe-input--date-picker-current-btn',
- on: {
- click: _vm.dateTodayMonthEvent
- }
- }, [h('i', {
- class: 'vxe-icon--dot'
- })]), h('span', {
- class: ['vxe-input--date-picker-btn vxe-input--date-picker-next-btn', {
- 'is--disabled': isDisabledNextDateBtn
- }],
- on: {
- click: _vm.dateNextEvent
- }
- }, [h('i', {
- class: 'vxe-icon--caret-right'
- })])])]), h('div', {
- class: 'vxe-input--date-picker-body'
- }, renderDateTable(h, _vm))];
- }
- function renderTimePanel(h, _vm) {
- var dateTimeLabel = _vm.dateTimeLabel,
- datetimePanelValue = _vm.datetimePanelValue,
- hourList = _vm.hourList,
- minuteList = _vm.minuteList,
- secondList = _vm.secondList;
- return [h('div', {
- class: 'vxe-input--time-picker-header'
- }, [h('span', {
- class: 'vxe-input--time-picker-title'
- }, dateTimeLabel), h('button', {
- class: 'vxe-input--time-picker-confirm',
- attrs: {
- type: 'button'
- },
- on: {
- click: _vm.dateConfirmEvent
- }
- }, conf.i18n('vxe.button.confirm'))]), h('div', {
- ref: 'timeBody',
- class: 'vxe-input--time-picker-body'
- }, [h('ul', {
- class: 'vxe-input--time-picker-hour-list'
- }, hourList.map(function (item, index) {
- return h('li', {
- key: index,
- class: {
- 'is--selected': datetimePanelValue && datetimePanelValue.getHours() === item.value
- },
- on: {
- click: function click(evnt) {
- return _vm.dateHourEvent(evnt, item);
- }
- }
- }, item.label);
- })), h('ul', {
- class: 'vxe-input--time-picker-minute-list'
- }, minuteList.map(function (item, index) {
- return h('li', {
- key: index,
- class: {
- 'is--selected': datetimePanelValue && datetimePanelValue.getMinutes() === item.value
- },
- on: {
- click: function click(evnt) {
- return _vm.dateMinuteEvent(evnt, item);
- }
- }
- }, item.label);
- })), h('ul', {
- class: 'vxe-input--time-picker-second-list'
- }, secondList.map(function (item, index) {
- return h('li', {
- key: index,
- class: {
- 'is--selected': datetimePanelValue && datetimePanelValue.getSeconds() === item.value
- },
- on: {
- click: function click(evnt) {
- return _vm.dateSecondEvent(evnt, item);
- }
- }
- }, item.label);
- }))])];
- }
- function renderPanel(h, _vm) {
- var type = _vm.type,
- vSize = _vm.vSize,
- isDatePicker = _vm.isDatePicker,
- transfer = _vm.transfer,
- animatVisible = _vm.animatVisible,
- visiblePanel = _vm.visiblePanel,
- panelPlacement = _vm.panelPlacement,
- panelStyle = _vm.panelStyle;
- var renders = [];
- if (isDatePicker) {
- var _ref;
- if (type === 'datetime') {
- renders.push(h('div', {
- class: 'vxe-input--panel-layout-wrapper'
- }, [h('div', {
- class: 'vxe-input--panel-left-wrapper'
- }, renderDatePanel(h, _vm)), h('div', {
- class: 'vxe-input--panel-right-wrapper'
- }, renderTimePanel(h, _vm))]));
- } else if (type === 'time') {
- renders.push(h('div', {
- class: 'vxe-input--panel-wrapper'
- }, renderTimePanel(h, _vm)));
- } else {
- renders.push(h('div', {
- class: 'vxe-input--panel-wrapper'
- }, renderDatePanel(h, _vm)));
- }
- return h('div', {
- ref: 'panel',
- 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)],
- attrs: {
- 'data-placement': panelPlacement
- },
- style: panelStyle
- }, renders);
- }
- return null;
- }
- function renderNumberIcon(h, _vm) {
- return h('span', {
- class: 'vxe-input--number-suffix'
- }, [h('span', {
- class: 'vxe-input--number-prev is--prev',
- on: {
- mousedown: _vm.numberMousedownEvent,
- mouseup: _vm.numberStopDown,
- mouseleave: _vm.numberStopDown
- }
- }, [h('i', {
- class: ['vxe-input--number-prev-icon', conf.icon.INPUT_PREV_NUM]
- })]), h('span', {
- class: 'vxe-input--number-next is--next',
- on: {
- mousedown: _vm.numberMousedownEvent,
- mouseup: _vm.numberStopDown,
- mouseleave: _vm.numberStopDown
- }
- }, [h('i', {
- class: ['vxe-input--number-next-icon', conf.icon.INPUT_NEXT_NUM]
- })])]);
- }
- function renderDatePickerIcon(h, _vm) {
- return h('span', {
- class: 'vxe-input--date-picker-suffix',
- on: {
- click: _vm.datePickerOpenEvent
- }
- }, [h('i', {
- class: ['vxe-input--date-picker-icon', conf.icon.INPUT_DATE]
- })]);
- }
- function renderSearchIcon(h, _vm) {
- return h('span', {
- class: 'vxe-input--search-suffix',
- on: {
- click: _vm.searchEvent
- }
- }, [h('i', {
- class: ['vxe-input--search-icon', conf.icon.INPUT_SEARCH]
- })]);
- }
- function renderPasswordIcon(h, _vm) {
- var showPwd = _vm.showPwd;
- return h('span', {
- class: 'vxe-input--password-suffix',
- on: {
- click: _vm.passwordToggleEvent
- }
- }, [h('i', {
- class: ['vxe-input--password-icon', showPwd ? conf.icon.INPUT_SHOW_PWD : conf.icon.INPUT_PWD]
- })]);
- }
- function rendePrefixIcon(h, _vm) {
- var $scopedSlots = _vm.$scopedSlots,
- prefixIcon = _vm.prefixIcon;
- var icons = [];
- if ($scopedSlots.prefix) {
- icons.push(h('span', {
- class: 'vxe-input--prefix-icon'
- }, $scopedSlots.prefix.call(this, {}, h)));
- } else if (prefixIcon) {
- icons.push(h('i', {
- class: ['vxe-input--prefix-icon', prefixIcon]
- }));
- }
- return icons.length ? h('span', {
- class: 'vxe-input--prefix',
- on: {
- click: _vm.clickPrefixEvent
- }
- }, icons) : null;
- }
- function renderSuffixIcon(h, _vm) {
- var $scopedSlots = _vm.$scopedSlots,
- value = _vm.value,
- isClearable = _vm.isClearable,
- disabled = _vm.disabled,
- suffixIcon = _vm.suffixIcon;
- var icons = [];
- if ($scopedSlots.suffix) {
- icons.push(h('span', {
- class: 'vxe-input--suffix-icon'
- }, $scopedSlots.suffix.call(this, {}, h)));
- } else if (suffixIcon) {
- icons.push(h('i', {
- class: ['vxe-input--suffix-icon', suffixIcon]
- }));
- }
- if (isClearable) {
- icons.push(h('i', {
- class: ['vxe-input--clear-icon', conf.icon.INPUT_CLEAR]
- }));
- }
- return icons.length ? h('span', {
- class: ['vxe-input--suffix', {
- 'is--clear': isClearable && !disabled && !(value === '' || ctor_amd_xe_utils_default.a.eqNull(value))
- }],
- on: {
- click: _vm.clickSuffixEvent
- }
- }, icons) : null;
- }
- function renderExtraSuffixIcon(h, _vm) {
- var controls = _vm.controls,
- isPassword = _vm.isPassword,
- isNumber = _vm.isNumber,
- isDatePicker = _vm.isDatePicker,
- isSearch = _vm.isSearch;
- var icons;
- if (isPassword) {
- icons = renderPasswordIcon(h, _vm);
- } else if (isNumber) {
- if (controls) {
- icons = renderNumberIcon(h, _vm);
- }
- } else if (isDatePicker) {
- icons = renderDatePickerIcon(h, _vm);
- } else if (isSearch) {
- icons = renderSearchIcon(h, _vm);
- }
- return icons ? h('span', {
- class: 'vxe-input--extra-suffix'
- }, [icons]) : null;
- }
- /* harmony default export */ var input = ({
- name: 'VxeInput',
- props: {
- value: [String, Number, Date],
- name: String,
- type: {
- type: String,
- default: 'text'
- },
- clearable: {
- type: Boolean,
- default: function _default() {
- return conf.input.clearable;
- }
- },
- readonly: Boolean,
- disabled: Boolean,
- placeholder: String,
- maxlength: [String, Number],
- autocomplete: {
- type: String,
- default: 'off'
- },
- align: String,
- form: String,
- size: {
- type: String,
- default: function _default() {
- return conf.input.size || conf.size;
- }
- },
- // number、integer、float
- min: {
- type: [String, Number],
- default: null
- },
- max: {
- type: [String, Number],
- default: null
- },
- step: [String, Number],
- // number、integer、float、password
- controls: {
- type: Boolean,
- default: function _default() {
- return conf.input.controls;
- }
- },
- // float
- digits: {
- type: [String, Number],
- default: function _default() {
- return conf.input.digits;
- }
- },
- // date、week、month、year
- dateConfig: Object,
- minDate: {
- type: [String, Number, Date],
- default: function _default() {
- return conf.input.minDate;
- }
- },
- maxDate: {
- type: [String, Number, Date],
- default: function _default() {
- return conf.input.maxDate;
- }
- },
- // 已废弃 startWeek,被 startDay 替换
- startWeek: Number,
- startDay: {
- type: [String, Number],
- default: function _default() {
- return conf.input.startDay;
- }
- },
- labelFormat: {
- type: String,
- default: function _default() {
- return conf.input.labelFormat;
- }
- },
- parseFormat: {
- type: String,
- default: function _default() {
- return conf.input.parseFormat;
- }
- },
- valueFormat: {
- type: String,
- default: function _default() {
- return conf.input.valueFormat;
- }
- },
- editable: {
- type: Boolean,
- default: true
- },
- festivalMethod: {
- type: Function,
- default: function _default() {
- return conf.input.festivalMethod;
- }
- },
- disabledMethod: {
- type: Function,
- default: function _default() {
- return conf.input.disabledMethod;
- }
- },
- prefixIcon: String,
- suffixIcon: String,
- placement: String,
- transfer: {
- type: Boolean,
- default: function _default() {
- return conf.input.transfer;
- }
- }
- },
- data: function data() {
- return {
- panelIndex: 0,
- showPwd: false,
- visiblePanel: false,
- animatVisible: false,
- panelStyle: null,
- panelPlacement: null,
- isActivated: false,
- inputValue: '',
- datetimePanelValue: null,
- datePanelValue: null,
- datePanelLabel: '',
- datePanelType: 'day',
- selectMonth: null,
- currentDate: null
- };
- },
- computed: {
- vSize: function vSize() {
- return this.size || this.$parent.size || this.$parent.vSize;
- },
- isNumber: function isNumber() {
- return ['number', 'integer', 'float'].indexOf(this.type) > -1;
- },
- isDatePicker: function isDatePicker() {
- return this.hasTime || ['date', 'week', 'month', 'year'].indexOf(this.type) > -1;
- },
- hasTime: function hasTime() {
- var type = this.type;
- return type === 'time' || type === 'datetime';
- },
- isPassword: function isPassword() {
- return this.type === 'password';
- },
- isSearch: function isSearch() {
- return this.type === 'search';
- },
- stepValue: function stepValue() {
- var type = this.type,
- step = this.step;
- if (type === 'integer') {
- return ctor_amd_xe_utils_default.a.toInteger(step) || 1;
- } else if (type === 'float') {
- return ctor_amd_xe_utils_default.a.toNumber(step) || 1 / Math.pow(10, this.digitsValue);
- }
- return ctor_amd_xe_utils_default.a.toNumber(step) || 1;
- },
- digitsValue: function digitsValue() {
- return ctor_amd_xe_utils_default.a.toInteger(this.digits) || 1;
- },
- isClearable: function isClearable() {
- return this.clearable && (this.isPassword || this.isNumber || this.isDatePicker || this.type === 'text' || this.type === 'search');
- },
- isDisabledPrevDateBtn: function isDisabledPrevDateBtn() {
- var selectMonth = this.selectMonth,
- dateMinTime = this.dateMinTime;
- if (selectMonth) {
- return selectMonth <= dateMinTime;
- }
- return false;
- },
- isDisabledNextDateBtn: function isDisabledNextDateBtn() {
- var selectMonth = this.selectMonth,
- dateMaxTime = this.dateMaxTime;
- if (selectMonth) {
- return selectMonth >= dateMaxTime;
- }
- return false;
- },
- dateMinTime: function dateMinTime() {
- return this.minDate ? ctor_amd_xe_utils_default.a.toStringDate(this.minDate) : null;
- },
- dateMaxTime: function dateMaxTime() {
- return this.maxDate ? ctor_amd_xe_utils_default.a.toStringDate(this.maxDate) : null;
- },
- dateValue: function dateValue() {
- var value = this.value,
- isDatePicker = this.isDatePicker,
- type = this.type,
- dateValueFormat = this.dateValueFormat;
- var val = null;
- if (value && isDatePicker) {
- var date;
- if (type === 'time') {
- date = toStringTime(value);
- } else {
- date = ctor_amd_xe_utils_default.a.toStringDate(value, dateValueFormat);
- }
- if (ctor_amd_xe_utils_default.a.isValidDate(date)) {
- val = date;
- }
- }
- return val;
- },
- dateTimeLabel: function dateTimeLabel() {
- var datetimePanelValue = this.datetimePanelValue;
- if (datetimePanelValue) {
- return ctor_amd_xe_utils_default.a.toDateString(datetimePanelValue, 'HH:mm:ss');
- }
- return '';
- },
- hmsTime: function hmsTime() {
- var dateValue = this.dateValue;
- return dateValue && this.hasTime ? (dateValue.getHours() * 3600 + dateValue.getMinutes() * 60 + dateValue.getSeconds()) * 1000 : 0;
- },
- dateLabelFormat: function dateLabelFormat() {
- if (this.isDatePicker) {
- return this.labelFormat || this.dateOpts.labelFormat || conf.i18n("vxe.input.date.labelFormat.".concat(this.type));
- }
- return null;
- },
- dateValueFormat: function dateValueFormat() {
- var type = this.type;
- return type === 'time' ? 'HH:mm:ss' : this.valueFormat || this.dateOpts.valueFormat || (type === 'datetime' ? 'yyyy-MM-dd HH:mm:ss' : 'yyyy-MM-dd');
- },
- selectDatePanelLabel: function selectDatePanelLabel() {
- if (this.isDatePicker) {
- var datePanelType = this.datePanelType,
- selectMonth = this.selectMonth,
- yearList = this.yearList;
- var year = '';
- var month;
- if (selectMonth) {
- year = selectMonth.getFullYear();
- month = selectMonth.getMonth() + 1;
- }
- if (datePanelType === 'month') {
- return conf.i18n('vxe.input.date.monthLabel', [year]);
- } else if (datePanelType === 'year') {
- return yearList.length ? "".concat(yearList[0].year, " - ").concat(yearList[yearList.length - 1].year) : '';
- }
- return conf.i18n('vxe.input.date.dayLabel', [year, month ? conf.i18n("vxe.input.date.m".concat(month)) : '-']);
- }
- return '';
- },
- weekDatas: function weekDatas() {
- var weeks = [];
- if (this.isDatePicker) {
- var startDay = this.startDay,
- startWeek = this.startWeek;
- var sWeek = ctor_amd_xe_utils_default.a.toNumber(ctor_amd_xe_utils_default.a.isNumber(startDay) || ctor_amd_xe_utils_default.a.isString(startDay) ? startDay : ctor_amd_xe_utils_default.a.isNumber(startWeek) ? startWeek : this.dateOpts.startWeek);
- weeks.push(sWeek);
- for (var index = 0; index < 6; index++) {
- if (sWeek >= 6) {
- sWeek = 0;
- } else {
- sWeek++;
- }
- weeks.push(sWeek);
- }
- }
- return weeks;
- },
- dateHeaders: function dateHeaders() {
- if (this.isDatePicker) {
- return this.weekDatas.map(function (day) {
- return {
- value: day,
- label: conf.i18n("vxe.input.date.weeks.w".concat(day))
- };
- });
- }
- return [];
- },
- weekHeaders: function weekHeaders() {
- if (this.isDatePicker) {
- return [{
- label: conf.i18n('vxe.input.date.weeks.w')
- }].concat(this.dateHeaders);
- }
- return [];
- },
- yearList: function yearList() {
- var selectMonth = this.selectMonth,
- currentDate = this.currentDate;
- var months = [];
- if (selectMonth && currentDate) {
- var currFullYear = currentDate.getFullYear();
- var startYear = new Date(('' + selectMonth.getFullYear()).replace(/\d{1}$/, '0'), 0, 1);
- for (var index = -10; index < yearSize - 10; index++) {
- var date = ctor_amd_xe_utils_default.a.getWhatYear(startYear, index, 'first');
- var itemFullYear = date.getFullYear();
- months.push({
- date: date,
- isCurrent: true,
- isNow: currFullYear === itemFullYear,
- year: itemFullYear
- });
- }
- }
- return months;
- },
- yearDatas: function yearDatas() {
- return ctor_amd_xe_utils_default.a.chunk(this.yearList, 4);
- },
- monthList: function monthList() {
- var selectMonth = this.selectMonth,
- currentDate = this.currentDate;
- var months = [];
- if (selectMonth && currentDate) {
- var currFullYear = currentDate.getFullYear();
- var currMonth = currentDate.getMonth();
- var selFullYear = ctor_amd_xe_utils_default.a.getWhatYear(selectMonth, 0, 'first').getFullYear();
- for (var index = -4; index < monthSize - 4; index++) {
- var date = ctor_amd_xe_utils_default.a.getWhatYear(selectMonth, 0, index);
- var itemFullYear = date.getFullYear();
- var itemMonth = date.getMonth();
- var isPrev = itemFullYear < selFullYear;
- months.push({
- date: date,
- isPrev: isPrev,
- isCurrent: itemFullYear === selFullYear,
- isNow: itemFullYear === currFullYear && itemMonth === currMonth,
- isNext: !isPrev && itemFullYear > selFullYear,
- month: itemMonth
- });
- }
- }
- return months;
- },
- monthDatas: function monthDatas() {
- return ctor_amd_xe_utils_default.a.chunk(this.monthList, 4);
- },
- dayList: function dayList() {
- var weekDatas = this.weekDatas,
- selectMonth = this.selectMonth,
- currentDate = this.currentDate,
- hmsTime = this.hmsTime;
- var days = [];
- if (selectMonth && currentDate) {
- var currFullYear = currentDate.getFullYear();
- var currMonth = currentDate.getMonth();
- var currDate = currentDate.getDate();
- var selFullYear = selectMonth.getFullYear();
- var selMonth = selectMonth.getMonth();
- var selDay = selectMonth.getDay();
- var prevOffsetDate = -weekDatas.indexOf(selDay);
- var startDate = new Date(ctor_amd_xe_utils_default.a.getWhatDay(selectMonth, prevOffsetDate).getTime() + hmsTime);
- for (var index = 0; index < 42; index++) {
- var date = ctor_amd_xe_utils_default.a.getWhatDay(startDate, index);
- var itemFullYear = date.getFullYear();
- var itemMonth = date.getMonth();
- var itemDate = date.getDate();
- var isPrev = date < selectMonth;
- days.push({
- date: date,
- isPrev: isPrev,
- isCurrent: itemFullYear === selFullYear && itemMonth === selMonth,
- isNow: itemFullYear === currFullYear && itemMonth === currMonth && itemDate === currDate,
- isNext: !isPrev && selMonth !== itemMonth,
- label: itemDate
- });
- }
- }
- return days;
- },
- dayDatas: function dayDatas() {
- return ctor_amd_xe_utils_default.a.chunk(this.dayList, 7);
- },
- weekDates: function weekDates() {
- return this.dayDatas.map(function (list) {
- var firstItem = list[0];
- var item = {
- date: firstItem.date,
- isWeekNumber: true,
- isPrev: false,
- isCurrent: false,
- isNow: false,
- isNext: false,
- label: ctor_amd_xe_utils_default.a.getYearWeek(firstItem.date)
- };
- return [item].concat(list);
- });
- },
- dateOpts: function dateOpts() {
- return Object.assign({}, this.dateConfig, conf.input.dateConfig);
- },
- hourList: function hourList() {
- var list = [];
- if (this.hasTime) {
- for (var index = 0; index < 24; index++) {
- list.push({
- value: index,
- label: ('' + index).padStart(2, 0)
- });
- }
- }
- return list;
- },
- minuteList: function minuteList() {
- var list = [];
- if (this.hasTime) {
- for (var index = 0; index < 60; index++) {
- list.push({
- value: index,
- label: ('' + index).padStart(2, 0)
- });
- }
- }
- return list;
- },
- secondList: function secondList() {
- return this.minuteList;
- },
- inpAttrs: function inpAttrs() {
- var isDatePicker = this.isDatePicker,
- isNumber = this.isNumber,
- isPassword = this.isPassword,
- type = this.type,
- name = this.name,
- placeholder = this.placeholder,
- readonly = this.readonly,
- disabled = this.disabled,
- maxlength = this.maxlength,
- form = this.form,
- autocomplete = this.autocomplete,
- showPwd = this.showPwd,
- editable = this.editable;
- var inputType = type;
- if (isDatePicker || isNumber || isPassword && showPwd || type === 'number') {
- inputType = 'text';
- }
- var attrs = {
- name: name,
- form: form,
- type: inputType,
- placeholder: placeholder,
- maxlength: isNumber && !ctor_amd_xe_utils_default.a.toNumber(maxlength) ? 16 : maxlength,
- // 数值最大长度限制 16 位,包含小数
- readonly: readonly || type === 'week' || !editable || this.dateOpts.editable === false,
- disabled: disabled,
- autocomplete: autocomplete
- };
- if (placeholder) {
- attrs.placeholder = UtilTools.getFuncText(placeholder);
- }
- return attrs;
- },
- inpEvents: function inpEvents() {
- var _this = this;
- var evnts = {};
- ctor_amd_xe_utils_default.a.each(this.$listeners, function (cb, name) {
- if (['change', 'clear', 'prefix-click', 'suffix-click'].indexOf(name) === -1) {
- evnts[name] = _this.triggerEvent;
- }
- });
- if (this.isNumber) {
- evnts.keydown = this.keydownEvent;
- evnts[input_wheelName] = this.mousewheelEvent;
- } else if (this.isDatePicker) {
- evnts.click = this.clickEvent;
- }
- evnts.input = this.inputEvent;
- evnts.focus = this.focusEvent;
- evnts.blur = this.blurEvent;
- return evnts;
- }
- },
- watch: {
- value: function value() {
- this.changeValue();
- },
- dateLabelFormat: function dateLabelFormat() {
- this.dateParseValue(this.datePanelValue);
- this.inputValue = this.datePanelLabel;
- }
- },
- created: function created() {
- this.initValue();
- GlobalEvent.on(this, 'mousewheel', this.handleGlobalMousewheelEvent);
- GlobalEvent.on(this, 'mousedown', this.handleGlobalMousedownEvent);
- GlobalEvent.on(this, 'keydown', this.handleGlobalKeydownEvent);
- GlobalEvent.on(this, 'blur', this.handleGlobalBlurEvent);
- },
- mounted: function mounted() {
- if (this.dateConfig) {
- UtilTools.warn('vxe.error.removeProp', ['date-config']);
- }
- if (this.isDatePicker) {
- if (this.transfer) {
- document.body.appendChild(this.$refs.panel);
- }
- }
- },
- beforeDestroy: function beforeDestroy() {
- var panelElem = this.$refs.panel;
- if (panelElem && panelElem.parentNode) {
- panelElem.parentNode.removeChild(panelElem);
- }
- },
- destroyed: function destroyed() {
- this.numberStopDown();
- GlobalEvent.off(this, 'mousewheel');
- GlobalEvent.off(this, 'mousedown');
- GlobalEvent.off(this, 'keydown');
- GlobalEvent.off(this, 'blur');
- },
- render: function render(h) {
- var _ref2;
- var controls = this.controls,
- isDatePicker = this.isDatePicker,
- visiblePanel = this.visiblePanel,
- isActivated = this.isActivated,
- vSize = this.vSize,
- type = this.type,
- align = this.align,
- readonly = this.readonly,
- disabled = this.disabled;
- var childs = [];
- var prefix = rendePrefixIcon(h, this);
- var suffix = renderSuffixIcon(h, this); // 前缀图标
- if (prefix) {
- childs.push(prefix);
- } // 输入框
- childs.push(isDatePicker ? renderDateInput(h, this) : renderDefaultInput(h, this)); // 后缀图标
- if (suffix) {
- childs.push(suffix);
- } // 特殊功能图标
- childs.push(renderExtraSuffixIcon(h, this)); // 面板容器
- if (isDatePicker) {
- childs.push(renderPanel(h, this));
- }
- return h('div', {
- class: ['vxe-input', "type--".concat(type), (_ref2 = {}, _defineProperty(_ref2, "size--".concat(vSize), vSize), _defineProperty(_ref2, "is--".concat(align), align), _defineProperty(_ref2, 'is--controls', controls), _defineProperty(_ref2, 'is--prefix', !!prefix), _defineProperty(_ref2, 'is--suffix', !!suffix), _defineProperty(_ref2, 'is--readonly', readonly), _defineProperty(_ref2, 'is--visivle', visiblePanel), _defineProperty(_ref2, 'is--disabled', disabled), _defineProperty(_ref2, 'is--active', isActivated), _ref2)]
- }, childs);
- },
- methods: {
- focus: function focus() {
- this.isActivated = true;
- this.$refs.input.focus();
- return this.$nextTick();
- },
- blur: function blur() {
- this.$refs.input.blur();
- this.isActivated = false;
- return this.$nextTick();
- },
- triggerEvent: function triggerEvent(evnt) {
- var $refs = this.$refs,
- value = this.value;
- this.$emit(evnt.type, {
- $panel: $refs.panel,
- value: value,
- $event: evnt
- }, evnt);
- },
- emitUpdate: function emitUpdate(value, evnt) {
- this.$emit('input', value);
- if (ctor_amd_xe_utils_default.a.toString(this.value) !== value) {
- this.$emit('change', {
- value: value,
- $event: evnt
- });
- }
- },
- inputEvent: function inputEvent(evnt) {
- var isDatePicker = this.isDatePicker;
- var value = evnt.target.value;
- this.inputValue = value;
- if (!isDatePicker) {
- this.emitUpdate(value, evnt);
- }
- },
- focusEvent: function focusEvent(evnt) {
- this.isActivated = true;
- this.triggerEvent(evnt);
- },
- blurEvent: function blurEvent(evnt) {
- this.afterCheckValue();
- if (!this.visiblePanel) {
- this.isActivated = false;
- }
- this.triggerEvent(evnt);
- },
- keydownEvent: function keydownEvent(evnt) {
- if (this.isNumber) {
- var isCtrlKey = evnt.ctrlKey;
- var isShiftKey = evnt.shiftKey;
- var isAltKey = evnt.altKey;
- var keyCode = evnt.keyCode;
- if (!isCtrlKey && !isShiftKey && !isAltKey && (keyCode === 32 || keyCode >= 65 && keyCode <= 90 || keyCode >= 186 && keyCode <= 188 || keyCode >= 191)) {
- evnt.preventDefault();
- }
- this.numberKeydownEvent(evnt);
- }
- this.triggerEvent(evnt);
- },
- mousewheelEvent: function mousewheelEvent(evnt) {
- if (this.isNumber && this.controls) {
- if (this.isActivated) {
- var delta = -evnt.wheelDelta || evnt.detail;
- if (delta > 0) {
- this.numberNextEvent(evnt);
- } else if (delta < 0) {
- this.numberPrevEvent(evnt);
- }
- evnt.preventDefault();
- }
- }
- },
- clickEvent: function clickEvent(evnt) {
- var isDatePicker = this.isDatePicker;
- if (isDatePicker) {
- this.datePickerOpenEvent(evnt);
- }
- this.triggerEvent(evnt);
- },
- clickPrefixEvent: function clickPrefixEvent(evnt) {
- var $refs = this.$refs,
- disabled = this.disabled,
- value = this.value;
- if (!disabled) {
- this.$emit('prefix-click', {
- $panel: $refs.panel,
- value: value,
- $event: evnt
- }, evnt);
- }
- },
- clickSuffixEvent: function clickSuffixEvent(evnt) {
- var $refs = this.$refs,
- disabled = this.disabled,
- value = this.value;
- if (!disabled) {
- if (DomTools.hasClass(evnt.currentTarget, 'is--clear')) {
- this.emitUpdate('', evnt);
- this.clearValueEvent(evnt, '');
- } else {
- this.$emit('suffix-click', {
- $panel: $refs.panel,
- value: value,
- $event: evnt
- }, evnt);
- }
- }
- },
- clearValueEvent: function clearValueEvent(evnt, value) {
- var $refs = this.$refs,
- type = this.type,
- isNumber = this.isNumber;
- if (this.isDatePicker) {
- this.hidePanel();
- }
- if (isNumber || ['text', 'password'].indexOf(type) > -1) {
- this.focus();
- }
- this.$emit('clear', {
- $panel: $refs.panel,
- value: value,
- $event: evnt
- }, evnt);
- },
- /**
- * 检查初始值
- */
- initValue: function initValue() {
- var type = this.type,
- isDatePicker = this.isDatePicker,
- value = this.value,
- digitsValue = this.digitsValue;
- if (isDatePicker) {
- this.changeValue();
- } else if (type === 'float') {
- if (value) {
- var validValue = toFloatValueFixed(value, digitsValue);
- if (value !== validValue) {
- this.emitUpdate(validValue, {
- type: 'init'
- });
- }
- }
- }
- },
- /**
- * 值变化时处理
- */
- changeValue: function changeValue() {
- if (this.isDatePicker) {
- this.dateParseValue(this.value);
- this.inputValue = this.datePanelLabel;
- }
- },
- afterCheckValue: function afterCheckValue() {
- var type = this.type,
- inpAttrs = this.inpAttrs,
- value = this.value,
- inputValue = this.inputValue,
- isDatePicker = this.isDatePicker,
- isNumber = this.isNumber,
- datetimePanelValue = this.datetimePanelValue,
- dateLabelFormat = this.dateLabelFormat,
- min = this.min,
- max = this.max,
- digitsValue = this.digitsValue;
- if (!inpAttrs.readonly) {
- if (isNumber) {
- if (value) {
- var inpVal = type === 'integer' ? ctor_amd_xe_utils_default.a.toInteger(value) : ctor_amd_xe_utils_default.a.toNumber(value);
- if (!this.vaildMinNum(inpVal)) {
- inpVal = min;
- } else if (!this.vaildMaxNum(inpVal)) {
- inpVal = max;
- }
- this.emitUpdate(type === 'float' ? toFloatValueFixed(inpVal, digitsValue) : ctor_amd_xe_utils_default.a.toString(inpVal), {
- type: 'check'
- });
- }
- } else if (isDatePicker) {
- var _inpVal = inputValue;
- if (_inpVal) {
- if (type === 'time') {
- _inpVal = toStringTime(_inpVal, dateLabelFormat);
- } else {
- _inpVal = ctor_amd_xe_utils_default.a.toStringDate(_inpVal, dateLabelFormat);
- }
- if (ctor_amd_xe_utils_default.a.isValidDate(_inpVal)) {
- if (type === 'time') {
- _inpVal = ctor_amd_xe_utils_default.a.toDateString(_inpVal, dateLabelFormat);
- if (value !== _inpVal) {
- this.emitUpdate(_inpVal, {
- type: 'check'
- });
- }
- this.inputValue = _inpVal;
- } else {
- if (!ctor_amd_xe_utils_default.a.isDateSame(value, _inpVal, dateLabelFormat)) {
- if (type === 'datetime') {
- datetimePanelValue.setHours(_inpVal.getHours());
- datetimePanelValue.setMinutes(_inpVal.getMinutes());
- datetimePanelValue.setSeconds(_inpVal.getSeconds());
- }
- this.dateChange(_inpVal);
- } else {
- this.inputValue = ctor_amd_xe_utils_default.a.toDateString(value, dateLabelFormat);
- }
- }
- } else {
- this.dateRevert();
- }
- } else {
- this.emitUpdate('', {
- type: 'check'
- });
- }
- }
- }
- },
- // 密码
- passwordToggleEvent: function passwordToggleEvent(evnt) {
- var disabled = this.disabled,
- readonly = this.readonly,
- showPwd = this.showPwd;
- if (!disabled && !readonly) {
- this.showPwd = !showPwd;
- }
- this.$emit('toggle-visible', {
- visible: this.showPwd,
- $event: evnt
- });
- },
- // 密码
- // 搜索
- searchEvent: function searchEvent(evnt) {
- this.$emit('search-click', {
- $event: evnt
- });
- },
- // 搜索
- // 数值
- vaildMinNum: function vaildMinNum(num) {
- return this.min === null || num >= ctor_amd_xe_utils_default.a.toNumber(this.min);
- },
- vaildMaxNum: function vaildMaxNum(num) {
- return this.max === null || num <= ctor_amd_xe_utils_default.a.toNumber(this.max);
- },
- numberStopDown: function numberStopDown() {
- clearTimeout(this.downbumTimeout);
- },
- numberDownPrevEvent: function numberDownPrevEvent(evnt) {
- var _this2 = this;
- this.downbumTimeout = setTimeout(function () {
- _this2.numberPrevEvent(evnt);
- _this2.numberDownPrevEvent(evnt);
- }, 60);
- },
- numberDownNextEvent: function numberDownNextEvent(evnt) {
- var _this3 = this;
- this.downbumTimeout = setTimeout(function () {
- _this3.numberNextEvent(evnt);
- _this3.numberDownNextEvent(evnt);
- }, 60);
- },
- numberKeydownEvent: function numberKeydownEvent(evnt) {
- var keyCode = evnt.keyCode;
- var isUpArrow = keyCode === 38;
- var isDwArrow = keyCode === 40;
- if (isUpArrow || isDwArrow) {
- evnt.preventDefault();
- if (isUpArrow) {
- this.numberPrevEvent(evnt);
- } else {
- this.numberNextEvent(evnt);
- }
- }
- },
- numberMousedownEvent: function numberMousedownEvent(evnt) {
- var _this4 = this;
- this.numberStopDown();
- if (evnt.button === 0) {
- var isPrevNumber = DomTools.hasClass(evnt.currentTarget, 'is--prev');
- if (isPrevNumber) {
- this.numberPrevEvent(evnt);
- } else {
- this.numberNextEvent(evnt);
- }
- this.downbumTimeout = setTimeout(function () {
- if (isPrevNumber) {
- _this4.numberDownPrevEvent(evnt);
- } else {
- _this4.numberDownNextEvent(evnt);
- }
- }, 500);
- }
- },
- numberPrevEvent: function numberPrevEvent(evnt) {
- var disabled = this.disabled,
- readonly = this.readonly;
- clearTimeout(this.downbumTimeout);
- if (!disabled && !readonly) {
- this.numberChange(true, evnt);
- }
- this.$emit('prev-number', {
- $event: evnt
- });
- },
- numberNextEvent: function numberNextEvent(evnt) {
- var disabled = this.disabled,
- readonly = this.readonly;
- clearTimeout(this.downbumTimeout);
- if (!disabled && !readonly) {
- this.numberChange(false, evnt);
- }
- this.$emit('next-number', {
- $event: evnt
- });
- },
- numberChange: function numberChange(isPlus, evnt) {
- var type = this.type,
- digitsValue = this.digitsValue,
- value = this.value,
- stepValue = this.stepValue;
- var inputValue = type === 'integer' ? ctor_amd_xe_utils_default.a.toInteger(value) : ctor_amd_xe_utils_default.a.toNumber(value);
- var newValue = isPlus ? ctor_amd_xe_utils_default.a.add(inputValue, stepValue) : ctor_amd_xe_utils_default.a.subtract(inputValue, stepValue);
- if (this.vaildMinNum(newValue) && this.vaildMaxNum(newValue)) {
- this.emitUpdate(type === 'float' ? toFloatValueFixed(newValue, digitsValue) : ctor_amd_xe_utils_default.a.toString(newValue), evnt);
- }
- },
- // 数值
- // 日期
- datePickerOpenEvent: function datePickerOpenEvent(evnt) {
- var readonly = this.readonly;
- if (!readonly) {
- evnt.preventDefault();
- this.showPanel();
- }
- },
- dateMonthHandle: function dateMonthHandle(date, offsetMonth) {
- this.selectMonth = ctor_amd_xe_utils_default.a.getWhatMonth(date, offsetMonth, 'first');
- },
- dateNowHandle: function dateNowHandle() {
- var currentDate = ctor_amd_xe_utils_default.a.getWhatDay(Date.now(), 0, 'first');
- this.currentDate = currentDate;
- this.dateMonthHandle(currentDate, 0);
- },
- dateToggleTypeEvent: function dateToggleTypeEvent() {
- var datePanelType = this.datePanelType;
- if (datePanelType === 'month') {
- datePanelType = 'year';
- } else {
- datePanelType = 'month';
- }
- this.datePanelType = datePanelType;
- },
- datePrevEvent: function datePrevEvent(evnt) {
- var isDisabledPrevDateBtn = this.isDisabledPrevDateBtn,
- type = this.type,
- datePanelType = this.datePanelType;
- if (!isDisabledPrevDateBtn) {
- if (type === 'year') {
- this.selectMonth = ctor_amd_xe_utils_default.a.getWhatYear(this.selectMonth, -yearSize, 'first');
- } else if (type === 'month') {
- if (datePanelType === 'year') {
- this.selectMonth = ctor_amd_xe_utils_default.a.getWhatYear(this.selectMonth, -yearSize, 'first');
- } else {
- this.selectMonth = ctor_amd_xe_utils_default.a.getWhatYear(this.selectMonth, -1, 'first');
- }
- } else {
- if (datePanelType === 'year') {
- this.selectMonth = ctor_amd_xe_utils_default.a.getWhatYear(this.selectMonth, -yearSize, 'first');
- } else if (datePanelType === 'month') {
- this.selectMonth = ctor_amd_xe_utils_default.a.getWhatYear(this.selectMonth, -1, 'first');
- } else {
- this.selectMonth = ctor_amd_xe_utils_default.a.getWhatMonth(this.selectMonth, -1, 'first');
- }
- }
- this.$emit('date-prev', {
- type: type,
- $event: evnt
- });
- }
- },
- dateTodayMonthEvent: function dateTodayMonthEvent(evnt) {
- this.dateNowHandle();
- this.dateChange(this.currentDate);
- this.hidePanel();
- this.$emit('date-today', {
- type: this.type,
- $event: evnt
- });
- },
- dateNextEvent: function dateNextEvent(evnt) {
- var isDisabledNextDateBtn = this.isDisabledNextDateBtn,
- type = this.type,
- datePanelType = this.datePanelType;
- if (!isDisabledNextDateBtn) {
- if (type === 'year') {
- this.selectMonth = ctor_amd_xe_utils_default.a.getWhatYear(this.selectMonth, yearSize, 'first');
- } else if (type === 'month') {
- if (datePanelType === 'year') {
- this.selectMonth = ctor_amd_xe_utils_default.a.getWhatYear(this.selectMonth, yearSize, 'first');
- } else {
- this.selectMonth = ctor_amd_xe_utils_default.a.getWhatYear(this.selectMonth, 1, 'first');
- }
- } else {
- if (datePanelType === 'year') {
- this.selectMonth = ctor_amd_xe_utils_default.a.getWhatYear(this.selectMonth, yearSize, 'first');
- } else if (datePanelType === 'month') {
- this.selectMonth = ctor_amd_xe_utils_default.a.getWhatYear(this.selectMonth, 1, 'first');
- } else {
- this.selectMonth = ctor_amd_xe_utils_default.a.getWhatMonth(this.selectMonth, 1, 'first');
- }
- }
- this.$emit('date-prev', {
- type: type,
- $event: evnt
- });
- }
- },
- dateSelectEvent: function dateSelectEvent(item) {
- if (!isDateDisabled(this, item)) {
- this.dateSelectItem(item.date);
- }
- },
- dateSelectItem: function dateSelectItem(date) {
- var type = this.type,
- datePanelType = this.datePanelType;
- if (type === 'month') {
- if (datePanelType === 'year') {
- this.datePanelType = 'month';
- this.dateCheckMonth(date);
- } else {
- this.dateChange(date);
- this.hidePanel();
- }
- } else if (type === 'year') {
- this.hidePanel();
- this.dateChange(date);
- } else {
- if (datePanelType === 'month') {
- this.datePanelType = type === 'week' ? type : 'day';
- this.dateCheckMonth(date);
- } else if (datePanelType === 'year') {
- this.datePanelType = 'month';
- this.dateCheckMonth(date);
- } else {
- this.dateChange(date);
- this.hidePanel();
- }
- }
- },
- dateMouseenterEvent: function dateMouseenterEvent(item) {
- if (!isDateDisabled(this, item)) {
- var datePanelType = this.datePanelType;
- if (datePanelType === 'month') {
- this.dateMoveMonth(item.date);
- } else if (datePanelType === 'year') {
- this.dateMoveYear(item.date);
- } else {
- this.dateMoveDay(item.date);
- }
- }
- },
- dateHourEvent: function dateHourEvent(evnt, item) {
- this.datetimePanelValue.setHours(item.value);
- this.dateTimeChangeEvent(evnt);
- },
- dateConfirmEvent: function dateConfirmEvent() {
- this.dateChange(this.dateValue || this.currentDate);
- this.hidePanel();
- },
- dateMinuteEvent: function dateMinuteEvent(evnt, item) {
- this.datetimePanelValue.setMinutes(item.value);
- this.dateTimeChangeEvent(evnt);
- },
- dateSecondEvent: function dateSecondEvent(evnt, item) {
- this.datetimePanelValue.setSeconds(item.value);
- this.dateTimeChangeEvent(evnt);
- },
- dateTimeChangeEvent: function dateTimeChangeEvent(evnt) {
- this.datetimePanelValue = new Date(this.datetimePanelValue.getTime());
- this.updateTimePos(evnt.currentTarget);
- },
- updateTimePos: function updateTimePos(liElem) {
- if (liElem) {
- var height = liElem.offsetHeight;
- liElem.parentNode.scrollTop = liElem.offsetTop - height * 4;
- }
- },
- dateMoveDay: function dateMoveDay(offsetDay) {
- if (!isDateDisabled(this, {
- date: offsetDay
- })) {
- if (!this.dayList.some(function (item) {
- return ctor_amd_xe_utils_default.a.isDateSame(item.date, offsetDay, 'yyyy-MM-dd');
- })) {
- this.dateCheckMonth(offsetDay);
- }
- this.dateParseValue(offsetDay);
- }
- },
- dateMoveMonth: function dateMoveMonth(offsetMonth) {
- if (!isDateDisabled(this, {
- date: offsetMonth
- })) {
- if (!this.monthList.some(function (item) {
- return ctor_amd_xe_utils_default.a.isDateSame(item.date, offsetMonth, 'yyyy-MM');
- })) {
- this.dateCheckMonth(offsetMonth);
- }
- this.dateParseValue(offsetMonth);
- }
- },
- dateMoveYear: function dateMoveYear(offsetYear) {
- if (!isDateDisabled(this, {
- date: offsetYear
- })) {
- if (!this.yearList.some(function (item) {
- return ctor_amd_xe_utils_default.a.isDateSame(item.date, offsetYear, 'yyyy');
- })) {
- this.dateCheckMonth(offsetYear);
- }
- this.dateParseValue(offsetYear);
- }
- },
- dateParseValue: function dateParseValue(date) {
- var type = this.type,
- dateLabelFormat = this.dateLabelFormat,
- valueFormat = this.valueFormat,
- parseFormat = this.parseFormat;
- var dValue = null;
- var dLabel = '';
- if (date) {
- if (type === 'time') {
- dValue = toStringTime(date, valueFormat || parseFormat || this.dateOpts.parseFormat);
- } else {
- dValue = ctor_amd_xe_utils_default.a.toStringDate(date, valueFormat || parseFormat || this.dateOpts.parseFormat);
- }
- }
- if (ctor_amd_xe_utils_default.a.isValidDate(dValue)) {
- dLabel = ctor_amd_xe_utils_default.a.toDateString(dValue, dateLabelFormat);
- } else {
- dValue = null;
- }
- this.datePanelValue = dValue;
- this.datePanelLabel = dLabel;
- },
- dateOffsetEvent: function dateOffsetEvent(evnt) {
- var isActivated = this.isActivated,
- datePanelValue = this.datePanelValue,
- datePanelType = this.datePanelType;
- if (isActivated) {
- evnt.preventDefault();
- var keyCode = evnt.keyCode;
- var isLeftArrow = keyCode === 37;
- var isUpArrow = keyCode === 38;
- var isRightArrow = keyCode === 39;
- var isDwArrow = keyCode === 40;
- if (datePanelType === 'year') {
- var offsetYear = ctor_amd_xe_utils_default.a.getWhatYear(datePanelValue || Date.now(), 0, 'first');
- if (isLeftArrow) {
- offsetYear = ctor_amd_xe_utils_default.a.getWhatYear(offsetYear, -1);
- } else if (isUpArrow) {
- offsetYear = ctor_amd_xe_utils_default.a.getWhatYear(offsetYear, -4);
- } else if (isRightArrow) {
- offsetYear = ctor_amd_xe_utils_default.a.getWhatYear(offsetYear, 1);
- } else if (isDwArrow) {
- offsetYear = ctor_amd_xe_utils_default.a.getWhatYear(offsetYear, 4);
- }
- this.dateMoveYear(offsetYear);
- } else if (datePanelType === 'month') {
- var offsetMonth = ctor_amd_xe_utils_default.a.getWhatMonth(datePanelValue || Date.now(), 0, 'first');
- if (isLeftArrow) {
- offsetMonth = ctor_amd_xe_utils_default.a.getWhatMonth(offsetMonth, -1);
- } else if (isUpArrow) {
- offsetMonth = ctor_amd_xe_utils_default.a.getWhatMonth(offsetMonth, -4);
- } else if (isRightArrow) {
- offsetMonth = ctor_amd_xe_utils_default.a.getWhatMonth(offsetMonth, 1);
- } else if (isDwArrow) {
- offsetMonth = ctor_amd_xe_utils_default.a.getWhatMonth(offsetMonth, 4);
- }
- this.dateMoveMonth(offsetMonth);
- } else {
- var offsetDay = datePanelValue || ctor_amd_xe_utils_default.a.getWhatDay(Date.now(), 0, 'first');
- if (isLeftArrow) {
- offsetDay = ctor_amd_xe_utils_default.a.getWhatDay(offsetDay, -1);
- } else if (isUpArrow) {
- offsetDay = ctor_amd_xe_utils_default.a.getWhatWeek(offsetDay, -1);
- } else if (isRightArrow) {
- offsetDay = ctor_amd_xe_utils_default.a.getWhatDay(offsetDay, 1);
- } else if (isDwArrow) {
- offsetDay = ctor_amd_xe_utils_default.a.getWhatWeek(offsetDay, 1);
- }
- this.dateMoveDay(offsetDay);
- }
- }
- },
- datePgOffsetEvent: function datePgOffsetEvent(evnt) {
- var isActivated = this.isActivated;
- if (isActivated) {
- var isPgUp = evnt.keyCode === 33;
- evnt.preventDefault();
- if (isPgUp) {
- this.datePrevEvent(evnt);
- } else {
- this.dateNextEvent(evnt);
- }
- }
- },
- dateChange: function dateChange(date) {
- var value = this.value,
- datetimePanelValue = this.datetimePanelValue,
- dateValueFormat = this.dateValueFormat;
- if (this.type === 'week') {
- var sWeek = ctor_amd_xe_utils_default.a.toNumber(ctor_amd_xe_utils_default.a.isNumber(this.startWeek) ? this.startWeek : this.dateOpts.startWeek);
- date = ctor_amd_xe_utils_default.a.getWhatWeek(date, 0, sWeek);
- } else if (this.hasTime) {
- date.setHours(datetimePanelValue.getHours());
- date.setMinutes(datetimePanelValue.getMinutes());
- date.setSeconds(datetimePanelValue.getSeconds());
- }
- var inpVal = ctor_amd_xe_utils_default.a.toDateString(date, dateValueFormat);
- this.dateCheckMonth(date);
- if (!ctor_amd_xe_utils_default.a.isEqual(value, inpVal)) {
- this.emitUpdate(inpVal, {
- type: 'update'
- });
- }
- },
- dateCheckMonth: function dateCheckMonth(date) {
- var month = ctor_amd_xe_utils_default.a.getWhatMonth(date, 0, 'first');
- if (!ctor_amd_xe_utils_default.a.isEqual(month, this.selectMonth)) {
- this.selectMonth = month;
- }
- },
- dateOpenPanel: function dateOpenPanel() {
- var _this5 = this;
- var type = this.type,
- dateValue = this.dateValue;
- if (['year', 'month', 'week'].indexOf(type) > -1) {
- this.datePanelType = type;
- } else {
- this.datePanelType = 'day';
- }
- this.currentDate = ctor_amd_xe_utils_default.a.getWhatDay(Date.now(), 0, 'first');
- if (dateValue) {
- this.dateMonthHandle(dateValue, 0);
- this.dateParseValue(dateValue);
- } else {
- this.dateNowHandle();
- }
- if (this.hasTime) {
- this.datetimePanelValue = this.datePanelValue || ctor_amd_xe_utils_default.a.getWhatDay(Date.now(), 0, 'first');
- this.$nextTick(function () {
- ctor_amd_xe_utils_default.a.arrayEach(_this5.$refs.timeBody.querySelectorAll('li.is--selected'), _this5.updateTimePos);
- });
- }
- },
- dateRevert: function dateRevert() {
- this.inputValue = this.datePanelLabel;
- },
- // 日期
- // 弹出面板
- updateZindex: function updateZindex() {
- if (this.panelIndex < UtilTools.getLastZIndex()) {
- this.panelIndex = UtilTools.nextZIndex();
- }
- },
- showPanel: function showPanel() {
- var _this6 = this;
- var disabled = this.disabled,
- visiblePanel = this.visiblePanel,
- isDatePicker = this.isDatePicker;
- if (!disabled && !visiblePanel) {
- clearTimeout(this.hidePanelTimeout);
- this.isActivated = true;
- this.animatVisible = true;
- if (isDatePicker) {
- this.dateOpenPanel();
- }
- setTimeout(function () {
- _this6.visiblePanel = true;
- }, 10);
- this.updateZindex();
- this.updatePlacement();
- }
- },
- hidePanel: function hidePanel() {
- var _this7 = this;
- this.visiblePanel = false;
- this.hidePanelTimeout = setTimeout(function () {
- _this7.animatVisible = false;
- }, 350);
- },
- updatePlacement: function updatePlacement() {
- var _this8 = this;
- return this.$nextTick().then(function () {
- var $refs = _this8.$refs,
- transfer = _this8.transfer,
- placement = _this8.placement,
- panelIndex = _this8.panelIndex;
- var targetElem = $refs.input;
- var panelElem = $refs.panel;
- if (targetElem && panelElem) {
- var targetHeight = targetElem.offsetHeight;
- var targetWidth = targetElem.offsetWidth;
- var panelHeight = panelElem.offsetHeight;
- var panelWidth = panelElem.offsetWidth;
- var marginSize = 5;
- var panelStyle = {
- zIndex: panelIndex
- };
- var _DomTools$getAbsolute = DomTools.getAbsolutePos(targetElem),
- boundingTop = _DomTools$getAbsolute.boundingTop,
- boundingLeft = _DomTools$getAbsolute.boundingLeft,
- visibleHeight = _DomTools$getAbsolute.visibleHeight,
- visibleWidth = _DomTools$getAbsolute.visibleWidth;
- var panelPlacement = 'bottom';
- if (transfer) {
- var left = boundingLeft;
- var top = boundingTop + targetHeight;
- if (placement === 'top') {
- panelPlacement = 'top';
- top = boundingTop - panelHeight;
- } else if (!placement) {
- // 如果下面不够放,则向上
- if (top + panelHeight + marginSize > visibleHeight) {
- panelPlacement = 'top';
- top = boundingTop - panelHeight;
- } // 如果上面不够放,则向下(优先)
- if (top < marginSize) {
- panelPlacement = 'bottom';
- top = boundingTop + targetHeight;
- }
- } // 如果溢出右边
- if (left + panelWidth + marginSize > visibleWidth) {
- left -= left + panelWidth + marginSize - visibleWidth;
- } // 如果溢出左边
- if (left < marginSize) {
- left = marginSize;
- }
- Object.assign(panelStyle, {
- left: "".concat(left, "px"),
- top: "".concat(top, "px"),
- minWidth: "".concat(targetWidth, "px")
- });
- } else {
- if (placement === 'top') {
- panelPlacement = 'top';
- panelStyle.bottom = "".concat(targetHeight, "px");
- } else if (!placement) {
- // 如果下面不够放,则向上
- if (boundingTop + targetHeight + panelHeight > visibleHeight) {
- // 如果上面不够放,则向下(优先)
- if (boundingTop - targetHeight - panelHeight > marginSize) {
- panelPlacement = 'top';
- panelStyle.bottom = "".concat(targetHeight, "px");
- }
- }
- }
- }
- _this8.panelStyle = panelStyle;
- _this8.panelPlacement = panelPlacement;
- return _this8.$nextTick();
- }
- });
- },
- // 弹出面板
- // 全局事件
- handleGlobalMousedownEvent: function handleGlobalMousedownEvent(evnt) {
- var $refs = this.$refs,
- $el = this.$el,
- disabled = this.disabled,
- visiblePanel = this.visiblePanel,
- isActivated = this.isActivated;
- if (!disabled && isActivated) {
- this.isActivated = DomTools.getEventTargetNode(evnt, $el).flag || DomTools.getEventTargetNode(evnt, $refs.panel).flag;
- if (!this.isActivated) {
- // 如果是日期类型
- if (this.isDatePicker) {
- if (visiblePanel) {
- this.hidePanel();
- this.afterCheckValue();
- }
- } else {
- this.afterCheckValue();
- }
- }
- }
- },
- handleGlobalKeydownEvent: function handleGlobalKeydownEvent(evnt) {
- var isDatePicker = this.isDatePicker,
- visiblePanel = this.visiblePanel,
- clearable = this.clearable,
- disabled = this.disabled;
- if (!disabled) {
- var keyCode = evnt.keyCode;
- var isTab = keyCode === 9;
- var isDel = keyCode === 46;
- var isEsc = keyCode === 27;
- var isEnter = keyCode === 13;
- var isLeftArrow = keyCode === 37;
- var isUpArrow = keyCode === 38;
- var isRightArrow = keyCode === 39;
- var isDwArrow = keyCode === 40;
- var isPgUp = keyCode === 33;
- var isPgDn = keyCode === 34;
- var operArrow = isLeftArrow || isUpArrow || isRightArrow || isDwArrow;
- var isActivated = this.isActivated;
- if (isTab) {
- if (isActivated) {
- this.afterCheckValue();
- }
- isActivated = false;
- this.isActivated = isActivated;
- } else if (operArrow) {
- if (isDatePicker) {
- if (isActivated) {
- if (visiblePanel) {
- this.dateOffsetEvent(evnt);
- } else if (isUpArrow || isDwArrow) {
- this.datePickerOpenEvent(evnt);
- }
- }
- }
- } else if (isEnter) {
- if (isDatePicker) {
- if (visiblePanel) {
- if (this.datePanelValue) {
- this.dateSelectItem(this.datePanelValue);
- } else {
- this.hidePanel();
- }
- } else if (isActivated) {
- this.datePickerOpenEvent(evnt);
- }
- }
- } else if (isPgUp || isPgDn) {
- if (isDatePicker) {
- if (isActivated) {
- this.datePgOffsetEvent(evnt);
- }
- }
- }
- if (isTab || isEsc) {
- if (visiblePanel) {
- this.hidePanel();
- }
- } else if (isDel && clearable) {
- if (isActivated) {
- this.clearValueEvent(evnt, null);
- }
- }
- }
- },
- handleGlobalMousewheelEvent: function handleGlobalMousewheelEvent(evnt) {
- var $refs = this.$refs,
- disabled = this.disabled,
- visiblePanel = this.visiblePanel;
- if (!disabled) {
- if (visiblePanel) {
- if (DomTools.getEventTargetNode(evnt, $refs.panel).flag) {
- this.updatePlacement();
- } else {
- this.hidePanel();
- this.afterCheckValue();
- }
- }
- }
- },
- handleGlobalBlurEvent: function handleGlobalBlurEvent() {
- var isActivated = this.isActivated,
- visiblePanel = this.visiblePanel;
- if (visiblePanel) {
- this.hidePanel();
- this.afterCheckValue();
- } else if (isActivated) {
- this.afterCheckValue();
- }
- } // 全局事件
- }
- });
- // CONCATENATED MODULE: ./packages/input/index.js
- input.install = function (Vue) {
- Vue.component(input.name, input);
- };
- var Input = input;
- /* harmony default export */ var packages_input = (input);
- // CONCATENATED MODULE: ./packages/textarea/src/textarea.js
- var autoTxtElem;
- /* harmony default export */ var src_textarea = ({
- name: 'VxeTextarea',
- props: {
- value: [String, Number],
- name: String,
- readonly: Boolean,
- disabled: Boolean,
- placeholder: String,
- maxlength: [String, Number],
- rows: {
- type: [String, Number],
- default: 2
- },
- showWordCount: Boolean,
- autosize: [Boolean, Object],
- form: String,
- resize: {
- type: String,
- default: function _default() {
- return conf.textarea.resize;
- }
- },
- size: {
- type: String,
- default: function _default() {
- return conf.textarea.size || conf.size;
- }
- }
- },
- computed: {
- vSize: function vSize() {
- return this.size || this.$parent.size || this.$parent.vSize;
- },
- inputCount: function inputCount() {
- return ctor_amd_xe_utils_default.a.getSize(this.value);
- },
- isCountError: function isCountError() {
- return this.maxlength && this.inputCount > ctor_amd_xe_utils_default.a.toNumber(this.maxlength);
- },
- defaultEvents: function defaultEvents() {
- var _this = this;
- var evnts = {};
- ctor_amd_xe_utils_default.a.each(this.$listeners, function (cb, name) {
- if (['change'].indexOf(name) === -1) {
- evnts[name] = _this.triggerEvent;
- }
- });
- evnts.input = this.inputEvent;
- return evnts;
- },
- sizeOpts: function sizeOpts() {
- return Object.assign({
- minRows: 1,
- maxRows: 10
- }, conf.textarea.autosize, this.autosize);
- }
- },
- watch: {
- value: function value() {
- this.updateAutoTxt();
- }
- },
- created: function created() {
- if (!autoTxtElem) {
- autoTxtElem = document.createElement('div');
- document.body.appendChild(autoTxtElem);
- }
- },
- mounted: function mounted() {
- this.updateAutoTxt();
- this.handleResize();
- },
- render: function render(h) {
- var _ref;
- var defaultEvents = this.defaultEvents,
- value = this.value,
- vSize = this.vSize,
- name = this.name,
- form = this.form,
- resize = this.resize,
- placeholder = this.placeholder,
- readonly = this.readonly,
- disabled = this.disabled,
- maxlength = this.maxlength,
- autosize = this.autosize,
- showWordCount = this.showWordCount;
- var attrs = {
- name: name,
- form: form,
- placeholder: placeholder,
- maxlength: maxlength,
- readonly: readonly,
- disabled: disabled
- };
- if (placeholder) {
- attrs.placeholder = UtilTools.getFuncText(placeholder);
- }
- return h('div', {
- class: ['vxe-textarea', (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, 'is--autosize', autosize), _defineProperty(_ref, 'is--disabled', disabled), _ref)]
- }, [h('textarea', {
- ref: 'textarea',
- class: 'vxe-textarea--inner',
- domProps: {
- value: value
- },
- attrs: attrs,
- style: resize ? {
- resize: resize
- } : null,
- on: defaultEvents
- }), showWordCount ? h('span', {
- class: ['vxe-textarea--count', {
- 'is--error': this.isCountError
- }]
- }, "".concat(this.inputCount).concat(maxlength ? "/".concat(maxlength) : '')) : null]);
- },
- methods: {
- focus: function focus() {
- this.$refs.textarea.focus();
- return this.$nextTick();
- },
- blur: function blur() {
- this.$refs.textarea.blur();
- return this.$nextTick();
- },
- triggerEvent: function triggerEvent(evnt) {
- var value = this.value;
- this.$emit(evnt.type, {
- value: value,
- $event: evnt
- }, evnt);
- },
- emitUpdate: function emitUpdate(value, evnt) {
- if (this.value !== value) {
- this.$emit('input', value);
- this.$emit('change', {
- value: value,
- $event: evnt
- });
- }
- },
- inputEvent: function inputEvent(evnt) {
- this.emitUpdate(evnt.target.value, evnt);
- this.handleResize();
- },
- updateAutoTxt: function updateAutoTxt() {
- var $refs = this.$refs,
- value = this.value,
- size = this.size,
- autosize = this.autosize;
- if (autosize) {
- var textElem = $refs.textarea;
- var textStyle = getComputedStyle(textElem);
- autoTxtElem.className = ['vxe-textarea--autosize', size ? "size--".concat(size) : ''].join(' ');
- autoTxtElem.style.width = "".concat(textElem.clientWidth, "px");
- autoTxtElem.style.padding = textStyle.padding;
- autoTxtElem.innerHTML = ('' + (value || ' ')).replace(/\n$/, '\n ');
- }
- },
- handleResize: function handleResize() {
- var _this2 = this;
- if (this.autosize) {
- this.$nextTick(function () {
- var $refs = _this2.$refs,
- sizeOpts = _this2.sizeOpts;
- var minRows = sizeOpts.minRows,
- maxRows = sizeOpts.maxRows;
- var textElem = $refs.textarea;
- var sizeHeight = autoTxtElem.clientHeight;
- var textStyle = getComputedStyle(textElem);
- var lineHeight = ctor_amd_xe_utils_default.a.toNumber(textStyle.lineHeight);
- var paddingTop = ctor_amd_xe_utils_default.a.toNumber(textStyle.paddingTop);
- var paddingBottom = ctor_amd_xe_utils_default.a.toNumber(textStyle.paddingBottom);
- var borderTopWidth = ctor_amd_xe_utils_default.a.toNumber(textStyle.borderTopWidth);
- var borderBottomWidth = ctor_amd_xe_utils_default.a.toNumber(textStyle.borderBottomWidth);
- var intervalHeight = paddingTop + paddingBottom + borderTopWidth + borderBottomWidth;
- var rowNum = (sizeHeight - intervalHeight) / lineHeight;
- var textRows = rowNum && /[0-9]/.test(rowNum) ? rowNum : Math.floor(rowNum) + 1;
- var vaildRows = textRows;
- if (textRows < minRows) {
- vaildRows = minRows;
- } else if (textRows > maxRows) {
- vaildRows = maxRows;
- }
- textElem.style.height = "".concat(vaildRows * lineHeight + intervalHeight, "px");
- });
- }
- }
- }
- });
- // CONCATENATED MODULE: ./packages/textarea/index.js
- src_textarea.install = function (Vue) {
- Vue.component(src_textarea.name, src_textarea);
- };
- var Textarea = src_textarea;
- /* harmony default export */ var packages_textarea = (src_textarea);
- // CONCATENATED MODULE: ./packages/button/src/button.js
- /* harmony default export */ var button_src_button = ({
- name: 'VxeButton',
- props: {
- type: String,
- size: {
- type: String,
- default: function _default() {
- return conf.button.size || conf.size;
- }
- },
- name: [String, Number],
- content: String,
- placement: String,
- status: String,
- icon: String,
- round: Boolean,
- circle: Boolean,
- disabled: Boolean,
- loading: Boolean,
- destroyOnClose: Boolean,
- transfer: {
- type: Boolean,
- default: function _default() {
- return conf.button.transfer;
- }
- }
- },
- data: function data() {
- return {
- inited: false,
- showPanel: false,
- animatVisible: false,
- panelIndex: 0,
- panelStyle: null,
- panelPlacement: null
- };
- },
- computed: {
- vSize: function vSize() {
- return this.size || this.$parent.size || this.$parent.vSize;
- },
- isText: function isText() {
- return this.type === 'text';
- },
- isFormBtn: function isFormBtn() {
- return ['submit', 'reset', 'button'].indexOf(this.type) > -1;
- },
- btnType: function btnType() {
- return this.isText ? this.type : 'button';
- },
- btnStatus: function btnStatus() {
- return this.status || (this.type === 'primary' ? this.type : null);
- }
- },
- created: function created() {
- if (this.type === 'primary') {
- UtilTools.warn('vxe.error.delProp', ['type=primary', 'status=primary']);
- }
- GlobalEvent.on(this, 'mousewheel', this.handleGlobalMousewheelEvent);
- },
- beforeDestroy: function beforeDestroy() {
- var panelElem = this.$refs.panel;
- if (panelElem && panelElem.parentNode) {
- panelElem.parentNode.removeChild(panelElem);
- }
- },
- destroyed: function destroyed() {
- GlobalEvent.off(this, 'mousewheel');
- },
- render: function render(h) {
- var _ref,
- _ref2,
- _this = this,
- _ref3,
- _ref4;
- var $scopedSlots = this.$scopedSlots,
- $listeners = this.$listeners,
- inited = this.inited,
- type = this.type,
- destroyOnClose = this.destroyOnClose,
- isFormBtn = this.isFormBtn,
- btnStatus = this.btnStatus,
- btnType = this.btnType,
- vSize = this.vSize,
- name = this.name,
- disabled = this.disabled,
- loading = this.loading,
- showPanel = this.showPanel,
- animatVisible = this.animatVisible,
- panelPlacement = this.panelPlacement;
- var downsSlot = $scopedSlots.dropdowns;
- return downsSlot ? h('div', {
- class: ['vxe-button--dropdown', (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, 'is--active', showPanel), _ref)]
- }, [h('button', {
- ref: 'btn',
- class: ['vxe-button', "type--".concat(btnType), (_ref2 = {}, _defineProperty(_ref2, "size--".concat(vSize), vSize), _defineProperty(_ref2, "theme--".concat(btnStatus), btnStatus), _defineProperty(_ref2, 'is--round', this.round), _defineProperty(_ref2, 'is--circle', this.circle), _defineProperty(_ref2, 'is--disabled', disabled || loading), _defineProperty(_ref2, 'is--loading', loading), _ref2)],
- attrs: {
- name: name,
- type: isFormBtn ? type : 'button',
- disabled: disabled || loading
- },
- on: Object.assign({
- mouseenter: this.mouseenterTargetEvent,
- mouseleave: this.mouseleaveEvent
- }, ctor_amd_xe_utils_default.a.objectMap($listeners, function (cb, type) {
- return function (evnt) {
- return _this.$emit(type, {
- $event: evnt
- }, evnt);
- };
- }))
- }, this.renderContent(h).concat([h('i', {
- class: "vxe-button--dropdown-arrow ".concat(conf.icon.BUTTON_DROPDOWN)
- })])), h('div', {
- ref: 'panel',
- class: ['vxe-button--dropdown-panel', (_ref3 = {}, _defineProperty(_ref3, "size--".concat(vSize), vSize), _defineProperty(_ref3, 'animat--leave', animatVisible), _defineProperty(_ref3, 'animat--enter', showPanel), _ref3)],
- attrs: {
- 'data-placement': panelPlacement
- },
- style: this.panelStyle
- }, inited ? [h('div', {
- class: 'vxe-button--dropdown-wrapper',
- on: {
- click: this.clickDropdownEvent,
- mouseenter: this.mouseenterEvent,
- mouseleave: this.mouseleaveEvent
- }
- }, destroyOnClose && !showPanel ? [] : downsSlot.call(this, {}, h))] : null)]) : h('button', {
- ref: 'btn',
- class: ['vxe-button', "type--".concat(btnType), (_ref4 = {}, _defineProperty(_ref4, "size--".concat(vSize), vSize), _defineProperty(_ref4, "theme--".concat(btnStatus), btnStatus), _defineProperty(_ref4, 'is--round', this.round), _defineProperty(_ref4, 'is--circle', this.circle), _defineProperty(_ref4, 'is--disabled', disabled || loading), _defineProperty(_ref4, 'is--loading', loading), _ref4)],
- attrs: {
- name: name,
- type: isFormBtn ? type : 'button',
- disabled: disabled || loading
- },
- on: ctor_amd_xe_utils_default.a.objectMap($listeners, function (cb, type) {
- return function (evnt) {
- return _this.$emit(type, {
- $event: evnt
- }, evnt);
- };
- })
- }, this.renderContent(h));
- },
- methods: {
- renderContent: function renderContent(h) {
- var $scopedSlots = this.$scopedSlots,
- content = this.content,
- icon = this.icon,
- loading = this.loading;
- var contents = [];
- if (loading) {
- contents.push(h('i', {
- class: ['vxe-button--loading-icon', conf.icon.BUTTON_LOADING]
- }));
- } else if (icon) {
- contents.push(h('i', {
- class: ['vxe-button--icon', icon]
- }));
- }
- if ($scopedSlots.default) {
- contents.push(h('span', {
- class: 'vxe-button--content'
- }, $scopedSlots.default.call(this)));
- } else if (content) {
- contents.push(h('span', {
- class: 'vxe-button--content'
- }, [UtilTools.getFuncText(content)]));
- }
- return contents;
- },
- handleGlobalMousewheelEvent: function handleGlobalMousewheelEvent(evnt) {
- if (this.showPanel && !DomTools.getEventTargetNode(evnt, this.$refs.panel).flag) {
- this.closePanel();
- }
- },
- updateZindex: function updateZindex() {
- if (this.panelIndex < UtilTools.getLastZIndex()) {
- this.panelIndex = UtilTools.nextZIndex();
- }
- },
- clickDropdownEvent: function clickDropdownEvent(evnt) {
- var _this2 = this;
- var dropdownElem = evnt.currentTarget;
- var panelElem = this.$refs.panel;
- var _DomTools$getEventTar = DomTools.getEventTargetNode(evnt, dropdownElem, 'vxe-button'),
- flag = _DomTools$getEventTar.flag,
- targetElem = _DomTools$getEventTar.targetElem;
- if (flag) {
- if (panelElem) {
- panelElem.dataset.active = 'N';
- }
- this.showPanel = false;
- setTimeout(function () {
- if (!panelElem || panelElem.dataset.active !== 'Y') {
- _this2.animatVisible = false;
- }
- }, 350);
- this.$emit('dropdown-click', {
- name: targetElem.getAttribute('name'),
- $event: evnt
- }, evnt);
- }
- },
- mouseenterTargetEvent: function mouseenterTargetEvent() {
- var _this3 = this;
- var panelElem = this.$refs.panel;
- panelElem.dataset.active = 'Y';
- if (!this.inited) {
- this.inited = true;
- if (this.transfer) {
- document.body.appendChild(panelElem);
- }
- }
- this.showTime = setTimeout(function () {
- if (panelElem.dataset.active === 'Y') {
- _this3.mouseenterEvent();
- } else {
- _this3.animatVisible = false;
- }
- }, 250);
- },
- mouseenterEvent: function mouseenterEvent() {
- var _this4 = this;
- var panelElem = this.$refs.panel;
- panelElem.dataset.active = 'Y';
- this.animatVisible = true;
- setTimeout(function () {
- if (panelElem.dataset.active === 'Y') {
- _this4.showPanel = true;
- _this4.updateZindex();
- _this4.updatePlacement();
- setTimeout(function () {
- if (_this4.showPanel) {
- _this4.updatePlacement();
- }
- }, 50);
- }
- }, 20);
- },
- mouseleaveEvent: function mouseleaveEvent() {
- this.closePanel();
- },
- closePanel: function closePanel() {
- var _this5 = this;
- var panelElem = this.$refs.panel;
- clearTimeout(this.showTime);
- if (panelElem) {
- panelElem.dataset.active = 'N';
- setTimeout(function () {
- if (panelElem.dataset.active !== 'Y') {
- _this5.showPanel = false;
- setTimeout(function () {
- if (panelElem.dataset.active !== 'Y') {
- _this5.animatVisible = false;
- }
- }, 350);
- }
- }, 100);
- } else {
- this.animatVisible = false;
- this.showPanel = false;
- }
- },
- updatePlacement: function updatePlacement() {
- var _this6 = this;
- return this.$nextTick().then(function () {
- var $refs = _this6.$refs,
- transfer = _this6.transfer,
- placement = _this6.placement,
- panelIndex = _this6.panelIndex;
- var targetElem = $refs.btn;
- var panelElem = $refs.panel;
- if (panelElem && targetElem) {
- var targetHeight = targetElem.offsetHeight;
- var targetWidth = targetElem.offsetWidth;
- var panelHeight = panelElem.offsetHeight;
- var panelWidth = panelElem.offsetWidth;
- var marginSize = 5;
- var panelStyle = {
- zIndex: panelIndex
- };
- var _DomTools$getAbsolute = DomTools.getAbsolutePos(targetElem),
- boundingTop = _DomTools$getAbsolute.boundingTop,
- boundingLeft = _DomTools$getAbsolute.boundingLeft,
- visibleHeight = _DomTools$getAbsolute.visibleHeight,
- visibleWidth = _DomTools$getAbsolute.visibleWidth;
- var panelPlacement = 'bottom';
- if (transfer) {
- var left = boundingLeft;
- var top = boundingTop + targetHeight;
- if (placement === 'top') {
- panelPlacement = 'top';
- top = boundingTop - panelHeight;
- } else if (!placement) {
- // 如果下面不够放,则向上
- if (top + panelHeight + marginSize > visibleHeight) {
- panelPlacement = 'top';
- top = boundingTop - panelHeight;
- } // 如果上面不够放,则向下(优先)
- if (top < marginSize) {
- panelPlacement = 'bottom';
- top = boundingTop + targetHeight;
- }
- } // 如果溢出右边
- if (left + panelWidth + marginSize > visibleWidth) {
- left -= left + panelWidth + marginSize - visibleWidth;
- } // 如果溢出左边
- if (left < marginSize) {
- left = marginSize;
- }
- Object.assign(panelStyle, {
- left: "".concat(left, "px"),
- top: "".concat(top, "px"),
- minWidth: "".concat(targetWidth, "px")
- });
- } else {
- if (placement === 'top') {
- panelPlacement = 'top';
- panelStyle.bottom = "".concat(targetHeight, "px");
- } else if (!placement) {
- // 如果下面不够放,则向上
- if (boundingTop + targetHeight + panelHeight > visibleHeight) {
- // 如果上面不够放,则向下(优先)
- if (boundingTop - targetHeight - panelHeight > marginSize) {
- panelPlacement = 'top';
- panelStyle.bottom = "".concat(targetHeight, "px");
- }
- }
- }
- }
- _this6.panelStyle = panelStyle;
- _this6.panelPlacement = panelPlacement;
- return _this6.$nextTick();
- }
- });
- },
- focus: function focus() {
- this.$el.focus();
- return this.$nextTick();
- },
- blur: function blur() {
- this.$el.blur();
- return this.$nextTick();
- }
- }
- });
- // CONCATENATED MODULE: ./packages/button/index.js
- button_src_button.install = function (Vue) {
- Vue.component(button_src_button.name, button_src_button);
- };
- var Button = button_src_button;
- /* harmony default export */ var packages_button = (button_src_button);
- // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
- function _arrayWithHoles(arr) {
- if (Array.isArray(arr)) return arr;
- }
- // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
- function _iterableToArrayLimit(arr, i) {
- if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
- var _arr = [];
- var _n = true;
- var _d = false;
- var _e = undefined;
- try {
- for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
- _arr.push(_s.value);
- if (i && _arr.length === i) break;
- }
- } catch (err) {
- _d = true;
- _e = err;
- } finally {
- try {
- if (!_n && _i["return"] != null) _i["return"]();
- } finally {
- if (_d) throw _e;
- }
- }
- return _arr;
- }
- // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
- function _nonIterableRest() {
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
- }
- // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js
- function _slicedToArray(arr, i) {
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
- }
- // CONCATENATED MODULE: ./packages/modal/src/queue.js
- var queue = [];
- /* harmony default export */ var src_queue = (queue);
- // CONCATENATED MODULE: ./packages/modal/src/activities.js
- var allActivedModals = [];
- /* harmony default export */ var activities = (allActivedModals);
- // CONCATENATED MODULE: ./packages/modal/src/modal.js
- var activeModals = [];
- /* harmony default export */ var modal = ({
- name: 'VxeModal',
- props: {
- value: Boolean,
- id: String,
- type: {
- type: String,
- default: 'modal'
- },
- loading: {
- type: Boolean,
- default: null
- },
- status: String,
- iconStatus: String,
- className: String,
- top: {
- type: [Number, String],
- default: function _default() {
- return conf.modal.top;
- }
- },
- position: [String, Object],
- title: String,
- duration: {
- type: [Number, String],
- default: function _default() {
- return conf.modal.duration;
- }
- },
- // 请使用 content
- message: [String, Function],
- content: [String, Function],
- cancelButtonText: {
- type: String,
- default: function _default() {
- return conf.modal.cancelButtonText;
- }
- },
- confirmButtonText: {
- type: String,
- default: function _default() {
- return conf.modal.confirmButtonText;
- }
- },
- lockView: {
- type: Boolean,
- default: function _default() {
- return conf.modal.lockView;
- }
- },
- lockScroll: Boolean,
- mask: {
- type: Boolean,
- default: function _default() {
- return conf.modal.mask;
- }
- },
- maskClosable: {
- type: Boolean,
- default: function _default() {
- return conf.modal.maskClosable;
- }
- },
- escClosable: {
- type: Boolean,
- default: function _default() {
- return conf.modal.escClosable;
- }
- },
- resize: {
- type: Boolean,
- default: function _default() {
- return conf.modal.resize;
- }
- },
- showHeader: {
- type: Boolean,
- default: function _default() {
- return conf.modal.showHeader;
- }
- },
- showFooter: {
- type: Boolean,
- default: function _default() {
- return conf.modal.showFooter;
- }
- },
- showZoom: {
- type: Boolean,
- default: null
- },
- dblclickZoom: {
- type: Boolean,
- default: function _default() {
- return conf.modal.dblclickZoom;
- }
- },
- width: [Number, String],
- height: [Number, String],
- minWidth: {
- type: [Number, String],
- default: function _default() {
- return conf.modal.minWidth;
- }
- },
- minHeight: {
- type: [Number, String],
- default: function _default() {
- return conf.modal.minHeight;
- }
- },
- zIndex: Number,
- marginSize: {
- type: [Number, String],
- default: conf.modal.marginSize
- },
- fullscreen: Boolean,
- remember: {
- type: Boolean,
- default: function _default() {
- return conf.modal.remember;
- }
- },
- destroyOnClose: {
- type: Boolean,
- default: function _default() {
- return conf.modal.destroyOnClose;
- }
- },
- showTitleOverflow: {
- type: Boolean,
- default: function _default() {
- return conf.modal.showTitleOverflow;
- }
- },
- transfer: {
- type: Boolean,
- default: function _default() {
- return conf.modal.transfer;
- }
- },
- storage: {
- type: Boolean,
- default: function _default() {
- return conf.modal.storage;
- }
- },
- storageKey: {
- type: String,
- default: function _default() {
- return conf.modal.storageKey;
- }
- },
- animat: {
- type: Boolean,
- default: function _default() {
- return conf.modal.animat;
- }
- },
- size: {
- type: String,
- default: function _default() {
- return conf.modal.size || conf.size;
- }
- },
- beforeHideMethod: {
- type: Function,
- default: function _default() {
- return conf.modal.beforeHideMethod;
- }
- },
- slots: Object,
- events: Object
- },
- data: function data() {
- return {
- inited: false,
- visible: false,
- contentVisible: false,
- modalTop: 0,
- modalZindex: 0,
- zoomLocat: null,
- firstOpen: false
- };
- },
- computed: {
- vSize: function vSize() {
- return this.size || this.$parent && (this.$parent.size || this.$parent.vSize);
- },
- isMsg: function isMsg() {
- return this.type === 'message';
- }
- },
- watch: {
- width: function width() {
- this.recalculate();
- },
- height: function height() {
- this.recalculate();
- },
- value: function value(visible) {
- this[visible ? 'open' : 'close']();
- }
- },
- created: function created() {
- if (this.storage && !this.id) {
- UtilTools.error('vxe.error.reqProp', ['modal.id']);
- }
- activeModals.push(this);
- },
- mounted: function mounted() {
- var $listeners = this.$listeners,
- _this$events = this.events,
- events = _this$events === void 0 ? {} : _this$events;
- if (this.value) {
- this.open();
- }
- this.recalculate();
- if (this.escClosable) {
- GlobalEvent.on(this, 'keydown', this.handleGlobalKeydownEvent);
- } // 触发 inserted 事件
- var type = 'inserted';
- var params = {
- type: type,
- $modal: this,
- $event: {
- type: type
- }
- };
- if ($listeners.inserted) {
- this.$emit('inserted', params);
- } else if (events.inserted) {
- events.inserted.call(this, params);
- }
- },
- beforeDestroy: function beforeDestroy() {
- var _this = this;
- var $el = this.$el;
- GlobalEvent.off(this, 'keydown');
- this.removeMsgQueue();
- if ($el.parentNode === document.body) {
- $el.parentNode.removeChild($el);
- }
- ctor_amd_xe_utils_default.a.remove(activeModals, function ($modal) {
- return $modal === _this;
- });
- },
- render: function render(h) {
- var _ref,
- _this2 = this;
- var $scopedSlots = this.$scopedSlots,
- _this$slots = this.slots,
- slots = _this$slots === void 0 ? {} : _this$slots,
- inited = this.inited,
- vSize = this.vSize,
- className = this.className,
- type = this.type,
- resize = this.resize,
- showZoom = this.showZoom,
- animat = this.animat,
- loading = this.loading,
- status = this.status,
- iconStatus = this.iconStatus,
- showFooter = this.showFooter,
- zoomLocat = this.zoomLocat,
- modalTop = this.modalTop,
- dblclickZoom = this.dblclickZoom,
- contentVisible = this.contentVisible,
- visible = this.visible,
- title = this.title,
- lockScroll = this.lockScroll,
- lockView = this.lockView,
- mask = this.mask,
- isMsg = this.isMsg,
- showTitleOverflow = this.showTitleOverflow,
- destroyOnClose = this.destroyOnClose;
- var content = this.content || this.message;
- var defaultSlot = $scopedSlots.default || slots.default;
- var footerSlot = $scopedSlots.footer || slots.footer;
- var headerSlot = $scopedSlots.header || slots.header;
- var titleSlot = $scopedSlots.title || slots.title;
- var headerOns = {
- mousedown: this.mousedownEvent
- };
- if ((showZoom === null ? resize : showZoom) && dblclickZoom && type === 'modal') {
- headerOns.dblclick = this.toggleZoomEvent;
- }
- return h('div', {
- 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)],
- style: {
- zIndex: this.modalZindex,
- top: modalTop ? "".concat(modalTop, "px") : null
- },
- on: {
- click: this.selfClickEvent
- }
- }, [h('div', {
- class: 'vxe-modal--box',
- on: {
- mousedown: this.boxMousedownEvent
- },
- ref: 'modalBox'
- }, [this.showHeader ? h('div', {
- class: ['vxe-modal--header', !isMsg && showTitleOverflow ? 'is--ellipsis' : ''],
- on: headerOns
- }, headerSlot ? !inited || destroyOnClose && !visible ? [] : headerSlot.call(this, {
- $modal: this
- }, h) : [titleSlot ? titleSlot.call(this, {
- $modal: this
- }, h) : h('span', {
- class: 'vxe-modal--title'
- }, title ? UtilTools.getFuncText(title) : conf.i18n('vxe.alert.title')), (showZoom === null ? resize : showZoom) ? h('i', {
- class: ['vxe-modal--zoom-btn', 'trigger--btn', zoomLocat ? conf.icon.MODAL_ZOOM_OUT : conf.icon.MODAL_ZOOM_IN],
- attrs: {
- title: conf.i18n("vxe.modal.zoom".concat(zoomLocat ? 'Out' : 'In'))
- },
- on: {
- click: this.toggleZoomEvent
- }
- }) : null, h('i', {
- class: ['vxe-modal--close-btn', 'trigger--btn', conf.icon.MODAL_CLOSE],
- attrs: {
- title: conf.i18n('vxe.modal.close')
- },
- on: {
- click: this.closeEvent
- }
- })]) : null, h('div', {
- class: 'vxe-modal--body'
- }, [status ? h('div', {
- class: 'vxe-modal--status-wrapper'
- }, [h('i', {
- class: ['vxe-modal--status-icon', iconStatus || conf.icon["MODAL_".concat(status).toLocaleUpperCase()]]
- })]) : null, h('div', {
- class: 'vxe-modal--content'
- }, defaultSlot ? !inited || destroyOnClose && !visible ? [] : defaultSlot.call(this, {
- $modal: this
- }, h) : UtilTools.getFuncText(content)), !isMsg ? h('div', {
- class: ['vxe-loading', {
- 'is--visible': loading
- }]
- }, [h('div', {
- class: 'vxe-loading--spinner'
- })]) : null]), showFooter ? h('div', {
- class: 'vxe-modal--footer'
- }, footerSlot ? !inited || destroyOnClose && !visible ? [] : footerSlot.call(this, {
- $modal: this
- }, h) : [type === 'confirm' ? h('vxe-button', {
- ref: 'cancelBtn',
- on: {
- click: this.cancelEvent
- }
- }, this.cancelButtonText || conf.i18n('vxe.button.cancel')) : null, h('vxe-button', {
- ref: 'confirmBtn',
- props: {
- status: 'primary'
- },
- on: {
- click: this.confirmEvent
- }
- }, this.confirmButtonText || conf.i18n('vxe.button.confirm'))]) : null, !isMsg && resize ? h('span', {
- class: 'vxe-modal--resize'
- }, ['wl', 'wr', 'swst', 'sest', 'st', 'swlb', 'selb', 'sb'].map(function (type) {
- return h('span', {
- class: "".concat(type, "-resize"),
- attrs: {
- 'data-type': type
- },
- on: {
- mousedown: _this2.dragEvent
- }
- });
- })) : null])]);
- },
- methods: {
- recalculate: function recalculate() {
- var width = this.width,
- height = this.height;
- var modalBoxElem = this.getBox();
- modalBoxElem.style.width = width ? isNaN(width) ? width : "".concat(width, "px") : null;
- modalBoxElem.style.height = height ? isNaN(height) ? height : "".concat(height, "px") : null;
- return this.$nextTick();
- },
- selfClickEvent: function selfClickEvent(evnt) {
- if (this.maskClosable && evnt.target === this.$el) {
- var type = 'mask';
- this.close(type);
- }
- },
- updateZindex: function updateZindex() {
- var zIndex = this.zIndex,
- modalZindex = this.modalZindex;
- if (zIndex) {
- this.modalZindex = zIndex;
- } else if (modalZindex < UtilTools.getLastZIndex()) {
- this.modalZindex = UtilTools.nextZIndex();
- }
- },
- closeEvent: function closeEvent(evnt) {
- var type = 'close';
- this.$emit(type, {
- type: type,
- $modal: this,
- $event: evnt
- }, evnt);
- this.close(type);
- },
- confirmEvent: function confirmEvent(evnt) {
- var type = 'confirm';
- this.$emit(type, {
- type: type,
- $modal: this,
- $event: evnt
- }, evnt);
- this.close(type);
- },
- cancelEvent: function cancelEvent(evnt) {
- var type = 'cancel';
- this.$emit(type, {
- type: type,
- $modal: this,
- $event: evnt
- }, evnt);
- this.close(type);
- },
- open: function open() {
- var _this3 = this;
- var $refs = this.$refs,
- _this$events2 = this.events,
- events = _this$events2 === void 0 ? {} : _this$events2,
- inited = this.inited,
- duration = this.duration,
- visible = this.visible,
- isMsg = this.isMsg,
- remember = this.remember,
- showFooter = this.showFooter;
- if (!inited) {
- this.inited = true;
- if (this.transfer) {
- document.body.appendChild(this.$el);
- }
- }
- if (!visible) {
- var type = 'show';
- var params = {
- type: type,
- $modal: this,
- $event: {
- type: type
- }
- };
- if (!remember) {
- this.recalculate();
- }
- this.visible = true;
- this.contentVisible = false;
- this.updateZindex();
- activities.push(this);
- this.$emit('activated', params);
- setTimeout(function () {
- _this3.contentVisible = true;
- _this3.$nextTick(function () {
- if (showFooter) {
- var operBtn = $refs.confirmBtn || $refs.cancelBtn;
- if (operBtn) {
- operBtn.focus();
- }
- }
- if (events.show) {
- events.show.call(_this3, params);
- } else {
- _this3.$emit('input', true);
- _this3.$emit('show', params);
- }
- });
- }, 10);
- if (isMsg) {
- this.addMsgQueue();
- if (duration !== -1) {
- setTimeout(this.close, ctor_amd_xe_utils_default.a.toNumber(duration));
- }
- } else {
- this.$nextTick(function () {
- var firstOpen = _this3.firstOpen,
- fullscreen = _this3.fullscreen;
- if (!remember || !firstOpen) {
- _this3.updatePosition().then(function () {
- setTimeout(function () {
- return _this3.updatePosition();
- }, 20);
- });
- }
- if (!firstOpen) {
- _this3.firstOpen = true;
- if (_this3.hasPosStorage()) {
- _this3.restorePosStorage();
- } else if (fullscreen) {
- _this3.$nextTick(function () {
- return _this3.maximize();
- });
- }
- }
- });
- }
- }
- },
- addMsgQueue: function addMsgQueue() {
- if (src_queue.indexOf(this) === -1) {
- src_queue.push(this);
- }
- this.updateStyle();
- },
- removeMsgQueue: function removeMsgQueue() {
- var _this4 = this;
- if (src_queue.indexOf(this) > -1) {
- ctor_amd_xe_utils_default.a.remove(src_queue, function (comp) {
- return comp === _this4;
- });
- }
- this.updateStyle();
- },
- updateStyle: function updateStyle() {
- this.$nextTick(function () {
- var offsetTop = 0;
- src_queue.forEach(function (comp) {
- offsetTop += ctor_amd_xe_utils_default.a.toNumber(comp.top);
- comp.modalTop = offsetTop;
- offsetTop += comp.$refs.modalBox.clientHeight;
- });
- });
- },
- updatePosition: function updatePosition() {
- var _this5 = this;
- return this.$nextTick().then(function () {
- var marginSize = _this5.marginSize,
- position = _this5.position;
- var modalBoxElem = _this5.getBox();
- var clientVisibleWidth = document.documentElement.clientWidth || document.body.clientWidth;
- var clientVisibleHeight = document.documentElement.clientHeight || document.body.clientHeight;
- var isPosCenter = position === 'center';
- var _ref2 = isPosCenter ? {
- top: position,
- left: position
- } : Object.assign({}, position),
- top = _ref2.top,
- left = _ref2.left;
- var topCenter = isPosCenter || top === 'center';
- var leftCenter = isPosCenter || left === 'center';
- var posTop = '';
- var posLeft = '';
- if (left && !leftCenter) {
- posLeft = isNaN(left) ? left : "".concat(left, "px");
- } else {
- posLeft = "".concat(Math.max(marginSize, clientVisibleWidth / 2 - modalBoxElem.offsetWidth / 2), "px");
- }
- if (top && !topCenter) {
- posTop = isNaN(top) ? top : "".concat(top, "px");
- } else {
- posTop = "".concat(Math.max(marginSize, clientVisibleHeight / 2 - modalBoxElem.offsetHeight / 2), "px");
- }
- modalBoxElem.style.top = posTop;
- modalBoxElem.style.left = posLeft;
- });
- },
- close: function close(type) {
- var _this6 = this;
- var _this$events3 = this.events,
- events = _this$events3 === void 0 ? {} : _this$events3,
- remember = this.remember,
- visible = this.visible,
- isMsg = this.isMsg,
- beforeHideMethod = this.beforeHideMethod;
- var params = {
- type: type,
- $modal: this,
- $event: {
- type: type
- }
- };
- if (visible) {
- Promise.resolve(beforeHideMethod ? beforeHideMethod(params) : null).then(function (rest) {
- if (!ctor_amd_xe_utils_default.a.isError(rest)) {
- if (isMsg) {
- _this6.removeMsgQueue();
- }
- _this6.contentVisible = false;
- if (!remember) {
- _this6.zoomLocat = null;
- }
- _this6.$emit('deactivated', params);
- ctor_amd_xe_utils_default.a.remove(activities, function (item) {
- return item === _this6;
- });
- setTimeout(function () {
- _this6.visible = false;
- if (events.hide) {
- events.hide.call(_this6, params);
- } else {
- _this6.$emit('input', false);
- _this6.$emit('hide', params);
- }
- }, 200);
- }
- }).catch(function (e) {
- return e;
- });
- }
- },
- handleGlobalKeydownEvent: function handleGlobalKeydownEvent(evnt) {
- var _this7 = this;
- if (evnt.keyCode === 27) {
- var lastModal = ctor_amd_xe_utils_default.a.max(activities, function (item) {
- return item.modalZindex;
- }); // 多个时,只关掉最上层的窗口
- if (lastModal) {
- setTimeout(function () {
- if (lastModal === _this7 && lastModal.escClosable) {
- _this7.close();
- }
- }, 10);
- }
- }
- },
- getBox: function getBox() {
- return this.$refs.modalBox;
- },
- isMaximized: function isMaximized() {
- return !!this.zoomLocat;
- },
- maximize: function maximize() {
- var _this8 = this;
- return this.$nextTick().then(function () {
- var zoomLocat = _this8.zoomLocat;
- if (!zoomLocat) {
- var marginSize = _this8.marginSize;
- var modalBoxElem = _this8.getBox();
- var _DomTools$getDomNode = DomTools.getDomNode(),
- visibleHeight = _DomTools$getDomNode.visibleHeight,
- visibleWidth = _DomTools$getDomNode.visibleWidth;
- _this8.zoomLocat = {
- top: modalBoxElem.offsetTop,
- left: modalBoxElem.offsetLeft,
- width: modalBoxElem.offsetWidth + (modalBoxElem.style.width ? 0 : 1),
- height: modalBoxElem.offsetHeight + (modalBoxElem.style.height ? 0 : 1)
- };
- Object.assign(modalBoxElem.style, {
- top: "".concat(marginSize, "px"),
- left: "".concat(marginSize, "px"),
- width: "".concat(visibleWidth - marginSize * 2, "px"),
- height: "".concat(visibleHeight - marginSize * 2, "px")
- });
- _this8.savePosStorage();
- }
- });
- },
- revert: function revert() {
- var _this9 = this;
- return this.$nextTick().then(function () {
- var zoomLocat = _this9.zoomLocat;
- if (zoomLocat) {
- var modalBoxElem = _this9.getBox();
- _this9.zoomLocat = null;
- Object.assign(modalBoxElem.style, {
- top: "".concat(zoomLocat.top, "px"),
- left: "".concat(zoomLocat.left, "px"),
- width: "".concat(zoomLocat.width, "px"),
- height: "".concat(zoomLocat.height, "px")
- });
- _this9.savePosStorage();
- }
- });
- },
- zoom: function zoom() {
- var _this10 = this;
- return this[this.zoomLocat ? 'revert' : 'maximize']().then(function () {
- return _this10.isMaximized();
- });
- },
- toggleZoomEvent: function toggleZoomEvent(evnt) {
- var _this11 = this;
- var $listeners = this.$listeners,
- zoomLocat = this.zoomLocat,
- _this$events4 = this.events,
- events = _this$events4 === void 0 ? {} : _this$events4;
- var params = {
- type: zoomLocat ? 'revert' : 'max',
- $modal: this,
- $event: evnt
- };
- return this.zoom().then(function () {
- if ($listeners.zoom) {
- _this11.$emit('zoom', params, evnt);
- } else if (events.zoom) {
- events.zoom.call(_this11, params, evnt);
- }
- });
- },
- getPosition: function getPosition() {
- if (!this.isMsg) {
- var modalBoxElem = this.getBox();
- if (modalBoxElem) {
- return {
- top: modalBoxElem.offsetTop,
- left: modalBoxElem.offsetLeft
- };
- }
- }
- return null;
- },
- setPosition: function setPosition(top, left) {
- if (!this.isMsg) {
- var modalBoxElem = this.getBox();
- if (ctor_amd_xe_utils_default.a.isNumber(top)) {
- modalBoxElem.style.top = "".concat(top, "px");
- }
- if (ctor_amd_xe_utils_default.a.isNumber(left)) {
- modalBoxElem.style.left = "".concat(left, "px");
- }
- }
- return this.$nextTick();
- },
- boxMousedownEvent: function boxMousedownEvent() {
- var modalZindex = this.modalZindex;
- if (activeModals.some(function (_vm) {
- return _vm.visible && _vm.modalZindex > modalZindex;
- })) {
- this.updateZindex();
- }
- },
- mousedownEvent: function mousedownEvent(evnt) {
- var _this12 = this;
- var remember = this.remember,
- storage = this.storage,
- marginSize = this.marginSize,
- zoomLocat = this.zoomLocat;
- var modalBoxElem = this.getBox();
- if (!zoomLocat && evnt.button === 0 && !DomTools.getEventTargetNode(evnt, modalBoxElem, 'trigger--btn').flag) {
- evnt.preventDefault();
- var domMousemove = document.onmousemove;
- var domMouseup = document.onmouseup;
- var disX = evnt.clientX - modalBoxElem.offsetLeft;
- var disY = evnt.clientY - modalBoxElem.offsetTop;
- var _DomTools$getDomNode2 = DomTools.getDomNode(),
- visibleHeight = _DomTools$getDomNode2.visibleHeight,
- visibleWidth = _DomTools$getDomNode2.visibleWidth;
- document.onmousemove = function (evnt) {
- evnt.preventDefault();
- var offsetWidth = modalBoxElem.offsetWidth;
- var offsetHeight = modalBoxElem.offsetHeight;
- var minX = marginSize;
- var maxX = visibleWidth - offsetWidth - marginSize - 1;
- var minY = marginSize;
- var maxY = visibleHeight - offsetHeight - marginSize - 1;
- var left = evnt.clientX - disX;
- var top = evnt.clientY - disY;
- if (left > maxX) {
- left = maxX;
- }
- if (left < minX) {
- left = minX;
- }
- if (top > maxY) {
- top = maxY;
- }
- if (top < minY) {
- top = minY;
- }
- modalBoxElem.style.left = "".concat(left, "px");
- modalBoxElem.style.top = "".concat(top, "px");
- };
- document.onmouseup = function () {
- document.onmousemove = domMousemove;
- document.onmouseup = domMouseup;
- if (remember && storage) {
- _this12.$nextTick(function () {
- _this12.savePosStorage();
- });
- }
- };
- }
- },
- dragEvent: function dragEvent(evnt) {
- var _this13 = this;
- evnt.preventDefault();
- var $listeners = this.$listeners,
- marginSize = this.marginSize,
- _this$events5 = this.events,
- events = _this$events5 === void 0 ? {} : _this$events5,
- remember = this.remember,
- storage = this.storage;
- var _DomTools$getDomNode3 = DomTools.getDomNode(),
- visibleHeight = _DomTools$getDomNode3.visibleHeight,
- visibleWidth = _DomTools$getDomNode3.visibleWidth;
- var type = evnt.target.dataset.type;
- var minWidth = ctor_amd_xe_utils_default.a.toNumber(this.minWidth);
- var minHeight = ctor_amd_xe_utils_default.a.toNumber(this.minHeight);
- var maxWidth = visibleWidth;
- var maxHeight = visibleHeight;
- var modalBoxElem = this.getBox();
- var domMousemove = document.onmousemove;
- var domMouseup = document.onmouseup;
- var clientWidth = modalBoxElem.clientWidth;
- var clientHeight = modalBoxElem.clientHeight;
- var disX = evnt.clientX;
- var disY = evnt.clientY;
- var offsetTop = modalBoxElem.offsetTop;
- var offsetLeft = modalBoxElem.offsetLeft;
- var params = {
- type: 'resize',
- $modal: this
- };
- document.onmousemove = function (evnt) {
- evnt.preventDefault();
- var dragLeft;
- var dragTop;
- var width;
- var height;
- switch (type) {
- case 'wl':
- dragLeft = disX - evnt.clientX;
- width = dragLeft + clientWidth;
- if (offsetLeft - dragLeft > marginSize) {
- if (width > minWidth) {
- modalBoxElem.style.width = "".concat(width < maxWidth ? width : maxWidth, "px");
- modalBoxElem.style.left = "".concat(offsetLeft - dragLeft, "px");
- }
- }
- break;
- case 'swst':
- dragLeft = disX - evnt.clientX;
- dragTop = disY - evnt.clientY;
- width = dragLeft + clientWidth;
- height = dragTop + clientHeight;
- if (offsetLeft - dragLeft > marginSize) {
- if (width > minWidth) {
- modalBoxElem.style.width = "".concat(width < maxWidth ? width : maxWidth, "px");
- modalBoxElem.style.left = "".concat(offsetLeft - dragLeft, "px");
- }
- }
- if (offsetTop - dragTop > marginSize) {
- if (height > minHeight) {
- modalBoxElem.style.height = "".concat(height < maxHeight ? height : maxHeight, "px");
- modalBoxElem.style.top = "".concat(offsetTop - dragTop, "px");
- }
- }
- break;
- case 'swlb':
- dragLeft = disX - evnt.clientX;
- dragTop = evnt.clientY - disY;
- width = dragLeft + clientWidth;
- height = dragTop + clientHeight;
- if (offsetLeft - dragLeft > marginSize) {
- if (width > minWidth) {
- modalBoxElem.style.width = "".concat(width < maxWidth ? width : maxWidth, "px");
- modalBoxElem.style.left = "".concat(offsetLeft - dragLeft, "px");
- }
- }
- if (offsetTop + height + marginSize < visibleHeight) {
- if (height > minHeight) {
- modalBoxElem.style.height = "".concat(height < maxHeight ? height : maxHeight, "px");
- }
- }
- break;
- case 'st':
- dragTop = disY - evnt.clientY;
- height = clientHeight + dragTop;
- if (offsetTop - dragTop > marginSize) {
- if (height > minHeight) {
- modalBoxElem.style.height = "".concat(height < maxHeight ? height : maxHeight, "px");
- modalBoxElem.style.top = "".concat(offsetTop - dragTop, "px");
- }
- }
- break;
- case 'wr':
- dragLeft = evnt.clientX - disX;
- width = dragLeft + clientWidth;
- if (offsetLeft + width + marginSize < visibleWidth) {
- if (width > minWidth) {
- modalBoxElem.style.width = "".concat(width < maxWidth ? width : maxWidth, "px");
- }
- }
- break;
- case 'sest':
- dragLeft = evnt.clientX - disX;
- dragTop = disY - evnt.clientY;
- width = dragLeft + clientWidth;
- height = dragTop + clientHeight;
- if (offsetLeft + width + marginSize < visibleWidth) {
- if (width > minWidth) {
- modalBoxElem.style.width = "".concat(width < maxWidth ? width : maxWidth, "px");
- }
- }
- if (offsetTop - dragTop > marginSize) {
- if (height > minHeight) {
- modalBoxElem.style.height = "".concat(height < maxHeight ? height : maxHeight, "px");
- modalBoxElem.style.top = "".concat(offsetTop - dragTop, "px");
- }
- }
- break;
- case 'selb':
- dragLeft = evnt.clientX - disX;
- dragTop = evnt.clientY - disY;
- width = dragLeft + clientWidth;
- height = dragTop + clientHeight;
- if (offsetLeft + width + marginSize < visibleWidth) {
- if (width > minWidth) {
- modalBoxElem.style.width = "".concat(width < maxWidth ? width : maxWidth, "px");
- }
- }
- if (offsetTop + height + marginSize < visibleHeight) {
- if (height > minHeight) {
- modalBoxElem.style.height = "".concat(height < maxHeight ? height : maxHeight, "px");
- }
- }
- break;
- case 'sb':
- dragTop = evnt.clientY - disY;
- height = dragTop + clientHeight;
- if (offsetTop + height + marginSize < visibleHeight) {
- if (height > minHeight) {
- modalBoxElem.style.height = "".concat(height < maxHeight ? height : maxHeight, "px");
- }
- }
- break;
- }
- modalBoxElem.className = modalBoxElem.className.replace(/\s?is--drag/, '') + ' is--drag';
- if (remember && storage) {
- _this13.savePosStorage();
- }
- if ($listeners.zoom) {
- _this13.$emit('zoom', params, evnt);
- } else if (events.zoom) {
- events.zoom.call(_this13, params, evnt);
- }
- };
- document.onmouseup = function () {
- _this13.zoomLocat = null;
- document.onmousemove = domMousemove;
- document.onmouseup = domMouseup;
- setTimeout(function () {
- modalBoxElem.className = modalBoxElem.className.replace(/\s?is--drag/, '');
- }, 50);
- };
- },
- getStorageMap: function getStorageMap(key) {
- var version = conf.version;
- var rest = ctor_amd_xe_utils_default.a.toStringJSON(localStorage.getItem(key));
- return rest && rest._v === version ? rest : {
- _v: version
- };
- },
- hasPosStorage: function hasPosStorage() {
- var id = this.id,
- remember = this.remember,
- storage = this.storage,
- storageKey = this.storageKey;
- return !!(remember && storage && this.getStorageMap(storageKey)[id]);
- },
- restorePosStorage: function restorePosStorage() {
- var id = this.id,
- remember = this.remember,
- storage = this.storage,
- storageKey = this.storageKey;
- if (remember && storage) {
- var posStorage = this.getStorageMap(storageKey)[id];
- if (posStorage) {
- var modalBoxElem = this.getBox();
- var _posStorage$split = posStorage.split(','),
- _posStorage$split2 = _slicedToArray(_posStorage$split, 8),
- left = _posStorage$split2[0],
- top = _posStorage$split2[1],
- width = _posStorage$split2[2],
- height = _posStorage$split2[3],
- zoomLeft = _posStorage$split2[4],
- zoomTop = _posStorage$split2[5],
- zoomWidth = _posStorage$split2[6],
- zoomHeight = _posStorage$split2[7];
- if (left) {
- modalBoxElem.style.left = "".concat(left, "px");
- }
- if (top) {
- modalBoxElem.style.top = "".concat(top, "px");
- }
- if (width) {
- modalBoxElem.style.width = "".concat(width, "px");
- }
- if (height) {
- modalBoxElem.style.height = "".concat(height, "px");
- }
- if (zoomLeft && zoomTop) {
- this.zoomLocat = {
- left: zoomLeft,
- top: zoomTop,
- width: zoomWidth,
- height: zoomHeight
- };
- }
- }
- }
- },
- savePosStorage: function savePosStorage() {
- var id = this.id,
- remember = this.remember,
- storage = this.storage,
- storageKey = this.storageKey,
- zoomLocat = this.zoomLocat;
- if (remember && storage) {
- var modalBoxElem = this.getBox();
- var posStorageMap = this.getStorageMap(storageKey);
- 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) {
- return val ? ctor_amd_xe_utils_default.a.toNumber(val) : '';
- }).join(',');
- localStorage.setItem(storageKey, ctor_amd_xe_utils_default.a.toJSONString(posStorageMap));
- }
- }
- }
- });
- // CONCATENATED MODULE: ./packages/modal/index.js
- /* eslint-disable @typescript-eslint/no-use-before-define */
- var ModalClass = null;
- function openModal(opts) {
- var options = Object.assign({}, opts, {
- transfer: true
- });
- return new Promise(function (resolve) {
- if (options && options.id && activities.some(function (comp) {
- return comp.id === options.id;
- })) {
- resolve('exist');
- } else {
- var events = options.events || {};
- options.events = Object.assign({}, events, {
- hide: function hide(params) {
- if (events.hide) {
- events.hide.call(this, params);
- }
- setTimeout(function () {
- return $modal.$destroy();
- }, $modal.isMsg ? 500 : 100);
- resolve(params.type);
- }
- });
- var $modal = new ModalClass({
- el: document.createElement('div'),
- propsData: options
- });
- setTimeout(function () {
- if ($modal.isDestroy) {
- $modal.close();
- } else {
- $modal.open();
- }
- });
- }
- });
- }
- function ModalController(options) {
- UtilTools.warn('vxe.error.delFunc', ['Modal', 'Modal.open']);
- return openModal(options);
- }
- ['alert', 'confirm', 'message'].forEach(function (type, index) {
- var defOpts = index === 2 ? {
- mask: false,
- lockView: false,
- showHeader: false
- } : {
- showFooter: true
- };
- defOpts.type = type;
- defOpts.dblclickZoom = false;
- if (index === 1) {
- defOpts.status = 'question';
- }
- ModalController[type] = function (content, title, options) {
- var opts = {};
- if (ctor_amd_xe_utils_default.a.isObject(content)) {
- opts = content;
- } else {
- if (title) {
- opts = index === 2 ? {
- status: title
- } : {
- title: title
- };
- }
- opts.content = ctor_amd_xe_utils_default.a.toString(content);
- }
- return openModal(Object.assign({
- type: type
- }, defOpts, opts, options));
- };
- });
- /**
- * 全局关闭动态的活动窗口(只能用于关闭动态的创建的活动窗口)
- * 如果传 id 则关闭指定的窗口
- * 如果不传则关闭所有窗口
- */
- function closeModal(id) {
- var modals = arguments.length ? [getModal(id)] : activities;
- modals.forEach(function ($modal) {
- if ($modal) {
- $modal.isDestroy = true;
- $modal.close('close');
- }
- });
- return Promise.resolve();
- }
- function getModal(id) {
- return ctor_amd_xe_utils_default.a.find(activities, function ($modal) {
- return $modal.id === id;
- });
- }
- ModalController.closeAll = function () {
- UtilTools.warn('vxe.error.delFunc', ['closeAll', 'close']);
- closeModal();
- };
- ModalController.get = getModal;
- ModalController.close = closeModal;
- ModalController.open = openModal;
- ModalController.install = function (Vue) {
- v_x_e_table._modal = 1;
- Vue.component('vxe-message', modal);
- Vue.component(modal.name, modal);
- ModalClass = Vue.extend(modal);
- Vue.prototype.$XMsg = ModalController;
- Vue.prototype.$XModal = ModalController;
- v_x_e_table.$modal = ModalController;
- v_x_e_table.modal = ModalController;
- if (!Vue.prototype.$vxe) {
- Vue.prototype.$vxe = {
- modal: ModalController
- };
- } else {
- Vue.prototype.$vxe.modal = ModalController;
- }
- };
- var Modal = ModalController;
- /* harmony default export */ var packages_modal = (ModalController);
- // CONCATENATED MODULE: ./packages/tooltip/src/tooltip.js
- function updateTipStyle(_vm) {
- var wrapperElem = _vm.$el,
- tipTarget = _vm.tipTarget,
- tipStore = _vm.tipStore;
- if (tipTarget) {
- var _DomTools$getDomNode = DomTools.getDomNode(),
- scrollTop = _DomTools$getDomNode.scrollTop,
- scrollLeft = _DomTools$getDomNode.scrollLeft,
- visibleWidth = _DomTools$getDomNode.visibleWidth;
- var _DomTools$getAbsolute = DomTools.getAbsolutePos(tipTarget),
- top = _DomTools$getAbsolute.top,
- left = _DomTools$getAbsolute.left;
- var marginSize = 6;
- var offsetHeight = wrapperElem.offsetHeight;
- var offsetWidth = wrapperElem.offsetWidth;
- var tipLeft = left;
- var tipTop = top - offsetHeight - marginSize;
- tipLeft = Math.max(marginSize, left + Math.floor((tipTarget.offsetWidth - offsetWidth) / 2));
- if (tipLeft + offsetWidth + marginSize > scrollLeft + visibleWidth) {
- tipLeft = scrollLeft + visibleWidth - offsetWidth - marginSize;
- }
- if (top - offsetHeight < scrollTop + marginSize) {
- tipStore.placement = 'bottom';
- tipTop = top + tipTarget.offsetHeight + marginSize;
- }
- tipStore.style.top = "".concat(tipTop, "px");
- tipStore.style.left = "".concat(tipLeft, "px");
- tipStore.arrowStyle.left = "".concat(left - tipLeft + tipTarget.offsetWidth / 2, "px");
- }
- }
- /* harmony default export */ var src_tooltip = ({
- name: 'VxeTooltip',
- props: {
- value: Boolean,
- size: {
- type: String,
- default: function _default() {
- return conf.tooltip.size || conf.size;
- }
- },
- trigger: {
- type: String,
- default: function _default() {
- return conf.tooltip.trigger;
- }
- },
- theme: {
- type: String,
- default: function _default() {
- return conf.tooltip.theme;
- }
- },
- content: [String, Function],
- zIndex: [String, Number],
- isArrow: {
- type: Boolean,
- default: true
- },
- enterable: Boolean,
- leaveDelay: {
- type: Number,
- default: conf.tooltip.leaveDelay
- }
- },
- data: function data() {
- return {
- isUpdate: false,
- isHover: false,
- visible: false,
- message: '',
- tipTarget: null,
- tipZindex: 0,
- tipStore: {
- style: {},
- placement: '',
- arrowStyle: null
- }
- };
- },
- computed: {
- vSize: function vSize() {
- return this.size || this.$parent.size || this.$parent.vSize;
- }
- },
- watch: {
- content: function content(value) {
- this.message = value;
- },
- value: function value(_value) {
- if (!this.isUpdate) {
- this[_value ? 'open' : 'close']();
- }
- this.isUpdate = false;
- }
- },
- mounted: function mounted() {
- var $el = this.$el,
- trigger = this.trigger,
- content = this.content,
- value = this.value;
- var parentNode = $el.parentNode;
- var target;
- this.message = content;
- this.tipZindex = UtilTools.nextZIndex();
- ctor_amd_xe_utils_default.a.arrayEach($el.children, function (elem, index) {
- if (index > 1) {
- parentNode.insertBefore(elem, $el);
- if (!target) {
- target = elem;
- }
- }
- });
- parentNode.removeChild($el);
- this.target = target;
- if (target) {
- if (trigger === 'hover') {
- target.onmouseleave = this.targetMouseleaveEvent;
- target.onmouseenter = this.targetMouseenterEvent;
- } else if (trigger === 'click') {
- target.onclick = this.clickEvent;
- }
- }
- if (value) {
- this.open();
- }
- },
- beforeDestroy: function beforeDestroy() {
- var $el = this.$el,
- target = this.target,
- trigger = this.trigger;
- var parentNode = $el.parentNode;
- if (parentNode) {
- parentNode.removeChild($el);
- }
- if (target) {
- if (trigger === 'hover') {
- target.onmouseenter = null;
- target.onmouseleave = null;
- } else if (trigger === 'click') {
- target.onclick = null;
- }
- }
- },
- render: function render(h) {
- var _ref;
- var vSize = this.vSize,
- theme = this.theme,
- message = this.message,
- isHover = this.isHover,
- isArrow = this.isArrow,
- visible = this.visible,
- tipStore = this.tipStore,
- enterable = this.enterable;
- var on;
- if (enterable) {
- on = {
- mouseenter: this.wrapperMouseenterEvent,
- mouseleave: this.wrapperMouseleaveEvent
- };
- }
- return h('div', {
- class: ['vxe-table--tooltip-wrapper', "theme--".concat(theme), (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, "placement--".concat(tipStore.placement), tipStore.placement), _defineProperty(_ref, 'is--enterable', enterable), _defineProperty(_ref, 'is--visible', visible), _defineProperty(_ref, 'is--arrow', isArrow), _defineProperty(_ref, 'is--hover', isHover), _ref)],
- style: tipStore.style,
- ref: 'tipWrapper',
- on: on
- }, [h('div', {
- class: 'vxe-table--tooltip-content'
- }, this.$slots.content || message), h('div', {
- class: 'vxe-table--tooltip-arrow',
- style: tipStore.arrowStyle
- })].concat(this.$slots.default));
- },
- methods: {
- show: function show(target, message) {
- return this.open(target, message);
- },
- open: function open(target, message) {
- return this.toVisible(target || this.target, message);
- },
- close: function close() {
- this.tipTarget = null;
- Object.assign(this.tipStore, {
- style: {},
- placement: '',
- arrowStyle: null
- });
- this.update(false);
- return this.$nextTick();
- },
- update: function update(value) {
- if (value !== this.visible) {
- this.visible = value;
- this.isUpdate = true;
- if (this.$listeners.input) {
- this.$emit('input', this.visible);
- }
- }
- },
- updateZindex: function updateZindex() {
- if (this.tipZindex < UtilTools.getLastZIndex()) {
- this.tipZindex = UtilTools.nextZIndex();
- }
- },
- toVisible: function toVisible(target, message) {
- this.targetActive = true;
- if (target) {
- var $el = this.$el,
- tipStore = this.tipStore,
- zIndex = this.zIndex;
- var parentNode = $el.parentNode;
- if (!parentNode) {
- document.body.appendChild($el);
- }
- if (message) {
- this.message = message;
- }
- this.tipTarget = target;
- this.update(true);
- this.updateZindex();
- tipStore.placement = 'top';
- tipStore.style = {
- width: 'auto',
- left: 0,
- top: 0,
- zIndex: zIndex || this.tipZindex
- };
- tipStore.arrowStyle = {
- left: '50%'
- };
- return this.updatePlacement();
- }
- return this.$nextTick();
- },
- updatePlacement: function updatePlacement() {
- var _this = this;
- return this.$nextTick().then(function () {
- var wrapperElem = _this.$el,
- tipTarget = _this.tipTarget;
- if (tipTarget && wrapperElem) {
- updateTipStyle(_this);
- return _this.$nextTick().then(function () {
- return updateTipStyle(_this);
- });
- }
- });
- },
- clickEvent: function clickEvent() {
- this[this.visible ? 'close' : 'open']();
- },
- targetMouseenterEvent: function targetMouseenterEvent() {
- this.open();
- },
- targetMouseleaveEvent: function targetMouseleaveEvent() {
- var _this2 = this;
- var trigger = this.trigger,
- enterable = this.enterable,
- leaveDelay = this.leaveDelay;
- this.targetActive = false;
- if (enterable && trigger === 'hover') {
- setTimeout(function () {
- if (!_this2.isHover) {
- _this2.close();
- }
- }, leaveDelay);
- } else {
- this.close();
- }
- },
- wrapperMouseenterEvent: function wrapperMouseenterEvent() {
- this.isHover = true;
- },
- wrapperMouseleaveEvent: function wrapperMouseleaveEvent(evnt) {
- var _this3 = this;
- var $listeners = this.$listeners,
- trigger = this.trigger,
- enterable = this.enterable,
- leaveDelay = this.leaveDelay;
- this.isHover = false;
- if ($listeners.leave) {
- this.$emit('leave', {
- $event: evnt
- });
- } else if (enterable && trigger === 'hover') {
- setTimeout(function () {
- if (!_this3.targetActive) {
- _this3.close();
- }
- }, leaveDelay);
- }
- }
- }
- });
- // CONCATENATED MODULE: ./packages/tooltip/index.js
- src_tooltip.install = function (Vue) {
- v_x_e_table._tooltip = 1;
- Vue.component(src_tooltip.name, src_tooltip);
- };
- var Tooltip = src_tooltip;
- /* harmony default export */ var packages_tooltip = (src_tooltip);
- // CONCATENATED MODULE: ./packages/form/src/form.js
- var form_Rule = /*#__PURE__*/function () {
- function Rule(rule) {
- _classCallCheck(this, Rule);
- Object.assign(this, {
- $options: rule,
- required: rule.required,
- min: rule.min,
- max: rule.min,
- type: rule.type,
- pattern: rule.pattern,
- validator: rule.validator,
- trigger: rule.trigger,
- maxWidth: rule.maxWidth
- });
- }
- _createClass(Rule, [{
- key: "content",
- get: function get() {
- return UtilTools.getFuncText(this.$options.content || this.$options.message);
- }
- }, {
- key: "message",
- get: function get() {
- return this.content;
- }
- }]);
- return Rule;
- }();
- function getResetValue(value, resetValue) {
- if (ctor_amd_xe_utils_default.a.isArray(value)) {
- resetValue = [];
- }
- return resetValue;
- }
- function getItemSlots(_vm, item) {
- var $scopedSlots = _vm.$scopedSlots;
- var itemSlots = item.slots;
- var slots = {};
- var $default;
- if (itemSlots) {
- $default = itemSlots.default;
- if ($default && $scopedSlots[$default]) {
- $default = $scopedSlots[$default];
- }
- }
- if ($default) {
- slots.default = $default;
- }
- return slots;
- }
- function renderItems(h, _vm) {
- var items = _vm.items;
- return items ? items.map(function (item) {
- return h('vxe-form-item', {
- props: item,
- scopedSlots: getItemSlots(_vm, item)
- });
- }) : [];
- }
- /* harmony default export */ var src_form = ({
- name: 'VxeForm',
- props: {
- loading: Boolean,
- data: Object,
- size: {
- type: String,
- default: function _default() {
- return conf.form.size || conf.size;
- }
- },
- span: [String, Number],
- align: {
- type: String,
- default: function _default() {
- return conf.form.align;
- }
- },
- titleAlign: {
- type: String,
- default: function _default() {
- return conf.form.titleAlign;
- }
- },
- titleWidth: [String, Number],
- titleColon: {
- type: Boolean,
- default: function _default() {
- return conf.form.titleColon;
- }
- },
- titleAsterisk: {
- type: Boolean,
- default: function _default() {
- return conf.form.titleAsterisk;
- }
- },
- titleOverflow: {
- type: [Boolean, String],
- default: null
- },
- items: Array,
- rules: Object,
- preventSubmit: {
- type: Boolean,
- default: function _default() {
- return conf.form.preventSubmit;
- }
- },
- validConfig: Object
- },
- data: function data() {
- return {
- collapseAll: true,
- invalids: [],
- tooltipTimeout: null,
- tooltipActive: false,
- tooltipStore: {
- item: null,
- visible: false
- }
- };
- },
- provide: function provide() {
- return {
- $vxeform: this
- };
- },
- computed: {
- vSize: function vSize() {
- return this.size || this.$parent.size || this.$parent.vSize;
- },
- validOpts: function validOpts() {
- return Object.assign({}, conf.form.validConfig, this.validConfig);
- },
- tooltipOpts: function tooltipOpts() {
- var opts = Object.assign({
- leaveDelay: 300
- }, conf.form.tooltipConfig, this.tooltipConfig);
- if (opts.enterable) {
- opts.leaveMethod = this.handleTooltipLeaveMethod;
- }
- return opts;
- }
- },
- render: function render(h) {
- var _ref;
- var _e = this._e,
- $slots = this.$slots,
- loading = this.loading,
- vSize = this.vSize,
- tooltipOpts = this.tooltipOpts;
- var hasUseTooltip = v_x_e_table._tooltip;
- return h('form', {
- class: ['vxe-form', 'vxe-row', (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, 'is--colon', this.titleColon), _defineProperty(_ref, 'is--asterisk', this.titleAsterisk), _defineProperty(_ref, 'is--loading', loading), _ref)],
- on: {
- submit: this.submitEvent,
- reset: this.resetEvent
- }
- }, [].concat($slots.default || renderItems(h, this)).concat([h('div', {
- class: ['vxe-loading', {
- 'is--visible': loading
- }]
- }, [h('div', {
- class: 'vxe-loading--spinner'
- })]),
- /**
- * 工具提示
- */
- hasUseTooltip ? h('vxe-tooltip', _objectSpread2({
- ref: 'tooltip'
- }, tooltipOpts)) : _e()]));
- },
- methods: {
- getItems: function getItems() {
- return this.$children.map(function (_ref2) {
- var field = _ref2.field,
- title = _ref2.title,
- itemRender = _ref2.itemRender;
- return {
- field: field,
- title: title,
- itemRender: itemRender
- };
- });
- },
- toggleCollapse: function toggleCollapse() {
- this.collapseAll = !this.collapseAll;
- return this.$nextTick();
- },
- submitEvent: function submitEvent(evnt) {
- var _this = this;
- evnt.preventDefault();
- if (!this.preventSubmit) {
- this.beginValidate().then(function () {
- _this.$emit('submit', {
- data: _this.data,
- $form: _this,
- $event: evnt
- }, evnt);
- }).catch(function (errMap) {
- _this.$emit('submit-invalid', {
- data: _this.data,
- errMap: errMap,
- $form: _this,
- $event: evnt
- }, evnt);
- });
- }
- },
- reset: function reset() {
- var _this2 = this;
- var data = this.data;
- if (data) {
- this.$children.forEach(function (_ref3) {
- var field = _ref3.field,
- resetValue = _ref3.resetValue,
- itemRender = _ref3.itemRender;
- if (field) {
- ctor_amd_xe_utils_default.a.set(data, field, resetValue === null ? getResetValue(ctor_amd_xe_utils_default.a.get(data, field), undefined) : resetValue);
- var compConf = itemRender ? v_x_e_table.renderer.get(itemRender.name) : null;
- if (compConf && compConf.itemResetMethod) {
- compConf.itemResetMethod({
- data: data,
- property: field,
- $form: _this2
- });
- }
- }
- });
- }
- return this.clearValidate();
- },
- resetEvent: function resetEvent(evnt) {
- evnt.preventDefault();
- this.reset();
- this.$emit('reset', {
- data: this.data,
- $form: this,
- $event: evnt
- }, evnt);
- },
- handleTooltipLeaveMethod: function handleTooltipLeaveMethod() {
- var _this3 = this;
- var tooltipOpts = this.tooltipOpts;
- setTimeout(function () {
- if (!_this3.tooltipActive) {
- _this3.closeTooltip();
- }
- }, tooltipOpts.leaveDelay);
- return false;
- },
- closeTooltip: function closeTooltip() {
- var tooltipStore = this.tooltipStore;
- var $tooltip = this.$refs.tooltip;
- if (tooltipStore.visible) {
- Object.assign(tooltipStore, {
- item: null,
- visible: false
- });
- if ($tooltip) {
- $tooltip.close();
- }
- }
- return this.$nextTick();
- },
- triggerHeaderHelpEvent: function triggerHeaderHelpEvent(evnt, params) {
- var item = params.item;
- var tooltipStore = this.tooltipStore;
- var $tooltip = this.$refs.tooltip;
- var overflowElem = evnt.currentTarget;
- var content = (overflowElem.textContent || '').trim();
- var isCellOverflow = overflowElem.scrollWidth > overflowElem.clientWidth;
- clearTimeout(this.tooltipTimeout);
- this.tooltipActive = true;
- this.closeTooltip();
- if (content && isCellOverflow) {
- Object.assign(tooltipStore, {
- item: item,
- visible: true
- });
- if ($tooltip) {
- $tooltip.open(overflowElem, content);
- }
- }
- },
- handleTargetLeaveEvent: function handleTargetLeaveEvent() {
- var _this4 = this;
- var tooltipOpts = this.tooltipOpts;
- this.tooltipActive = false;
- if (tooltipOpts.enterable) {
- this.tooltipTimeout = setTimeout(function () {
- var $tooltip = _this4.$refs.tooltip;
- if ($tooltip && !$tooltip.isHover) {
- _this4.closeTooltip();
- }
- }, tooltipOpts.leaveDelay);
- } else {
- this.closeTooltip();
- }
- },
- clearValidate: function clearValidate(field) {
- if (field) {
- ctor_amd_xe_utils_default.a.remove(this.invalids, function (_ref4) {
- var property = _ref4.property;
- return property === field;
- });
- } else {
- this.invalids = [];
- }
- return this.$nextTick();
- },
- validate: function validate(callback) {
- return this.beginValidate('', callback);
- },
- beginValidate: function beginValidate(type, callback) {
- var _this5 = this;
- var data = this.data,
- formRules = this.rules,
- validOpts = this.validOpts;
- var validRest = {};
- var validFields = [];
- var itemValids = [];
- this.clearValidate();
- if (data && formRules) {
- this.$children.forEach(function (_ref5) {
- var field = _ref5.field;
- if (field) {
- itemValids.push(_this5.validItemRules(type || 'all', field).catch(function (_ref6) {
- var rule = _ref6.rule,
- rules = _ref6.rules;
- var rest = {
- rule: rule,
- rules: rules,
- data: data,
- property: field,
- $form: _this5
- };
- if (!validRest[field]) {
- validRest[field] = [];
- }
- validRest[field].push(rest);
- validFields.push(field);
- _this5.invalids.push(rest);
- return Promise.reject(rest);
- }));
- }
- });
- return Promise.all(itemValids).then(function () {
- if (callback) {
- callback();
- }
- }).catch(function () {
- if (callback) {
- callback(validRest);
- }
- if (validOpts.autoPos) {
- _this5.$nextTick(function () {
- _this5.handleFocus(validFields);
- });
- }
- return Promise.reject(validRest);
- });
- }
- if (callback) {
- callback();
- }
- return Promise.resolve();
- },
- /**
- * 校验数据
- * 按表格行、列顺序依次校验(同步或异步)
- * 校验规则根据索引顺序依次校验,如果是异步则会等待校验完成才会继续校验下一列
- * 如果校验失败则,触发回调或者 Promise<(ErrMap 校验不通过列的信息)>
- * 如果是传回调方式这返回一个 (ErrMap 校验不通过列的信息)
- *
- * rule 配置:
- * required=Boolean 是否必填
- * min=Number 最小长度
- * max=Number 最大长度
- * validator=Function({ itemValue, rule, rules, data, property }) 自定义校验,接收一个 Promise
- * trigger=change 触发方式
- */
- validItemRules: function validItemRules(type, property, val) {
- var _this6 = this;
- var data = this.data,
- formRules = this.rules;
- var errorRules = [];
- var syncVailds = [];
- if (property && formRules) {
- var rules = ctor_amd_xe_utils_default.a.get(formRules, property);
- if (rules) {
- var itemValue = ctor_amd_xe_utils_default.a.isUndefined(val) ? ctor_amd_xe_utils_default.a.get(data, property) : val;
- rules.forEach(function (rule) {
- if (type === 'all' || !rule.trigger || type === rule.trigger) {
- if (ctor_amd_xe_utils_default.a.isFunction(rule.validator)) {
- var customValid = rule.validator({
- itemValue: itemValue,
- rule: rule,
- rules: rules,
- data: data,
- property: property,
- $form: _this6
- });
- if (customValid) {
- if (ctor_amd_xe_utils_default.a.isError(customValid)) {
- errorRules.push(new form_Rule({
- type: 'custom',
- trigger: rule.trigger,
- message: customValid.message,
- rule: new form_Rule(rule)
- }));
- } else if (customValid.catch) {
- // 如果为异步校验(注:异步校验是并发无序的)
- syncVailds.push(customValid.catch(function (e) {
- errorRules.push(new form_Rule({
- type: 'custom',
- trigger: rule.trigger,
- message: e ? e.message : rule.content || rule.message,
- rule: new form_Rule(rule)
- }));
- }));
- }
- }
- } else {
- var isNumber = rule.type === 'number';
- var numVal = isNumber ? ctor_amd_xe_utils_default.a.toNumber(itemValue) : ctor_amd_xe_utils_default.a.getSize(itemValue);
- if (itemValue === null || itemValue === undefined || itemValue === '') {
- if (rule.required) {
- errorRules.push(new form_Rule(rule));
- }
- } else if (isNumber && isNaN(itemValue) || !isNaN(rule.min) && numVal < parseFloat(rule.min) || !isNaN(rule.max) && numVal > parseFloat(rule.max) || rule.pattern && !(rule.pattern.test ? rule.pattern : new RegExp(rule.pattern)).test(itemValue)) {
- errorRules.push(new form_Rule(rule));
- }
- }
- }
- });
- }
- }
- return Promise.all(syncVailds).then(function () {
- if (errorRules.length) {
- var rest = {
- rules: errorRules,
- rule: errorRules[0]
- };
- return Promise.reject(rest);
- }
- });
- },
- handleFocus: function handleFocus(fields) {
- var $children = this.$children;
- fields.some(function (property) {
- var comp = ctor_amd_xe_utils_default.a.find($children, function (item) {
- return item.field === property;
- });
- if (comp && comp.itemRender) {
- var $el = comp.$el,
- itemRender = comp.itemRender;
- var compConf = v_x_e_table.renderer.get(itemRender.name);
- var inputElem; // 如果指定了聚焦 class
- if (itemRender.autofocus) {
- inputElem = $el.querySelector(itemRender.autofocus);
- } // 渲染器的聚焦处理
- if (!inputElem && compConf && compConf.autofocus) {
- inputElem = $el.querySelector(compConf.autofocus);
- }
- if (inputElem) {
- inputElem.focus(); // 保持一致行为,光标移到末端
- if (DomTools.browse.msie) {
- var textRange = inputElem.createTextRange();
- textRange.collapse(false);
- textRange.select();
- }
- return true;
- }
- }
- });
- },
- /**
- * 更新项状态
- * 如果组件值 v-model 发生 change 时,调用改函数用于更新某一项编辑状态
- * 如果单元格配置了校验规则,则会进行校验
- */
- updateStatus: function updateStatus(scope, itemValue) {
- var _this7 = this;
- var property = scope.property;
- if (property) {
- this.validItemRules('change', property, itemValue).then(function () {
- _this7.clearValidate(property);
- }).catch(function (_ref7) {
- var rule = _ref7.rule,
- rules = _ref7.rules;
- var rest = ctor_amd_xe_utils_default.a.find(_this7.invalids, function (rest) {
- return rest.property === property;
- });
- if (rest) {
- rest.rule = rule;
- rest.rules = rules;
- } else {
- _this7.invalids.push({
- rule: rule,
- rules: rules,
- property: property
- });
- }
- });
- }
- }
- }
- });
- // CONCATENATED MODULE: ./packages/form/src/form-item.js
- function renderPrefixIcon(h, titlePrefix) {
- return h('span', {
- class: 'vxe-form--item-title-prefix'
- }, [h('i', {
- class: titlePrefix.icon || conf.icon.FORM_PREFIX
- })]);
- }
- function form_item_renderSuffixIcon(h, titleSuffix) {
- return h('span', {
- class: 'vxe-form--item-title-suffix'
- }, [h('i', {
- class: titleSuffix.icon || conf.icon.FORM_SUFFIX
- })]);
- }
- function renderTitle(h, _vm) {
- var title = _vm.title,
- titlePrefix = _vm.titlePrefix,
- titleSuffix = _vm.titleSuffix;
- var titles = [];
- if (titlePrefix) {
- titles.push(titlePrefix.content || titlePrefix.message ? h('vxe-tooltip', {
- props: {
- content: UtilTools.getFuncText(titlePrefix.content || titlePrefix.message),
- enterable: titlePrefix.enterable,
- theme: titlePrefix.theme
- }
- }, [renderPrefixIcon(h, titlePrefix)]) : renderPrefixIcon(h, titlePrefix));
- }
- titles.push(h('span', {
- class: 'vxe-form--item-title-label'
- }, UtilTools.getFuncText(title)));
- if (titleSuffix) {
- titles.push(titleSuffix.content || titleSuffix.message ? h('vxe-tooltip', {
- props: {
- content: UtilTools.getFuncText(titleSuffix.content || titleSuffix.message),
- enterable: titleSuffix.enterable,
- theme: titleSuffix.theme
- }
- }, [form_item_renderSuffixIcon(h, titleSuffix)]) : form_item_renderSuffixIcon(h, titleSuffix));
- }
- return titles;
- }
- /* harmony default export */ var form_item = ({
- name: 'VxeFormItem',
- props: {
- title: String,
- field: String,
- size: String,
- span: [String, Number],
- align: String,
- titleAlign: String,
- titleWidth: [String, Number],
- className: [String, Function],
- titleOverflow: {
- type: [Boolean, String],
- default: null
- },
- titlePrefix: Object,
- titleSuffix: Object,
- resetValue: {
- default: null
- },
- visible: {
- type: Boolean,
- default: null
- },
- visibleMethod: Function,
- folding: Boolean,
- collapseNode: Boolean,
- itemRender: Object
- },
- inject: {
- $vxeform: {
- default: null
- }
- },
- data: function data() {
- return {
- showError: false,
- showRule: null
- };
- },
- computed: {
- vSize: function vSize() {
- return this.size || this.$parent.size || this.$parent.vSize;
- },
- isRequired: function isRequired() {
- var $vxeform = this.$vxeform,
- field = this.field;
- if ($vxeform && $vxeform.rules) {
- var rules = $vxeform.rules[field];
- if (rules) {
- return rules.some(function (rule) {
- return rule.required;
- });
- }
- }
- return false;
- },
- errRule: function errRule() {
- var $vxeform = this.$vxeform,
- field = this.field;
- if ($vxeform) {
- return ctor_amd_xe_utils_default.a.find($vxeform.invalids, function (_ref) {
- var property = _ref.property;
- return field === property;
- });
- }
- return null;
- }
- },
- watch: {
- errRule: function errRule(value) {
- var _this = this;
- clearTimeout(this.showErrTimeout);
- this.showError = false;
- if (value) {
- this.showRule = value.rule;
- setTimeout(function () {
- _this.showError = true;
- }, 30);
- } else {
- this.showErrTimeout = setTimeout(function () {
- _this.showRule = null;
- }, 350);
- }
- }
- },
- render: function render(h) {
- var _e = this._e,
- $scopedSlots = this.$scopedSlots,
- $vxeform = this.$vxeform,
- title = this.title,
- folding = this.folding,
- visible = this.visible,
- visibleMethod = this.visibleMethod,
- field = this.field,
- className = this.className,
- collapseNode = this.collapseNode,
- itemRender = this.itemRender,
- isRequired = this.isRequired,
- showError = this.showError,
- showRule = this.showRule,
- titleOverflow = this.titleOverflow;
- var compConf = itemRender ? v_x_e_table.renderer.get(itemRender.name) : null;
- var span = this.span || $vxeform.span;
- var align = this.align || $vxeform.align;
- var titleAlign = this.titleAlign || $vxeform.titleAlign;
- var titleWidth = this.titleWidth || $vxeform.titleWidth;
- var collapseAll = $vxeform.collapseAll;
- var itemVisibleMethod = visibleMethod;
- var itemOverflow = ctor_amd_xe_utils_default.a.isUndefined(titleOverflow) || ctor_amd_xe_utils_default.a.isNull(titleOverflow) ? $vxeform.titleOverflow : titleOverflow;
- var showEllipsis = itemOverflow === 'ellipsis';
- var showTitle = itemOverflow === 'title';
- var showTooltip = itemOverflow === true || itemOverflow === 'tooltip';
- var hasEllipsis = showTitle || showTooltip || showEllipsis;
- var params = {
- data: $vxeform.data,
- property: field,
- item: this,
- $form: $vxeform
- };
- if (visible === false) {
- return _e();
- }
- if (!itemVisibleMethod && compConf && compConf.itemVisibleMethod) {
- itemVisibleMethod = compConf.itemVisibleMethod;
- }
- var contentVNs = [];
- if (compConf && compConf.renderItemContent) {
- contentVNs = compConf.renderItemContent.call(this, h, itemRender, params);
- } else if (compConf && compConf.renderItem) {
- // 在 v4 中废弃 renderItem
- UtilTools.warn('vxe.error.delFunc', ['renderItem', 'renderItemContent']);
- contentVNs = compConf.renderItem.call(this, h, itemRender, params);
- } else if ($scopedSlots && $scopedSlots.default) {
- contentVNs = $scopedSlots.default.call(this, params, h);
- } else if (field) {
- contentVNs = ["".concat(ctor_amd_xe_utils_default.a.get($vxeform.data, field))];
- }
- var ons = showTooltip && $vxeform ? {
- mouseenter: function mouseenter(evnt) {
- $vxeform.triggerHeaderHelpEvent(evnt, params);
- },
- mouseleave: $vxeform.handleTargetLeaveEvent
- } : {};
- return h('div', {
- class: ['vxe-form--item', span ? "vxe-col--".concat(span, " is--span") : null, className, {
- 'is--title': title,
- 'is--required': isRequired,
- 'is--hidden': folding && collapseAll,
- 'is--active': !itemVisibleMethod || itemVisibleMethod(params),
- 'is--error': showError
- }]
- }, [h('div', {
- class: 'vxe-form--item-inner'
- }, [title ? h('div', {
- class: ['vxe-form--item-title', titleAlign ? "align--".concat(titleAlign) : null, {
- 'is--ellipsis': hasEllipsis
- }],
- style: titleWidth ? {
- width: isNaN(titleWidth) ? titleWidth : "".concat(titleWidth, "px")
- } : null,
- attrs: {
- title: showTitle ? UtilTools.getFuncText(title) : null
- },
- on: ons
- }, renderTitle(h, this)) : null, h('div', {
- class: ['vxe-form--item-content', align ? "align--".concat(align) : null]
- }, contentVNs.concat([collapseNode ? h('div', {
- class: 'vxe-form--item-trigger-node',
- on: {
- click: this.toggleCollapseEvent
- }
- }, [h('span', {
- class: 'vxe-form--item-trigger-text'
- }, collapseAll ? conf.i18n('vxe.form.unfolding') : conf.i18n('vxe.form.folding')), h('i', {
- class: ['vxe-form--item-trigger-icon', collapseAll ? conf.icon.FORM_FOLDING : conf.icon.FORM_UNFOLDING]
- })]) : null, showRule && $vxeform.validOpts.showMessage ? h('div', {
- class: 'vxe-form--item-valid',
- style: showRule.maxWidth ? {
- width: "".concat(showRule.maxWidth, "px")
- } : null
- }, showRule.message) : null]))])]);
- },
- methods: {
- toggleCollapseEvent: function toggleCollapseEvent(evnt) {
- var $form = this.$vxeform;
- $form.toggleCollapse();
- $form.$emit('toggle-collapse', {
- collapse: !$form.collapseAll,
- data: $form.data,
- $form: $form,
- $event: evnt
- }, evnt);
- }
- }
- });
- // CONCATENATED MODULE: ./packages/form/index.js
- src_form.install = function (Vue) {
- Vue.component(src_form.name, src_form);
- Vue.component(form_item.name, form_item);
- };
- var Form = src_form;
- /* harmony default export */ var packages_form = (src_form);
- // CONCATENATED MODULE: ./packages/select/src/select.js
- function isOptionVisible(option) {
- return option.visible !== false;
- }
- function getOptUniqueId() {
- return ctor_amd_xe_utils_default.a.uniqueId('opt_');
- }
- function getOptkey(_vm) {
- return _vm.optionId || _vm.optId || '_XID';
- }
- function getOptid(_vm, option) {
- var optid = option[getOptkey(_vm)];
- return optid ? encodeURIComponent(optid) : '';
- }
- function findOffsetOption(_vm, optionValue, isUpArrow) {
- var isGroup = _vm.isGroup,
- visibleOptionList = _vm.visibleOptionList,
- visibleGroupList = _vm.visibleGroupList,
- valueField = _vm.valueField,
- groupOptionsField = _vm.groupOptionsField;
- var firstOption;
- var prevOption;
- var nextOption;
- var currOption;
- if (isGroup) {
- for (var gIndex = 0; gIndex < visibleGroupList.length; gIndex++) {
- var group = visibleGroupList[gIndex];
- var groupOptionList = group[groupOptionsField];
- var isGroupDisabled = group.disabled;
- if (groupOptionList) {
- for (var index = 0; index < groupOptionList.length; index++) {
- var option = groupOptionList[index];
- var isVisible = isOptionVisible(option);
- var isDisabled = isGroupDisabled || option.disabled;
- if (!firstOption && !isDisabled) {
- firstOption = option;
- }
- if (currOption) {
- if (isVisible && !isDisabled) {
- nextOption = option;
- if (!isUpArrow) {
- return {
- offsetOption: nextOption
- };
- }
- }
- }
- if (optionValue === option[valueField]) {
- currOption = option;
- if (isUpArrow) {
- return {
- offsetOption: prevOption
- };
- }
- } else {
- if (isVisible && !isDisabled) {
- prevOption = option;
- }
- }
- }
- }
- }
- } else {
- for (var _index = 0; _index < visibleOptionList.length; _index++) {
- var _option = visibleOptionList[_index];
- var _isDisabled = _option.disabled;
- if (!firstOption && !_isDisabled) {
- firstOption = _option;
- }
- if (currOption) {
- if (!_isDisabled) {
- nextOption = _option;
- if (!isUpArrow) {
- return {
- offsetOption: nextOption
- };
- }
- }
- }
- if (optionValue === _option[valueField]) {
- currOption = _option;
- if (isUpArrow) {
- return {
- offsetOption: prevOption
- };
- }
- } else {
- if (!_isDisabled) {
- prevOption = _option;
- }
- }
- }
- }
- return {
- firstOption: firstOption
- };
- }
- function findOption(_vm, optionValue) {
- var isGroup = _vm.isGroup,
- fullOptionList = _vm.fullOptionList,
- fullGroupList = _vm.fullGroupList,
- valueField = _vm.valueField;
- if (isGroup) {
- for (var gIndex = 0; gIndex < fullGroupList.length; gIndex++) {
- var group = fullGroupList[gIndex];
- if (group.options) {
- for (var index = 0; index < group.options.length; index++) {
- var option = group.options[index];
- if (optionValue === option[valueField]) {
- return option;
- }
- }
- }
- }
- }
- return fullOptionList.find(function (item) {
- return optionValue === item[valueField];
- });
- }
- function getSelectLabel(_vm, value) {
- var item = findOption(_vm, value);
- return ctor_amd_xe_utils_default.a.toString(item ? item[_vm.labelField] : value);
- }
- function renderOption(h, _vm, list, group) {
- var isGroup = _vm.isGroup,
- labelField = _vm.labelField,
- valueField = _vm.valueField,
- optkey = _vm.optkey,
- optionKey = _vm.optionKey,
- value = _vm.value,
- multiple = _vm.multiple,
- currentValue = _vm.currentValue;
- return list.map(function (option, cIndex) {
- var isVisible = !isGroup || isOptionVisible(option);
- var isDisabled = group && group.disabled || option.disabled;
- var optionValue = option[valueField];
- var optid = getOptid(_vm, option);
- return isVisible ? h('div', {
- key: optionKey || optkey ? optid : cIndex,
- class: ['vxe-select-option', {
- 'is--disabled': isDisabled,
- 'is--selected': multiple ? value && value.indexOf(optionValue) > -1 : value === optionValue,
- 'is--hover': currentValue === optionValue
- }],
- attrs: {
- 'data-optid': optid
- },
- on: {
- mousedown: function mousedown(evnt) {
- var isLeftBtn = evnt.button === 0;
- if (isLeftBtn) {
- evnt.stopPropagation();
- }
- },
- click: function click(evnt) {
- if (!isDisabled) {
- _vm.changeOptionEvent(evnt, optionValue);
- }
- },
- mouseenter: function mouseenter() {
- if (!isDisabled) {
- _vm.setCurrentOption(option);
- }
- }
- }
- }, UtilTools.formatText(UtilTools.getFuncText(option[labelField]))) : null;
- });
- }
- function renderOptgroup(h, _vm) {
- var optionKey = _vm.optionKey,
- optkey = _vm.optkey,
- visibleGroupList = _vm.visibleGroupList,
- groupLabelField = _vm.groupLabelField,
- groupOptionsField = _vm.groupOptionsField;
- return visibleGroupList.map(function (group, gIndex) {
- var optid = getOptid(_vm, group);
- var isGroupDisabled = group.disabled;
- return h('div', {
- key: optionKey || optkey ? optid : gIndex,
- class: ['vxe-optgroup', {
- 'is--disabled': isGroupDisabled
- }],
- attrs: {
- 'data-optid': optid
- }
- }, [h('div', {
- class: 'vxe-optgroup--title'
- }, UtilTools.getFuncText(group[groupLabelField])), h('div', {
- class: 'vxe-optgroup--wrapper'
- }, renderOption(h, _vm, group[groupOptionsField], group))]);
- });
- }
- function select_renderOpts(h, _vm) {
- var isGroup = _vm.isGroup,
- visibleGroupList = _vm.visibleGroupList,
- visibleOptionList = _vm.visibleOptionList;
- if (isGroup) {
- if (visibleGroupList.length) {
- return renderOptgroup(h, _vm);
- }
- } else {
- if (visibleOptionList.length) {
- return renderOption(h, _vm, visibleOptionList);
- }
- }
- return [h('div', {
- class: 'vxe-select--empty-placeholder'
- }, _vm.emptyText || conf.i18n('vxe.select.emptyText'))];
- }
- /* harmony default export */ var src_select = ({
- name: 'VxeSelect',
- props: {
- value: null,
- clearable: Boolean,
- placeholder: String,
- disabled: Boolean,
- multiple: Boolean,
- multiCharOverflow: {
- type: [Number, String],
- default: function _default() {
- return conf.select.multiCharOverflow;
- }
- },
- prefixIcon: String,
- placement: String,
- options: Array,
- optionProps: Object,
- optionGroups: Array,
- optionGroupProps: Object,
- size: {
- type: String,
- default: function _default() {
- return conf.select.size || conf.size;
- }
- },
- emptyText: String,
- optId: {
- type: String,
- default: function _default() {
- return conf.select.optionId;
- }
- },
- optionId: {
- type: String,
- default: function _default() {
- return conf.select.optionId;
- }
- },
- optKey: Boolean,
- optionKey: Boolean,
- transfer: {
- type: Boolean,
- default: function _default() {
- return conf.select.transfer;
- }
- }
- },
- components: {
- VxeInput: input
- },
- provide: function provide() {
- return {
- $xeselect: this
- };
- },
- data: function data() {
- return {
- inited: false,
- collectOption: [],
- fullGroupList: [],
- fullOptionList: [],
- visibleGroupList: [],
- visibleOptionList: [],
- panelIndex: 0,
- panelStyle: null,
- panelPlacement: null,
- currentValue: null,
- visiblePanel: false,
- animatVisible: false,
- isActivated: false
- };
- },
- computed: {
- vSize: function vSize() {
- return this.size || this.$parent.size || this.$parent.vSize;
- },
- propsOpts: function propsOpts() {
- return this.optionProps || {};
- },
- groupPropsOpts: function groupPropsOpts() {
- return this.optionGroupProps || {};
- },
- labelField: function labelField() {
- return this.propsOpts.label || 'label';
- },
- valueField: function valueField() {
- return this.propsOpts.value || 'value';
- },
- groupLabelField: function groupLabelField() {
- return this.groupPropsOpts.label || 'label';
- },
- groupOptionsField: function groupOptionsField() {
- return this.groupPropsOpts.options || 'options';
- },
- isGroup: function isGroup() {
- return this.fullGroupList.some(function (item) {
- return item.options && item.options.length;
- });
- },
- multiMaxCharNum: function multiMaxCharNum() {
- return ctor_amd_xe_utils_default.a.toNumber(this.multiCharOverflow);
- },
- selectLabel: function selectLabel() {
- var _this = this;
- var value = this.value,
- multiple = this.multiple,
- multiMaxCharNum = this.multiMaxCharNum;
- if (value && multiple) {
- return value.map(function (val) {
- var label = getSelectLabel(_this, val);
- if (multiMaxCharNum > 0 && label.length > multiMaxCharNum) {
- return "".concat(label.substring(0, multiMaxCharNum), "...");
- }
- return label;
- }).join(', ');
- }
- return getSelectLabel(this, value);
- }
- },
- watch: {
- collectOption: function collectOption(value) {
- if (value.some(function (item) {
- return item.options && item.options.length;
- })) {
- this.fullOptionList = [];
- this.fullGroupList = value;
- } else {
- this.fullGroupList = [];
- this.fullOptionList = value;
- }
- this.updateCache();
- },
- options: function options(value) {
- this.fullGroupList = [];
- this.fullOptionList = value;
- this.updateCache();
- },
- optionGroups: function optionGroups(value) {
- this.fullOptionList = [];
- this.fullGroupList = value;
- this.updateCache();
- }
- },
- created: function created() {
- var options = this.options,
- optionGroups = this.optionGroups;
- if (optionGroups) {
- this.fullGroupList = optionGroups;
- } else if (options) {
- this.fullOptionList = options;
- }
- this.updateCache();
- GlobalEvent.on(this, 'mousewheel', this.handleGlobalMousewheelEvent);
- GlobalEvent.on(this, 'mousedown', this.handleGlobalMousedownEvent);
- GlobalEvent.on(this, 'keydown', this.handleGlobalKeydownEvent);
- GlobalEvent.on(this, 'blur', this.handleGlobalBlurEvent);
- },
- beforeDestroy: function beforeDestroy() {
- var panelElem = this.$refs.panel;
- if (panelElem && panelElem.parentNode) {
- panelElem.parentNode.removeChild(panelElem);
- }
- },
- destroyed: function destroyed() {
- GlobalEvent.off(this, 'mousewheel');
- GlobalEvent.off(this, 'mousedown');
- GlobalEvent.off(this, 'keydown');
- GlobalEvent.off(this, 'blur');
- },
- render: function render(h) {
- var _ref, _ref2;
- var vSize = this.vSize,
- inited = this.inited,
- loading = this.loading,
- isActivated = this.isActivated,
- disabled = this.disabled,
- visiblePanel = this.visiblePanel;
- return h('div', {
- class: ['vxe-select', (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, 'is--visivle', visiblePanel), _defineProperty(_ref, 'is--disabled', disabled), _defineProperty(_ref, 'is--loading', loading), _defineProperty(_ref, 'is--active', isActivated), _ref)]
- }, [h('div', {
- class: 'vxe-select-slots',
- ref: 'hideOption'
- }, this.$slots.default), h('vxe-input', {
- ref: 'input',
- props: {
- clearable: this.clearable,
- placeholder: this.placeholder,
- readonly: true,
- disabled: disabled,
- type: 'text',
- prefixIcon: this.prefixIcon,
- suffixIcon: visiblePanel ? conf.icon.SELECT_OPEN : conf.icon.SELECT_CLOSE,
- value: this.selectLabel
- },
- on: {
- clear: this.clearEvent,
- click: this.togglePanelEvent,
- focus: this.focusEvent,
- blur: this.blurEvent,
- 'suffix-click': this.togglePanelEvent
- }
- }), h('div', {
- ref: 'panel',
- class: ['vxe-table--ignore-clear vxe-select--panel', (_ref2 = {}, _defineProperty(_ref2, "size--".concat(vSize), vSize), _defineProperty(_ref2, 'is--transfer', this.transfer), _defineProperty(_ref2, 'animat--leave', this.animatVisible), _defineProperty(_ref2, 'animat--enter', visiblePanel), _ref2)],
- attrs: {
- 'data-placement': this.panelPlacement
- },
- style: this.panelStyle
- }, inited ? [h('div', {
- ref: 'optWrapper',
- class: 'vxe-select-option--wrapper'
- }, select_renderOpts(h, this))] : [])]);
- },
- methods: {
- updateCache: function updateCache() {
- var _this2 = this;
- var fullOptionList = this.fullOptionList,
- fullGroupList = this.fullGroupList,
- groupOptionsField = this.groupOptionsField;
- var optkey = getOptkey(this);
- var handleOptis = function handleOptis(item) {
- if (!getOptid(_this2, item)) {
- item[optkey] = getOptUniqueId();
- }
- };
- if (fullGroupList.length) {
- fullGroupList.forEach(function (group) {
- handleOptis(group);
- if (group[groupOptionsField]) {
- group[groupOptionsField].forEach(handleOptis);
- }
- });
- } else if (fullOptionList.length) {
- fullOptionList.forEach(handleOptis);
- }
- this.refreshOption();
- },
- /**
- * 刷新选项,当选项被动态显示/隐藏时可能会用到
- */
- refreshOption: function refreshOption() {
- var isGroup = this.isGroup,
- fullOptionList = this.fullOptionList,
- fullGroupList = this.fullGroupList;
- if (isGroup) {
- this.visibleGroupList = fullGroupList.filter(isOptionVisible);
- } else {
- this.visibleOptionList = fullOptionList.filter(isOptionVisible);
- }
- return this.$nextTick();
- },
- setCurrentOption: function setCurrentOption(option) {
- if (option) {
- this.currentValue = option[this.valueField];
- }
- },
- scrollToOption: function scrollToOption(option, isAlignBottom) {
- var _this3 = this;
- return this.$nextTick().then(function () {
- if (option) {
- var $refs = _this3.$refs;
- var optWrapperElem = $refs.optWrapper;
- var optElem = $refs.panel.querySelector("[data-optid='".concat(getOptid(_this3, option), "']"));
- if (optWrapperElem && optElem) {
- var wrapperHeight = optWrapperElem.offsetHeight;
- var offsetPadding = 5;
- if (isAlignBottom) {
- if (optElem.offsetTop + optElem.offsetHeight - optWrapperElem.scrollTop > wrapperHeight) {
- optWrapperElem.scrollTop = optElem.offsetTop + optElem.offsetHeight - wrapperHeight;
- }
- } else {
- if (optElem.offsetTop + offsetPadding < optWrapperElem.scrollTop || optElem.offsetTop + offsetPadding > optWrapperElem.scrollTop + optWrapperElem.clientHeight) {
- optWrapperElem.scrollTop = optElem.offsetTop - offsetPadding;
- }
- }
- }
- }
- });
- },
- clearEvent: function clearEvent(params, evnt) {
- this.clearValueEvent(evnt, null);
- this.hideOptionPanel();
- },
- clearValueEvent: function clearValueEvent(evnt, selectValue) {
- this.changeEvent(evnt, selectValue);
- this.$emit('clear', {
- value: selectValue,
- $event: evnt
- }, evnt);
- },
- changeEvent: function changeEvent(evnt, selectValue) {
- if (selectValue !== this.value) {
- this.$emit('input', selectValue);
- this.$emit('change', {
- value: selectValue,
- $event: evnt
- }, evnt);
- }
- },
- changeOptionEvent: function changeOptionEvent(evnt, selectValue) {
- var _this4 = this;
- var value = this.value,
- multiple = this.multiple;
- if (multiple) {
- var multipleValue;
- if (value) {
- if (value.indexOf(selectValue) === -1) {
- multipleValue = value.concat([selectValue]);
- } else {
- multipleValue = value.filter(function (val) {
- return val !== selectValue;
- });
- }
- } else {
- multipleValue = [selectValue];
- }
- this.changeEvent(evnt, multipleValue);
- } else {
- this.changeEvent(evnt, selectValue); // 显示效果
- setTimeout(function () {
- _this4.hideOptionPanel();
- }, 50);
- }
- },
- handleGlobalMousewheelEvent: function handleGlobalMousewheelEvent(evnt) {
- var $refs = this.$refs,
- disabled = this.disabled,
- visiblePanel = this.visiblePanel;
- if (!disabled) {
- if (visiblePanel) {
- if (DomTools.getEventTargetNode(evnt, $refs.panel).flag) {
- this.updatePlacement();
- } else {
- this.hideOptionPanel();
- }
- }
- }
- },
- handleGlobalMousedownEvent: function handleGlobalMousedownEvent(evnt) {
- var $refs = this.$refs,
- $el = this.$el,
- disabled = this.disabled,
- visiblePanel = this.visiblePanel;
- if (!disabled) {
- this.isActivated = DomTools.getEventTargetNode(evnt, $el).flag || DomTools.getEventTargetNode(evnt, $refs.panel).flag;
- if (visiblePanel && !this.isActivated) {
- this.hideOptionPanel();
- }
- }
- },
- handleGlobalKeydownEvent: function handleGlobalKeydownEvent(evnt) {
- var visiblePanel = this.visiblePanel,
- currentValue = this.currentValue,
- clearable = this.clearable,
- disabled = this.disabled;
- if (!disabled) {
- var keyCode = evnt.keyCode;
- var isTab = keyCode === 9;
- var isEnter = keyCode === 13;
- var isEsc = keyCode === 27;
- var isUpArrow = keyCode === 38;
- var isDwArrow = keyCode === 40;
- var isDel = keyCode === 46;
- var isSpacebar = keyCode === 32;
- if (isTab) {
- this.isActivated = false;
- }
- if (visiblePanel) {
- if (isEsc || isTab) {
- this.hideOptionPanel();
- } else if (isEnter) {
- evnt.preventDefault();
- evnt.stopPropagation();
- this.changeOptionEvent(evnt, currentValue);
- } else if (isUpArrow || isDwArrow) {
- evnt.preventDefault();
- var _findOffsetOption = findOffsetOption(this, currentValue, isUpArrow),
- firstOption = _findOffsetOption.firstOption,
- offsetOption = _findOffsetOption.offsetOption;
- if (!offsetOption && !findOption(this, currentValue)) {
- offsetOption = firstOption;
- }
- this.setCurrentOption(offsetOption);
- this.scrollToOption(offsetOption, isDwArrow);
- } else if (isSpacebar) {
- evnt.preventDefault();
- }
- } else if ((isUpArrow || isDwArrow || isEnter || isSpacebar) && this.isActivated) {
- evnt.preventDefault();
- this.showOptionPanel();
- }
- if (this.isActivated) {
- if (isDel && clearable) {
- this.clearValueEvent(evnt, null);
- }
- }
- }
- },
- handleGlobalBlurEvent: function handleGlobalBlurEvent() {
- this.hideOptionPanel();
- },
- updateZindex: function updateZindex() {
- if (this.panelIndex < UtilTools.getLastZIndex()) {
- this.panelIndex = UtilTools.nextZIndex();
- }
- },
- focusEvent: function focusEvent() {
- if (!this.disabled) {
- this.isActivated = true;
- }
- },
- blurEvent: function blurEvent() {
- this.isActivated = false;
- },
- isPanelVisible: function isPanelVisible() {
- return this.visiblePanel;
- },
- togglePanelEvent: function togglePanelEvent(params) {
- var $event = params.$event;
- $event.preventDefault();
- if (this.visiblePanel) {
- this.hideOptionPanel();
- } else {
- this.showOptionPanel();
- }
- },
- showOptionPanel: function showOptionPanel() {
- var _this5 = this;
- if (!this.disabled) {
- clearTimeout(this.hidePanelTimeout);
- if (!this.inited) {
- this.inited = true;
- if (this.transfer) {
- document.body.appendChild(this.$refs.panel);
- }
- }
- this.isActivated = true;
- this.animatVisible = true;
- setTimeout(function () {
- var value = _this5.value,
- multiple = _this5.multiple;
- var currOption = findOption(_this5, multiple && value ? value[0] : value);
- _this5.visiblePanel = true;
- if (currOption) {
- _this5.setCurrentOption(currOption);
- _this5.scrollToOption(currOption);
- }
- }, 10);
- this.updateZindex();
- this.updatePlacement();
- }
- },
- hideOptionPanel: function hideOptionPanel() {
- var _this6 = this;
- this.visiblePanel = false;
- this.hidePanelTimeout = setTimeout(function () {
- _this6.animatVisible = false;
- }, 350);
- },
- updatePlacement: function updatePlacement() {
- var _this7 = this;
- return this.$nextTick().then(function () {
- var $refs = _this7.$refs,
- transfer = _this7.transfer,
- placement = _this7.placement,
- panelIndex = _this7.panelIndex;
- var targetElem = $refs.input.$el;
- var panelElem = $refs.panel;
- if (panelElem && targetElem) {
- var targetHeight = targetElem.offsetHeight;
- var targetWidth = targetElem.offsetWidth;
- var panelHeight = panelElem.offsetHeight;
- var panelWidth = panelElem.offsetWidth;
- var marginSize = 5;
- var panelStyle = {
- zIndex: panelIndex
- };
- var _DomTools$getAbsolute = DomTools.getAbsolutePos(targetElem),
- boundingTop = _DomTools$getAbsolute.boundingTop,
- boundingLeft = _DomTools$getAbsolute.boundingLeft,
- visibleHeight = _DomTools$getAbsolute.visibleHeight,
- visibleWidth = _DomTools$getAbsolute.visibleWidth;
- var panelPlacement = 'bottom';
- if (transfer) {
- var left = boundingLeft;
- var top = boundingTop + targetHeight;
- if (placement === 'top') {
- panelPlacement = 'top';
- top = boundingTop - panelHeight;
- } else if (!placement) {
- // 如果下面不够放,则向上
- if (top + panelHeight + marginSize > visibleHeight) {
- panelPlacement = 'top';
- top = boundingTop - panelHeight;
- } // 如果上面不够放,则向下(优先)
- if (top < marginSize) {
- panelPlacement = 'bottom';
- top = boundingTop + targetHeight;
- }
- } // 如果溢出右边
- if (left + panelWidth + marginSize > visibleWidth) {
- left -= left + panelWidth + marginSize - visibleWidth;
- } // 如果溢出左边
- if (left < marginSize) {
- left = marginSize;
- }
- Object.assign(panelStyle, {
- left: "".concat(left, "px"),
- top: "".concat(top, "px"),
- minWidth: "".concat(targetWidth, "px")
- });
- } else {
- if (placement === 'top') {
- panelPlacement = 'top';
- panelStyle.bottom = "".concat(targetHeight, "px");
- } else if (!placement) {
- // 如果下面不够放,则向上
- if (boundingTop + targetHeight + panelHeight > visibleHeight) {
- // 如果上面不够放,则向下(优先)
- if (boundingTop - targetHeight - panelHeight > marginSize) {
- panelPlacement = 'top';
- panelStyle.bottom = "".concat(targetHeight, "px");
- }
- }
- }
- }
- _this7.panelStyle = panelStyle;
- _this7.panelPlacement = panelPlacement;
- return _this7.$nextTick();
- }
- });
- },
- focus: function focus() {
- this.isActivated = true;
- this.$refs.input.focus();
- return this.$nextTick();
- },
- blur: function blur() {
- this.$refs.input.blur();
- this.isActivated = false;
- return this.$nextTick();
- }
- }
- });
- // CONCATENATED MODULE: ./packages/select/src/util.js
- var util_OptionConfig = /*#__PURE__*/function () {
- function OptionConfig($xeselect, _vm) {
- _classCallCheck(this, OptionConfig);
- Object.assign(this, {
- value: _vm.value,
- label: _vm.label,
- visible: _vm.visible,
- disabled: _vm.disabled
- });
- }
- _createClass(OptionConfig, [{
- key: "update",
- value: function update(name, value) {
- this[name] = value;
- }
- }]);
- return OptionConfig;
- }();
- function isOption(option) {
- return option instanceof util_OptionConfig;
- }
- function getOptionConfig($xeselect, _vm, options) {
- return isOption(_vm) ? _vm : new util_OptionConfig($xeselect, _vm, options);
- }
- function createOption($xeselect, _vm) {
- return getOptionConfig($xeselect, _vm);
- }
- function destroyOption(_vm) {
- var $xeselect = _vm.$xeselect,
- optionConfig = _vm.optionConfig;
- var matchObj = ctor_amd_xe_utils_default.a.findTree($xeselect.collectOption, function (option) {
- return option === optionConfig;
- });
- if (matchObj) {
- matchObj.items.splice(matchObj.index, 1);
- }
- }
- function assemOption(_vm) {
- var $el = _vm.$el,
- $xeselect = _vm.$xeselect,
- $xeoptgroup = _vm.$xeoptgroup,
- optionConfig = _vm.optionConfig;
- var groupConfig = $xeoptgroup ? $xeoptgroup.optionConfig : null;
- optionConfig.slots = _vm.$scopedSlots;
- if (groupConfig) {
- if (!groupConfig.options) {
- groupConfig.options = [];
- }
- groupConfig.options.splice([].indexOf.call($xeoptgroup.$el.children, $el), 0, optionConfig);
- } else {
- $xeselect.collectOption.splice([].indexOf.call($xeselect.$refs.hideOption.children, $el), 0, optionConfig);
- }
- }
- // CONCATENATED MODULE: ./packages/select/src/option.js
- var option_props = {
- value: null,
- label: {
- type: [String, Number, Boolean],
- default: ''
- },
- visible: {
- type: Boolean,
- default: null
- },
- disabled: Boolean
- };
- var option_watch = {};
- Object.keys(option_props).forEach(function (name) {
- option_watch[name] = function (value) {
- this.optionConfig.update(name, value);
- };
- });
- /* harmony default export */ var src_option = ({
- name: 'VxeOption',
- props: option_props,
- inject: {
- $xeselect: {
- default: null
- },
- $xeoptgroup: {
- default: null
- }
- },
- watch: option_watch,
- mounted: function mounted() {
- assemOption(this);
- },
- created: function created() {
- this.optionConfig = createOption(this.$xeselect, this);
- },
- destroyed: function destroyed() {
- destroyOption(this);
- },
- render: function render(h) {
- return h('div');
- }
- });
- // CONCATENATED MODULE: ./packages/select/src/optgroup.js
- var optgroup_props = {
- label: {
- type: [String, Number, Boolean],
- default: ''
- },
- visible: {
- type: Boolean,
- default: null
- },
- disabled: Boolean
- };
- var optgroup_watch = {};
- Object.keys(optgroup_props).forEach(function (name) {
- optgroup_watch[name] = function (value) {
- this.optionConfig.update(name, value);
- };
- });
- /* harmony default export */ var optgroup = ({
- name: 'VxeOptgroup',
- props: optgroup_props,
- provide: function provide() {
- return {
- $xeoptgroup: this
- };
- },
- inject: {
- $xeselect: {
- default: null
- }
- },
- computed: {
- vSize: function vSize() {
- return this.size || this.$parent.size || this.$parent.vSize;
- }
- },
- watch: optgroup_watch,
- mounted: function mounted() {
- assemOption(this);
- },
- created: function created() {
- this.optionConfig = createOption(this.$xeselect, this);
- },
- destroyed: function destroyed() {
- destroyOption(this);
- },
- render: function render(h) {
- return h('div', this.$slots.default);
- }
- });
- // CONCATENATED MODULE: ./packages/select/index.js
- src_select.install = function (Vue) {
- Vue.component(src_select.name, src_select);
- Vue.component(src_option.name, src_option);
- Vue.component(optgroup.name, optgroup);
- };
- var Select = src_select;
- /* harmony default export */ var packages_select = (src_select);
- // CONCATENATED MODULE: ./packages/switch/src/switch.js
- var switch_browse = DomTools.browse;
- /* harmony default export */ var src_switch = ({
- name: 'VxeSwitch',
- props: {
- value: [String, Number, Boolean],
- disabled: Boolean,
- size: {
- type: String,
- default: function _default() {
- return conf.switch.size || conf.size;
- }
- },
- openLabel: String,
- closeLabel: String,
- openValue: {
- type: [String, Number, Boolean],
- default: true
- },
- closeValue: {
- type: [String, Number, Boolean],
- default: false
- },
- openIcon: String,
- closeIcon: String,
- // 在 v3 中废弃 onLabel、offLabel、onValue、offValue、onIcon、offIcon
- onLabel: String,
- offLabel: String,
- onValue: {
- type: [String, Number, Boolean],
- default: true
- },
- offValue: {
- type: [String, Number, Boolean],
- default: false
- },
- onIcon: String,
- offIcon: String
- },
- data: function data() {
- return {
- isActivated: false,
- hasAnimat: false,
- offsetLeft: 0
- };
- },
- computed: {
- vSize: function vSize() {
- return this.size || this.$parent.size || this.$parent.vSize;
- },
- isChecked: function isChecked() {
- return ctor_amd_xe_utils_default.a.isBoolean(this.onValue) ? this.value === this.openValue : this.value === this.onValue;
- },
- onShowLabel: function onShowLabel() {
- return UtilTools.getFuncText(this.openLabel || this.onLabel);
- },
- offShowLabel: function offShowLabel() {
- return UtilTools.getFuncText(this.closeLabel || this.offLabel);
- },
- styles: function styles() {
- return switch_browse.msie && this.isChecked ? {
- left: "".concat(this.offsetLeft, "px")
- } : null;
- }
- },
- created: function created() {
- var _this = this;
- // 在 v3 中废弃 onLabel、offLabel、onValue、offValue、onIcon、offIcon
- var propsData = this.$options.propsData;
- if (propsData.onLabel) {
- UtilTools.warn('vxe.error.delProp', ['on-label', 'open-label']);
- }
- if (propsData.offLabel) {
- UtilTools.warn('vxe.error.delProp', ['off-label', 'close-label']);
- }
- if (propsData.onValue) {
- UtilTools.warn('vxe.error.delProp', ['on-value', 'open-value']);
- }
- if (propsData.offValue) {
- UtilTools.warn('vxe.error.delProp', ['off-value', 'close-value']);
- }
- if (propsData.onIcon) {
- UtilTools.warn('vxe.error.delProp', ['on-icon', 'open-icon']);
- }
- if (propsData.offIcon) {
- UtilTools.warn('vxe.error.delProp', ['off-icon', 'close-icon']);
- }
- if (switch_browse.msie) {
- this.$nextTick(function () {
- return _this.updateStyle();
- });
- }
- },
- render: function render(h) {
- var _ref;
- var isChecked = this.isChecked,
- vSize = this.vSize,
- disabled = this.disabled,
- openIcon = this.openIcon,
- onIcon = this.onIcon,
- closeIcon = this.closeIcon,
- offIcon = this.offIcon;
- return h('div', {
- class: ['vxe-switch', isChecked ? 'is--on' : 'is--off', (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, 'is--disabled', disabled), _defineProperty(_ref, 'is--animat', this.hasAnimat), _ref)]
- }, [h('button', {
- ref: 'btn',
- class: 'vxe-switch--button',
- attrs: {
- type: 'button',
- disabled: disabled
- },
- on: {
- click: this.clickEvent
- }
- }, [h('span', {
- class: 'vxe-switch--label vxe-switch--label-on'
- }, [openIcon || onIcon ? h('i', {
- class: ['vxe-switch--label-icon', openIcon || onIcon]
- }) : null, this.onShowLabel]), h('span', {
- class: 'vxe-switch--label vxe-switch--label-off'
- }, [closeIcon || offIcon ? h('i', {
- class: ['vxe-switch--label-icon', closeIcon || offIcon]
- }) : null, this.offShowLabel]), h('span', {
- class: 'vxe-switch--icon',
- style: this.styles
- })])]);
- },
- methods: {
- updateStyle: function updateStyle() {
- // 兼容 IE
- this.hasAnimat = true;
- this.offsetLeft = this.$refs.btn.offsetWidth;
- },
- clickEvent: function clickEvent(evnt) {
- var _this2 = this;
- if (!this.disabled) {
- clearTimeout(this.activeTimeout);
- var value = this.isChecked ? ctor_amd_xe_utils_default.a.isBoolean(this.offValue) ? this.closeValue : this.offValue : ctor_amd_xe_utils_default.a.isBoolean(this.onValue) ? this.openValue : this.onValue;
- this.hasAnimat = true;
- if (switch_browse.msie) {
- this.updateStyle();
- }
- this.$emit('input', value);
- this.$emit('change', {
- value: value,
- $event: evnt
- });
- this.activeTimeout = setTimeout(function () {
- _this2.hasAnimat = false;
- }, 400);
- }
- }
- }
- });
- // CONCATENATED MODULE: ./packages/switch/index.js
- src_switch.install = function (Vue) {
- Vue.component(src_switch.name, src_switch);
- };
- var Switch = src_switch;
- /* harmony default export */ var packages_switch = (src_switch);
- // CONCATENATED MODULE: ./packages/list/src/list.js
- /* harmony default export */ var src_list = ({
- name: 'VxeList',
- props: {
- data: Array,
- height: [Number, String],
- maxHeight: [Number, String],
- loading: Boolean,
- size: {
- type: String,
- default: function _default() {
- return conf.list.size || conf.size;
- }
- },
- autoResize: {
- type: Boolean,
- default: function _default() {
- return conf.list.autoResize;
- }
- },
- syncResize: [Boolean, String, Number],
- scrollY: Object
- },
- data: function data() {
- return {
- scrollYLoad: false,
- bodyHeight: 0,
- topSpaceHeight: 0,
- items: []
- };
- },
- computed: {
- vSize: function vSize() {
- return this.size || this.$parent.size || this.$parent.vSize;
- },
- sYOpts: function sYOpts() {
- return Object.assign({}, conf.list.scrollY, this.scrollY);
- },
- styles: function styles() {
- var height = this.height,
- maxHeight = this.maxHeight;
- var style = {};
- if (height) {
- style.height = isNaN(height) ? height : "".concat(height, "px");
- } else if (maxHeight) {
- style.height = 'auto';
- style.maxHeight = isNaN(maxHeight) ? maxHeight : "".concat(maxHeight, "px");
- }
- return style;
- }
- },
- watch: {
- data: function data(value) {
- this.loadData(value);
- },
- syncResize: function syncResize(value) {
- var _this = this;
- if (value) {
- this.recalculate();
- this.$nextTick(function () {
- return setTimeout(function () {
- return _this.recalculate();
- });
- });
- }
- }
- },
- created: function created() {
- Object.assign(this, {
- fullData: [],
- lastScrollLeft: 0,
- lastScrollTop: 0,
- scrollYStore: {
- startIndex: 0,
- visibleIndex: 0,
- renderSize: 0
- }
- });
- this.loadData(this.data);
- GlobalEvent.on(this, 'resize', this.handleGlobalResizeEvent);
- },
- mounted: function mounted() {
- var _this2 = this;
- if (this.autoResize) {
- var resizeObserver = new ResizeEvent(function () {
- return _this2.recalculate();
- });
- resizeObserver.observe(this.$el);
- this.$resize = resizeObserver;
- }
- },
- beforeDestroy: function beforeDestroy() {
- if (this.$resize) {
- this.$resize.disconnect();
- }
- },
- destroyed: function destroyed() {
- GlobalEvent.off(this, 'resize');
- },
- render: function render(h) {
- var $scopedSlots = this.$scopedSlots,
- styles = this.styles,
- bodyHeight = this.bodyHeight,
- topSpaceHeight = this.topSpaceHeight,
- items = this.items,
- loading = this.loading;
- return h('div', {
- class: ['vxe-list', {
- 'is--loading': loading
- }]
- }, [h('div', {
- ref: 'virtualWrapper',
- class: 'vxe-list--virtual-wrapper',
- style: styles,
- on: {
- scroll: this.scrollEvent
- }
- }, [h('div', {
- ref: 'ySpace',
- class: 'vxe-list--y-space',
- style: {
- height: bodyHeight ? "".concat(bodyHeight, "px") : ''
- }
- }), h('div', {
- ref: 'virtualBody',
- class: 'vxe-list--body',
- style: {
- marginTop: topSpaceHeight ? "".concat(topSpaceHeight, "px") : ''
- }
- }, $scopedSlots.default ? $scopedSlots.default.call(this, {
- items: items,
- $list: this
- }, h) : [])]), h('div', {
- class: ['vxe-list--loading vxe-loading', {
- 'is--visible': loading
- }]
- }, [h('div', {
- class: 'vxe-loading--spinner'
- })])]);
- },
- methods: {
- getParentElem: function getParentElem() {
- return this.$el.parentNode;
- },
- /**
- * 加载数据
- * @param {Array} datas 数据
- */
- loadData: function loadData(datas) {
- var _this3 = this;
- var sYOpts = this.sYOpts,
- scrollYStore = this.scrollYStore;
- var fullData = datas || [];
- Object.assign(scrollYStore, {
- startIndex: 0,
- endIndex: 1,
- visibleSize: 0,
- visibleIndex: 0
- });
- this.fullData = fullData;
- this.scrollYLoad = sYOpts.enabled && sYOpts.gt > -1 && fullData.length > sYOpts.gt;
- this.handleData();
- return this.computeScrollLoad().then(function () {
- _this3.refreshScroll();
- });
- },
- /**
- * 重新加载数据
- * @param {Array} datas 数据
- */
- reloadData: function reloadData(datas) {
- this.clearScroll();
- return this.loadData(datas);
- },
- handleData: function handleData() {
- var fullData = this.fullData,
- scrollYLoad = this.scrollYLoad,
- scrollYStore = this.scrollYStore;
- this.items = scrollYLoad ? fullData.slice(scrollYStore.startIndex, Math.max(scrollYStore.startIndex + scrollYStore.renderSize, 1)) : fullData.slice(0);
- return this.$nextTick();
- },
- /**
- * 重新计算列表
- */
- recalculate: function recalculate() {
- var $el = this.$el;
- if ($el.clientWidth && $el.clientHeight) {
- return this.computeScrollLoad();
- }
- return Promise.resolve();
- },
- /**
- * 清除滚动条
- */
- clearScroll: function clearScroll() {
- var scrollBodyElem = this.$refs.virtualWrapper;
- if (scrollBodyElem) {
- scrollBodyElem.scrollTop = 0;
- }
- return this.$nextTick();
- },
- /**
- * 刷新滚动条
- */
- refreshScroll: function refreshScroll() {
- var _this4 = this;
- var lastScrollLeft = this.lastScrollLeft,
- lastScrollTop = this.lastScrollTop;
- this.clearScroll();
- return this.$nextTick().then(function () {
- if (lastScrollLeft || lastScrollTop) {
- _this4.lastScrollLeft = 0;
- _this4.lastScrollTop = 0;
- return _this4.scrollTo(lastScrollLeft, lastScrollTop);
- }
- });
- },
- /**
- * 如果有滚动条,则滚动到对应的位置
- * @param {Number} scrollLeft 左距离
- * @param {Number} scrollTop 上距离
- */
- scrollTo: function scrollTo(scrollLeft, scrollTop) {
- var _this5 = this;
- var scrollBodyElem = this.$refs.virtualWrapper;
- if (ctor_amd_xe_utils_default.a.isNumber(scrollLeft)) {
- scrollBodyElem.scrollLeft = scrollLeft;
- }
- if (ctor_amd_xe_utils_default.a.isNumber(scrollTop)) {
- scrollBodyElem.scrollTop = scrollTop;
- }
- DomTools.triggerEvent(scrollBodyElem, 'scroll');
- if (this.scrollYLoad) {
- return new Promise(function (resolve) {
- return setTimeout(function () {
- return resolve(_this5.$nextTick());
- }, 50);
- });
- }
- return this.$nextTick();
- },
- computeScrollLoad: function computeScrollLoad() {
- var _this6 = this;
- return this.$nextTick().then(function () {
- var $refs = _this6.$refs,
- sYOpts = _this6.sYOpts,
- scrollYLoad = _this6.scrollYLoad,
- scrollYStore = _this6.scrollYStore;
- if (scrollYLoad) {
- var rHeight = 48;
- if (sYOpts.rHeight) {
- rHeight = sYOpts.rHeight;
- } else {
- var firstItemElem;
- if ($refs.virtualBody) {
- if (sYOpts.sItem) {
- firstItemElem = $refs.virtualBody.querySelector(sYOpts.sItem);
- }
- if (!firstItemElem) {
- firstItemElem = $refs.virtualBody.children[0];
- }
- }
- if (firstItemElem) {
- rHeight = firstItemElem.offsetHeight;
- }
- }
- var visibleYSize = ctor_amd_xe_utils_default.a.toNumber(sYOpts.vSize || Math.ceil($refs.virtualWrapper.clientHeight / rHeight));
- scrollYStore.visibleSize = visibleYSize;
- scrollYStore.rowHeight = rHeight;
- if (!sYOpts.oSize) {
- scrollYStore.offsetSize = visibleYSize;
- }
- if (!sYOpts.rSize) {
- scrollYStore.renderSize = Math.max(6, visibleYSize + 2);
- }
- _this6.updateYData();
- } else {
- _this6.updateYSpace();
- }
- });
- },
- scrollEvent: function scrollEvent(evnt) {
- var scrollBodyElem = evnt.target;
- var scrollTop = scrollBodyElem.scrollTop;
- var scrollLeft = scrollBodyElem.scrollLeft;
- var isX = scrollLeft !== this.lastScrollLeft;
- var isY = scrollTop !== this.lastScrollTop;
- this.lastScrollTop = scrollTop;
- this.lastScrollLeft = scrollLeft;
- if (this.scrollYLoad) {
- this.loadYData(evnt);
- }
- this.$emit('scroll', {
- scrollLeft: scrollLeft,
- scrollTop: scrollTop,
- isX: isX,
- isY: isY,
- $event: evnt
- });
- },
- loadYData: function loadYData(evnt) {
- var fullData = this.fullData,
- scrollYStore = this.scrollYStore,
- isLoadData = this.isLoadData;
- var startIndex = scrollYStore.startIndex,
- renderSize = scrollYStore.renderSize,
- offsetSize = scrollYStore.offsetSize,
- visibleSize = scrollYStore.visibleSize,
- rowHeight = scrollYStore.rowHeight;
- var scrollBodyElem = evnt.target;
- var scrollTop = scrollBodyElem.scrollTop;
- var toVisibleIndex = Math.ceil(scrollTop / rowHeight);
- var preload = false;
- if (isLoadData || scrollYStore.visibleIndex !== toVisibleIndex) {
- var marginSize = Math.min(Math.floor((renderSize - visibleSize) / 2), visibleSize);
- if (scrollYStore.visibleIndex > toVisibleIndex) {
- preload = toVisibleIndex - offsetSize <= startIndex;
- if (preload) {
- scrollYStore.startIndex = Math.max(0, toVisibleIndex - Math.max(marginSize, renderSize - visibleSize));
- }
- } else {
- preload = toVisibleIndex + visibleSize + offsetSize >= startIndex + renderSize;
- if (preload) {
- scrollYStore.startIndex = Math.max(0, Math.min(fullData.length - renderSize, toVisibleIndex - marginSize));
- }
- }
- if (preload) {
- this.updateYData();
- }
- scrollYStore.visibleIndex = toVisibleIndex;
- this.isLoadData = false;
- }
- },
- updateYData: function updateYData() {
- this.handleData();
- this.updateYSpace();
- },
- updateYSpace: function updateYSpace() {
- var scrollYStore = this.scrollYStore,
- scrollYLoad = this.scrollYLoad,
- fullData = this.fullData;
- this.bodyHeight = scrollYLoad ? fullData.length * scrollYStore.rowHeight : 0;
- this.topSpaceHeight = scrollYLoad ? Math.max(scrollYStore.startIndex * scrollYStore.rowHeight, 0) : 0;
- },
- handleGlobalResizeEvent: function handleGlobalResizeEvent() {
- this.recalculate();
- }
- }
- });
- // CONCATENATED MODULE: ./packages/list/index.js
- src_list.install = function (Vue) {
- Vue.component(src_list.name, src_list);
- };
- var List = src_list;
- /* harmony default export */ var packages_list = (src_list);
- // CONCATENATED MODULE: ./packages/pulldown/src/pulldown.js
- /* harmony default export */ var pulldown = ({
- name: 'VxePulldown',
- props: {
- disabled: Boolean,
- placement: String,
- size: {
- type: String,
- default: function _default() {
- return conf.size;
- }
- },
- destroyOnClose: Boolean,
- transfer: Boolean
- },
- data: function data() {
- return {
- inited: false,
- panelIndex: 0,
- panelStyle: null,
- panelPlacement: null,
- currentValue: null,
- visiblePanel: false,
- animatVisible: false,
- isActivated: false
- };
- },
- computed: {
- vSize: function vSize() {
- return this.size || this.$parent.size || this.$parent.vSize;
- }
- },
- created: function created() {
- GlobalEvent.on(this, 'mousewheel', this.handleGlobalMousewheelEvent);
- GlobalEvent.on(this, 'mousedown', this.handleGlobalMousedownEvent);
- GlobalEvent.on(this, 'blur', this.handleGlobalBlurEvent);
- },
- beforeDestroy: function beforeDestroy() {
- var panelElem = this.$refs.panel;
- if (panelElem && panelElem.parentNode) {
- panelElem.parentNode.removeChild(panelElem);
- }
- },
- destroyed: function destroyed() {
- GlobalEvent.off(this, 'mousewheel');
- GlobalEvent.off(this, 'mousedown');
- GlobalEvent.off(this, 'blur');
- },
- render: function render(h) {
- var _ref, _ref2;
- var $scopedSlots = this.$scopedSlots,
- inited = this.inited,
- vSize = this.vSize,
- destroyOnClose = this.destroyOnClose,
- transfer = this.transfer,
- isActivated = this.isActivated,
- disabled = this.disabled,
- animatVisible = this.animatVisible,
- visiblePanel = this.visiblePanel,
- panelStyle = this.panelStyle,
- panelPlacement = this.panelPlacement;
- var defaultSlot = $scopedSlots.default;
- var downSlot = $scopedSlots.dropdown;
- return h('div', {
- 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)]
- }, [h('div', {
- ref: 'content',
- class: 'vxe-pulldown--content'
- }, defaultSlot ? defaultSlot.call(this, {
- $pulldown: this
- }, h) : []), h('div', {
- ref: 'panel',
- 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)],
- attrs: {
- 'data-placement': panelPlacement
- },
- style: panelStyle
- }, downSlot ? !inited || destroyOnClose && !visiblePanel && !animatVisible ? [] : downSlot.call(this, {
- $pulldown: this
- }, h) : [])]);
- },
- methods: {
- handleGlobalMousewheelEvent: function handleGlobalMousewheelEvent(evnt) {
- var $refs = this.$refs,
- disabled = this.disabled,
- visiblePanel = this.visiblePanel;
- if (!disabled) {
- if (visiblePanel) {
- if (DomTools.getEventTargetNode(evnt, $refs.panel).flag) {
- this.updatePlacement();
- } else {
- this.hidePanel();
- this.$emit('hide-panel', {
- $event: evnt
- });
- }
- }
- }
- },
- handleGlobalMousedownEvent: function handleGlobalMousedownEvent(evnt) {
- var $refs = this.$refs,
- $el = this.$el,
- disabled = this.disabled,
- visiblePanel = this.visiblePanel;
- if (!disabled) {
- this.isActivated = DomTools.getEventTargetNode(evnt, $el).flag || DomTools.getEventTargetNode(evnt, $refs.panel).flag;
- if (visiblePanel && !this.isActivated) {
- this.hidePanel();
- this.$emit('hide-panel', {
- $event: evnt
- });
- }
- }
- },
- handleGlobalBlurEvent: function handleGlobalBlurEvent(evnt) {
- if (this.visiblePanel) {
- this.hidePanel();
- this.$emit('hide-panel', {
- $event: evnt
- });
- }
- },
- updateZindex: function updateZindex() {
- if (this.panelIndex < UtilTools.getLastZIndex()) {
- this.panelIndex = UtilTools.nextZIndex();
- }
- },
- isPanelVisible: function isPanelVisible() {
- return this.visiblePanel;
- },
- /**
- * 切换下拉面板
- */
- togglePanel: function togglePanel() {
- if (this.visiblePanel) {
- return this.hidePanel();
- }
- return this.showPanel();
- },
- /**
- * 显示下拉面板
- */
- showPanel: function showPanel() {
- var _this = this;
- if (!this.inited) {
- this.inited = true;
- if (this.transfer) {
- document.body.appendChild(this.$refs.panel);
- }
- }
- return new Promise(function (resolve) {
- if (!_this.disabled) {
- clearTimeout(_this.hidePanelTimeout);
- _this.isActivated = true;
- _this.animatVisible = true;
- setTimeout(function () {
- _this.visiblePanel = true;
- _this.updatePlacement();
- setTimeout(function () {
- resolve(_this.updatePlacement());
- }, 40);
- }, 10);
- _this.updateZindex();
- } else {
- resolve(_this.$nextTick());
- }
- });
- },
- /**
- * 隐藏下拉面板
- */
- hidePanel: function hidePanel() {
- var _this2 = this;
- this.visiblePanel = false;
- return new Promise(function (resolve) {
- if (_this2.animatVisible) {
- _this2.hidePanelTimeout = setTimeout(function () {
- _this2.animatVisible = false;
- resolve(_this2.$nextTick());
- }, 350);
- } else {
- resolve(_this2.$nextTick());
- }
- });
- },
- /**
- * 手动更新位置
- */
- updatePlacement: function updatePlacement() {
- var _this3 = this;
- return this.$nextTick().then(function () {
- var $refs = _this3.$refs,
- transfer = _this3.transfer,
- placement = _this3.placement,
- panelIndex = _this3.panelIndex,
- visiblePanel = _this3.visiblePanel;
- if (visiblePanel) {
- var panelElem = $refs.panel;
- var targetElem = $refs.content;
- if (panelElem && targetElem) {
- var targetHeight = targetElem.offsetHeight;
- var targetWidth = targetElem.offsetWidth;
- var panelHeight = panelElem.offsetHeight;
- var panelWidth = panelElem.offsetWidth;
- var marginSize = 5;
- var panelStyle = {
- zIndex: panelIndex
- };
- var _DomTools$getAbsolute = DomTools.getAbsolutePos(targetElem),
- boundingTop = _DomTools$getAbsolute.boundingTop,
- boundingLeft = _DomTools$getAbsolute.boundingLeft,
- visibleHeight = _DomTools$getAbsolute.visibleHeight,
- visibleWidth = _DomTools$getAbsolute.visibleWidth;
- var panelPlacement = 'bottom';
- if (transfer) {
- var left = boundingLeft;
- var top = boundingTop + targetHeight;
- if (placement === 'top') {
- panelPlacement = 'top';
- top = boundingTop - panelHeight;
- } else if (!placement) {
- // 如果下面不够放,则向上
- if (top + panelHeight + marginSize > visibleHeight) {
- panelPlacement = 'top';
- top = boundingTop - panelHeight;
- } // 如果上面不够放,则向下(优先)
- if (top < marginSize) {
- panelPlacement = 'bottom';
- top = boundingTop + targetHeight;
- }
- } // 如果溢出右边
- if (left + panelWidth + marginSize > visibleWidth) {
- left -= left + panelWidth + marginSize - visibleWidth;
- } // 如果溢出左边
- if (left < marginSize) {
- left = marginSize;
- }
- Object.assign(panelStyle, {
- left: "".concat(left, "px"),
- top: "".concat(top, "px"),
- minWidth: "".concat(targetWidth, "px")
- });
- } else {
- if (placement === 'top') {
- panelPlacement = 'top';
- panelStyle.bottom = "".concat(targetHeight, "px");
- } else if (!placement) {
- // 如果下面不够放,则向上
- if (boundingTop + targetHeight + panelHeight > visibleHeight) {
- // 如果上面不够放,则向下(优先)
- if (boundingTop - targetHeight - panelHeight > marginSize) {
- panelPlacement = 'top';
- panelStyle.bottom = "".concat(targetHeight, "px");
- }
- }
- }
- }
- _this3.panelStyle = panelStyle;
- _this3.panelPlacement = panelPlacement;
- }
- }
- return _this3.$nextTick();
- });
- }
- }
- });
- // CONCATENATED MODULE: ./packages/pulldown/index.js
- pulldown.install = function (Vue) {
- Vue.component(pulldown.name, pulldown);
- };
- var Pulldown = pulldown;
- /* harmony default export */ var packages_pulldown = (pulldown);
- // CONCATENATED MODULE: ./packages/edit/src/mixin.js
- /* harmony default export */ var edit_src_mixin = ({
- methods: {
- /**
- * 往表格中插入临时数据
- *
- * @param {*} records
- */
- _insert: function _insert(records) {
- return this.insertAt(records);
- },
- /**
- * 往表格指定行中插入临时数据
- * 如果 row 为空则从插入到顶部
- * 如果 row 为 -1 则从插入到底部
- * 如果 row 为有效行则插入到该行的位置
- * @param {Object/Array} records 新的数据
- * @param {Row} row 指定行
- */
- _insertAt: function _insertAt(records, row) {
- var _this = this,
- _editStore$insertList;
- var mergeList = this.mergeList,
- afterFullData = this.afterFullData,
- editStore = this.editStore,
- sYOpts = this.sYOpts,
- scrollYLoad = this.scrollYLoad,
- tableFullData = this.tableFullData,
- treeConfig = this.treeConfig;
- if (!ctor_amd_xe_utils_default.a.isArray(records)) {
- records = [records];
- }
- var newRecords = records.map(function (record) {
- return _this.defineField(Object.assign({}, record));
- });
- if (!row) {
- afterFullData.unshift.apply(afterFullData, _toConsumableArray(newRecords));
- tableFullData.unshift.apply(tableFullData, _toConsumableArray(newRecords)); // 刷新单元格合并
- mergeList.forEach(function (mergeItem) {
- var mergeRowIndex = mergeItem.row;
- if (mergeRowIndex > 0) {
- mergeItem.row = mergeRowIndex + newRecords.length;
- }
- });
- } else {
- if (row === -1) {
- afterFullData.push.apply(afterFullData, _toConsumableArray(newRecords));
- tableFullData.push.apply(tableFullData, _toConsumableArray(newRecords)); // 刷新单元格合并
- mergeList.forEach(function (mergeItem) {
- var mergeRowIndex = mergeItem.row,
- mergeRowspan = mergeItem.rowspan;
- if (mergeRowIndex + mergeRowspan > afterFullData.length) {
- mergeItem.rowspan = mergeRowspan + newRecords.length;
- }
- });
- } else {
- if (treeConfig) {
- throw new Error(UtilTools.getLog('vxe.error.noTree', ['insert']));
- }
- var afIndex = afterFullData.indexOf(row);
- if (afIndex === -1) {
- throw new Error(UtilTools.error('vxe.error.unableInsert'));
- }
- afterFullData.splice.apply(afterFullData, _toConsumableArray([afIndex, 0].concat(newRecords)));
- tableFullData.splice.apply(tableFullData, _toConsumableArray([tableFullData.indexOf(row), 0].concat(newRecords))); // 刷新单元格合并
- mergeList.forEach(function (mergeItem) {
- var mergeRowIndex = mergeItem.row,
- mergeRowspan = mergeItem.rowspan;
- if (mergeRowIndex > afIndex) {
- mergeItem.row = mergeRowIndex + newRecords.length;
- } else if (mergeRowIndex + mergeRowspan > afIndex) {
- mergeItem.rowspan = mergeRowspan + newRecords.length;
- }
- });
- }
- }
- (_editStore$insertList = editStore.insertList).unshift.apply(_editStore$insertList, _toConsumableArray(newRecords));
- this.scrollYLoad = !treeConfig && sYOpts.gt > -1 && sYOpts.gt < tableFullData.length;
- this.handleTableData();
- this.updateFooter();
- this.updateCache();
- this.checkSelectionStatus();
- if (scrollYLoad) {
- this.updateScrollYSpace();
- }
- return this.$nextTick().then(function () {
- _this.recalculate();
- _this.updateCellAreas();
- return {
- row: newRecords.length ? newRecords[newRecords.length - 1] : null,
- rows: newRecords
- };
- });
- },
- /**
- * 删除指定行数据
- * 如果传 row 则删除一行
- * 如果传 rows 则删除多行
- * 如果为空则删除所有
- */
- _remove: function _remove(rows) {
- var _this2 = this;
- var afterFullData = this.afterFullData,
- tableFullData = this.tableFullData,
- treeConfig = this.treeConfig,
- mergeList = this.mergeList,
- editStore = this.editStore,
- checkboxOpts = this.checkboxOpts,
- selection = this.selection,
- isInsertByRow = this.isInsertByRow,
- sYOpts = this.sYOpts,
- scrollYLoad = this.scrollYLoad;
- var actived = editStore.actived,
- removeList = editStore.removeList,
- insertList = editStore.insertList;
- var property = checkboxOpts.checkField;
- var rest = [];
- if (!rows) {
- rows = tableFullData;
- } else if (!ctor_amd_xe_utils_default.a.isArray(rows)) {
- rows = [rows];
- } // 如果是新增,则保存记录
- rows.forEach(function (row) {
- if (!isInsertByRow(row)) {
- removeList.push(row);
- }
- }); // 如果绑定了多选属性,则更新状态
- if (!property) {
- rows.forEach(function (row) {
- var sIndex = selection.indexOf(row);
- if (sIndex > -1) {
- selection.splice(sIndex, 1);
- }
- });
- } // 从数据源中移除
- if (tableFullData === rows) {
- rows = rest = tableFullData.slice(0);
- this.tableFullData = [];
- this.afterFullData = [];
- this.clearMergeCells();
- } else {
- rows.forEach(function (row) {
- var tfIndex = tableFullData.indexOf(row);
- if (tfIndex > -1) {
- var rItems = tableFullData.splice(tfIndex, 1);
- rest.push(rItems[0]);
- }
- var afIndex = afterFullData.indexOf(row);
- if (afIndex > -1) {
- // 刷新单元格合并
- mergeList.forEach(function (mergeItem) {
- var mergeRowIndex = mergeItem.row,
- mergeRowspan = mergeItem.rowspan;
- if (mergeRowIndex > afIndex) {
- mergeItem.row = mergeRowIndex - 1;
- } else if (mergeRowIndex + mergeRowspan > afIndex) {
- mergeItem.rowspan = mergeRowspan - 1;
- }
- });
- afterFullData.splice(afIndex, 1);
- }
- });
- } // 如果当前行被激活编辑,则清除激活状态
- if (actived.row && rows.indexOf(actived.row) > -1) {
- this.clearActived();
- } // 从新增中移除已删除的数据
- rows.forEach(function (row) {
- var iIndex = insertList.indexOf(row);
- if (iIndex > -1) {
- insertList.splice(iIndex, 1);
- }
- });
- this.scrollYLoad = !treeConfig && sYOpts.gt > -1 && sYOpts.gt < tableFullData.length;
- this.handleTableData();
- this.updateFooter();
- this.updateCache();
- this.checkSelectionStatus();
- if (scrollYLoad) {
- this.updateScrollYSpace();
- }
- return this.$nextTick().then(function () {
- _this2.recalculate();
- _this2.updateCellAreas();
- return {
- row: rest.length ? rest[rest.length - 1] : null,
- rows: rest
- };
- });
- },
- _removeSelecteds: function _removeSelecteds() {
- // 在 v3 中废弃 removeSelecteds
- UtilTools.warn('vxe.error.delFunc', ['removeSelecteds', 'removeCheckboxRow']);
- return this.removeCheckboxRow();
- },
- /**
- * 删除复选框选中的数据
- */
- _removeCheckboxRow: function _removeCheckboxRow() {
- var _this3 = this;
- return this.remove(this.getCheckboxRecords()).then(function (params) {
- _this3.clearCheckboxRow();
- return params;
- });
- },
- /**
- * 删除单选框选中的数据
- */
- _removeRadioRow: function _removeRadioRow() {
- var _this4 = this;
- var radioRecord = this.getRadioRecord();
- return this.remove(radioRecord || []).then(function (params) {
- _this4.clearRadioRow();
- return params;
- });
- },
- /**
- * 删除当前行选中的数据
- */
- _removeCurrentRow: function _removeCurrentRow() {
- var _this5 = this;
- var currentRecord = this.getCurrentRecord();
- return this.remove(currentRecord || []).then(function (params) {
- _this5.clearCurrentRow();
- return params;
- });
- },
- /**
- * 获取表格数据集,包含新增、删除、修改
- */
- _getRecordset: function _getRecordset() {
- return {
- insertRecords: this.getInsertRecords(),
- removeRecords: this.getRemoveRecords(),
- updateRecords: this.getUpdateRecords()
- };
- },
- /**
- * 获取新增的临时数据
- */
- _getInsertRecords: function _getInsertRecords() {
- var insertList = this.editStore.insertList;
- var insertRecords = [];
- if (insertList.length) {
- this.tableFullData.forEach(function (row) {
- if (insertList.indexOf(row) > -1) {
- insertRecords.push(row);
- }
- });
- }
- return insertRecords;
- },
- /**
- * 获取已删除的数据
- */
- _getRemoveRecords: function _getRemoveRecords() {
- return this.editStore.removeList;
- },
- /**
- * 获取更新数据
- * 只精准匹配 row 的更改
- * 如果是树表格,子节点更改状态不会影响父节点的更新状态
- */
- _getUpdateRecords: function _getUpdateRecords() {
- var keepSource = this.keepSource,
- tableFullData = this.tableFullData,
- isUpdateByRow = this.isUpdateByRow,
- treeConfig = this.treeConfig,
- treeOpts = this.treeOpts,
- editStore = this.editStore; // 在 v3 中必须要开启 keep-source
- if (!keepSource) {
- UtilTools.warn('vxe.error.reqProp', ['keep-source']);
- }
- if (keepSource) {
- var actived = editStore.actived;
- var row = actived.row,
- column = actived.column;
- if (row || column) {
- this._syncActivedCell();
- }
- if (treeConfig) {
- return ctor_amd_xe_utils_default.a.filterTree(tableFullData, function (row) {
- return isUpdateByRow(row);
- }, treeOpts);
- }
- return tableFullData.filter(function (row) {
- return isUpdateByRow(row);
- });
- }
- return [];
- },
- /**
- * 处理激活编辑
- */
- handleActived: function handleActived(params, evnt) {
- var _this6 = this;
- var editStore = this.editStore,
- editOpts = this.editOpts,
- tableColumn = this.tableColumn,
- mouseConfig = this.mouseConfig;
- var mode = editOpts.mode,
- activeMethod = editOpts.activeMethod;
- var actived = editStore.actived;
- var row = params.row,
- column = params.column;
- var editRender = column.editRender;
- var cell = params.cell = params.cell || this.getCell(row, column);
- if (UtilTools.isEnableConf(editRender) && cell) {
- if (actived.row !== row || (mode === 'cell' ? actived.column !== column : false)) {
- // 判断是否禁用编辑
- var type = 'edit-disabled';
- if (!activeMethod || activeMethod(params)) {
- if (mouseConfig) {
- this.clearCopyed(evnt);
- this.clearChecked();
- this.clearSelected(evnt);
- this.clearCellAreas(evnt);
- this.clearCopyCellArea(evnt);
- }
- this.closeTooltip();
- this.clearActived(evnt);
- type = 'edit-actived';
- column.renderHeight = cell.offsetHeight;
- actived.args = params;
- actived.row = row;
- actived.column = column;
- if (mode === 'row') {
- tableColumn.forEach(function (column) {
- return _this6._getColumnModel(row, column);
- });
- } else {
- this._getColumnModel(row, column);
- }
- this.$nextTick(function () {
- _this6.handleFocus(params, evnt);
- });
- }
- this.emitEvent(type, Object.assign({}, params, {
- row: row,
- rowIndex: this.getRowIndex(row),
- $rowIndex: this.getVMRowIndex(row),
- column: column,
- columnIndex: this.getColumnIndex(column),
- $columnIndex: this.getVMColumnIndex(column)
- }), evnt);
- } else {
- var oldColumn = actived.column;
- if (mouseConfig) {
- this.clearCopyed(evnt);
- this.clearChecked();
- this.clearSelected(evnt);
- this.clearCellAreas(evnt);
- this.clearCopyCellArea(evnt);
- }
- if (oldColumn !== column) {
- var oldModel = oldColumn.model;
- if (oldModel.update) {
- UtilTools.setCellValue(row, oldColumn, oldModel.value);
- }
- this.clearValidate();
- }
- column.renderHeight = cell.offsetHeight;
- actived.args = params;
- actived.column = column;
- setTimeout(function () {
- _this6.handleFocus(params, evnt);
- });
- }
- this.focus();
- }
- return this.$nextTick();
- },
- _getColumnModel: function _getColumnModel(row, column) {
- var model = column.model,
- editRender = column.editRender;
- if (editRender) {
- model.value = UtilTools.getCellValue(row, column);
- model.update = false;
- }
- },
- _setColumnModel: function _setColumnModel(row, column) {
- var model = column.model,
- editRender = column.editRender;
- if (editRender && model.update) {
- UtilTools.setCellValue(row, column, model.value);
- model.update = false;
- model.value = null;
- }
- },
- _syncActivedCell: function _syncActivedCell() {
- var _this7 = this;
- var tableColumn = this.tableColumn,
- editStore = this.editStore,
- editOpts = this.editOpts;
- var actived = editStore.actived;
- var row = actived.row,
- column = actived.column;
- if (row || column) {
- if (editOpts.mode === 'row') {
- tableColumn.forEach(function (column) {
- return _this7._setColumnModel(row, column);
- });
- } else {
- this._setColumnModel(row, column);
- }
- }
- },
- /**
- * 清除激活的编辑
- */
- _clearActived: function _clearActived(evnt) {
- var editStore = this.editStore;
- var actived = editStore.actived;
- var args = actived.args,
- row = actived.row,
- column = actived.column;
- if (row || column) {
- this._syncActivedCell();
- actived.args = null;
- actived.row = null;
- actived.column = null;
- this.updateFooter();
- this.emitEvent('edit-closed', Object.assign({}, args, {
- row: row,
- rowIndex: this.getRowIndex(row),
- $rowIndex: this.getVMRowIndex(row),
- column: column,
- columnIndex: this.getColumnIndex(column),
- $columnIndex: this.getVMColumnIndex(column)
- }), evnt);
- }
- return (v_x_e_table._valid ? this.clearValidate() : this.$nextTick()).then(this.recalculate);
- },
- // 在 v3.0 中废弃 getActiveRow
- _getActiveRow: function _getActiveRow() {
- UtilTools.warn('vxe.error.delFunc', ['getActiveRow', 'getActiveRecord']);
- return this.getActiveRecord();
- },
- _getActiveRecord: function _getActiveRecord() {
- var $el = this.$el,
- editStore = this.editStore,
- afterFullData = this.afterFullData;
- var _editStore$actived = editStore.actived,
- args = _editStore$actived.args,
- row = _editStore$actived.row;
- if (args && afterFullData.indexOf(row) > -1 && $el.querySelectorAll('.vxe-body--column.col--actived').length) {
- return Object.assign({}, args);
- }
- return null;
- },
- // 在 v3.0 中废弃 hasActiveRow
- _hasActiveRow: function _hasActiveRow(row) {
- UtilTools.warn('vxe.error.delFunc', ['hasActiveRow', 'isActiveByRow']);
- return this.isActiveByRow(row);
- },
- /**
- * 判断行是否为激活编辑状态
- * @param {Row} row 行对象
- */
- _isActiveByRow: function _isActiveByRow(row) {
- return this.editStore.actived.row === row;
- },
- /**
- * 处理聚焦
- */
- handleFocus: function handleFocus(params) {
- var row = params.row,
- column = params.column,
- cell = params.cell;
- var editRender = column.editRender;
- if (UtilTools.isEnableConf(editRender)) {
- var compRender = v_x_e_table.renderer.get(editRender.name);
- var autofocus = editRender.autofocus,
- autoselect = editRender.autoselect;
- var inputElem; // 如果指定了聚焦 class
- if (autofocus) {
- inputElem = cell.querySelector(autofocus);
- } // 渲染器的聚焦处理
- if (!inputElem && compRender && compRender.autofocus) {
- inputElem = cell.querySelector(compRender.autofocus);
- }
- if (inputElem) {
- inputElem.focus();
- if (autoselect) {
- inputElem.select();
- } else {
- // 保持一致行为,光标移到末端
- if (DomTools.browse.msie) {
- var textRange = inputElem.createTextRange();
- textRange.collapse(false);
- textRange.select();
- }
- }
- } else {
- // 显示到可视区中
- this.scrollToRow(row, column);
- }
- }
- },
- /**
- * 激活行编辑
- */
- _setActiveRow: function _setActiveRow(row) {
- return this.setActiveCell(row, ctor_amd_xe_utils_default.a.find(this.visibleColumn, function (column) {
- return UtilTools.isEnableConf(column.editRender);
- }));
- },
- /**
- * 激活单元格编辑
- */
- _setActiveCell: function _setActiveCell(row, fieldOrColumn) {
- var _this8 = this;
- var column = ctor_amd_xe_utils_default.a.isString(fieldOrColumn) ? this.getColumnByField(fieldOrColumn) : fieldOrColumn;
- if (row && column && UtilTools.isEnableConf(column.editRender)) {
- return this.scrollToRow(row, true).then(function () {
- var cell = _this8.getCell(row, column);
- if (cell) {
- _this8.handleActived({
- row: row,
- rowIndex: _this8.getRowIndex(row),
- column: column,
- columnIndex: _this8.getColumnIndex(column),
- cell: cell,
- $table: _this8
- });
- _this8.lastCallTime = Date.now();
- }
- });
- }
- return this.$nextTick();
- },
- /**
- * 只对 trigger=dblclick 有效,选中单元格
- */
- _setSelectCell: function _setSelectCell(row, fieldOrColumn) {
- var tableData = this.tableData,
- editOpts = this.editOpts,
- visibleColumn = this.visibleColumn;
- var column = ctor_amd_xe_utils_default.a.isString(fieldOrColumn) ? this.getColumnByField(fieldOrColumn) : fieldOrColumn;
- if (row && column && editOpts.trigger !== 'manual') {
- var rowIndex = tableData.indexOf(row);
- if (rowIndex > -1 && column) {
- var cell = this.getCell(row, column);
- var params = {
- row: row,
- rowIndex: rowIndex,
- column: column,
- columnIndex: visibleColumn.indexOf(column),
- cell: cell
- };
- this.handleSelected(params, {});
- }
- }
- return this.$nextTick();
- },
- /**
- * 处理选中源
- */
- handleSelected: function handleSelected(params, evnt) {
- var _this9 = this;
- var mouseConfig = this.mouseConfig,
- mouseOpts = this.mouseOpts,
- editOpts = this.editOpts,
- editStore = this.editStore,
- elemStore = this.elemStore;
- var actived = editStore.actived,
- selected = editStore.selected;
- var row = params.row,
- column = params.column,
- cell = params.cell;
- var isMouseSelected = mouseConfig && mouseOpts.selected; // 在 v3.0 中废弃 mouse-config.checked
- var isMouseChecked = mouseConfig && mouseOpts.checked;
- var selectMethod = function selectMethod() {
- if ((isMouseSelected || isMouseChecked) && (selected.row !== row || selected.column !== column)) {
- if (actived.row !== row || (editOpts.mode === 'cell' ? actived.column !== column : false)) {
- if (_this9.keyboardConfig) {
- _this9.clearChecked(evnt);
- _this9.clearIndexChecked();
- _this9.clearHeaderChecked();
- }
- _this9.clearActived(evnt);
- _this9.clearSelected(evnt);
- _this9.clearCellAreas(evnt);
- _this9.clearCopyCellArea(evnt);
- selected.args = params;
- selected.row = row;
- selected.column = column;
- if (isMouseSelected) {
- _this9.addColSdCls();
- } // 如果配置了批量选中功能,则为批量选中状态
- if (isMouseChecked) {
- var headerElem = elemStore['main-header-list'];
- _this9.handleChecked([[cell]]);
- if (headerElem) {
- _this9.handleHeaderChecked([[headerElem.querySelector(".".concat(column.id))]]);
- }
- _this9.handleIndexChecked([[cell.parentNode.querySelector('.col--seq')]]);
- }
- _this9.focus();
- if (evnt) {
- _this9.emitEvent('cell-selected', params, evnt);
- }
- }
- }
- return _this9.$nextTick();
- };
- return selectMethod();
- },
- /**
- * 清除所选中源状态
- */
- _clearSelected: function _clearSelected() {
- var selected = this.editStore.selected;
- selected.row = null;
- selected.column = null;
- this.reColTitleSdCls();
- this.reColSdCls();
- return this.$nextTick();
- },
- reColTitleSdCls: function reColTitleSdCls() {
- var headerElem = this.elemStore['main-header-list'];
- if (headerElem) {
- ctor_amd_xe_utils_default.a.arrayEach(headerElem.querySelectorAll('.col--title-selected'), function (elem) {
- return DomTools.removeClass(elem, 'col--title-selected');
- });
- }
- },
- reColSdCls: function reColSdCls() {
- var cell = this.$el.querySelector('.col--selected');
- if (cell) {
- DomTools.removeClass(cell, 'col--selected');
- }
- },
- addColSdCls: function addColSdCls() {
- var selected = this.editStore.selected;
- var row = selected.row,
- column = selected.column;
- this.reColSdCls();
- if (row && column) {
- var cell = this.getCell(row, column);
- if (cell) {
- DomTools.addClass(cell, 'col--selected');
- }
- }
- }
- }
- });
- // CONCATENATED MODULE: ./packages/edit/index.js
- var Edit = {
- install: function install() {
- v_x_e_table.reg('edit');
- packages_table.mixins.push(edit_src_mixin);
- }
- };
- /* harmony default export */ var edit = (Edit);
- // CONCATENATED MODULE: ./packages/export/src/export-panel.js
- /* harmony default export */ var export_panel = ({
- name: 'VxeExportPanel',
- props: {
- defaultOptions: Object,
- storeData: Object
- },
- components: {
- VxeModal: modal,
- VxeInput: input,
- VxeCheckbox: src_checkbox,
- VxeSelect: src_select,
- VxeOption: src_option
- },
- data: function data() {
- return {
- isAll: false,
- isIndeterminate: false,
- loading: false
- };
- },
- computed: {
- vSize: function vSize() {
- return this.size || this.$parent.size || this.$parent.vSize;
- },
- showSheet: function showSheet() {
- return ['html', 'xml', 'xlsx', 'pdf'].indexOf(this.defaultOptions.type) > -1;
- }
- },
- render: function render(h) {
- var _this = this;
- var _e = this._e,
- isAll = this.isAll,
- isIndeterminate = this.isIndeterminate,
- showSheet = this.showSheet,
- defaultOptions = this.defaultOptions,
- storeData = this.storeData;
- var cols = [];
- ctor_amd_xe_utils_default.a.eachTree(storeData.columns, function (column) {
- var colTitle = UtilTools.formatText(column.getTitle(), 1);
- var isColGroup = column.children && column.children.length;
- cols.push(h('li', {
- class: ['vxe-export--panel-column-option', "level--".concat(column.level), {
- 'is--group': isColGroup,
- 'is--checked': column.checked,
- 'is--indeterminate': column.halfChecked,
- 'is--disabled': column.disabled
- }],
- attrs: {
- title: colTitle
- },
- on: {
- click: function click() {
- if (!column.disabled) {
- _this.changeOption(column);
- }
- }
- }
- }, [h('span', {
- class: 'vxe-checkbox--icon vxe-checkbox--checked-icon'
- }), h('span', {
- class: 'vxe-checkbox--icon vxe-checkbox--unchecked-icon'
- }), h('span', {
- class: 'vxe-checkbox--icon vxe-checkbox--indeterminate-icon'
- }), h('span', {
- class: 'vxe-checkbox--label'
- }, colTitle)]));
- });
- return h('vxe-modal', {
- res: 'modal',
- props: {
- value: storeData.visible,
- title: conf.i18n('vxe.export.expTitle'),
- width: 660,
- mask: true,
- lockView: true,
- showFooter: false,
- escClosable: true,
- maskClosable: true,
- loading: this.loading
- },
- on: {
- input: function input(value) {
- storeData.visible = value;
- },
- show: this.showEvent
- }
- }, [h('div', {
- class: 'vxe-export--panel'
- }, [h('table', {
- attrs: {
- cellspacing: 0,
- cellpadding: 0,
- border: 0
- }
- }, [h('tbody', [[h('tr', [h('td', conf.i18n('vxe.export.expName')), h('td', [h('vxe-input', {
- ref: 'filename',
- props: {
- value: defaultOptions.filename,
- type: 'text',
- clearable: true,
- placeholder: conf.i18n('vxe.export.expNamePlaceholder')
- },
- on: {
- input: function input(value) {
- defaultOptions.filename = value;
- }
- }
- })])]), h('tr', [h('td', conf.i18n('vxe.export.expType')), h('td', [h('vxe-select', {
- props: {
- value: defaultOptions.type
- },
- on: {
- input: function input(value) {
- defaultOptions.type = value;
- }
- }
- }, storeData.typeList.map(function (item) {
- return h('vxe-option', {
- props: {
- value: item.value,
- label: conf.i18n(item.label)
- }
- });
- }))])]), showSheet ? h('tr', [h('td', conf.i18n('vxe.export.expSheetName')), h('td', [h('vxe-input', {
- props: {
- value: defaultOptions.sheetName,
- type: 'text',
- clearable: true,
- placeholder: conf.i18n('vxe.export.expSheetNamePlaceholder')
- },
- on: {
- input: function input(value) {
- defaultOptions.sheetName = value;
- }
- }
- })])]) : _e(), h('tr', [h('td', conf.i18n('vxe.export.expMode')), h('td', [h('vxe-select', {
- props: {
- value: defaultOptions.mode
- },
- on: {
- input: function input(value) {
- defaultOptions.mode = value;
- }
- }
- }, storeData.modeList.map(function (item) {
- return h('vxe-option', {
- props: {
- value: item.value,
- label: conf.i18n(item.label)
- }
- });
- }))])]), h('tr', [h('td', [conf.i18n('vxe.export.expColumn')]), h('td', [h('div', {
- class: 'vxe-export--panel-column'
- }, [h('ul', {
- class: 'vxe-export--panel-column-header'
- }, [h('li', {
- class: ['vxe-export--panel-column-option', {
- 'is--checked': isAll,
- 'is--indeterminate': isIndeterminate
- }],
- attrs: {
- title: conf.i18n('vxe.table.allTitle')
- },
- on: {
- click: this.allColumnEvent
- }
- }, [h('span', {
- class: 'vxe-checkbox--icon vxe-checkbox--checked-icon'
- }), h('span', {
- class: 'vxe-checkbox--icon vxe-checkbox--unchecked-icon'
- }), h('span', {
- class: 'vxe-checkbox--icon vxe-checkbox--indeterminate-icon'
- }), h('span', {
- class: 'vxe-checkbox--label'
- }, conf.i18n('vxe.export.expCurrentColumn'))])]), h('ul', {
- class: 'vxe-export--panel-column-body'
- }, cols)])])]), h('tr', [h('td', conf.i18n('vxe.export.expOpts')), h('td', [h('vxe-checkbox', {
- props: {
- value: defaultOptions.isHeader,
- title: conf.i18n('vxe.export.expHeaderTitle')
- },
- on: {
- input: function input(value) {
- defaultOptions.isHeader = value;
- }
- }
- }, conf.i18n('vxe.export.expOptHeader')), h('vxe-checkbox', {
- props: {
- value: defaultOptions.isFooter,
- disabled: !storeData.hasFooter,
- title: conf.i18n('vxe.export.expFooterTitle')
- },
- on: {
- input: function input(value) {
- defaultOptions.isFooter = value;
- }
- }
- }, conf.i18n('vxe.export.expOptFooter')), h('vxe-checkbox', {
- props: {
- value: defaultOptions.original,
- title: conf.i18n('vxe.export.expOriginalTitle')
- },
- on: {
- input: function input(value) {
- defaultOptions.original = value;
- }
- }
- }, conf.i18n('vxe.export.expOptOriginal'))])])]])]), h('div', {
- class: 'vxe-export--panel-btns'
- }, [defaultOptions.isPrint ? h('vxe-button', {
- on: {
- click: this.printEvent
- }
- }, conf.i18n('vxe.export.expPrint')) : null, h('vxe-button', {
- props: {
- status: 'primary'
- },
- on: {
- click: this.exportEvent
- }
- }, conf.i18n('vxe.export.expConfirm'))])])]);
- },
- methods: {
- changeOption: function changeOption(column) {
- var isChecked = !column.checked;
- ctor_amd_xe_utils_default.a.eachTree([column], function (item) {
- item.checked = isChecked;
- item.halfChecked = false;
- });
- this.handleOptionCheck(column);
- this.checkStatus();
- },
- handleOptionCheck: function handleOptionCheck(column) {
- var matchObj = ctor_amd_xe_utils_default.a.findTree(this.storeData.columns, function (item) {
- return item === column;
- });
- if (matchObj && matchObj.parent) {
- var parent = matchObj.parent;
- if (parent.children && parent.children.length) {
- parent.checked = parent.children.every(function (column) {
- return column.checked;
- });
- parent.halfChecked = !parent.checked && parent.children.some(function (column) {
- return column.checked || column.halfChecked;
- });
- this.handleOptionCheck(parent);
- }
- }
- },
- checkStatus: function checkStatus() {
- var columns = this.storeData.columns;
- this.isAll = columns.every(function (column) {
- return column.disabled || column.checked;
- });
- this.isIndeterminate = !this.isAll && columns.some(function (column) {
- return !column.disabled && (column.checked || column.halfChecked);
- });
- },
- allColumnEvent: function allColumnEvent() {
- var isAll = !this.isAll;
- ctor_amd_xe_utils_default.a.eachTree(this.storeData.columns, function (column) {
- if (!column.disabled) {
- column.checked = isAll;
- column.halfChecked = false;
- }
- });
- this.isAll = isAll;
- this.checkStatus();
- },
- showEvent: function showEvent() {
- var _this2 = this;
- this.$nextTick(function () {
- _this2.$refs.filename.focus();
- });
- this.checkStatus();
- },
- getExportOption: function getExportOption() {
- var storeData = this.storeData,
- defaultOptions = this.defaultOptions;
- var checkColumns = [];
- ctor_amd_xe_utils_default.a.eachTree(storeData.columns, function (column) {
- var isColGroup = column.children && column.children.length;
- if (!isColGroup && column.checked) {
- checkColumns.push(column);
- }
- });
- return Object.assign({}, defaultOptions, {
- columns: checkColumns
- });
- },
- printEvent: function printEvent() {
- var $xetable = this.$parent;
- this.storeData.visible = false;
- $xetable.print(Object.assign({}, $xetable.printOpts, this.getExportOption()));
- },
- exportEvent: function exportEvent() {
- var _this3 = this;
- var $xetable = this.$parent;
- this.loading = true;
- $xetable.exportData(Object.assign({}, $xetable.exportOpts, this.getExportOption())).then(function () {
- _this3.loading = false;
- _this3.storeData.visible = false;
- }).catch(function () {
- _this3.loading = false;
- });
- }
- }
- });
- // CONCATENATED MODULE: ./packages/export/src/import-panel.js
- /* harmony default export */ var import_panel = ({
- name: 'VxeImportPanel',
- props: {
- defaultOptions: Object,
- storeData: Object
- },
- components: {
- VxeModal: modal,
- VxeRadio: src_radio
- },
- data: function data() {
- return {
- loading: false
- };
- },
- computed: {
- vSize: function vSize() {
- return this.size || this.$parent.size || this.$parent.vSize;
- },
- selectName: function selectName() {
- return "".concat(this.storeData.filename, ".").concat(this.storeData.type);
- },
- hasFile: function hasFile() {
- return this.storeData.file && this.storeData.type;
- },
- parseTypeLabel: function parseTypeLabel() {
- var storeData = this.storeData;
- var type = storeData.type,
- typeList = storeData.typeList;
- if (type) {
- var selectItem = ctor_amd_xe_utils_default.a.find(typeList, function (item) {
- return type === item.value;
- });
- return selectItem ? conf.i18n(selectItem.label) : '*.*';
- }
- return "*.".concat(typeList.map(function (item) {
- return item.value;
- }).join(', *.'));
- }
- },
- render: function render(h) {
- var hasFile = this.hasFile,
- parseTypeLabel = this.parseTypeLabel,
- defaultOptions = this.defaultOptions,
- storeData = this.storeData,
- selectName = this.selectName;
- return h('vxe-modal', {
- res: 'modal',
- props: {
- value: storeData.visible,
- title: conf.i18n('vxe.import.impTitle'),
- width: 440,
- mask: true,
- lockView: true,
- showFooter: false,
- escClosable: true,
- maskClosable: true,
- loading: this.loading
- },
- on: {
- input: function input(value) {
- storeData.visible = value;
- }
- }
- }, [h('div', {
- class: 'vxe-export--panel'
- }, [h('table', {
- attrs: {
- cellspacing: 0,
- cellpadding: 0,
- border: 0
- }
- }, [h('tbody', [h('tr', [h('td', conf.i18n('vxe.import.impFile')), h('td', [hasFile ? h('div', {
- class: 'vxe-import-selected--file',
- attrs: {
- title: selectName
- }
- }, [h('span', selectName), h('i', {
- class: conf.icon.INPUT_CLEAR,
- on: {
- click: this.clearFileEvent
- }
- })]) : h('span', {
- class: 'vxe-import-select--file',
- on: {
- click: this.selectFileEvent
- }
- }, conf.i18n('vxe.import.impSelect'))])]), h('tr', [h('td', conf.i18n('vxe.import.impType')), h('td', parseTypeLabel)]), h('tr', [h('td', conf.i18n('vxe.import.impOpts')), h('td', [h('vxe-radio-group', {
- props: {
- value: defaultOptions.mode
- },
- on: {
- input: function input(value) {
- defaultOptions.mode = value;
- }
- }
- }, storeData.modeList.map(function (item) {
- return h('vxe-radio', {
- props: {
- label: item.value
- }
- }, conf.i18n(item.label));
- }))])])])]), h('div', {
- class: 'vxe-export--panel-btns'
- }, [h('vxe-button', {
- props: {
- status: 'primary',
- disabled: !hasFile
- },
- on: {
- click: this.importEvent
- }
- }, conf.i18n('vxe.import.impConfirm'))])])]);
- },
- methods: {
- clearFileEvent: function clearFileEvent() {
- Object.assign(this.storeData, {
- filename: '',
- sheetName: '',
- type: ''
- });
- },
- selectFileEvent: function selectFileEvent() {
- var _this = this;
- var $xetable = this.$parent;
- $xetable.readFile(this.defaultOptions).then(function (params) {
- var file = params.file;
- Object.assign(_this.storeData, UtilTools.parseFile(file), {
- file: file
- });
- }).catch(function (e) {
- return e;
- });
- },
- importEvent: function importEvent() {
- var _this2 = this;
- var $xetable = this.$parent;
- this.loading = true;
- $xetable.importByFile(this.storeData.file, Object.assign({}, $xetable.importOpts, this.defaultOptions)).then(function () {
- _this2.loading = false;
- _this2.storeData.visible = false;
- }).catch(function () {
- _this2.loading = false;
- });
- }
- }
- });
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.includes.js
- var es_array_includes = __webpack_require__("caad");
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.includes.js
- var es_string_includes = __webpack_require__("2532");
- // EXTERNAL MODULE: ./node_modules/core-js/modules/web.url.js
- var web_url = __webpack_require__("2b3d");
- // CONCATENATED MODULE: ./packages/export/src/mixin.js
- // 默认导出或打印的 HTML 样式
- 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}';
- var htmlCellElem; // 导入
- var fileForm;
- var fileInput; // 打印
- var printFrame;
- var csvBOM = "\uFEFF";
- var enterSymbol = '\r\n';
- function createFrame() {
- var frame = document.createElement('iframe');
- frame.className = 'vxe-table--print-frame';
- return frame;
- }
- function getExportBlobByContent(content, options) {
- if (window.Blob) {
- return new Blob([content], {
- type: "text/".concat(options.type)
- });
- }
- return null;
- }
- function hasTreeChildren($xetable, row) {
- var treeOpts = $xetable.treeOpts;
- return row[treeOpts.children] && row[treeOpts.children].length;
- }
- function getSeq($xetable, row, rowIndex, column, columnIndex) {
- // 在 v3.0 中废弃 startIndex、indexMethod
- var seqOpts = $xetable.seqOpts;
- var seqMethod = seqOpts.seqMethod || column.seqMethod || column.indexMethod;
- return seqMethod ? seqMethod({
- row: row,
- rowIndex: rowIndex,
- column: column,
- columnIndex: columnIndex
- }) : (seqOpts.startIndex || $xetable.startIndex) + rowIndex + 1;
- }
- function defaultFilterExportColumn(column) {
- return column.property || ['seq', 'index', 'checkbox', 'selection', 'radio'].indexOf(column.type) > -1;
- }
- function toTableBorder(border) {
- if (border === true) {
- return 'full';
- }
- if (border) {
- return border;
- }
- return 'default';
- }
- function toBooleanValue(cellValue) {
- return ctor_amd_xe_utils_default.a.isBoolean(cellValue) ? cellValue ? 'TRUE' : 'FALSE' : cellValue;
- }
- function getLabelData($xetable, opts, columns, datas) {
- var treeConfig = $xetable.treeConfig,
- treeOpts = $xetable.treeOpts,
- radioOpts = $xetable.radioOpts,
- checkboxOpts = $xetable.checkboxOpts;
- if (!htmlCellElem) {
- htmlCellElem = document.createElement('div');
- }
- if (treeConfig) {
- // 如果是树表格只允许导出数据源
- var rest = [];
- ctor_amd_xe_utils_default.a.eachTree(datas, function (row, rowIndex, items, path, parent, nodes) {
- var item = {
- _level: nodes.length - 1,
- _hasChild: hasTreeChildren($xetable, row)
- };
- columns.forEach(function (column, columnIndex) {
- var cellValue = '';
- var renderOpts = column.editRender || column.cellRender;
- var exportLabelMethod = column.exportMethod;
- if (!exportLabelMethod && renderOpts && renderOpts.name) {
- var compConf = v_x_e_table.renderer.get(renderOpts.name);
- if (compConf) {
- exportLabelMethod = compConf.exportMethod || compConf.cellExportMethod;
- }
- }
- if (exportLabelMethod) {
- cellValue = exportLabelMethod({
- $table: $xetable,
- row: row,
- column: column,
- options: opts
- });
- } else {
- switch (column.type) {
- // v3.0 废弃 type=index
- case 'seq':
- case 'index':
- cellValue = getSeq($xetable, row, rowIndex, column, columnIndex);
- break;
- // v3.0 废弃 type=selection
- case 'selection':
- case 'checkbox':
- cellValue = toBooleanValue($xetable.isCheckedByCheckboxRow(row));
- item._checkboxLabel = checkboxOpts.labelField ? ctor_amd_xe_utils_default.a.get(row, checkboxOpts.labelField) : '';
- item._checkboxDisabled = checkboxOpts.checkMethod && !checkboxOpts.checkMethod({
- row: row
- });
- break;
- case 'radio':
- cellValue = toBooleanValue($xetable.isCheckedByRadioRow(row));
- item._radioLabel = radioOpts.labelField ? ctor_amd_xe_utils_default.a.get(row, radioOpts.labelField) : '';
- item._radioDisabled = radioOpts.checkMethod && !radioOpts.checkMethod({
- row: row
- });
- break;
- default:
- if (opts.original) {
- cellValue = UtilTools.getCellValue(row, column);
- } else {
- cellValue = $xetable.getCellLabel(row, column);
- if (column.type === 'html') {
- htmlCellElem.innerHTML = cellValue;
- cellValue = htmlCellElem.innerText.trim();
- }
- }
- }
- }
- item[column.id] = ctor_amd_xe_utils_default.a.toString(cellValue);
- });
- rest.push(Object.assign(item, row));
- }, treeOpts);
- return rest;
- }
- return datas.map(function (row, rowIndex) {
- var item = {};
- columns.forEach(function (column, columnIndex) {
- var cellValue = '';
- var renderOpts = column.editRender || column.cellRender;
- var exportLabelMethod = column.exportMethod;
- if (!exportLabelMethod && renderOpts && renderOpts.name) {
- var compConf = v_x_e_table.renderer.get(renderOpts.name);
- if (compConf) {
- exportLabelMethod = compConf.exportMethod || compConf.cellExportMethod;
- }
- }
- if (exportLabelMethod) {
- cellValue = exportLabelMethod({
- $table: $xetable,
- row: row,
- column: column,
- options: opts
- });
- } else {
- switch (column.type) {
- // v3.0 废弃 type=index
- case 'seq':
- case 'index':
- cellValue = getSeq($xetable, row, rowIndex, column, columnIndex);
- break;
- // v3.0 废弃 type=selection
- case 'selection':
- case 'checkbox':
- cellValue = toBooleanValue($xetable.isCheckedByCheckboxRow(row));
- item._checkboxLabel = checkboxOpts.labelField ? ctor_amd_xe_utils_default.a.get(row, checkboxOpts.labelField) : '';
- item._checkboxDisabled = checkboxOpts.checkMethod && !checkboxOpts.checkMethod({
- row: row
- });
- break;
- case 'radio':
- cellValue = toBooleanValue($xetable.isCheckedByRadioRow(row));
- item._radioLabel = radioOpts.labelField ? ctor_amd_xe_utils_default.a.get(row, radioOpts.labelField) : '';
- item._radioDisabled = radioOpts.checkMethod && !radioOpts.checkMethod({
- row: row
- });
- break;
- default:
- if (opts.original) {
- cellValue = UtilTools.getCellValue(row, column);
- } else {
- cellValue = $xetable.getCellLabel(row, column);
- if (column.type === 'html') {
- htmlCellElem.innerHTML = cellValue;
- cellValue = htmlCellElem.innerText.trim();
- }
- }
- }
- }
- item[column.id] = ctor_amd_xe_utils_default.a.toString(cellValue);
- });
- return item;
- });
- }
- function getExportData($xetable, opts) {
- var columnFilterMethod = opts.columnFilterMethod,
- dataFilterMethod = opts.dataFilterMethod;
- var columns = opts.columns;
- var datas = opts.data;
- if (columnFilterMethod) {
- columns = columns.filter(function (column, index) {
- return columnFilterMethod({
- column: column,
- $columnIndex: index
- });
- });
- }
- if (dataFilterMethod) {
- datas = datas.filter(function (row, index) {
- return dataFilterMethod({
- row: row,
- $rowIndex: index
- });
- });
- }
- return {
- columns: columns,
- datas: getLabelData($xetable, opts, columns, datas)
- };
- }
- function getBooleanValue(cellValue) {
- return cellValue === 'TRUE' || cellValue === 'true' || cellValue === true;
- }
- function getHeaderTitle(opts, column) {
- return (opts.original ? column.property : column.getTitle()) || '';
- }
- function getFooterCellValue($xetable, opts, items, column) {
- var renderOpts = column.editRender || column.cellRender;
- var exportLabelMethod = column.footerExportMethod;
- if (!exportLabelMethod && renderOpts && renderOpts.name) {
- var compConf = v_x_e_table.renderer.get(renderOpts.name);
- if (compConf) {
- exportLabelMethod = compConf.footerExportMethod || compConf.footerCellExportMethod;
- }
- }
- var _columnIndex = $xetable.getVTColumnIndex(column);
- var cellValue = exportLabelMethod ? exportLabelMethod({
- $table: $xetable,
- items: items,
- itemIndex: _columnIndex,
- _columnIndex: _columnIndex,
- column: column,
- options: opts
- }) : ctor_amd_xe_utils_default.a.toString(items[_columnIndex]);
- return cellValue;
- }
- function getFooterData(opts, footerTableData) {
- var footerFilterMethod = opts.footerFilterMethod;
- return footerFilterMethod ? footerTableData.filter(function (items, index) {
- return footerFilterMethod({
- items: items,
- $rowIndex: index
- });
- }) : footerTableData;
- }
- function toCsv($xetable, opts, columns, datas) {
- var content = csvBOM;
- if (opts.isHeader) {
- content += columns.map(function (column) {
- return "\"".concat(getHeaderTitle(opts, column), "\"");
- }).join(',') + enterSymbol;
- }
- datas.forEach(function (row) {
- content += columns.map(function (column) {
- return "\"".concat(row[column.id], "\"");
- }).join(',') + enterSymbol;
- });
- if (opts.isFooter) {
- var footerTableData = $xetable.footerTableData;
- var footers = getFooterData(opts, footerTableData);
- footers.forEach(function (rows) {
- content += columns.map(function (column) {
- return "\"".concat(getFooterCellValue($xetable, opts, rows, column), "\"");
- }).join(',') + enterSymbol;
- });
- }
- return content;
- }
- function toTxt($xetable, opts, columns, datas) {
- var content = '';
- if (opts.isHeader) {
- content += columns.map(function (column) {
- return "".concat(getHeaderTitle(opts, column));
- }).join('\t') + enterSymbol;
- }
- datas.forEach(function (row) {
- content += columns.map(function (column) {
- return "".concat(row[column.id]);
- }).join('\t') + enterSymbol;
- });
- if (opts.isFooter) {
- var footerTableData = $xetable.footerTableData;
- var footers = getFooterData(opts, footerTableData);
- footers.forEach(function (rows) {
- content += columns.map(function (column) {
- return "".concat(getFooterCellValue($xetable, opts, rows, column));
- }).join(',') + enterSymbol;
- });
- }
- return content;
- }
- function mixin_hasEllipsis($xetable, column, property, allColumnOverflow) {
- var columnOverflow = column[property];
- var headOverflow = ctor_amd_xe_utils_default.a.isUndefined(columnOverflow) || ctor_amd_xe_utils_default.a.isNull(columnOverflow) ? allColumnOverflow : columnOverflow;
- var showEllipsis = headOverflow === 'ellipsis';
- var showTitle = headOverflow === 'title';
- var showTooltip = headOverflow === true || headOverflow === 'tooltip';
- var isEllipsis = showTitle || showTooltip || showEllipsis; // 虚拟滚动不支持动态高度
- if (($xetable.scrollXLoad || $xetable.scrollYLoad) && !isEllipsis) {
- isEllipsis = true;
- }
- return isEllipsis;
- }
- function createHtmlPage(opts, content) {
- var style = opts.style;
- return ['<!DOCTYPE html><html>', '<head>', '<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no,minimal-ui">', "<title>".concat(opts.sheetName, "</title>"), "<style>".concat(defaultHtmlStyle, "</style>"), style ? "<style>".concat(style, "</style>") : '', '</head>', "<body>".concat(ctor_amd_xe_utils_default.a.toString(content), "</body>"), '</html>'].join('');
- }
- function toHtml($xetable, opts, columns, datas) {
- var id = $xetable.id,
- border = $xetable.border,
- treeConfig = $xetable.treeConfig,
- treeOpts = $xetable.treeOpts,
- isAllSelected = $xetable.isAllSelected,
- isIndeterminate = $xetable.isIndeterminate,
- allHeaderAlign = $xetable.headerAlign,
- allAlign = $xetable.align,
- allFooterAlign = $xetable.footerAlign,
- allColumnOverflow = $xetable.showOverflow,
- allColumnHeaderOverflow = $xetable.showHeaderOverflow;
- var isPrint = opts.print,
- isHeader = opts.isHeader,
- isFooter = opts.isFooter;
- var allCls = 'check-all';
- var clss = ['vxe-table', "border--".concat(toTableBorder(border)), isPrint ? 'is--print' : '', isHeader ? 'show--head' : ''].filter(function (cls) {
- return cls;
- });
- var body = ["<table class=\"".concat(clss.join(' '), "\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"), "<colgroup>".concat(columns.map(function (column) {
- return "<col style=\"width:".concat(column.renderWidth, "px\">");
- }).join(''), "</colgroup>")].join('');
- if (isHeader) {
- body += "<thead><tr>".concat(columns.map(function (column) {
- var headAlign = column.headerAlign || column.align || allHeaderAlign || allAlign;
- var classNames = mixin_hasEllipsis($xetable, column, 'showHeaderOverflow', allColumnHeaderOverflow) ? ['col--ellipsis'] : [];
- var cellTitle = getHeaderTitle(opts, column);
- if (headAlign) {
- classNames.push("col--".concat(headAlign));
- }
- if (column.type === 'checkbox' || column.type === 'selection') {
- 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>");
- }
- return "<th class=\"".concat(classNames.join(' '), "\" title=\"").concat(cellTitle, "\"><div ").concat(isPrint ? '' : "style=\"width: ".concat(column.renderWidth, "px\""), "><span>").concat(UtilTools.formatText(cellTitle, true), "</span></div></th>");
- }).join(''), "</tr></thead>");
- }
- if (datas.length) {
- body += '<tbody>';
- if (treeConfig) {
- datas.forEach(function (item) {
- body += '<tr>' + columns.map(function (column) {
- var cellAlign = column.align || allAlign;
- var classNames = mixin_hasEllipsis($xetable, column, 'showOverflow', allColumnOverflow) ? ['col--ellipsis'] : [];
- var cellValue = item[column.id];
- if (cellAlign) {
- classNames.push("col--".concat(cellAlign));
- }
- if (column.treeNode) {
- var treeIcon = '';
- if (item._hasChild) {
- treeIcon = "<i class=\"".concat(item._expand ? 'vxe-table--tree-fold-icon' : 'vxe-table--tree-unfold-icon', "\"></i>");
- }
- classNames.push('vxe-table--tree-node');
- if (column.type === 'radio') {
- 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>");
- } else if (column.type === 'checkbox' || column.type === 'selection') {
- 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>");
- }
- 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>");
- }
- if (column.type === 'radio') {
- 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>");
- } else if (column.type === 'checkbox' || column.type === 'selection') {
- 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>");
- }
- return "<td class=\"".concat(classNames.join(' '), "\" title=\"").concat(cellValue, "\"><div ").concat(isPrint ? '' : "style=\"width: ".concat(column.renderWidth, "px\""), ">").concat(UtilTools.formatText(cellValue, true), "</div></td>");
- }).join('') + '</tr>';
- });
- } else {
- datas.forEach(function (item) {
- body += '<tr>' + columns.map(function (column) {
- var cellAlign = column.align || allAlign;
- var classNames = mixin_hasEllipsis($xetable, column, 'showOverflow', allColumnOverflow) ? ['col--ellipsis'] : [];
- var cellValue = item[column.id];
- if (cellAlign) {
- classNames.push("col--".concat(cellAlign));
- }
- if (column.type === 'radio') {
- 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>");
- } else if (column.type === 'checkbox' || column.type === 'selection') {
- 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>");
- }
- return "<td class=\"".concat(classNames.join(' '), "\" title=\"").concat(cellValue, "\"><div ").concat(isPrint ? '' : "style=\"width: ".concat(column.renderWidth, "px\""), ">").concat(UtilTools.formatText(cellValue, true), "</div></td>");
- }).join('') + '</tr>';
- });
- }
- body += '</tbody>';
- }
- if (isFooter) {
- var footerTableData = $xetable.footerTableData;
- var footers = getFooterData(opts, footerTableData);
- if (footers.length) {
- body += '<tfoot>';
- footers.forEach(function (rows) {
- body += "<tr>".concat(columns.map(function (column) {
- var footAlign = column.footerAlign || column.align || allFooterAlign || allAlign;
- var classNames = mixin_hasEllipsis($xetable, column, 'showOverflow', allColumnOverflow) ? ['col--ellipsis'] : [];
- var cellValue = getFooterCellValue($xetable, opts, rows, column);
- if (footAlign) {
- classNames.push("col--".concat(footAlign));
- }
- return "<td class=\"".concat(classNames.join(' '), "\" title=\"").concat(cellValue, "\"><div ").concat(isPrint ? '' : "style=\"width: ".concat(column.renderWidth, "px\""), ">").concat(UtilTools.formatText(cellValue, true), "</div></td>");
- }).join(''), "</tr>");
- });
- body += '</tfoot>';
- }
- } // 是否半选状态
- var script = !isAllSelected && isIndeterminate ? "<script>(function(){var a=document.querySelector(\".".concat(allCls, "\");if(a){a.indeterminate=true}})()</script>") : '';
- body += '</table>' + script;
- return isPrint ? body : createHtmlPage(opts, body);
- }
- function toXML($xetable, opts, columns, datas) {
- 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) {
- return "<Column ss:Width=\"".concat(column.renderWidth, "\"/>");
- }).join('')].join('');
- if (opts.isHeader) {
- xml += "<Row>".concat(columns.map(function (column) {
- return "<Cell><Data ss:Type=\"String\">".concat(getHeaderTitle(opts, column), "</Data></Cell>");
- }).join(''), "</Row>");
- }
- datas.forEach(function (row) {
- xml += '<Row>' + columns.map(function (column) {
- return "<Cell><Data ss:Type=\"String\">".concat(row[column.id], "</Data></Cell>");
- }).join('') + '</Row>';
- });
- if (opts.isFooter) {
- var footerTableData = $xetable.footerTableData;
- var footers = getFooterData(opts, footerTableData);
- footers.forEach(function (rows) {
- xml += "<Row>".concat(columns.map(function (column) {
- return "<Cell><Data ss:Type=\"String\">".concat(getFooterCellValue($xetable, opts, rows, column), "</Data></Cell>");
- }).join(''), "</Row>");
- });
- }
- return "".concat(xml, "</Table></Worksheet></Workbook>");
- }
- function getContent($xetable, opts, columns, datas) {
- if (columns.length) {
- switch (opts.type) {
- case 'csv':
- return toCsv($xetable, opts, columns, datas);
- case 'txt':
- return toTxt($xetable, opts, columns, datas);
- case 'html':
- return toHtml($xetable, opts, columns, datas);
- case 'xml':
- return toXML($xetable, opts, columns, datas);
- }
- }
- return '';
- }
- /**
- * 保存文件到本地
- * @param {*} options 参数
- */
- function saveLocalFile(options) {
- var filename = options.filename,
- type = options.type,
- content = options.content;
- var name = "".concat(filename, ".").concat(type);
- if (window.Blob) {
- var blob = content instanceof Blob ? content : getExportBlobByContent(ctor_amd_xe_utils_default.a.toString(content), options);
- if (navigator.msSaveBlob) {
- navigator.msSaveBlob(blob, name);
- } else {
- var linkElem = document.createElement('a');
- linkElem.target = '_blank';
- linkElem.download = name;
- linkElem.href = URL.createObjectURL(blob);
- document.body.appendChild(linkElem);
- linkElem.click();
- document.body.removeChild(linkElem);
- }
- return Promise.resolve();
- }
- return Promise.reject(new Error(UtilTools.getLog('vxe.error.notExp')));
- }
- function downloadFile($xetable, opts, content) {
- var filename = opts.filename,
- type = opts.type,
- download = opts.download;
- if (!download) {
- var blob = getExportBlobByContent(content, opts);
- return Promise.resolve({
- type: type,
- content: content,
- blob: blob
- });
- }
- saveLocalFile({
- filename: filename,
- type: type,
- content: content
- }).then(function () {
- if (opts.message !== false) {
- v_x_e_table.modal.message({
- message: conf.i18n('vxe.table.expSuccess'),
- status: 'success'
- });
- }
- });
- }
- function handleExport($xetable, opts) {
- if (opts.remote) {
- var params = {
- options: opts,
- $table: $xetable,
- $grid: $xetable.$xegrid
- };
- if (opts.exportMethod) {
- return opts.exportMethod(params);
- }
- return Promise.resolve(params);
- }
- var _getExportData = getExportData($xetable, opts),
- columns = _getExportData.columns,
- datas = _getExportData.datas;
- return Promise.resolve($xetable.preventEvent(null, 'event.export', {
- options: opts,
- columns: columns,
- datas: datas
- }, function () {
- return downloadFile($xetable, opts, getContent($xetable, opts, columns, datas));
- }));
- }
- function getElementsByTagName(elem, qualifiedName) {
- return elem.getElementsByTagName(qualifiedName);
- }
- function replaceDoubleQuotation(val) {
- return val.replace(/^"/, '').replace(/"$/, '');
- }
- function parseCsv(columns, content) {
- var list = content.split(enterSymbol);
- var rows = [];
- var fields = [];
- if (list.length) {
- var rList = list.slice(1);
- fields = list[0].split(',').map(replaceDoubleQuotation);
- rList.forEach(function (r) {
- if (r) {
- var item = {};
- r.split(',').forEach(function (val, colIndex) {
- if (fields[colIndex]) {
- item[fields[colIndex]] = replaceDoubleQuotation(val);
- }
- });
- rows.push(item);
- }
- });
- }
- return {
- fields: fields,
- rows: rows
- };
- }
- function parseTxt(columns, content) {
- var list = content.split('\n');
- var rows = [];
- var fields = [];
- if (list.length) {
- var rList = list.slice(1);
- fields = list[0].split('\t');
- rList.forEach(function (r) {
- if (r) {
- var item = {};
- r.split('\t').forEach(function (val, colIndex) {
- if (fields[colIndex]) {
- item[fields[colIndex]] = replaceDoubleQuotation(val);
- }
- });
- rows.push(item);
- }
- });
- }
- return {
- fields: fields,
- rows: rows
- };
- }
- function parseHTML(columns, content) {
- var domParser = new DOMParser();
- var xmlDoc = domParser.parseFromString(content, 'text/html');
- var bodyNodes = getElementsByTagName(xmlDoc, 'body');
- var rows = [];
- var fields = [];
- if (bodyNodes.length) {
- var tableNodes = getElementsByTagName(bodyNodes[0], 'table');
- if (tableNodes.length) {
- var theadNodes = getElementsByTagName(tableNodes[0], 'thead');
- if (theadNodes.length) {
- ctor_amd_xe_utils_default.a.arrayEach(getElementsByTagName(theadNodes[0], 'tr'), function (rowNode) {
- ctor_amd_xe_utils_default.a.arrayEach(getElementsByTagName(rowNode, 'th'), function (cellNode) {
- fields.push(cellNode.textContent);
- });
- });
- var tbodyNodes = getElementsByTagName(tableNodes[0], 'tbody');
- if (tbodyNodes.length) {
- ctor_amd_xe_utils_default.a.arrayEach(getElementsByTagName(tbodyNodes[0], 'tr'), function (rowNode) {
- var item = {};
- ctor_amd_xe_utils_default.a.arrayEach(getElementsByTagName(rowNode, 'td'), function (cellNode, colIndex) {
- if (fields[colIndex]) {
- item[fields[colIndex]] = cellNode.textContent || '';
- }
- });
- rows.push(item);
- });
- }
- }
- }
- }
- return {
- fields: fields,
- rows: rows
- };
- }
- function parseXML(columns, content) {
- var domParser = new DOMParser();
- var xmlDoc = domParser.parseFromString(content, 'application/xml');
- var sheetNodes = getElementsByTagName(xmlDoc, 'Worksheet');
- var rows = [];
- var fields = [];
- if (sheetNodes.length) {
- var tableNodes = getElementsByTagName(sheetNodes[0], 'Table');
- if (tableNodes.length) {
- var rowNodes = getElementsByTagName(tableNodes[0], 'Row');
- if (rowNodes.length) {
- ctor_amd_xe_utils_default.a.arrayEach(getElementsByTagName(rowNodes[0], 'Cell'), function (cellNode) {
- fields.push(cellNode.textContent);
- });
- ctor_amd_xe_utils_default.a.arrayEach(rowNodes, function (rowNode, index) {
- if (index) {
- var item = {};
- var cellNodes = getElementsByTagName(rowNode, 'Cell');
- ctor_amd_xe_utils_default.a.arrayEach(cellNodes, function (cellNode, colIndex) {
- if (fields[colIndex]) {
- item[fields[colIndex]] = cellNode.textContent;
- }
- });
- rows.push(item);
- }
- });
- }
- }
- }
- return {
- fields: fields,
- rows: rows
- };
- }
- /**
- * 检查导入的列是否完整
- * @param {Array} fields 字段名列表
- * @param {Array} rows 数据列表
- */
- function checkImportData(columns, fields) {
- var tableFields = [];
- columns.forEach(function (column) {
- var field = column.property;
- if (field) {
- tableFields.push(field);
- }
- });
- return tableFields.every(function (field) {
- return fields.indexOf(field) > -1;
- });
- }
- function handleImport($xetable, content, opts) {
- var tableFullColumn = $xetable.tableFullColumn,
- _importResolve = $xetable._importResolve;
- var rest = {
- fields: [],
- rows: []
- };
- switch (opts.type) {
- case 'csv':
- rest = parseCsv(tableFullColumn, content);
- break;
- case 'txt':
- rest = parseTxt(tableFullColumn, content);
- break;
- case 'html':
- rest = parseHTML(tableFullColumn, content);
- break;
- case 'xml':
- rest = parseXML(tableFullColumn, content);
- break;
- }
- var _rest = rest,
- fields = _rest.fields,
- rows = _rest.rows;
- var status = checkImportData(tableFullColumn, fields);
- if (status) {
- $xetable.createData(rows).then(function (data) {
- if (opts.mode === 'insert') {
- $xetable.insert(data);
- } else {
- $xetable.reloadData(data);
- }
- });
- if (opts.message !== false) {
- v_x_e_table.modal.message({
- message: conf.i18n('vxe.table.impSuccess', [rows.length]),
- status: 'success'
- });
- }
- } else if (opts.message !== false) {
- v_x_e_table.modal.message({
- message: conf.i18n('vxe.error.impFields'),
- status: 'error'
- });
- }
- if (_importResolve) {
- _importResolve(status);
- $xetable._importResolve = null;
- }
- }
- function afterPrintEvent() {
- if (printFrame && printFrame.parentNode) {
- printFrame.parentNode.removeChild(printFrame);
- }
- }
- function handlePrint($xetable, opts, content) {
- var beforePrintMethod = opts.beforePrintMethod;
- if (beforePrintMethod) {
- content = beforePrintMethod({
- content: content,
- options: opts,
- $table: $xetable
- }) || '';
- }
- content = createHtmlPage(opts, content);
- var blob = getExportBlobByContent(content, opts);
- if (DomTools.browse.msie) {
- if (printFrame) {
- try {
- printFrame.contentDocument.write('');
- printFrame.contentDocument.clear();
- } catch (e) {}
- document.body.removeChild(printFrame);
- }
- printFrame = createFrame();
- document.body.appendChild(printFrame);
- printFrame.contentDocument.write(content);
- printFrame.contentDocument.execCommand('print');
- } else {
- if (!printFrame) {
- printFrame = createFrame();
- printFrame.onload = function (evnt) {
- if (evnt.target.src) {
- evnt.target.contentWindow.onafterprint = afterPrintEvent;
- evnt.target.contentWindow.print();
- }
- };
- }
- if (!printFrame.parentNode) {
- document.body.appendChild(printFrame);
- }
- printFrame.src = URL.createObjectURL(blob);
- }
- }
- /* harmony default export */ var export_src_mixin = ({
- methods: {
- // 在 v3.0 中废弃 exportCsv 方法
- _exportCsv: function _exportCsv(options) {
- UtilTools.warn('vxe.error.delFunc', ['exportCsv', 'exportData']);
- return this.exportData(options);
- },
- /**
- * 导出文件,支持 csv/html/xml/txt
- * 如果是树表格,则默认是导出所有节点
- * 如果是启用了虚拟滚动,则只能导出数据源,可以配合 dataFilterMethod 函数自行转换数据
- * @param {Object} options 参数
- */
- _exportData: function _exportData(options) {
- var _this = this;
- var $xegrid = this.$xegrid,
- visibleColumn = this.visibleColumn,
- tableFullColumn = this.tableFullColumn,
- afterFullData = this.afterFullData,
- treeConfig = this.treeConfig,
- treeOpts = this.treeOpts,
- exportOpts = this.exportOpts;
- var columns = options && options.columns;
- var expColumns = [];
- if (columns && columns.length) {
- columns.forEach(function (item) {
- var targetColumn;
- if (item) {
- if (UtilTools.isColumn(item)) {
- targetColumn = item;
- } else if (ctor_amd_xe_utils_default.a.isString(item)) {
- targetColumn = _this.getColumnByField(item);
- } else {
- var type = item.type;
- var field = item.property || item.field;
- if (field && type) {
- targetColumn = tableFullColumn.find(function (column) {
- return column.property === field && column.type === type;
- });
- } else if (field) {
- targetColumn = _this.getColumnByField(field);
- } else if (type) {
- targetColumn = tableFullColumn.find(function (column) {
- return column.type === type;
- });
- }
- }
- if (targetColumn) {
- expColumns.push(targetColumn);
- }
- }
- });
- } else {
- expColumns = visibleColumn;
- }
- var opts = Object.assign({
- // filename: '',
- // sheetName: '',
- // original: false,
- // message: false,
- isHeader: true,
- isFooter: true,
- download: true,
- type: 'csv',
- mode: 'current',
- // data: null,
- // remote: false,
- // dataFilterMethod: null,
- // footerFilterMethod: null,
- // exportMethod: null,
- columnFilterMethod: columns && columns.length ? null : function (_ref) {
- var column = _ref.column;
- return defaultFilterExportColumn(column);
- }
- }, exportOpts, {
- print: false
- }, options, {
- columns: expColumns
- });
- if (!opts.filename) {
- opts.filename = conf.i18n(opts.original ? 'vxe.table.expOriginFilename' : 'vxe.table.expFilename', [ctor_amd_xe_utils_default.a.toDateString(Date.now(), 'yyyyMMddHHmmss')]);
- }
- if (!opts.sheetName) {
- opts.sheetName = document.title;
- }
- if (v_x_e_table.exportTypes.indexOf(opts.type) === -1) {
- throw new Error(UtilTools.getLog('vxe.error.notType', [opts.type]));
- }
- if (!opts.data) {
- opts.data = afterFullData;
- if (opts.mode === 'selected') {
- var selectRecords = this.getCheckboxRecords();
- if (['html', 'pdf'].indexOf(opts.type) > -1 && treeConfig) {
- opts.data = ctor_amd_xe_utils_default.a.searchTree(this.getTableData().fullData, function (item) {
- return selectRecords.indexOf(item) > -1;
- }, treeOpts);
- } else {
- opts.data = selectRecords;
- }
- } else if (opts.mode === 'all') {
- if ($xegrid && !opts.remote) {
- var _$xegrid$proxyOpts = $xegrid.proxyOpts,
- beforeQueryAll = _$xegrid$proxyOpts.beforeQueryAll,
- afterQueryAll = _$xegrid$proxyOpts.afterQueryAll,
- _$xegrid$proxyOpts$aj = _$xegrid$proxyOpts.ajax,
- ajax = _$xegrid$proxyOpts$aj === void 0 ? {} : _$xegrid$proxyOpts$aj,
- _$xegrid$proxyOpts$pr = _$xegrid$proxyOpts.props,
- props = _$xegrid$proxyOpts$pr === void 0 ? {} : _$xegrid$proxyOpts$pr;
- var ajaxMethods = ajax.queryAll;
- if (ajaxMethods) {
- var params = {
- $table: this,
- $grid: $xegrid,
- sort: $xegrid.sortData,
- filters: $xegrid.filterData,
- form: $xegrid.formData,
- target: ajaxMethods,
- options: opts
- };
- return Promise.resolve((beforeQueryAll || ajaxMethods)(params)).catch(function (e) {
- return e;
- }).then(function (rest) {
- opts.data = (props.list ? ctor_amd_xe_utils_default.a.get(rest, props.list) : rest) || [];
- if (afterQueryAll) {
- afterQueryAll(params);
- }
- return handleExport(_this, opts);
- });
- }
- }
- }
- }
- return handleExport(this, opts);
- },
- _importByFile: function _importByFile(file, opts) {
- var _this2 = this;
- if (window.FileReader) {
- var _UtilTools$parseFile = UtilTools.parseFile(file),
- type = _UtilTools$parseFile.type,
- filename = _UtilTools$parseFile.filename;
- var options = Object.assign({
- mode: 'insert'
- }, opts, {
- type: type,
- filename: filename
- });
- var types = options.types || v_x_e_table.importTypes;
- if (types.indexOf(type) > -1) {
- if (options.remote) {
- var params = {
- file: file,
- options: options,
- $table: this
- };
- if (options.importMethod) {
- return options.importMethod(params);
- }
- return Promise.resolve(params);
- }
- this.preventEvent(null, 'event.import', {
- file: file,
- options: options,
- columns: this.tableFullColumn
- }, function () {
- var reader = new FileReader();
- reader.onerror = function () {
- UtilTools.error('vxe.error.notType', [type]);
- };
- reader.onload = function (e) {
- handleImport(_this2, e.target.result.trim(), options);
- };
- reader.readAsText(file, 'UTF-8');
- });
- } else {
- UtilTools.error('vxe.error.notType', [type]);
- }
- } else {
- UtilTools.error('vxe.error.notExp');
- }
- return Promise.resolve();
- },
- _importData: function _importData(options) {
- var _this3 = this;
- var opts = Object.assign({
- types: v_x_e_table.importTypes
- }, this.importOpts, options);
- var rest = new Promise(function (resolve, reject) {
- var _importResolve = function _importResolve(params) {
- resolve(params);
- _this3._importResolve = null;
- _this3._importReject = null;
- };
- var _importReject = function _importReject(params) {
- reject(params);
- _this3._importResolve = null;
- _this3._importReject = null;
- };
- _this3._importResolve = _importResolve;
- _this3._importReject = _importReject;
- });
- this.readFile(opts).then(function (params) {
- var file = params.file;
- _this3.importByFile(file, opts);
- }).catch(function (params) {
- _this3._importReject(params);
- _this3._importReject = null;
- });
- return rest;
- },
- _saveFile: function _saveFile(options) {
- return saveLocalFile(options);
- },
- _readFile: function _readFile() {
- var _this4 = this;
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- if (!fileForm) {
- fileForm = document.createElement('form');
- fileInput = document.createElement('input');
- fileForm.className = 'vxe-table--file-form';
- fileInput.name = 'file';
- fileInput.type = 'file';
- fileForm.appendChild(fileInput);
- document.body.appendChild(fileForm);
- }
- var types = options.types || [];
- var isAllType = !types.length || types.some(function (type) {
- return type === '*';
- });
- fileInput.multiple = !!options.multiple;
- fileInput.accept = isAllType ? '' : ".".concat(types.join(', .'));
- fileInput.onchange = function (evnt) {
- var files = evnt.target.files;
- var file = files[0];
- var errType; // 校验类型
- if (!isAllType) {
- for (var fIndex = 0; fIndex < files.length; fIndex++) {
- var _UtilTools$parseFile2 = UtilTools.parseFile(files[fIndex]),
- type = _UtilTools$parseFile2.type;
- if (!ctor_amd_xe_utils_default.a.includes(types, type)) {
- errType = type;
- break;
- }
- }
- }
- if (!errType) {
- _this4._fileResolve({
- files: files,
- file: file,
- target: evnt.target
- });
- } else {
- if (options.message !== false) {
- v_x_e_table.modal.message({
- message: ctor_amd_xe_utils_default.a.template(conf.i18n('vxe.error.notType'), [errType]),
- status: 'error'
- });
- }
- _this4._fileReject({
- files: files,
- file: file
- });
- }
- _this4._fileResolve = null;
- };
- fileForm.reset();
- fileInput.click();
- return new Promise(function (resolve, reject) {
- _this4._fileResolve = resolve;
- _this4._fileReject = reject;
- });
- },
- _print: function _print(options) {
- var _this5 = this;
- var opts = Object.assign({
- original: false
- }, this.printOpts, options, {
- type: 'html',
- download: false,
- remote: false,
- print: true
- });
- if (!opts.sheetName) {
- opts.sheetName = document.title;
- }
- if (opts.content) {
- handlePrint(this, opts, opts.content);
- } else {
- this.exportData(opts).then(function (_ref2) {
- var content = _ref2.content;
- handlePrint(_this5, opts, content);
- });
- }
- },
- _openImport: function _openImport(options) {
- var defOpts = Object.assign({
- mode: 'insert',
- message: true
- }, options, this.importOpts);
- var types = defOpts.types || v_x_e_table.exportTypes;
- var isTree = !!this.getTreeStatus();
- if (isTree) {
- if (defOpts.message) {
- v_x_e_table.modal.message({
- message: conf.i18n('vxe.error.treeNotImp'),
- status: 'error'
- });
- }
- return;
- }
- if (!this.importConfig) {
- UtilTools.error('vxe.error.reqProp', ['import-config']);
- } // 处理类型
- var typeList = types.map(function (value) {
- return {
- value: value,
- label: "vxe.export.types.".concat(value)
- };
- });
- var modeList = defOpts.modes.map(function (value) {
- return {
- value: value,
- label: "vxe.import.modes.".concat(value)
- };
- });
- Object.assign(this.importStore, {
- file: null,
- type: '',
- filename: '',
- modeList: modeList,
- typeList: typeList,
- visible: true
- });
- Object.assign(this.importParams, defOpts);
- },
- _openExport: function _openExport(options) {
- var $toolbar = this.$toolbar,
- exportConfig = this.exportConfig,
- customOpts = this.customOpts,
- exportOpts = this.exportOpts,
- collectColumn = this.collectColumn,
- footerTableData = this.footerTableData;
- var selectRecords = this.getCheckboxRecords();
- var hasFooter = !!footerTableData.length;
- var defOpts = Object.assign({
- message: true,
- isHeader: true
- }, exportOpts, options);
- var types = defOpts.types || v_x_e_table.exportTypes;
- var checkMethod = customOpts.checkMethod || ($toolbar ? $toolbar.customOpts.checkMethod : null);
- var exportColumns = collectColumn.slice(0);
- var columns = defOpts.columns;
- if (!exportConfig) {
- UtilTools.error('vxe.error.reqProp', ['export-config']);
- } // 处理类型
- var typeList = types.map(function (value) {
- return {
- value: value,
- label: "vxe.export.types.".concat(value)
- };
- });
- var modeList = defOpts.modes.map(function (value) {
- return {
- value: value,
- label: "vxe.export.modes.".concat(value)
- };
- }); // 默认选中
- ctor_amd_xe_utils_default.a.eachTree(exportColumns, function (column, index, items, path, parent) {
- var isColGroup = column.children && column.children.length;
- if (isColGroup || defaultFilterExportColumn(column)) {
- column.checked = columns ? columns.some(function (item) {
- if (UtilTools.isColumn(item)) {
- return column === item;
- } else if (ctor_amd_xe_utils_default.a.isString(item)) {
- return column.field === item;
- } else {
- var colid = item.id;
- var type = item.type;
- var field = item.property || item.field;
- if (colid) {
- return column.id === colid;
- } else if (field && type) {
- return column.property === field && column.type === type;
- } else if (field) {
- return column.property === field;
- } else if (type) {
- return column.type === type;
- }
- }
- }) : column.visible;
- column.halfChecked = false;
- column.disabled = parent && parent.disabled || (checkMethod ? !checkMethod({
- column: column
- }) : false);
- }
- }); // 更新条件
- Object.assign(this.exportStore, {
- columns: exportColumns,
- typeList: typeList,
- modeList: modeList,
- hasFooter: hasFooter,
- visible: true
- }); // 重置参数
- Object.assign(this.exportParams, {
- filename: defOpts.filename || '',
- sheetName: defOpts.sheetName || '',
- type: defOpts.type || typeList[0].value,
- mode: selectRecords.length ? 'selected' : 'current',
- original: defOpts.original,
- message: defOpts.message,
- isHeader: defOpts.isHeader,
- isFooter: hasFooter && (ctor_amd_xe_utils_default.a.isBoolean(exportOpts.isFooter) ? exportOpts.isFooter : true),
- isPrint: defOpts.isPrint
- });
- return this.$nextTick();
- }
- }
- });
- // CONCATENATED MODULE: ./packages/export/index.js
- function print(options) {
- var opts = Object.assign({}, options, {
- type: 'html'
- });
- handlePrint(null, opts, opts.content);
- }
- var Export = {
- install: function install(Vue) {
- v_x_e_table.reg('export');
- v_x_e_table.saveFile = saveLocalFile;
- v_x_e_table.print = print;
- v_x_e_table.setup({
- export: {
- types: {
- csv: 0,
- html: 0,
- xml: 0,
- txt: 0
- }
- }
- });
- packages_table.mixins.push(export_src_mixin);
- Vue.component(export_panel.name, export_panel);
- Vue.component(import_panel.name, import_panel);
- }
- };
- /* harmony default export */ var packages_export = (Export);
- // CONCATENATED MODULE: ./packages/keyboard/src/mixin.js
- var mixin_browse = DomTools.browse;
- function getTargetOffset(target, container) {
- var offsetTop = 0;
- var offsetLeft = 0;
- var triggerCheckboxLabel = !mixin_browse.firefox && DomTools.hasClass(target, 'vxe-checkbox--label');
- if (triggerCheckboxLabel) {
- var checkboxLabelStyle = getComputedStyle(target);
- offsetTop -= ctor_amd_xe_utils_default.a.toNumber(checkboxLabelStyle.paddingTop);
- offsetLeft -= ctor_amd_xe_utils_default.a.toNumber(checkboxLabelStyle.paddingLeft);
- }
- while (target && target !== container) {
- offsetTop += target.offsetTop;
- offsetLeft += target.offsetLeft;
- target = target.offsetParent;
- if (triggerCheckboxLabel) {
- var checkboxStyle = getComputedStyle(target);
- offsetTop -= ctor_amd_xe_utils_default.a.toNumber(checkboxStyle.paddingTop);
- offsetLeft -= ctor_amd_xe_utils_default.a.toNumber(checkboxStyle.paddingLeft);
- }
- }
- return {
- offsetTop: offsetTop,
- offsetLeft: offsetLeft
- };
- }
- function getCheckboxRangeRows(_vm, params, targetTrElem, moveRange) {
- var countHeight = 0;
- var rangeRows = [];
- var isDown = moveRange > 0;
- var moveSize = moveRange > 0 ? moveRange : Math.abs(moveRange) + targetTrElem.offsetHeight;
- var afterFullData = _vm.afterFullData,
- scrollYStore = _vm.scrollYStore,
- scrollYLoad = _vm.scrollYLoad;
- if (scrollYLoad) {
- var _rowIndex = _vm.getVTRowIndex(params.row);
- if (isDown) {
- rangeRows = afterFullData.slice(_rowIndex, _rowIndex + Math.ceil(moveSize / scrollYStore.rowHeight));
- } else {
- rangeRows = afterFullData.slice(_rowIndex - Math.floor(moveSize / scrollYStore.rowHeight) + 1, _rowIndex + 1);
- }
- } else {
- var siblingProp = isDown ? 'next' : 'previous';
- while (targetTrElem && countHeight < moveSize) {
- rangeRows.push(_vm.getRowNode(targetTrElem).item);
- countHeight += targetTrElem.offsetHeight;
- targetTrElem = targetTrElem["".concat(siblingProp, "ElementSibling")];
- }
- }
- return rangeRows;
- }
- /* harmony default export */ var keyboard_src_mixin = ({
- methods: {
- // 处理 Tab 键移动
- moveTabSelected: function moveTabSelected(args, isLeft, evnt) {
- var _this = this;
- var afterFullData = this.afterFullData,
- visibleColumn = this.visibleColumn,
- editConfig = this.editConfig,
- editOpts = this.editOpts,
- isSeqColumn = this.isSeqColumn;
- var targetRow;
- var targetRowIndex;
- var targetColumn;
- var targetColumnIndex;
- var params = Object.assign({}, args);
- var rowIndex = afterFullData.indexOf(params.row);
- var columnIndex = visibleColumn.indexOf(params.column);
- evnt.preventDefault();
- if (isLeft) {
- // 向左
- for (var len = columnIndex - 1; len >= 0; len--) {
- if (!isSeqColumn(visibleColumn[len])) {
- targetColumnIndex = len;
- targetColumn = visibleColumn[len];
- break;
- }
- }
- if (!targetColumn && rowIndex > 0) {
- // 如果找不到从上一行开始找,如果一行都找不到就不需要继续找了,可能不存在可编辑的列
- targetRowIndex = rowIndex - 1;
- targetRow = afterFullData[targetRowIndex];
- for (var _len = visibleColumn.length - 1; _len >= 0; _len--) {
- if (!isSeqColumn(visibleColumn[_len])) {
- targetColumnIndex = _len;
- targetColumn = visibleColumn[_len];
- break;
- }
- }
- }
- } else {
- // 向右
- for (var index = columnIndex + 1; index < visibleColumn.length; index++) {
- if (!isSeqColumn(visibleColumn[index])) {
- targetColumnIndex = index;
- targetColumn = visibleColumn[index];
- break;
- }
- }
- if (!targetColumn && rowIndex < afterFullData.length - 1) {
- // 如果找不到从下一行开始找,如果一行都找不到就不需要继续找了,可能不存在可编辑的列
- targetRowIndex = rowIndex + 1;
- targetRow = afterFullData[targetRowIndex];
- for (var _index = 0; _index < visibleColumn.length; _index++) {
- if (!isSeqColumn(visibleColumn[_index])) {
- targetColumnIndex = _index;
- targetColumn = visibleColumn[_index];
- break;
- }
- }
- }
- }
- if (targetColumn) {
- if (targetRow) {
- params.rowIndex = targetRowIndex;
- params.row = targetRow;
- } else {
- params.rowIndex = rowIndex;
- }
- params.columnIndex = targetColumnIndex;
- params.column = targetColumn;
- params.cell = this.getCell(params.row, params.column);
- if (editConfig) {
- if (editOpts.trigger === 'click' || editOpts.trigger === 'dblclick') {
- if (editOpts.mode === 'row') {
- this.handleActived(params, evnt);
- } else {
- this.scrollToRow(params.row, params.column).then(function () {
- return _this.handleSelected(params, evnt);
- });
- }
- }
- }
- }
- },
- // 处理当前行方向键移动
- moveCurrentRow: function moveCurrentRow(isUpArrow, isDwArrow, evnt) {
- var _this2 = this;
- var currentRow = this.currentRow,
- treeConfig = this.treeConfig,
- treeOpts = this.treeOpts,
- afterFullData = this.afterFullData;
- var targetRow;
- evnt.preventDefault();
- if (currentRow) {
- if (treeConfig) {
- var _XEUtils$findTree = ctor_amd_xe_utils_default.a.findTree(afterFullData, function (item) {
- return item === currentRow;
- }, treeOpts),
- index = _XEUtils$findTree.index,
- items = _XEUtils$findTree.items;
- if (isUpArrow && index > 0) {
- targetRow = items[index - 1];
- } else if (isDwArrow && index < items.length - 1) {
- targetRow = items[index + 1];
- }
- } else {
- var _rowIndex = this.getVTRowIndex(currentRow);
- if (isUpArrow && _rowIndex > 0) {
- targetRow = afterFullData[_rowIndex - 1];
- } else if (isDwArrow && _rowIndex < afterFullData.length - 1) {
- targetRow = afterFullData[_rowIndex + 1];
- }
- }
- } else {
- targetRow = afterFullData[0];
- }
- if (targetRow) {
- var params = {
- $table: this,
- row: targetRow
- };
- this.scrollToRow(targetRow).then(function () {
- return _this2.triggerCurrentRowEvent(evnt, params);
- });
- }
- },
- // 处理可编辑方向键移动
- moveSelected: function moveSelected(args, isLeftArrow, isUpArrow, isRightArrow, isDwArrow, evnt) {
- var _this3 = this;
- var afterFullData = this.afterFullData,
- visibleColumn = this.visibleColumn,
- isSeqColumn = this.isSeqColumn;
- var params = Object.assign({}, args);
- var _rowIndex = this.getVTRowIndex(params.row);
- var _columnIndex = this.getVTColumnIndex(params.column);
- evnt.preventDefault();
- if (isUpArrow && _rowIndex > 0) {
- // 移动到上一行
- params.rowIndex = _rowIndex - 1;
- params.row = afterFullData[params.rowIndex];
- } else if (isDwArrow && _rowIndex < afterFullData.length - 1) {
- // 移动到下一行
- params.rowIndex = _rowIndex + 1;
- params.row = afterFullData[params.rowIndex];
- } else if (isLeftArrow && _columnIndex) {
- for (var len = _columnIndex - 1; len >= 0; len--) {
- if (!isSeqColumn(visibleColumn[len])) {
- params.columnIndex = len;
- params.column = visibleColumn[len];
- break;
- }
- }
- } else if (isRightArrow) {
- for (var index = _columnIndex + 1; index < visibleColumn.length; index++) {
- if (!isSeqColumn(visibleColumn[index])) {
- params.columnIndex = index;
- params.column = visibleColumn[index];
- break;
- }
- }
- }
- this.scrollToRow(params.row, params.column).then(function () {
- params.cell = _this3.getCell(params.row, params.column);
- _this3.handleSelected(params, evnt);
- });
- },
- /**
- * 表头按下事件
- */
- triggerHeaderCellMousedownEvent: function triggerHeaderCellMousedownEvent(evnt, params) {
- var mouseConfig = this.mouseConfig,
- mouseOpts = this.mouseOpts;
- var cell = evnt.currentTarget;
- var triggerSort = DomTools.getEventTargetNode(evnt, cell, 'vxe-cell--sort').flag;
- var triggerFilter = DomTools.getEventTargetNode(evnt, cell, 'vxe-cell--filter').flag;
- if (mouseConfig && mouseOpts.area && this.handleHeaderCellAreaEvent) {
- this.handleHeaderCellAreaEvent(evnt, Object.assign({
- cell: cell,
- triggerSort: triggerSort,
- triggerFilter: triggerFilter
- }, params));
- } else if (mouseConfig && mouseOpts.checked) {
- this.handleHeaderCellCheckedEvent(evnt, Object.assign({
- cell: cell,
- triggerSort: triggerSort,
- triggerFilter: triggerFilter
- }, params));
- }
- this.focus();
- this.closeMenu();
- },
- /**
- * 单元格按下事件
- */
- triggerCellMousedownEvent: function triggerCellMousedownEvent(evnt, params) {
- var cell = evnt.currentTarget;
- params.cell = cell;
- this.handleCellMousedownEvent(evnt, params);
- this.focus();
- this.closeFilter();
- this.closeMenu();
- },
- handleCellMousedownEvent: function handleCellMousedownEvent(evnt, params) {
- var mouseConfig = this.mouseConfig,
- mouseOpts = this.mouseOpts,
- checkboxConfig = this.checkboxConfig,
- checkboxOpts = this.checkboxOpts,
- editConfig = this.editConfig,
- editOpts = this.editOpts;
- var column = params.column;
- if (mouseConfig && mouseOpts.area && this.handleCellAreaEvent) {
- this.handleCellAreaEvent(evnt, params);
- } else if (mouseConfig && mouseOpts.checked) {
- // 在 v3.0 中废弃 mouse-config.checked
- this.handleCheckedRangeEvent(evnt, params);
- } else {
- if (checkboxConfig && checkboxOpts.range) {
- this.handleCheckboxRangeEvent(evnt, params);
- }
- if (mouseConfig && mouseOpts.selected) {
- // v3.0 废弃 type=index
- if (!(column.type === 'seq' || column.type === 'index') && (!editConfig || editOpts.mode === 'cell')) {
- this.handleSelected(params, evnt);
- }
- }
- }
- },
- handleHeaderCellCheckedEvent: function handleHeaderCellCheckedEvent(evnt, params) {
- var $el = this.$el,
- tableData = this.tableData,
- mouseConfig = this.mouseConfig,
- mouseOpts = this.mouseOpts,
- elemStore = this.elemStore,
- handleChecked = this.handleChecked,
- handleHeaderChecked = this.handleHeaderChecked;
- var button = evnt.button;
- var column = params.column;
- var cell = evnt.currentTarget;
- var isLeftBtn = button === 0; // v3.0 废弃 type=index
- var isIndex = column.type === 'seq' || column.type === 'index';
- if (mouseConfig) {
- // 在 v3.0 中废弃 mouse-config.checked
- if (mouseOpts.checked) {
- var headerList = elemStore['main-header-list'].children;
- var bodyList = elemStore['main-body-list'].children;
- if (isIndex) {
- this.handleAllChecked(evnt);
- } else {
- this.clearSelected(evnt);
- this.clearHeaderChecked();
- this.clearIndexChecked();
- var startCell = bodyList[0].querySelector(".".concat(column.id));
- if (isLeftBtn) {
- var domMousemove = document.onmousemove;
- var domMouseup = document.onmouseup;
- var updateEvent = ctor_amd_xe_utils_default.a.throttle(function (evnt) {
- var _DomTools$getEventTar = DomTools.getEventTargetNode(evnt, $el, 'vxe-header--column'),
- flag = _DomTools$getEventTar.flag,
- targetElem = _DomTools$getEventTar.targetElem;
- if (!flag) {
- var nodeRest = DomTools.getEventTargetNode(evnt, $el, 'vxe-body--column');
- flag = nodeRest.flag;
- targetElem = nodeRest.targetElem;
- }
- if (flag && !DomTools.hasClass(targetElem, 'col--seq')) {
- var colIndex = [].indexOf.call(targetElem.parentNode.children, targetElem);
- var endCell = bodyList[bodyList.length - 1].children[colIndex];
- var head = headerList[0].children[colIndex];
- handleHeaderChecked(DomTools.getRowNodes(headerList, DomTools.getCellNodeIndex(head), DomTools.getCellNodeIndex(cell)));
- handleChecked(DomTools.getRowNodes(bodyList, DomTools.getCellNodeIndex(startCell), DomTools.getCellNodeIndex(endCell)));
- }
- }, 80, {
- leading: true,
- trailing: true
- });
- DomTools.addClass($el, 'c--checked');
- document.onmousemove = function (evnt) {
- evnt.preventDefault();
- evnt.stopPropagation();
- updateEvent(evnt);
- };
- document.onmouseup = function () {
- DomTools.removeClass($el, 'c--checked');
- document.onmousemove = domMousemove;
- document.onmouseup = domMouseup;
- };
- }
- handleHeaderChecked([[cell]]);
- if (bodyList.length) {
- var endCell = bodyList[bodyList.length - 1].querySelector(".".concat(column.id));
- var firstTrElem = bodyList[0];
- var lastTrElem = bodyList[bodyList.length - 1];
- var firstCell = firstTrElem.querySelector('.col--seq');
- params.rowIndex = 0;
- params.row = tableData[0];
- params.cell = this.getCell(params.row, params.column);
- this.handleSelected(params, evnt);
- this.handleIndexChecked(DomTools.getRowNodes(bodyList, DomTools.getCellNodeIndex(firstCell), DomTools.getCellNodeIndex(lastTrElem.querySelector('.col--seq'))));
- this.handleChecked(DomTools.getRowNodes(bodyList, DomTools.getCellNodeIndex(startCell), DomTools.getCellNodeIndex(endCell)));
- }
- }
- }
- }
- },
- getCheckboxRangeRows: function getCheckboxRangeRows(targetTrElem, moveRange) {
- var countHeight = 0;
- var rangeRows = [];
- var siblingProp = moveRange > 0 ? 'next' : 'previous';
- var moveSize = moveRange > 0 ? moveRange : Math.abs(moveRange) + targetTrElem.offsetHeight;
- while (targetTrElem && countHeight < moveSize) {
- rangeRows.push(this.getRowNode(targetTrElem).item);
- countHeight += targetTrElem.offsetHeight;
- targetTrElem = targetTrElem["".concat(siblingProp, "ElementSibling")];
- }
- return rangeRows;
- },
- handleCheckedRangeEvent: function handleCheckedRangeEvent(evnt, params) {
- var _this4 = this;
- var $el = this.$el,
- visibleColumn = this.visibleColumn,
- editStore = this.editStore,
- mouseOpts = this.mouseOpts,
- elemStore = this.elemStore;
- var checked = editStore.checked;
- var column = params.column;
- var button = evnt.button;
- var cell = evnt.currentTarget;
- var isLeftBtn = button === 0; // v3.0 废弃 type=index
- var isIndex = column.type === 'seq' || column.type === 'index';
- this.clearHeaderChecked();
- this.clearIndexChecked();
- var bodyList = elemStore['main-body-list'].children;
- var headerList = elemStore['main-header-list'].children;
- var cellLastElementChild = cell.parentNode.lastElementChild;
- var cellFirstElementChild = cell.parentNode.firstElementChild;
- if (isLeftBtn) {
- var domMousemove = document.onmousemove;
- var domMouseup = document.onmouseup;
- var startCellNode = DomTools.getCellNodeIndex(cell);
- var colIndex = [].indexOf.call(cell.parentNode.children, cell);
- var headStart = headerList[0].children[colIndex];
- var updateEvent = ctor_amd_xe_utils_default.a.throttle(function (evnt) {
- var _DomTools$getEventTar2 = DomTools.getEventTargetNode(evnt, $el, 'vxe-body--column'),
- flag = _DomTools$getEventTar2.flag,
- targetElem = _DomTools$getEventTar2.targetElem;
- if (flag) {
- if (isIndex) {
- var firstCell = targetElem.parentNode.firstElementChild;
- _this4.handleChecked(DomTools.getRowNodes(bodyList, DomTools.getCellNodeIndex(firstCell.nextElementSibling), DomTools.getCellNodeIndex(cellLastElementChild)));
- _this4.handleIndexChecked(DomTools.getRowNodes(bodyList, DomTools.getCellNodeIndex(firstCell), DomTools.getCellNodeIndex(cell)));
- } else if (!DomTools.hasClass(targetElem, 'col--seq')) {
- var _firstCell = targetElem.parentNode.firstElementChild;
- var _colIndex = [].indexOf.call(targetElem.parentNode.children, targetElem);
- var head = headerList[0].children[_colIndex];
- _this4.handleHeaderChecked(DomTools.getRowNodes(headerList, DomTools.getCellNodeIndex(head), DomTools.getCellNodeIndex(headStart)));
- _this4.handleIndexChecked(DomTools.getRowNodes(bodyList, DomTools.getCellNodeIndex(_firstCell), DomTools.getCellNodeIndex(cellFirstElementChild)));
- _this4.handleChecked(DomTools.getRowNodes(bodyList, startCellNode, DomTools.getCellNodeIndex(targetElem)));
- }
- }
- }, 80, {
- leading: true,
- trailing: true
- });
- document.onmousemove = function (evnt) {
- evnt.preventDefault();
- evnt.stopPropagation();
- updateEvent(evnt);
- };
- document.onmouseup = function () {
- document.onmousemove = domMousemove;
- document.onmouseup = domMouseup;
- };
- }
- if (isIndex) {
- var firstCell = cell.parentNode.firstElementChild;
- params.columnIndex++;
- params.column = visibleColumn[params.columnIndex];
- params.cell = cell.nextElementSibling;
- this.handleSelected(params, evnt);
- this.handleChecked(DomTools.getRowNodes(bodyList, DomTools.getCellNodeIndex(firstCell.nextElementSibling), DomTools.getCellNodeIndex(cellLastElementChild)));
- this.handleHeaderChecked([headerList[0].querySelectorAll('.vxe-header--column:not(.col--seq)')]);
- this.handleIndexChecked(DomTools.getRowNodes(bodyList, DomTools.getCellNodeIndex(firstCell), DomTools.getCellNodeIndex(cell)));
- } else {
- if (isLeftBtn) {
- var _firstCell2 = cell.parentNode.firstElementChild;
- this.handleSelected(params, evnt);
- this.handleHeaderChecked([[headerList[0].querySelector(".".concat(column.id))]]);
- this.handleIndexChecked([[_firstCell2]]);
- } else {
- if (mouseOpts.selected) {
- // 如果右键单元格不在所有选中的范围之内则重新选中
- if (!checked.rowNodes || !checked.rowNodes.some(function (list) {
- return list.indexOf(cell) > -1;
- })) {
- this.handleSelected(params, evnt);
- }
- }
- }
- }
- },
- handleCheckboxRangeEvent: function handleCheckboxRangeEvent(evnt, params) {
- var _this5 = this;
- var column = params.column,
- cell = params.cell;
- var isLeftBtn = evnt.button === 0; // 在 v3.0 中废弃 type=selection
- if (isLeftBtn && ['checkbox', 'selection'].indexOf(column.type) > -1) {
- var $el = this.$el,
- elemStore = this.elemStore;
- var disX = evnt.clientX;
- var disY = evnt.clientY;
- var bodyWrapperElem = elemStore["".concat(column.fixed || 'main', "-body-wrapper")] || elemStore['main-body-wrapper'];
- var checkboxRangeElem = bodyWrapperElem.querySelector('.vxe-table--checkbox-range');
- var domMousemove = document.onmousemove;
- var domMouseup = document.onmouseup;
- var trElem = cell.parentNode;
- var selectRecords = this.getCheckboxRecords();
- var lastRangeRows = [];
- var marginSize = 1;
- var offsetRest = getTargetOffset(evnt.target, bodyWrapperElem);
- var startTop = offsetRest.offsetTop + evnt.offsetY;
- var startLeft = offsetRest.offsetLeft + evnt.offsetX;
- var startScrollTop = bodyWrapperElem.scrollTop;
- var rowHeight = trElem.offsetHeight;
- var mouseScrollTimeout = null;
- var isMouseScrollDown = false;
- var mouseScrollSpaceSize = 1;
- var triggerEvent = function triggerEvent(type, evnt) {
- _this5.emitEvent("checkbox-range-".concat(type), {
- records: _this5.getCheckboxRecords(),
- reserves: _this5.getCheckboxReserveRecords()
- }, evnt);
- };
- var handleChecked = function handleChecked(evnt) {
- var clientX = evnt.clientX,
- clientY = evnt.clientY;
- var offsetLeft = clientX - disX;
- var offsetTop = clientY - disY + (bodyWrapperElem.scrollTop - startScrollTop);
- var rangeHeight = Math.abs(offsetTop);
- var rangeWidth = Math.abs(offsetLeft);
- var rangeTop = startTop;
- var rangeLeft = startLeft;
- if (offsetTop < marginSize) {
- // 向上
- rangeTop += offsetTop;
- if (rangeTop < marginSize) {
- rangeTop = marginSize;
- rangeHeight = startTop;
- }
- } else {
- // 向下
- rangeHeight = Math.min(rangeHeight, bodyWrapperElem.scrollHeight - startTop - marginSize);
- }
- if (offsetLeft < marginSize) {
- // 向左
- rangeLeft += offsetLeft;
- if (rangeWidth > startLeft) {
- rangeLeft = marginSize;
- rangeWidth = startLeft;
- }
- } else {
- // 向右
- rangeWidth = Math.min(rangeWidth, bodyWrapperElem.clientWidth - startLeft - marginSize);
- }
- checkboxRangeElem.style.height = "".concat(rangeHeight, "px");
- checkboxRangeElem.style.width = "".concat(rangeWidth, "px");
- checkboxRangeElem.style.left = "".concat(rangeLeft, "px");
- checkboxRangeElem.style.top = "".concat(rangeTop, "px");
- checkboxRangeElem.style.display = 'block';
- var rangeRows = getCheckboxRangeRows(_this5, params, trElem, offsetTop < marginSize ? -rangeHeight : rangeHeight); // 至少滑动 10px 才能有效匹配
- if (rangeHeight > 10 && rangeRows.length !== lastRangeRows.length) {
- lastRangeRows = rangeRows;
- if (evnt.ctrlKey) {
- rangeRows.forEach(function (row) {
- _this5.handleSelectRow({
- row: row
- }, selectRecords.indexOf(row) === -1);
- });
- } else {
- _this5.setAllCheckboxRow(false);
- _this5.setCheckboxRow(rangeRows, true);
- }
- triggerEvent('change', evnt);
- }
- }; // 停止鼠标滚动
- var stopMouseScroll = function stopMouseScroll() {
- clearTimeout(mouseScrollTimeout);
- mouseScrollTimeout = null;
- }; // 开始鼠标滚动
- var startMouseScroll = function startMouseScroll(evnt) {
- stopMouseScroll();
- mouseScrollTimeout = setTimeout(function () {
- if (mouseScrollTimeout) {
- var scrollLeft = bodyWrapperElem.scrollLeft,
- scrollTop = bodyWrapperElem.scrollTop,
- clientHeight = bodyWrapperElem.clientHeight,
- scrollHeight = bodyWrapperElem.scrollHeight;
- var topSize = Math.ceil(mouseScrollSpaceSize * 50 / rowHeight);
- if (isMouseScrollDown) {
- if (scrollTop + clientHeight < scrollHeight) {
- _this5.scrollTo(scrollLeft, scrollTop + topSize);
- startMouseScroll(evnt);
- handleChecked(evnt);
- } else {
- stopMouseScroll();
- }
- } else {
- if (scrollTop) {
- _this5.scrollTo(scrollLeft, scrollTop - topSize);
- startMouseScroll(evnt);
- handleChecked(evnt);
- } else {
- stopMouseScroll();
- }
- }
- }
- }, 50);
- };
- DomTools.addClass($el, 'drag--area');
- document.onmousemove = function (evnt) {
- evnt.preventDefault();
- evnt.stopPropagation();
- var clientY = evnt.clientY;
- var _DomTools$getAbsolute = DomTools.getAbsolutePos(bodyWrapperElem),
- boundingTop = _DomTools$getAbsolute.boundingTop; // 如果超过可视区,触发滚动
- if (clientY < boundingTop) {
- isMouseScrollDown = false;
- mouseScrollSpaceSize = boundingTop - clientY;
- if (!mouseScrollTimeout) {
- startMouseScroll(evnt);
- }
- } else if (clientY > boundingTop + bodyWrapperElem.clientHeight) {
- isMouseScrollDown = true;
- mouseScrollSpaceSize = clientY - boundingTop - bodyWrapperElem.clientHeight;
- if (!mouseScrollTimeout) {
- startMouseScroll(evnt);
- }
- } else if (mouseScrollTimeout) {
- stopMouseScroll();
- }
- handleChecked(evnt);
- };
- document.onmouseup = function (evnt) {
- stopMouseScroll();
- DomTools.removeClass($el, 'drag--area');
- checkboxRangeElem.removeAttribute('style');
- document.onmousemove = domMousemove;
- document.onmouseup = domMouseup;
- triggerEvent('end', evnt);
- };
- triggerEvent('start', evnt);
- }
- },
- /**
- * 清除所有选中状态
- */
- _clearChecked: function _clearChecked() {
- var $refs = this.$refs,
- editStore = this.editStore,
- mouseConfig = this.mouseConfig,
- mouseOpts = this.mouseOpts;
- var checked = editStore.checked; // 在 v3.0 中废弃 mouse-config.checked
- if (mouseConfig && mouseOpts.checked) {
- var tableBody = $refs.tableBody;
- checked.rows = [];
- checked.columns = [];
- checked.tRows = [];
- checked.tColumns = [];
- var checkBorders = tableBody.$refs.checkBorders;
- checkBorders.style.display = 'none';
- ctor_amd_xe_utils_default.a.arrayEach(tableBody.$el.querySelectorAll('.col--checked'), function (elem) {
- return DomTools.removeClass(elem, 'col--checked');
- });
- }
- return this.$nextTick();
- },
- _getMouseSelecteds: function _getMouseSelecteds() {
- UtilTools.warn('vxe.error.delFunc', ['getMouseSelecteds', 'getSelectedCell']);
- return this.getSelectedCell();
- },
- _getMouseCheckeds: function _getMouseCheckeds() {
- // UtilTools.warn('vxe.error.delFunc', ['getMouseCheckeds', 'getSelectedRanges'])
- return this.getSelectedRanges();
- },
- /**
- * 获取选中的单元格
- */
- _getSelectedCell: function _getSelectedCell() {
- var _this$editStore$selec = this.editStore.selected,
- args = _this$editStore$selec.args,
- column = _this$editStore$selec.column;
- if (args && column) {
- return Object.assign({}, args);
- }
- return null;
- },
- /**
- * 获取所有选中的单元格
- */
- _getSelectedRanges: function _getSelectedRanges() {
- var _this6 = this;
- var checked = this.editStore.checked;
- var _checked$rowNodes = checked.rowNodes,
- rowNodes = _checked$rowNodes === void 0 ? [] : _checked$rowNodes;
- var columns = [];
- var rows = [];
- if (rowNodes && rowNodes.length) {
- rows = rowNodes.map(function (list) {
- return _this6.getRowNode(list[0].parentNode).item;
- });
- columns = rowNodes[0].map(function (cell) {
- return _this6.getColumnNode(cell).item;
- });
- }
- return {
- columns: columns,
- rows: rows,
- rowNodes: rowNodes
- };
- },
- /**
- * 处理所有选中
- */
- handleChecked: function handleChecked(rowNodes) {
- var checked = this.editStore.checked;
- this.clearChecked();
- var cWidth = -2;
- var cHeight = -2;
- var offsetTop = 0;
- var offsetLeft = 0;
- ctor_amd_xe_utils_default.a.arrayEach(rowNodes, function (rows, rowIndex) {
- var isTop = rowIndex === 0;
- ctor_amd_xe_utils_default.a.arrayEach(rows, function (elem, colIndex) {
- var isLeft = colIndex === 0;
- if (isLeft && isTop) {
- offsetTop = elem.offsetTop;
- offsetLeft = elem.offsetLeft;
- }
- if (isTop) {
- cWidth += elem.offsetWidth;
- }
- if (isLeft) {
- cHeight += elem.offsetHeight;
- }
- DomTools.addClass(elem, 'col--checked');
- });
- });
- var _this$$refs$tableBody = this.$refs.tableBody.$refs,
- checkBorders = _this$$refs$tableBody.checkBorders,
- checkTop = _this$$refs$tableBody.checkTop,
- checkRight = _this$$refs$tableBody.checkRight,
- checkBottom = _this$$refs$tableBody.checkBottom,
- checkLeft = _this$$refs$tableBody.checkLeft;
- checkBorders.style.display = 'block';
- Object.assign(checkTop.style, {
- top: "".concat(offsetTop, "px"),
- left: "".concat(offsetLeft, "px"),
- width: "".concat(cWidth, "px")
- });
- Object.assign(checkRight.style, {
- top: "".concat(offsetTop, "px"),
- left: "".concat(offsetLeft + cWidth, "px"),
- height: "".concat(cHeight, "px")
- });
- Object.assign(checkBottom.style, {
- top: "".concat(offsetTop + cHeight, "px"),
- left: "".concat(offsetLeft, "px"),
- width: "".concat(cWidth, "px")
- });
- Object.assign(checkLeft.style, {
- top: "".concat(offsetTop, "px"),
- left: "".concat(offsetLeft, "px"),
- height: "".concat(cHeight, "px")
- });
- checked.rowNodes = rowNodes;
- },
- handleAllChecked: function handleAllChecked(evnt) {
- var tableData = this.tableData,
- visibleColumn = this.visibleColumn,
- mouseConfig = this.mouseConfig,
- mouseOpts = this.mouseOpts,
- elemStore = this.elemStore; // 在 v3.0 中废弃 mouse-config.checked
- if (mouseConfig && mouseOpts.checked) {
- evnt.preventDefault();
- var headerListElem = elemStore['main-header-list'];
- var headerList = headerListElem.children;
- var bodyList = elemStore['main-body-list'].children; // v3.0 废弃 type=index
- var column = ctor_amd_xe_utils_default.a.find(visibleColumn, function (column) {
- return column.type === 'seq' || column.type === 'index';
- }) || visibleColumn[0];
- var cell = headerListElem.querySelector(".".concat(column.id));
- var firstTrElem = bodyList[0];
- var lastTrElem = bodyList[bodyList.length - 1];
- var firstCell = firstTrElem.querySelector(".".concat(column.id));
- var params = {
- $table: this,
- rowIndex: 0,
- row: tableData[0],
- column: ctor_amd_xe_utils_default.a.find(visibleColumn, function (column) {
- return column.property;
- })
- };
- params.columnIndex = this.getColumnIndex(params.column);
- params.cell = this.getCell(params.row, params.column);
- this.handleSelected(params, evnt);
- this.handleHeaderChecked(DomTools.getRowNodes(headerList, DomTools.getCellNodeIndex(cell.nextElementSibling), DomTools.getCellNodeIndex(cell.parentNode.lastElementChild)));
- this.handleIndexChecked(DomTools.getRowNodes(bodyList, DomTools.getCellNodeIndex(firstCell), DomTools.getCellNodeIndex(lastTrElem.querySelector(".".concat(column.id)))));
- this.handleChecked(DomTools.getRowNodes(bodyList, DomTools.getCellNodeIndex(firstCell.nextElementSibling), DomTools.getCellNodeIndex(lastTrElem.lastElementChild)));
- }
- },
- handleIndexChecked: function handleIndexChecked(rowNodes) {
- var indexs = this.editStore.indexs;
- this.clearIndexChecked();
- ctor_amd_xe_utils_default.a.arrayEach(rowNodes, function (rows) {
- ctor_amd_xe_utils_default.a.arrayEach(rows, function (elem) {
- DomTools.addClass(elem, 'col--seq-checked');
- });
- });
- indexs.rowNodes = rowNodes;
- },
- _clearIndexChecked: function _clearIndexChecked() {
- var elemStore = this.elemStore;
- var bodyElem = elemStore['main-body-list'];
- ctor_amd_xe_utils_default.a.arrayEach(bodyElem.querySelectorAll('.col--seq-checked'), function (elem) {
- return DomTools.removeClass(elem, 'col--seq-checked');
- });
- return this.$nextTick();
- },
- handleHeaderChecked: function handleHeaderChecked(rowNodes) {
- var titles = this.editStore.titles;
- this.clearHeaderChecked();
- ctor_amd_xe_utils_default.a.arrayEach(rowNodes, function (rows) {
- ctor_amd_xe_utils_default.a.arrayEach(rows, function (elem) {
- DomTools.addClass(elem, 'col--title-checked');
- });
- });
- titles.rowNodes = rowNodes;
- },
- _clearHeaderChecked: function _clearHeaderChecked() {
- var elemStore = this.elemStore;
- var headerElem = elemStore['main-header-list'];
- if (headerElem) {
- ctor_amd_xe_utils_default.a.arrayEach(headerElem.querySelectorAll('.col--title-checked'), function (elem) {
- return DomTools.removeClass(elem, 'col--title-checked');
- });
- }
- return this.$nextTick();
- },
- /**
- * 清空已复制的内容
- */
- _clearCopyed: function _clearCopyed() {
- var $refs = this.$refs,
- editStore = this.editStore,
- keyboardConfig = this.keyboardConfig;
- var copyed = editStore.copyed;
- if (keyboardConfig && keyboardConfig.isCut) {
- var tableBody = $refs.tableBody;
- var copyBorders = $refs.tableBody.$refs.copyBorders;
- copyed.cut = false;
- copyed.rows = [];
- copyed.columns = [];
- copyBorders.style.display = 'none';
- ctor_amd_xe_utils_default.a.arrayEach(tableBody.$el.querySelectorAll('.col--copyed'), function (elem) {
- return DomTools.removeClass(elem, 'col--copyed');
- });
- }
- return this.$nextTick();
- },
- /**
- * 处理复制
- */
- handleCopyed: function handleCopyed(cut) {
- var tableData = this.tableData,
- tableColumn = this.tableColumn,
- editStore = this.editStore;
- var copyed = editStore.copyed,
- checked = editStore.checked;
- var rowNodes = checked.rowNodes;
- this.clearCopyed();
- var cWidth = -3;
- var cHeight = -3;
- var offsetTop = 0;
- var offsetLeft = 0;
- var columns = [];
- var rows = [];
- if (rowNodes.length) {
- var firstRows = rowNodes[0];
- var _DomTools$getCellNode = DomTools.getCellNodeIndex(firstRows[0]),
- rowIndex = _DomTools$getCellNode.rowIndex,
- columnIndex = _DomTools$getCellNode.columnIndex;
- columns = tableColumn.slice(columnIndex, columnIndex + firstRows.length);
- rows = tableData.slice(rowIndex, rowIndex + rowNodes.length);
- }
- ctor_amd_xe_utils_default.a.arrayEach(rowNodes, function (rows, rowIndex) {
- var isTop = rowIndex === 0;
- ctor_amd_xe_utils_default.a.arrayEach(rows, function (elem, colIndex) {
- var isLeft = colIndex === 0;
- if (isLeft && isTop) {
- offsetTop = elem.offsetTop;
- offsetLeft = elem.offsetLeft;
- }
- if (isTop) {
- cWidth += elem.offsetWidth;
- }
- if (isLeft) {
- cHeight += elem.offsetHeight;
- }
- DomTools.addClass(elem, 'col--copyed');
- });
- });
- var _this$$refs$tableBody2 = this.$refs.tableBody.$refs,
- copyBorders = _this$$refs$tableBody2.copyBorders,
- copyTop = _this$$refs$tableBody2.copyTop,
- copyRight = _this$$refs$tableBody2.copyRight,
- copyBottom = _this$$refs$tableBody2.copyBottom,
- copyLeft = _this$$refs$tableBody2.copyLeft;
- copyBorders.style.display = 'block';
- Object.assign(copyTop.style, {
- top: "".concat(offsetTop, "px"),
- left: "".concat(offsetLeft, "px"),
- width: "".concat(cWidth, "px")
- });
- Object.assign(copyRight.style, {
- top: "".concat(offsetTop, "px"),
- left: "".concat(offsetLeft + cWidth, "px"),
- height: "".concat(cHeight, "px")
- });
- Object.assign(copyBottom.style, {
- top: "".concat(offsetTop + cHeight, "px"),
- left: "".concat(offsetLeft, "px"),
- width: "".concat(cWidth, "px")
- });
- Object.assign(copyLeft.style, {
- top: "".concat(offsetTop, "px"),
- left: "".concat(offsetLeft, "px"),
- height: "".concat(cHeight, "px")
- });
- copyed.cut = cut;
- copyed.rows = rows;
- copyed.columns = columns;
- copyed.rowNodes = rowNodes;
- },
- /**
- * 处理粘贴
- */
- handlePaste: function handlePaste() {
- var tableData = this.tableData,
- visibleColumn = this.visibleColumn,
- editStore = this.editStore,
- elemStore = this.elemStore;
- var copyed = editStore.copyed,
- selected = editStore.selected;
- var cut = copyed.cut,
- rows = copyed.rows,
- columns = copyed.columns;
- if (rows.length && columns.length && selected.row && selected.column) {
- var _selected$args = selected.args,
- rowIndex = _selected$args.rowIndex,
- columnIndex = _selected$args.columnIndex;
- ctor_amd_xe_utils_default.a.arrayEach(rows, function (row, rIndex) {
- var offsetRow = tableData[rowIndex + rIndex];
- if (offsetRow) {
- ctor_amd_xe_utils_default.a.arrayEach(columns, function (column, cIndex) {
- var offsetColumn = visibleColumn[columnIndex + cIndex];
- if (offsetColumn) {
- UtilTools.setCellValue(offsetRow, offsetColumn, UtilTools.getCellValue(row, column));
- }
- if (cut) {
- UtilTools.setCellValue(row, column, null);
- }
- });
- }
- });
- if (cut) {
- this.clearCopyed();
- }
- var bodyList = elemStore['main-body-list'].children;
- var cell = selected.args.cell;
- var trElem = cell.parentNode;
- var colIndex = ctor_amd_xe_utils_default.a.arrayIndexOf(trElem.children, cell);
- var rIndex = ctor_amd_xe_utils_default.a.arrayIndexOf(bodyList, trElem);
- var targetTrElem = bodyList[rIndex + rows.length - 1];
- var targetCell = targetTrElem.children[colIndex + columns.length - 1];
- this.handleChecked(DomTools.getRowNodes(bodyList, DomTools.getCellNodeIndex(cell), DomTools.getCellNodeIndex(targetCell)));
- }
- }
- }
- });
- // CONCATENATED MODULE: ./packages/keyboard/index.js
- var Keyboard = {
- install: function install() {
- v_x_e_table.reg('keyboard');
- packages_table.mixins.push(keyboard_src_mixin);
- }
- };
- /* harmony default export */ var packages_keyboard = (Keyboard);
- // CONCATENATED MODULE: ./packages/validator/src/mixin.js
- /**
- * 校验规则
- */
- var mixin_Rule = /*#__PURE__*/function () {
- function Rule(rule) {
- _classCallCheck(this, Rule);
- Object.assign(this, {
- $options: rule,
- required: rule.required,
- min: rule.min,
- max: rule.max,
- type: rule.type,
- pattern: rule.pattern,
- validator: rule.validator,
- trigger: rule.trigger,
- maxWidth: rule.maxWidth
- });
- }
- /**
- * 获取校验不通过的消息
- * 支持国际化翻译
- */
- _createClass(Rule, [{
- key: "content",
- get: function get() {
- return UtilTools.getFuncText(this.$options.content || this.$options.message);
- }
- }, {
- key: "message",
- get: function get() {
- return this.content;
- }
- }]);
- return Rule;
- }();
- /* harmony default export */ var validator_src_mixin = ({
- methods: {
- /**
- * 完整校验,和 validate 的区别就是会给有效数据中的每一行进行校验
- */
- _fullValidate: function _fullValidate(rows, cb) {
- return this.beginValidate(rows, cb, true);
- },
- /**
- * 快速校验,如果存在记录不通过的记录,则返回不再继续校验(异步校验除外);
- */
- _validate: function _validate(rows, cb) {
- return this.beginValidate(rows, cb);
- },
- /**
- * 聚焦到校验通过的单元格并弹出校验错误提示
- */
- handleValidError: function handleValidError(params) {
- var _this = this;
- if (this.validOpts.autoPos === false) {
- this.emitEvent('valid-error', params);
- } else {
- this.handleActived(params, {
- type: 'valid-error',
- trigger: 'call'
- }).then(function () {
- return setTimeout(function () {
- return _this.showValidTooltip(params);
- }, 10);
- });
- }
- },
- /**
- * 对表格数据进行校验
- * 如果不指定数据,则默认只校验临时变动的数据,例如新增或修改
- * 如果传 true 则校验当前表格数据
- * 如果传 row 指定行记录,则只验证传入的行
- * 如果传 rows 为多行记录,则只验证传入的行
- * 如果只传 callback 否则默认验证整个表格数据
- * 返回 Promise 对象,或者使用回调方式
- */
- beginValidate: function beginValidate(rows, cb, isFull) {
- var _this2 = this;
- var validRest = {};
- var editRules = this.editRules,
- afterFullData = this.afterFullData,
- treeConfig = this.treeConfig,
- treeOpts = this.treeOpts;
- var vaildDatas;
- if (rows === true) {
- vaildDatas = afterFullData;
- } else if (rows) {
- if (ctor_amd_xe_utils_default.a.isFunction(rows)) {
- cb = rows;
- } else {
- vaildDatas = ctor_amd_xe_utils_default.a.isArray(rows) ? rows : [rows];
- }
- }
- if (!vaildDatas) {
- // 在 v3.0 中废弃 setup.validFullData
- if (conf.validFullData === 'obsolete') {
- vaildDatas = afterFullData;
- } else {
- vaildDatas = this.getInsertRecords().concat(this.getUpdateRecords());
- }
- }
- var status = true;
- var rowValids = [];
- this.lastCallTime = Date.now();
- this.validRuleErr = false; // 如果为快速校验,当存在某列校验不通过时将终止执行
- this.clearValidate();
- if (editRules) {
- var columns = this.getColumns();
- var handleVaild = function handleVaild(row) {
- if (isFull || !_this2.validRuleErr) {
- var colVailds = [];
- columns.forEach(function (column) {
- if ((isFull || !_this2.validRuleErr) && ctor_amd_xe_utils_default.a.has(editRules, column.property)) {
- colVailds.push(_this2.validCellRules('all', row, column).catch(function (_ref) {
- var rule = _ref.rule,
- rules = _ref.rules;
- var rest = {
- rule: rule,
- rules: rules,
- rowIndex: _this2.getRowIndex(row),
- row: row,
- columnIndex: _this2.getColumnIndex(column),
- column: column,
- $table: _this2
- };
- if (!validRest[column.property]) {
- validRest[column.property] = [];
- }
- validRest[column.property].push(rest);
- if (!isFull) {
- _this2.validRuleErr = true;
- return Promise.reject(rest);
- }
- }));
- }
- });
- rowValids.push(Promise.all(colVailds));
- }
- };
- if (treeConfig) {
- ctor_amd_xe_utils_default.a.eachTree(vaildDatas, handleVaild, treeOpts);
- } else {
- vaildDatas.forEach(handleVaild);
- }
- return Promise.all(rowValids).then(function () {
- var ruleProps = Object.keys(validRest);
- return _this2.$nextTick().then(function () {
- if (ruleProps.length) {
- return Promise.reject(validRest[ruleProps[0]][0]);
- }
- if (cb) {
- // 在 v3.0 中废弃 setup.validArgs
- if (conf.validArgs === 'obsolete') {
- cb(status);
- } else {
- cb();
- }
- }
- });
- }).catch(function (firstErrParams) {
- return new Promise(function (resolve, reject) {
- var finish = function finish() {
- _this2.$nextTick(function () {
- status = false;
- if (cb) {
- // 在 v3.0 中废弃 setup.validArgs
- if (conf.validArgs === 'obsolete') {
- cb(status, validRest);
- } else {
- cb(validRest);
- }
- resolve();
- } else {
- reject(validRest);
- }
- });
- };
- var posAndFinish = function posAndFinish() {
- firstErrParams.cell = _this2.getCell(firstErrParams.row, firstErrParams.column);
- DomTools.toView(firstErrParams.cell);
- _this2.handleValidError(firstErrParams);
- finish();
- };
- /**
- * 当校验不通过时
- * 将表格滚动到可视区
- * 由于提示信息至少需要占一行,定位向上偏移一行
- */
- var row = firstErrParams.row;
- var rowIndex = afterFullData.indexOf(row);
- var locatRow = rowIndex > 0 ? afterFullData[rowIndex - 1] : row;
- if (_this2.validOpts.autoPos === false) {
- finish();
- } else {
- if (treeConfig) {
- _this2.scrollToTreeRow(locatRow).then(posAndFinish);
- } else {
- _this2.scrollToRow(locatRow).then(posAndFinish);
- }
- }
- });
- });
- }
- return this.$nextTick().then(function () {
- if (cb) {
- // 在 v3.0 中废弃 setup.validArgs
- if (conf.validArgs === 'obsolete') {
- cb(status);
- } else {
- cb();
- }
- }
- });
- },
- hasCellRules: function hasCellRules(type, row, column) {
- var editRules = this.editRules;
- var property = column.property;
- if (property && editRules) {
- var rules = ctor_amd_xe_utils_default.a.get(editRules, property);
- return rules && ctor_amd_xe_utils_default.a.find(rules, function (rule) {
- return type === 'all' || !rule.trigger || type === rule.trigger;
- });
- }
- return false;
- },
- /**
- * 校验数据
- * 按表格行、同步列顺序校验/异步并发校验
- * 校验规则根据索引顺序依次校验,如果是异步则会等待校验完成才会继续校验下一列
- * 如果校验失败则,触发回调或者Promise<不通过列的错误消息>
- * 如果是传回调方式这返回一个校验不通过列的错误消息
- *
- * rule 配置:
- * required=Boolean 是否必填
- * min=Number 最小长度
- * max=Number 最大长度
- * validator=Function({ cellValue, rule, rules, row, column, rowIndex, columnIndex }) 自定义校验,接收一个 Promise
- * trigger=blur|change 触发方式(除非特殊场景,否则默认为空就行)
- */
- validCellRules: function validCellRules(type, row, column, val) {
- var _this3 = this;
- var editRules = this.editRules;
- var property = column.property;
- var errorRules = [];
- var syncVailds = [];
- if (property && editRules) {
- var rules = ctor_amd_xe_utils_default.a.get(editRules, property);
- if (rules) {
- var cellValue = ctor_amd_xe_utils_default.a.isUndefined(val) ? ctor_amd_xe_utils_default.a.get(row, property) : val;
- rules.forEach(function (rule) {
- if (type === 'all' || !rule.trigger || type === rule.trigger) {
- if (ctor_amd_xe_utils_default.a.isFunction(rule.validator)) {
- var customValid; // 在 v3.0 中废弃 setup.validArgs
- if (conf.validArgs === 'obsolete') {
- customValid = new Promise(function (resolve) {
- rule.validator(rule, cellValue, function (e) {
- if (ctor_amd_xe_utils_default.a.isError(e)) {
- _this3.validRuleErr = true;
- errorRules.push(new mixin_Rule({
- type: 'custom',
- trigger: rule.trigger,
- message: e.message,
- rule: new mixin_Rule(rule)
- }));
- }
- resolve();
- }, {
- rule: rule,
- rules: rules,
- row: row,
- column: column,
- rowIndex: _this3.getRowIndex(row),
- columnIndex: _this3.getColumnIndex(column),
- $table: _this3
- });
- });
- } else {
- customValid = rule.validator({
- cellValue: cellValue,
- rule: rule,
- rules: rules,
- row: row,
- rowIndex: _this3.getRowIndex(row),
- column: column,
- columnIndex: _this3.getColumnIndex(column),
- $table: _this3
- });
- }
- if (customValid) {
- if (ctor_amd_xe_utils_default.a.isError(customValid)) {
- _this3.validRuleErr = true;
- errorRules.push(new mixin_Rule({
- type: 'custom',
- trigger: rule.trigger,
- message: customValid.message,
- rule: new mixin_Rule(rule)
- }));
- } else if (customValid.catch) {
- // 如果为异步校验(注:异步校验是并发无序的)
- syncVailds.push(customValid.catch(function (e) {
- _this3.validRuleErr = true;
- errorRules.push(new mixin_Rule({
- type: 'custom',
- trigger: rule.trigger,
- message: e && e.message ? e.message : rule.content || rule.message,
- rule: new mixin_Rule(rule)
- }));
- }));
- }
- }
- } else {
- var isNumType = rule.type === 'number';
- var isArrType = rule.type === 'array';
- var numVal = isNumType ? ctor_amd_xe_utils_default.a.toNumber(cellValue) : ctor_amd_xe_utils_default.a.getSize(cellValue);
- if (rule.required && (isArrType ? !ctor_amd_xe_utils_default.a.isArray(cellValue) || !cellValue.length : cellValue === null || cellValue === undefined || cellValue === '')) {
- _this3.validRuleErr = true;
- errorRules.push(new mixin_Rule(rule));
- } else if (isNumType && isNaN(cellValue) || !isNaN(rule.min) && numVal < parseFloat(rule.min) || !isNaN(rule.max) && numVal > parseFloat(rule.max) || rule.pattern && !(rule.pattern.test ? rule.pattern : new RegExp(rule.pattern)).test(cellValue)) {
- _this3.validRuleErr = true;
- errorRules.push(new mixin_Rule(rule));
- }
- }
- }
- });
- }
- }
- return Promise.all(syncVailds).then(function () {
- if (errorRules.length) {
- var rest = {
- rules: errorRules,
- rule: errorRules[0]
- };
- return Promise.reject(rest);
- }
- });
- },
- _clearValidate: function _clearValidate() {
- var validTip = this.$refs.validTip;
- Object.assign(this.validStore, {
- visible: false,
- row: null,
- column: null,
- content: '',
- rule: null
- });
- if (validTip && validTip.visible) {
- validTip.close();
- }
- return this.$nextTick();
- },
- /**
- * 触发校验
- */
- triggerValidate: function triggerValidate(type) {
- var _this4 = this;
- var editConfig = this.editConfig,
- editStore = this.editStore,
- editRules = this.editRules,
- validStore = this.validStore;
- var actived = editStore.actived;
- if (actived.row && editRules) {
- var _actived$args = actived.args,
- row = _actived$args.row,
- column = _actived$args.column,
- cell = _actived$args.cell;
- if (this.hasCellRules(type, row, column)) {
- return this.validCellRules(type, row, column).then(function () {
- if (editConfig.mode === 'row') {
- if (validStore.visible && validStore.row === row && validStore.column === column) {
- _this4.clearValidate();
- }
- }
- }).catch(function (_ref2) {
- var rule = _ref2.rule;
- // 如果校验不通过与触发方式一致,则聚焦提示错误,否则跳过并不作任何处理
- if (!rule.trigger || type === rule.trigger) {
- var rest = {
- rule: rule,
- row: row,
- column: column,
- cell: cell
- };
- _this4.showValidTooltip(rest);
- return Promise.reject(rest);
- }
- return Promise.resolve();
- });
- }
- }
- return Promise.resolve();
- },
- /**
- * 弹出校验错误提示
- */
- showValidTooltip: function showValidTooltip(params) {
- var _this5 = this;
- var $refs = this.$refs,
- height = this.height,
- tableData = this.tableData,
- validOpts = this.validOpts;
- var rule = params.rule,
- row = params.row,
- column = params.column,
- cell = params.cell;
- var validTip = $refs.validTip;
- var content = rule.message;
- this.$nextTick(function () {
- Object.assign(_this5.validStore, {
- row: row,
- column: column,
- rule: rule,
- content: content,
- visible: true
- });
- if (validTip && (validOpts.message === 'tooltip' || validOpts.message === 'default' && !height && tableData.length < 2)) {
- validTip.open(cell, content);
- }
- _this5.emitEvent('valid-error', params);
- });
- }
- }
- });
- // CONCATENATED MODULE: ./packages/validator/index.js
- var Validator = {
- install: function install() {
- v_x_e_table.reg('valid');
- packages_table.mixins.push(validator_src_mixin);
- }
- };
- /* harmony default export */ var validator = (Validator);
- // CONCATENATED MODULE: ./packages/resize/index.js
- var Resize = {
- /* eslint-disable @typescript-eslint/no-empty-function */
- install: function install() {}
- };
- /* harmony default export */ var packages_resize = (Resize);
- // CONCATENATED MODULE: ./packages/locale/lang/zh-CN.js
- /* harmony default export */ var zh_CN = ({
- vxe: {
- error: {
- groupFixed: '如果使用分组表头,固定列必须按组设置',
- groupMouseRange: '分组表头与 "{0}" 不能同时使用,这可能会出现错误',
- groupTag: '分组列头应该使用 "{0}" 而不是 "{1}",这可能会出现错误',
- scrollErrProp: '启用虚拟滚动后不支持该参数 "{0}"',
- scrollXNotGroup: '横向虚拟滚动不支持分组表头,需要设置 "scroll-x.enabled=false" 参数,否则可能会导致出现错误',
- errConflicts: '参数 "{0}" 与 "{1}" 有冲突',
- unableInsert: '无法插入到指定位置,请检查参数是否正确',
- useErr: '安装 "{0}" 模块时发生错误,可能顺序不正确,依赖的模块需要在 Table 之前安装',
- barUnableLink: '工具栏无法关联表格',
- expandContent: '展开行的插槽应该是 "content",请检查是否正确',
- reqModule: '缺少 "{0}" 模块',
- reqProp: '缺少必要的 "{0}" 参数,这可能会导致出现错误',
- emptyProp: '参数 "{0}" 不允许为空',
- errProp: '不支持的参数 "{0}",可能为 "{1}"',
- colRepet: 'column.{0}="{1}" 重复了,这可能会导致某些功能无法使用',
- notFunc: '方法 "{0}" 不存在',
- notSlot: '插槽 "{0}" 不存在',
- noTree: '树结构不支持 "{0}"',
- notProp: '不支持的参数 "{0}"',
- coverProp: '"{0}" 的参数 "{1}" 被覆盖,这可能会出现错误',
- delFunc: '方法 "{0}" 已废弃,请使用 "{1}"',
- delProp: '参数 "{0}" 已废弃,请使用 "{1}"',
- delEvent: '事件 "{0}" 已废弃,请使用 "{1}"',
- removeProp: '参数 "{0}" 已废弃,不建议使用,这可能会导致出现错误',
- errFormat: '全局的格式化内容应该使用 "VXETable.formats" 定义,挂载 "formatter={0}" 的方式已不建议使用',
- notType: '不支持的文件类型 "{0}"',
- notExp: '该浏览器不支持导入/导出功能',
- impFields: '导入失败,请检查字段名和数据格式是否正确',
- treeNotImp: '树表格不支持导入'
- },
- renderer: {
- search: '搜索',
- cases: {
- equal: '等于',
- unequal: '不等于',
- gt: '大于',
- ge: '大于或等于',
- lt: '小于',
- le: '小于或等于',
- begin: '开头是',
- notbegin: '开头不是',
- endin: '结尾是',
- notendin: '结尾不是',
- include: '包含',
- exclude: '不包含',
- between: '介于',
- custom: '自定义筛选',
- insensitive: '不区分大小写',
- isSensitive: '区分大小写'
- },
- combination: {
- menus: {
- sortAsc: '升序',
- sortDesc: '降序',
- fixedColumn: '锁定列',
- fixedGroup: '锁定组',
- cancelFixed: '取消锁定',
- fixedLeft: '锁定左侧',
- fixedRight: '锁定右侧',
- clearFilter: '清除筛选',
- textOption: '文本筛选',
- numberOption: '数值筛选'
- },
- popup: {
- title: '自定义筛选的方式',
- currColumnTitle: '当前列:',
- and: '与',
- or: '或',
- describeHtml: '可用 ? 代表单个字符<br/>用 * 代表任意多个字符'
- },
- empty: '(空白)',
- notData: '无匹配项'
- }
- },
- pro: {
- area: {
- mergeErr: '无法对合并单元格进行该操作',
- multiErr: '无法对多重选择区域进行该操作',
- extendErr: '如果延伸的区域包含被合并的单元格,所有合并的单元格需大小相同'
- },
- fnr: {
- title: '查找和替换',
- findLabel: '查找',
- replaceLabel: '替换',
- findTitle: '查找内容:',
- replaceTitle: '替换为:',
- tabs: {
- find: '查找',
- replace: '替换'
- },
- filter: {
- re: '正则表达式',
- whole: '全词匹配',
- sensitive: '区分大小写'
- },
- btns: {
- findNext: '查找下一个',
- findAll: '查找全部',
- replace: '替换',
- replaceAll: '替换全部',
- cancel: '取消'
- },
- header: {
- seq: '#',
- cell: '单元格',
- value: '值'
- },
- empty: '(空值)',
- reError: '无效的正则表达式',
- recordCount: '已找到 {0} 个单元格',
- notCell: '找不到匹配的单元格',
- replaceSuccess: '成功替换 {0} 个单元格'
- }
- },
- table: {
- emptyText: '暂无数据',
- allTitle: '全选/取消',
- seqTitle: '#',
- confirmFilter: '筛选',
- resetFilter: '重置',
- allFilter: '全部',
- sortAsc: '升序:最低到最高',
- sortDesc: '降序:最高到最低',
- filter: '对所选的列启用筛选',
- impSuccess: '成功导入 {0} 条记录',
- expLoading: '正在导出中',
- expSuccess: '导出成功',
- expFilename: '导出_{0}',
- expOriginFilename: '导出_源_{0}',
- customTitle: '列设置',
- customAll: '全部',
- customConfirm: '确认',
- customRestore: '还原'
- },
- grid: {
- selectOneRecord: '请至少选择一条记录!',
- deleteSelectRecord: '您确定要删除所选记录吗?',
- removeSelectRecord: '您确定要移除所选记录吗?',
- dataUnchanged: '数据未改动!',
- delSuccess: '成功删除所选记录!',
- saveSuccess: '保存成功!',
- operError: '发生错误,操作失败!'
- },
- select: {
- emptyText: '暂无数据'
- },
- pager: {
- goto: '前往',
- pagesize: '{0}条/页',
- total: '共 {0} 条记录',
- pageClassifier: '页',
- prevPage: '上一页',
- nextPage: '下一页',
- prevJump: '向上跳页',
- nextJump: '向下跳页'
- },
- alert: {
- title: '消息提示'
- },
- button: {
- confirm: '确认',
- cancel: '取消'
- },
- import: {
- modes: {
- covering: '覆盖',
- insert: '新增'
- },
- impTitle: '导入数据',
- impFile: '文件名',
- impSelect: '选择文件',
- impType: '文件类型',
- impOpts: '参数设置',
- impConfirm: '导入',
- impCancel: '取消'
- },
- export: {
- types: {
- csv: 'CSV (逗号分隔)(*.csv)',
- html: '网页(*.html)',
- xml: 'XML 数据(*.xml)',
- txt: '文本文件(制表符分隔)(*.txt)',
- xls: 'Excel 97-2003 工作簿(*.xls)',
- xlsx: 'Excel 工作簿(*.xlsx)',
- pdf: 'PDF (*.pdf)'
- },
- modes: {
- current: '当前数据(当前页的数据)',
- selected: '选中数据(当前页选中的数据)',
- all: '全量数据(包括所有分页的数据)'
- },
- printTitle: '打印数据',
- expTitle: '导出数据',
- expName: '文件名',
- expNamePlaceholder: '请输入文件名',
- expSheetName: '标题',
- expSheetNamePlaceholder: '请输入标题',
- expType: '保存类型',
- expMode: '选择数据',
- expCurrentColumn: '全部字段',
- expColumn: '选择字段',
- expOpts: '参数设置',
- expOptHeader: '表头',
- expHeaderTitle: '是否需要表头',
- expOptFooter: '表尾',
- expFooterTitle: '是否需要表尾',
- expOptColgroup: '分组表头',
- expColgroupTitle: '如果存在,则支持带有分组结构的表头',
- expOptMerge: '合并',
- expMergeTitle: '如果存在,则支持带有合并结构的单元格',
- expOptAllExpand: '展开层级',
- expAllExpandTitle: '如果存在,则支持将带有层级结构的数据全部展开',
- expOptUseStyle: '样式',
- expUseStyleTitle: '如果存在,则支持带样式的单元格',
- expOptOriginal: '源数据',
- expOriginalTitle: '如果为源数据,则支持导入到表格中',
- expPrint: '打印',
- expConfirm: '导出',
- expCancel: '取消'
- },
- modal: {
- zoomIn: '最大化',
- zoomOut: '还原',
- close: '关闭'
- },
- form: {
- folding: '收起',
- unfolding: '展开'
- },
- toolbar: {
- import: '导入',
- export: '导出',
- print: '打印',
- refresh: '刷新',
- zoomIn: '全屏',
- zoomOut: '还原',
- custom: '列设置',
- customAll: '全部',
- customConfirm: '确认',
- customRestore: '还原'
- },
- input: {
- date: {
- m1: '01 月',
- m2: '02 月',
- m3: '03 月',
- m4: '04 月',
- m5: '05 月',
- m6: '06 月',
- m7: '07 月',
- m8: '08 月',
- m9: '09 月',
- m10: '10 月',
- m11: '11 月',
- m12: '12 月',
- quarterLabel: '{0} 年',
- monthLabel: '{0} 年',
- dayLabel: '{0} 年 {1}',
- labelFormat: {
- date: 'yyyy-MM-dd',
- time: 'HH:mm:ss',
- datetime: 'yyyy-MM-dd HH:mm:ss',
- week: 'yyyy 年第 WW 周',
- month: 'yyyy-MM',
- quarter: 'yyyy 年第 q 季度',
- year: 'yyyy'
- },
- weeks: {
- w: '周',
- w0: '周日',
- w1: '周一',
- w2: '周二',
- w3: '周三',
- w4: '周四',
- w5: '周五',
- w6: '周六'
- },
- months: {
- m0: '一月',
- m1: '二月',
- m2: '三月',
- m3: '四月',
- m4: '五月',
- m5: '六月',
- m6: '七月',
- m7: '八月',
- m8: '九月',
- m9: '十月',
- m10: '十一月',
- m11: '十二月'
- },
- quarters: {
- q1: '第一季度',
- q2: '第二季度',
- q3: '第三季度',
- q4: '第四季度'
- }
- }
- }
- }
- });
- // CONCATENATED MODULE: ./packages/vxe-table.js
- // 按需加载的组件
- var components = [// 模块
- packages_column, packages_header, packages_footer, filter, packages_loading, packages_grid, packages_menu, packages_toolbar, packages_pager, packages_checkbox, packages_radio, packages_input, packages_textarea, packages_button, packages_modal, packages_tooltip, packages_form, packages_select, packages_switch, packages_list, packages_pulldown, edit, packages_export, packages_keyboard, validator, packages_resize, // 核心
- packages_table]; // 默认安装
- function vxe_table_install(Vue, options) {
- if (ctor_amd_xe_utils_default.a.isPlainObject(options)) {
- v_x_e_table.setup(options);
- }
- components.map(function (component) {
- return component.install(Vue);
- });
- } // 默认中文
- v_x_e_table.setup({
- i18n: ctor_amd_xe_utils_default.a.toFormatString ? function (key, args) {
- return ctor_amd_xe_utils_default.a.toFormatString(ctor_amd_xe_utils_default.a.get(zh_CN, key), args);
- } : function (key, args) {
- return ctor_amd_xe_utils_default.a.template(ctor_amd_xe_utils_default.a.get(zh_CN, key), args, {
- tmplRE: /\{([.\w[\]\s]+)\}/g
- });
- }
- });
- v_x_e_table.install = vxe_table_install;
- if (typeof window !== 'undefined' && window.Vue && window.Vue.use) {
- window.Vue.use(v_x_e_table);
- }
- /* harmony default export */ var vxe_table = (v_x_e_table);
- // CONCATENATED MODULE: ./index.js
- // 默认主题
- // 默认安装全部模块
- /* harmony default export */ var index_0 = (vxe_table);
- // CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js
- /* harmony default export */ var entry_lib = __webpack_exports__["default"] = (index_0);
- /***/ }),
- /***/ "fb6a":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var $ = __webpack_require__("23e7");
- var isObject = __webpack_require__("861d");
- var isArray = __webpack_require__("e8b5");
- var toAbsoluteIndex = __webpack_require__("23cb");
- var toLength = __webpack_require__("50c4");
- var toIndexedObject = __webpack_require__("fc6a");
- var createProperty = __webpack_require__("8418");
- var wellKnownSymbol = __webpack_require__("b622");
- var arrayMethodHasSpeciesSupport = __webpack_require__("1dde");
- var arrayMethodUsesToLength = __webpack_require__("ae40");
- var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('slice');
- var USES_TO_LENGTH = arrayMethodUsesToLength('slice', { ACCESSORS: true, 0: 0, 1: 2 });
- var SPECIES = wellKnownSymbol('species');
- var nativeSlice = [].slice;
- var max = Math.max;
- // `Array.prototype.slice` method
- // https://tc39.github.io/ecma262/#sec-array.prototype.slice
- // fallback for not array-like ES3 strings and DOM objects
- $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {
- slice: function slice(start, end) {
- var O = toIndexedObject(this);
- var length = toLength(O.length);
- var k = toAbsoluteIndex(start, length);
- var fin = toAbsoluteIndex(end === undefined ? length : end, length);
- // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible
- var Constructor, result, n;
- if (isArray(O)) {
- Constructor = O.constructor;
- // cross-realm fallback
- if (typeof Constructor == 'function' && (Constructor === Array || isArray(Constructor.prototype))) {
- Constructor = undefined;
- } else if (isObject(Constructor)) {
- Constructor = Constructor[SPECIES];
- if (Constructor === null) Constructor = undefined;
- }
- if (Constructor === Array || Constructor === undefined) {
- return nativeSlice.call(O, k, fin);
- }
- }
- result = new (Constructor === undefined ? Array : Constructor)(max(fin - k, 0));
- for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);
- result.length = n;
- return result;
- }
- });
- /***/ }),
- /***/ "fc6a":
- /***/ (function(module, exports, __webpack_require__) {
- // toObject with fallback for non-array-like ES3 strings
- var IndexedObject = __webpack_require__("44ad");
- var requireObjectCoercible = __webpack_require__("1d80");
- module.exports = function (it) {
- return IndexedObject(requireObjectCoercible(it));
- };
- /***/ }),
- /***/ "fdbc":
- /***/ (function(module, exports) {
- // iterable DOM collections
- // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
- module.exports = {
- CSSRuleList: 0,
- CSSStyleDeclaration: 0,
- CSSValueList: 0,
- ClientRectList: 0,
- DOMRectList: 0,
- DOMStringList: 0,
- DOMTokenList: 1,
- DataTransferItemList: 0,
- FileList: 0,
- HTMLAllCollection: 0,
- HTMLCollection: 0,
- HTMLFormElement: 0,
- HTMLSelectElement: 0,
- MediaList: 0,
- MimeTypeArray: 0,
- NamedNodeMap: 0,
- NodeList: 1,
- PaintRequestList: 0,
- Plugin: 0,
- PluginArray: 0,
- SVGLengthList: 0,
- SVGNumberList: 0,
- SVGPathSegList: 0,
- SVGPointList: 0,
- SVGStringList: 0,
- SVGTransformList: 0,
- SourceBufferList: 0,
- StyleSheetList: 0,
- TextTrackCueList: 0,
- TextTrackList: 0,
- TouchList: 0
- };
- /***/ }),
- /***/ "fdbf":
- /***/ (function(module, exports, __webpack_require__) {
- var NATIVE_SYMBOL = __webpack_require__("4930");
- module.exports = NATIVE_SYMBOL
- // eslint-disable-next-line no-undef
- && !Symbol.sham
- // eslint-disable-next-line no-undef
- && typeof Symbol.iterator == 'symbol';
- /***/ })
- /******/ })["default"];
- //# sourceMappingURL=index.common.js.map
|