123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691 |
- (function webpackUniversalModuleDefinition(root, factory) {
- if(typeof exports === 'object' && typeof module === 'object')
- module.exports = factory(require("xe-utils/ctor"));
- else if(typeof define === 'function' && define.amd)
- define(["xe-utils"], factory);
- else if(typeof exports === 'object')
- exports["VXETable"] = factory(require("xe-utils/ctor"));
- else
- root["VXETable"] = factory(root["XEUtils"]);
- })((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__7fd6__) {
- return /******/ (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 = __WEBPACK_EXTERNAL_MODULE__7fd6__;
- /***/ }),
- /***/ "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.umd.js.map
|