12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042280432804428045280462804728048280492805028051280522805328054280552805628057280582805928060280612806228063280642806528066280672806828069280702807128072280732807428075280762807728078280792808028081280822808328084280852808628087280882808928090280912809228093280942809528096280972809828099281002810128102281032810428105281062810728108281092811028111281122811328114281152811628117281182811928120281212812228123281242812528126281272812828129281302813128132281332813428135281362813728138281392814028141281422814328144281452814628147281482814928150281512815228153281542815528156281572815828159281602816128162281632816428165281662816728168281692817028171281722817328174281752817628177281782817928180281812818228183281842818528186281872818828189281902819128192281932819428195281962819728198281992820028201282022820328204282052820628207282082820928210282112821228213282142821528216282172821828219282202822128222282232822428225282262822728228282292823028231282322823328234282352823628237282382823928240282412824228243282442824528246282472824828249282502825128252282532825428255282562825728258282592826028261282622826328264282652826628267282682826928270282712827228273282742827528276282772827828279282802828128282282832828428285282862828728288282892829028291282922829328294282952829628297282982829928300283012830228303283042830528306283072830828309283102831128312283132831428315283162831728318283192832028321283222832328324283252832628327283282832928330283312833228333283342833528336283372833828339283402834128342283432834428345283462834728348283492835028351283522835328354283552835628357283582835928360283612836228363283642836528366283672836828369283702837128372283732837428375283762837728378283792838028381283822838328384283852838628387283882838928390283912839228393283942839528396283972839828399284002840128402284032840428405284062840728408284092841028411284122841328414284152841628417284182841928420284212842228423284242842528426284272842828429284302843128432284332843428435284362843728438284392844028441284422844328444284452844628447284482844928450284512845228453284542845528456284572845828459284602846128462284632846428465284662846728468284692847028471284722847328474284752847628477284782847928480284812848228483284842848528486284872848828489284902849128492284932849428495284962849728498284992850028501285022850328504285052850628507285082850928510285112851228513285142851528516285172851828519285202852128522285232852428525285262852728528285292853028531285322853328534285352853628537285382853928540285412854228543285442854528546285472854828549285502855128552285532855428555285562855728558285592856028561285622856328564285652856628567285682856928570285712857228573285742857528576285772857828579285802858128582285832858428585285862858728588285892859028591285922859328594285952859628597285982859928600286012860228603286042860528606286072860828609286102861128612286132861428615286162861728618286192862028621286222862328624286252862628627286282862928630286312863228633286342863528636286372863828639286402864128642286432864428645286462864728648286492865028651286522865328654286552865628657286582865928660286612866228663286642866528666286672866828669286702867128672286732867428675286762867728678286792868028681286822868328684286852868628687286882868928690286912869228693286942869528696286972869828699287002870128702287032870428705287062870728708287092871028711287122871328714287152871628717287182871928720287212872228723287242872528726287272872828729287302873128732287332873428735287362873728738287392874028741287422874328744287452874628747287482874928750287512875228753287542875528756287572875828759287602876128762287632876428765287662876728768287692877028771287722877328774287752877628777287782877928780287812878228783287842878528786287872878828789287902879128792287932879428795287962879728798287992880028801288022880328804288052880628807288082880928810288112881228813288142881528816288172881828819288202882128822288232882428825288262882728828288292883028831288322883328834288352883628837288382883928840288412884228843288442884528846288472884828849288502885128852288532885428855288562885728858288592886028861288622886328864288652886628867288682886928870288712887228873288742887528876288772887828879288802888128882288832888428885288862888728888288892889028891288922889328894288952889628897288982889928900289012890228903289042890528906289072890828909289102891128912289132891428915289162891728918289192892028921289222892328924289252892628927289282892928930289312893228933289342893528936289372893828939289402894128942289432894428945289462894728948289492895028951289522895328954289552895628957289582895928960289612896228963289642896528966289672896828969289702897128972289732897428975289762897728978289792898028981289822898328984289852898628987289882898928990289912899228993289942899528996289972899828999290002900129002290032900429005290062900729008290092901029011290122901329014290152901629017290182901929020290212902229023290242902529026290272902829029290302903129032290332903429035290362903729038290392904029041290422904329044290452904629047290482904929050290512905229053290542905529056290572905829059290602906129062290632906429065290662906729068290692907029071290722907329074290752907629077290782907929080290812908229083290842908529086290872908829089290902909129092290932909429095290962909729098290992910029101291022910329104291052910629107291082910929110291112911229113291142911529116291172911829119291202912129122291232912429125291262912729128291292913029131291322913329134291352913629137291382913929140291412914229143291442914529146291472914829149291502915129152291532915429155291562915729158291592916029161291622916329164291652916629167291682916929170291712917229173291742917529176291772917829179291802918129182291832918429185291862918729188291892919029191291922919329194291952919629197291982919929200292012920229203292042920529206292072920829209292102921129212292132921429215292162921729218292192922029221292222922329224292252922629227292282922929230292312923229233292342923529236292372923829239292402924129242292432924429245292462924729248292492925029251292522925329254292552925629257292582925929260292612926229263292642926529266292672926829269292702927129272292732927429275292762927729278292792928029281292822928329284292852928629287292882928929290292912929229293292942929529296292972929829299293002930129302293032930429305293062930729308293092931029311293122931329314293152931629317293182931929320293212932229323293242932529326293272932829329293302933129332293332933429335293362933729338293392934029341293422934329344293452934629347293482934929350293512935229353293542935529356293572935829359293602936129362293632936429365293662936729368293692937029371293722937329374293752937629377293782937929380293812938229383293842938529386293872938829389293902939129392293932939429395293962939729398293992940029401294022940329404294052940629407294082940929410294112941229413294142941529416294172941829419294202942129422294232942429425294262942729428294292943029431294322943329434294352943629437294382943929440294412944229443294442944529446294472944829449294502945129452294532945429455294562945729458294592946029461294622946329464294652946629467294682946929470294712947229473294742947529476294772947829479294802948129482294832948429485294862948729488294892949029491294922949329494294952949629497294982949929500295012950229503295042950529506295072950829509295102951129512295132951429515295162951729518295192952029521295222952329524295252952629527295282952929530295312953229533295342953529536295372953829539295402954129542295432954429545295462954729548295492955029551295522955329554295552955629557295582955929560295612956229563295642956529566295672956829569295702957129572295732957429575295762957729578295792958029581295822958329584295852958629587295882958929590295912959229593295942959529596295972959829599296002960129602296032960429605296062960729608296092961029611296122961329614296152961629617296182961929620296212962229623296242962529626296272962829629296302963129632296332963429635296362963729638296392964029641296422964329644296452964629647296482964929650296512965229653296542965529656296572965829659296602966129662296632966429665296662966729668296692967029671296722967329674296752967629677296782967929680296812968229683296842968529686296872968829689296902969129692296932969429695296962969729698296992970029701297022970329704297052970629707297082970929710297112971229713297142971529716297172971829719297202972129722297232972429725297262972729728297292973029731297322973329734297352973629737297382973929740297412974229743297442974529746297472974829749297502975129752297532975429755297562975729758297592976029761297622976329764297652976629767297682976929770297712977229773297742977529776297772977829779297802978129782297832978429785297862978729788297892979029791297922979329794297952979629797297982979929800298012980229803298042980529806298072980829809298102981129812298132981429815298162981729818298192982029821298222982329824298252982629827298282982929830298312983229833298342983529836298372983829839298402984129842298432984429845298462984729848298492985029851298522985329854298552985629857298582985929860298612986229863298642986529866298672986829869298702987129872298732987429875298762987729878298792988029881298822988329884298852988629887298882988929890298912989229893298942989529896298972989829899299002990129902299032990429905299062990729908299092991029911299122991329914299152991629917299182991929920299212992229923299242992529926299272992829929299302993129932299332993429935299362993729938299392994029941299422994329944299452994629947299482994929950299512995229953299542995529956299572995829959299602996129962299632996429965299662996729968299692997029971299722997329974299752997629977299782997929980299812998229983299842998529986299872998829989299902999129992299932999429995299962999729998299993000030001300023000330004300053000630007300083000930010300113001230013300143001530016300173001830019300203002130022300233002430025300263002730028300293003030031300323003330034300353003630037300383003930040300413004230043300443004530046300473004830049300503005130052300533005430055300563005730058300593006030061300623006330064300653006630067300683006930070300713007230073300743007530076300773007830079300803008130082300833008430085300863008730088300893009030091300923009330094300953009630097300983009930100301013010230103301043010530106301073010830109301103011130112301133011430115301163011730118301193012030121301223012330124301253012630127301283012930130301313013230133301343013530136301373013830139301403014130142301433014430145301463014730148301493015030151301523015330154301553015630157301583015930160301613016230163301643016530166301673016830169301703017130172301733017430175301763017730178301793018030181301823018330184301853018630187301883018930190301913019230193301943019530196301973019830199302003020130202302033020430205302063020730208302093021030211302123021330214302153021630217302183021930220302213022230223302243022530226302273022830229302303023130232302333023430235302363023730238302393024030241302423024330244302453024630247302483024930250302513025230253302543025530256302573025830259302603026130262302633026430265302663026730268302693027030271302723027330274302753027630277302783027930280302813028230283302843028530286302873028830289302903029130292302933029430295302963029730298302993030030301303023030330304303053030630307303083030930310303113031230313303143031530316303173031830319303203032130322303233032430325303263032730328303293033030331303323033330334303353033630337303383033930340303413034230343303443034530346303473034830349303503035130352303533035430355303563035730358303593036030361303623036330364303653036630367303683036930370303713037230373303743037530376303773037830379303803038130382303833038430385303863038730388303893039030391303923039330394303953039630397303983039930400304013040230403304043040530406304073040830409304103041130412304133041430415304163041730418304193042030421304223042330424304253042630427304283042930430304313043230433304343043530436304373043830439304403044130442304433044430445304463044730448304493045030451304523045330454304553045630457304583045930460304613046230463304643046530466304673046830469304703047130472304733047430475304763047730478304793048030481304823048330484304853048630487304883048930490304913049230493304943049530496304973049830499305003050130502305033050430505305063050730508305093051030511305123051330514305153051630517305183051930520305213052230523305243052530526305273052830529305303053130532305333053430535305363053730538305393054030541305423054330544305453054630547305483054930550305513055230553305543055530556305573055830559305603056130562305633056430565305663056730568305693057030571305723057330574305753057630577305783057930580305813058230583305843058530586305873058830589305903059130592305933059430595305963059730598305993060030601306023060330604306053060630607306083060930610306113061230613306143061530616306173061830619306203062130622306233062430625306263062730628306293063030631306323063330634306353063630637306383063930640306413064230643306443064530646306473064830649306503065130652306533065430655306563065730658306593066030661306623066330664306653066630667306683066930670306713067230673306743067530676306773067830679306803068130682306833068430685306863068730688306893069030691306923069330694306953069630697306983069930700307013070230703307043070530706307073070830709307103071130712307133071430715307163071730718307193072030721307223072330724307253072630727307283072930730307313073230733307343073530736307373073830739307403074130742307433074430745307463074730748307493075030751307523075330754307553075630757307583075930760307613076230763307643076530766307673076830769307703077130772307733077430775307763077730778307793078030781307823078330784307853078630787307883078930790307913079230793307943079530796307973079830799308003080130802308033080430805308063080730808308093081030811308123081330814308153081630817308183081930820308213082230823308243082530826308273082830829308303083130832308333083430835308363083730838308393084030841308423084330844308453084630847308483084930850308513085230853308543085530856308573085830859308603086130862308633086430865308663086730868308693087030871308723087330874308753087630877308783087930880308813088230883308843088530886308873088830889308903089130892308933089430895308963089730898308993090030901309023090330904309053090630907309083090930910309113091230913309143091530916309173091830919309203092130922309233092430925309263092730928309293093030931309323093330934309353093630937309383093930940309413094230943309443094530946309473094830949309503095130952309533095430955309563095730958309593096030961309623096330964309653096630967309683096930970309713097230973309743097530976309773097830979309803098130982309833098430985309863098730988309893099030991309923099330994309953099630997309983099931000310013100231003310043100531006310073100831009310103101131012310133101431015310163101731018310193102031021310223102331024310253102631027310283102931030310313103231033310343103531036310373103831039310403104131042310433104431045310463104731048310493105031051310523105331054310553105631057310583105931060310613106231063310643106531066310673106831069310703107131072310733107431075310763107731078310793108031081310823108331084310853108631087310883108931090310913109231093310943109531096310973109831099311003110131102311033110431105311063110731108311093111031111311123111331114311153111631117311183111931120311213112231123311243112531126311273112831129311303113131132311333113431135311363113731138311393114031141311423114331144311453114631147311483114931150311513115231153311543115531156311573115831159311603116131162311633116431165311663116731168311693117031171311723117331174311753117631177311783117931180311813118231183311843118531186311873118831189311903119131192311933119431195311963119731198311993120031201312023120331204312053120631207312083120931210312113121231213312143121531216312173121831219312203122131222312233122431225312263122731228312293123031231312323123331234312353123631237312383123931240312413124231243312443124531246312473124831249312503125131252312533125431255312563125731258312593126031261312623126331264312653126631267312683126931270312713127231273312743127531276312773127831279312803128131282312833128431285312863128731288312893129031291312923129331294312953129631297312983129931300313013130231303313043130531306313073130831309313103131131312313133131431315313163131731318313193132031321313223132331324313253132631327313283132931330313313133231333313343133531336313373133831339313403134131342313433134431345313463134731348313493135031351313523135331354313553135631357313583135931360313613136231363313643136531366313673136831369313703137131372313733137431375313763137731378313793138031381313823138331384313853138631387313883138931390313913139231393313943139531396313973139831399314003140131402314033140431405314063140731408314093141031411314123141331414314153141631417314183141931420314213142231423314243142531426314273142831429314303143131432314333143431435314363143731438314393144031441314423144331444314453144631447314483144931450314513145231453314543145531456314573145831459314603146131462314633146431465314663146731468314693147031471314723147331474314753147631477314783147931480314813148231483314843148531486314873148831489314903149131492314933149431495314963149731498314993150031501315023150331504315053150631507315083150931510315113151231513315143151531516315173151831519315203152131522315233152431525315263152731528315293153031531315323153331534315353153631537315383153931540315413154231543315443154531546315473154831549315503155131552315533155431555315563155731558315593156031561315623156331564315653156631567315683156931570315713157231573315743157531576315773157831579315803158131582315833158431585315863158731588315893159031591315923159331594315953159631597315983159931600316013160231603316043160531606316073160831609316103161131612316133161431615316163161731618316193162031621316223162331624316253162631627316283162931630316313163231633316343163531636316373163831639316403164131642316433164431645316463164731648316493165031651316523165331654316553165631657316583165931660316613166231663316643166531666316673166831669316703167131672316733167431675316763167731678316793168031681316823168331684316853168631687316883168931690316913169231693316943169531696316973169831699317003170131702317033170431705317063170731708317093171031711317123171331714317153171631717317183171931720317213172231723317243172531726317273172831729317303173131732317333173431735317363173731738317393174031741317423174331744317453174631747317483174931750317513175231753317543175531756317573175831759317603176131762317633176431765317663176731768317693177031771317723177331774317753177631777317783177931780317813178231783317843178531786317873178831789317903179131792317933179431795317963179731798317993180031801318023180331804318053180631807318083180931810318113181231813318143181531816318173181831819318203182131822318233182431825318263182731828318293183031831318323183331834318353183631837318383183931840318413184231843318443184531846318473184831849318503185131852318533185431855318563185731858318593186031861318623186331864318653186631867318683186931870318713187231873318743187531876318773187831879318803188131882318833188431885318863188731888318893189031891318923189331894318953189631897318983189931900319013190231903319043190531906319073190831909319103191131912319133191431915319163191731918319193192031921319223192331924319253192631927319283192931930319313193231933319343193531936319373193831939319403194131942319433194431945319463194731948319493195031951319523195331954319553195631957319583195931960319613196231963319643196531966319673196831969319703197131972319733197431975319763197731978319793198031981319823198331984319853198631987319883198931990319913199231993319943199531996319973199831999320003200132002320033200432005320063200732008320093201032011320123201332014320153201632017320183201932020320213202232023320243202532026320273202832029320303203132032320333203432035320363203732038320393204032041320423204332044320453204632047320483204932050320513205232053320543205532056320573205832059320603206132062320633206432065320663206732068320693207032071320723207332074320753207632077320783207932080320813208232083320843208532086320873208832089320903209132092320933209432095320963209732098320993210032101321023210332104321053210632107321083210932110321113211232113321143211532116321173211832119321203212132122321233212432125321263212732128321293213032131321323213332134321353213632137321383213932140321413214232143321443214532146321473214832149321503215132152321533215432155321563215732158321593216032161321623216332164321653216632167321683216932170321713217232173321743217532176321773217832179321803218132182321833218432185321863218732188321893219032191321923219332194321953219632197321983219932200322013220232203322043220532206322073220832209322103221132212322133221432215322163221732218322193222032221322223222332224322253222632227322283222932230322313223232233322343223532236322373223832239322403224132242322433224432245322463224732248322493225032251322523225332254322553225632257322583225932260322613226232263322643226532266322673226832269322703227132272322733227432275322763227732278322793228032281322823228332284322853228632287322883228932290322913229232293322943229532296322973229832299323003230132302323033230432305323063230732308323093231032311323123231332314323153231632317323183231932320323213232232323323243232532326323273232832329323303233132332323333233432335323363233732338323393234032341323423234332344323453234632347323483234932350323513235232353323543235532356323573235832359323603236132362323633236432365323663236732368323693237032371323723237332374323753237632377323783237932380323813238232383323843238532386323873238832389323903239132392323933239432395323963239732398323993240032401324023240332404324053240632407324083240932410324113241232413324143241532416324173241832419324203242132422324233242432425324263242732428324293243032431324323243332434324353243632437324383243932440324413244232443324443244532446324473244832449324503245132452324533245432455324563245732458324593246032461324623246332464324653246632467324683246932470324713247232473324743247532476324773247832479324803248132482324833248432485324863248732488324893249032491324923249332494324953249632497324983249932500325013250232503325043250532506325073250832509325103251132512325133251432515325163251732518325193252032521325223252332524325253252632527325283252932530325313253232533325343253532536325373253832539325403254132542325433254432545325463254732548325493255032551325523255332554325553255632557325583255932560325613256232563325643256532566325673256832569325703257132572325733257432575325763257732578325793258032581325823258332584325853258632587325883258932590325913259232593325943259532596325973259832599326003260132602326033260432605326063260732608326093261032611326123261332614326153261632617326183261932620326213262232623326243262532626326273262832629326303263132632326333263432635326363263732638326393264032641326423264332644326453264632647326483264932650326513265232653326543265532656326573265832659326603266132662326633266432665326663266732668326693267032671326723267332674326753267632677326783267932680326813268232683326843268532686326873268832689326903269132692326933269432695326963269732698326993270032701327023270332704327053270632707327083270932710327113271232713327143271532716327173271832719327203272132722327233272432725327263272732728327293273032731327323273332734327353273632737327383273932740327413274232743327443274532746327473274832749327503275132752327533275432755327563275732758327593276032761327623276332764327653276632767327683276932770327713277232773327743277532776327773277832779327803278132782327833278432785327863278732788327893279032791327923279332794327953279632797327983279932800328013280232803328043280532806328073280832809328103281132812328133281432815328163281732818328193282032821328223282332824328253282632827328283282932830328313283232833328343283532836328373283832839328403284132842328433284432845328463284732848328493285032851328523285332854328553285632857328583285932860328613286232863328643286532866328673286832869328703287132872328733287432875328763287732878328793288032881328823288332884328853288632887328883288932890328913289232893328943289532896328973289832899329003290132902329033290432905329063290732908329093291032911329123291332914329153291632917329183291932920329213292232923329243292532926329273292832929329303293132932329333293432935329363293732938329393294032941329423294332944329453294632947329483294932950329513295232953329543295532956329573295832959329603296132962329633296432965329663296732968329693297032971329723297332974329753297632977329783297932980329813298232983329843298532986329873298832989329903299132992329933299432995329963299732998329993300033001330023300333004330053300633007330083300933010330113301233013330143301533016330173301833019330203302133022330233302433025330263302733028330293303033031330323303333034330353303633037330383303933040330413304233043330443304533046330473304833049330503305133052330533305433055330563305733058330593306033061330623306333064330653306633067330683306933070330713307233073330743307533076330773307833079330803308133082330833308433085330863308733088330893309033091330923309333094330953309633097330983309933100331013310233103331043310533106331073310833109331103311133112331133311433115331163311733118331193312033121331223312333124331253312633127331283312933130331313313233133331343313533136331373313833139331403314133142331433314433145331463314733148331493315033151331523315333154331553315633157331583315933160331613316233163331643316533166331673316833169331703317133172331733317433175331763317733178331793318033181331823318333184331853318633187331883318933190331913319233193331943319533196331973319833199332003320133202332033320433205332063320733208332093321033211332123321333214332153321633217332183321933220332213322233223332243322533226332273322833229332303323133232332333323433235332363323733238332393324033241332423324333244332453324633247332483324933250332513325233253332543325533256332573325833259332603326133262332633326433265332663326733268332693327033271332723327333274332753327633277332783327933280332813328233283332843328533286332873328833289332903329133292332933329433295332963329733298332993330033301333023330333304333053330633307333083330933310333113331233313333143331533316333173331833319333203332133322333233332433325333263332733328333293333033331333323333333334333353333633337333383333933340333413334233343333443334533346333473334833349333503335133352333533335433355333563335733358333593336033361333623336333364333653336633367333683336933370333713337233373333743337533376333773337833379333803338133382333833338433385333863338733388333893339033391333923339333394333953339633397333983339933400334013340233403334043340533406334073340833409334103341133412334133341433415334163341733418334193342033421334223342333424334253342633427334283342933430334313343233433334343343533436334373343833439334403344133442334433344433445334463344733448334493345033451334523345333454334553345633457334583345933460334613346233463334643346533466334673346833469334703347133472334733347433475334763347733478334793348033481334823348333484334853348633487334883348933490334913349233493334943349533496334973349833499335003350133502335033350433505335063350733508335093351033511335123351333514335153351633517335183351933520335213352233523335243352533526335273352833529335303353133532335333353433535335363353733538335393354033541335423354333544335453354633547335483354933550335513355233553335543355533556335573355833559335603356133562335633356433565335663356733568335693357033571335723357333574335753357633577335783357933580335813358233583335843358533586335873358833589335903359133592335933359433595335963359733598335993360033601336023360333604336053360633607336083360933610336113361233613336143361533616336173361833619336203362133622336233362433625336263362733628336293363033631336323363333634336353363633637336383363933640336413364233643336443364533646336473364833649336503365133652336533365433655336563365733658336593366033661336623366333664336653366633667336683366933670336713367233673336743367533676336773367833679336803368133682336833368433685336863368733688336893369033691336923369333694336953369633697336983369933700337013370233703337043370533706337073370833709337103371133712337133371433715337163371733718337193372033721337223372333724337253372633727337283372933730337313373233733337343373533736337373373833739337403374133742337433374433745337463374733748337493375033751337523375333754337553375633757337583375933760337613376233763337643376533766337673376833769337703377133772337733377433775337763377733778337793378033781337823378333784337853378633787337883378933790337913379233793337943379533796337973379833799338003380133802338033380433805338063380733808338093381033811338123381333814338153381633817338183381933820338213382233823338243382533826338273382833829338303383133832338333383433835338363383733838338393384033841338423384333844338453384633847338483384933850338513385233853338543385533856338573385833859338603386133862338633386433865338663386733868338693387033871338723387333874338753387633877338783387933880338813388233883338843388533886338873388833889338903389133892338933389433895338963389733898338993390033901339023390333904339053390633907339083390933910339113391233913339143391533916339173391833919339203392133922339233392433925339263392733928339293393033931339323393333934339353393633937339383393933940339413394233943339443394533946339473394833949339503395133952339533395433955339563395733958339593396033961339623396333964339653396633967339683396933970339713397233973339743397533976339773397833979339803398133982339833398433985339863398733988339893399033991339923399333994339953399633997339983399934000340013400234003340043400534006340073400834009340103401134012340133401434015340163401734018340193402034021340223402334024340253402634027340283402934030340313403234033340343403534036340373403834039340403404134042340433404434045340463404734048340493405034051340523405334054340553405634057340583405934060340613406234063340643406534066340673406834069340703407134072340733407434075340763407734078340793408034081340823408334084340853408634087340883408934090340913409234093340943409534096340973409834099341003410134102341033410434105341063410734108341093411034111341123411334114341153411634117341183411934120341213412234123341243412534126341273412834129341303413134132341333413434135341363413734138341393414034141341423414334144341453414634147341483414934150341513415234153341543415534156341573415834159341603416134162341633416434165341663416734168341693417034171341723417334174341753417634177341783417934180341813418234183341843418534186341873418834189341903419134192341933419434195341963419734198341993420034201342023420334204342053420634207342083420934210342113421234213342143421534216342173421834219342203422134222342233422434225342263422734228342293423034231342323423334234342353423634237342383423934240342413424234243342443424534246342473424834249342503425134252342533425434255342563425734258342593426034261342623426334264342653426634267342683426934270342713427234273342743427534276342773427834279342803428134282342833428434285342863428734288342893429034291342923429334294342953429634297342983429934300343013430234303343043430534306343073430834309343103431134312343133431434315343163431734318343193432034321343223432334324343253432634327343283432934330343313433234333343343433534336343373433834339343403434134342343433434434345343463434734348343493435034351343523435334354343553435634357343583435934360343613436234363343643436534366343673436834369343703437134372343733437434375343763437734378343793438034381343823438334384343853438634387343883438934390343913439234393343943439534396343973439834399344003440134402344033440434405344063440734408344093441034411344123441334414344153441634417344183441934420344213442234423344243442534426344273442834429344303443134432344333443434435344363443734438344393444034441344423444334444344453444634447344483444934450344513445234453344543445534456344573445834459344603446134462344633446434465344663446734468344693447034471344723447334474344753447634477344783447934480344813448234483344843448534486344873448834489344903449134492344933449434495344963449734498344993450034501345023450334504345053450634507345083450934510345113451234513345143451534516345173451834519345203452134522345233452434525345263452734528345293453034531345323453334534345353453634537345383453934540345413454234543345443454534546345473454834549345503455134552345533455434555345563455734558345593456034561345623456334564345653456634567345683456934570345713457234573345743457534576345773457834579345803458134582345833458434585345863458734588345893459034591345923459334594345953459634597345983459934600346013460234603346043460534606346073460834609346103461134612346133461434615346163461734618346193462034621346223462334624346253462634627346283462934630346313463234633346343463534636346373463834639346403464134642346433464434645346463464734648346493465034651346523465334654346553465634657346583465934660346613466234663346643466534666346673466834669346703467134672346733467434675346763467734678346793468034681346823468334684346853468634687346883468934690346913469234693346943469534696346973469834699347003470134702347033470434705347063470734708347093471034711347123471334714347153471634717347183471934720347213472234723347243472534726347273472834729347303473134732347333473434735347363473734738347393474034741347423474334744347453474634747347483474934750347513475234753347543475534756347573475834759347603476134762347633476434765347663476734768347693477034771347723477334774347753477634777347783477934780347813478234783347843478534786347873478834789347903479134792347933479434795347963479734798347993480034801348023480334804348053480634807348083480934810348113481234813348143481534816348173481834819348203482134822348233482434825348263482734828348293483034831348323483334834348353483634837348383483934840348413484234843348443484534846348473484834849348503485134852348533485434855348563485734858348593486034861348623486334864348653486634867348683486934870348713487234873348743487534876348773487834879348803488134882348833488434885348863488734888348893489034891348923489334894348953489634897348983489934900349013490234903349043490534906349073490834909349103491134912349133491434915349163491734918349193492034921349223492334924349253492634927349283492934930349313493234933349343493534936349373493834939349403494134942349433494434945349463494734948349493495034951349523495334954349553495634957349583495934960349613496234963349643496534966349673496834969349703497134972349733497434975349763497734978349793498034981349823498334984349853498634987349883498934990349913499234993349943499534996349973499834999350003500135002350033500435005350063500735008350093501035011350123501335014350153501635017350183501935020350213502235023350243502535026350273502835029350303503135032350333503435035350363503735038350393504035041350423504335044350453504635047350483504935050350513505235053350543505535056350573505835059350603506135062350633506435065350663506735068350693507035071350723507335074350753507635077350783507935080350813508235083350843508535086350873508835089350903509135092350933509435095350963509735098350993510035101351023510335104351053510635107351083510935110351113511235113351143511535116351173511835119351203512135122351233512435125351263512735128351293513035131351323513335134351353513635137351383513935140351413514235143351443514535146351473514835149351503515135152351533515435155351563515735158351593516035161351623516335164351653516635167351683516935170351713517235173351743517535176351773517835179351803518135182351833518435185351863518735188351893519035191351923519335194351953519635197351983519935200352013520235203352043520535206352073520835209352103521135212352133521435215352163521735218352193522035221352223522335224352253522635227352283522935230352313523235233352343523535236352373523835239352403524135242352433524435245352463524735248352493525035251352523525335254352553525635257352583525935260352613526235263352643526535266352673526835269352703527135272352733527435275352763527735278352793528035281352823528335284352853528635287352883528935290352913529235293352943529535296352973529835299353003530135302353033530435305353063530735308353093531035311353123531335314353153531635317353183531935320353213532235323353243532535326353273532835329353303533135332353333533435335353363533735338353393534035341353423534335344353453534635347353483534935350353513535235353353543535535356353573535835359353603536135362353633536435365353663536735368353693537035371353723537335374353753537635377353783537935380353813538235383353843538535386353873538835389353903539135392353933539435395353963539735398353993540035401354023540335404354053540635407354083540935410354113541235413354143541535416354173541835419354203542135422354233542435425354263542735428354293543035431354323543335434354353543635437354383543935440354413544235443354443544535446354473544835449354503545135452354533545435455354563545735458354593546035461354623546335464354653546635467354683546935470354713547235473354743547535476354773547835479354803548135482354833548435485354863548735488354893549035491354923549335494354953549635497354983549935500355013550235503355043550535506355073550835509355103551135512355133551435515355163551735518355193552035521355223552335524355253552635527 |
- (function webpackUniversalModuleDefinition(root, factory) {
- if(typeof exports === 'object' && typeof module === 'object')
- module.exports = factory(require("xe-utils"));
- else if(typeof define === 'function' && define.amd)
- define(["xe-utils"], factory);
- else if(typeof exports === 'object')
- exports["VXETable"] = factory(require("xe-utils"));
- else
- root["VXETable"] = factory(root["XEUtils"]);
- })((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE_f0af__) {
- 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.es/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]);
- };
- /***/ }),
- /***/ "0cb2":
- /***/ (function(module, exports, __webpack_require__) {
- var toObject = __webpack_require__("7b0b");
- var floor = Math.floor;
- var replace = ''.replace;
- var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g;
- var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g;
- // https://tc39.es/ecma262/#sec-getsubstitution
- module.exports = function (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 replace.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;
- });
- };
- /***/ }),
- /***/ "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.es/ecma262/#sec-string.prototype.padstart
- start: createMethod(false),
- // `String.prototype.padEnd` method
- // https://tc39.es/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.es/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' ||
- // eslint-disable-next-line regexp/no-empty-group -- required for testing
- 'test'.split(/(?:)/, -1).length != 4 ||
- 'ab'.split(/(?:ab)*/).length != 2 ||
- '.'.split(/(.?)(.?)/).length != 4 ||
- // eslint-disable-next-line regexp/no-assertion-capturing-group, regexp/no-empty-group -- required for testing
- '.'.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.es/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.es/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 CHROME_VERSION = __webpack_require__("2d00");
- var IS_NODE = __webpack_require__("605d");
- var STRICT_METHOD = arrayMethodIsStrict('reduce');
- // 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.es/ecma262/#sec-array.prototype.reduce
- $({ target: 'Array', proto: true, forced: !STRICT_METHOD || 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.es/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 STRICT_METHOD = arrayMethodIsStrict('forEach');
- // `Array.prototype.forEach` method implementation
- // https://tc39.es/ecma262/#sec-array.prototype.foreach
- module.exports = !STRICT_METHOD ? 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 -- required for testing
- 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;
- };
- /***/ }),
- /***/ "1cdc":
- /***/ (function(module, exports, __webpack_require__) {
- var userAgent = __webpack_require__("342f");
- module.exports = /(iphone|ipod|ipad).*applewebkit/i.test(userAgent);
- /***/ }),
- /***/ "1d80":
- /***/ (function(module, exports) {
- // `RequireObjectCoercible` abstract operation
- // https://tc39.es/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.es/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.es/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.es/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 no-control-regex -- safe */
- var FORBIDDEN_HOST_CODE_POINT = /[\u0000\t\u000A\u000D #%/:?@[\\]]/;
- var FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT = /[\u0000\t\u000A\u000D #/:?@[\\]]/;
- var LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE = /^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g;
- var TAB_AND_NEW_LINE = /[\t\u000A\u000D]/g;
- /* eslint-enable no-control-regex -- safe */
- 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 -- TODO
- 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 -- TODO
- 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 -- required for `.length`
- 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 -- required for `.length`
- 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
- });
- /***/ }),
- /***/ "2cf4":
- /***/ (function(module, exports, __webpack_require__) {
- var global = __webpack_require__("da84");
- var fails = __webpack_require__("d039");
- var bind = __webpack_require__("0366");
- var html = __webpack_require__("1be4");
- var createElement = __webpack_require__("cc12");
- var IS_IOS = __webpack_require__("1cdc");
- var IS_NODE = __webpack_require__("605d");
- var location = global.location;
- var set = global.setImmediate;
- var clear = global.clearImmediate;
- var process = global.process;
- var MessageChannel = global.MessageChannel;
- var Dispatch = global.Dispatch;
- var counter = 0;
- var queue = {};
- var ONREADYSTATECHANGE = 'onreadystatechange';
- var defer, channel, port;
- var run = function (id) {
- // eslint-disable-next-line no-prototype-builtins -- safe
- if (queue.hasOwnProperty(id)) {
- var fn = queue[id];
- delete queue[id];
- fn();
- }
- };
- var runner = function (id) {
- return function () {
- run(id);
- };
- };
- var listener = function (event) {
- run(event.data);
- };
- var post = function (id) {
- // old engines have not location.origin
- global.postMessage(id + '', location.protocol + '//' + location.host);
- };
- // Node.js 0.9+ & IE10+ has setImmediate, otherwise:
- if (!set || !clear) {
- set = function setImmediate(fn) {
- var args = [];
- var i = 1;
- while (arguments.length > i) args.push(arguments[i++]);
- queue[++counter] = function () {
- // eslint-disable-next-line no-new-func -- spec requirement
- (typeof fn == 'function' ? fn : Function(fn)).apply(undefined, args);
- };
- defer(counter);
- return counter;
- };
- clear = function clearImmediate(id) {
- delete queue[id];
- };
- // Node.js 0.8-
- if (IS_NODE) {
- defer = function (id) {
- process.nextTick(runner(id));
- };
- // Sphere (JS game engine) Dispatch API
- } else if (Dispatch && Dispatch.now) {
- defer = function (id) {
- Dispatch.now(runner(id));
- };
- // Browsers with MessageChannel, includes WebWorkers
- // except iOS - https://github.com/zloirock/core-js/issues/624
- } else if (MessageChannel && !IS_IOS) {
- channel = new MessageChannel();
- port = channel.port2;
- channel.port1.onmessage = listener;
- defer = bind(port.postMessage, port, 1);
- // Browsers with postMessage, skip WebWorkers
- // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
- } else if (
- global.addEventListener &&
- typeof postMessage == 'function' &&
- !global.importScripts &&
- location && location.protocol !== 'file:' &&
- !fails(post)
- ) {
- defer = post;
- global.addEventListener('message', listener, false);
- // IE8-
- } else if (ONREADYSTATECHANGE in createElement('script')) {
- defer = function (id) {
- html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () {
- html.removeChild(this);
- run(id);
- };
- };
- // Rest old browsers
- } else {
- defer = function (id) {
- setTimeout(runner(id), 0);
- };
- }
- }
- module.exports = {
- set: set,
- clear: clear
- };
- /***/ }),
- /***/ "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.es/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;
- };
- /***/ }),
- /***/ "38cf":
- /***/ (function(module, exports, __webpack_require__) {
- var $ = __webpack_require__("23e7");
- var repeat = __webpack_require__("1148");
- // `String.prototype.repeat` method
- // https://tc39.es/ecma262/#sec-string.prototype.repeat
- $({ target: 'String', proto: true }, {
- repeat: repeat
- });
- /***/ }),
- /***/ "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.es/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.es/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.es/ecma262/#sec-thisnumbervalue
- module.exports = function (value) {
- if (typeof value != 'number' && classof(value) != 'Number') {
- throw TypeError('Incorrect invocation');
- }
- return +value;
- };
- /***/ }),
- /***/ "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 -- safe
- 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.es/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;
- };
- /***/ }),
- /***/ "44de":
- /***/ (function(module, exports, __webpack_require__) {
- var global = __webpack_require__("da84");
- module.exports = function (a, b) {
- var console = global.console;
- if (console && console.error) {
- arguments.length === 1 ? console.error(a) : console.error(a, b);
- }
- };
- /***/ }),
- /***/ "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.es/ecma262/#sec-isregexp
- module.exports = function (it) {
- var isRegExp;
- return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classof(it) == 'RegExp');
- };
- /***/ }),
- /***/ "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.es/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.es/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.es/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 IS_NODE = __webpack_require__("605d");
- var V8_VERSION = __webpack_require__("2d00");
- var fails = __webpack_require__("d039");
- module.exports = !!Object.getOwnPropertySymbols && !fails(function () {
- /* global Symbol -- required for testing */
- return !Symbol.sham &&
- // Chrome 38 Symbol has incorrect toString conversion
- // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
- (IS_NODE ? V8_VERSION === 38 : V8_VERSION > 37 && V8_VERSION < 41);
- });
- /***/ }),
- /***/ "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.es/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.es/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.es/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 -- NaN check
- if (IS_INCLUDES && el != el) while (length > index) {
- value = O[index++];
- // eslint-disable-next-line no-self-compare -- NaN check
- 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.es/ecma262/#sec-array.prototype.includes
- includes: createMethod(true),
- // `Array.prototype.indexOf` method
- // https://tc39.es/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.es/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 HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');
- // `Array.prototype.filter` method
- // https://tc39.es/ecma262/#sec-array.prototype.filter
- // with adding support of @@species
- $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
- 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.es/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.es/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.es/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 toLength = __webpack_require__("50c4");
- var toInteger = __webpack_require__("a691");
- var requireObjectCoercible = __webpack_require__("1d80");
- var advanceStringIndex = __webpack_require__("8aa5");
- var getSubstitution = __webpack_require__("0cb2");
- var regExpExec = __webpack_require__("14c3");
- var max = Math.max;
- var min = Math.min;
- 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.es/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.es/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);
- }
- ];
- });
- /***/ }),
- /***/ "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.9.1',
- mode: IS_PURE ? 'pure' : 'global',
- copyright: '© 2021 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
- 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.es/ecma262/#sec-string.prototype.trimstart
- start: createMethod(1),
- // `String.prototype.{ trimRight, trimEnd }` methods
- // https://tc39.es/ecma262/#sec-string.prototype.trimend
- end: createMethod(2),
- // `String.prototype.trim` method
- // https://tc39.es/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 -- TODO
- 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.es/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 = {};
- /* global Symbol -- required for testing */
- 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 -- required for `.length`
- 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.es/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.es/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;
- }
- );
- };
- var REPLACE = isForced(
- CONSTRUCTOR_NAME,
- typeof NativeConstructor != 'function' || !(IS_WEAK || NativePrototype.forEach && !fails(function () {
- new NativeConstructor().entries().next();
- }))
- );
- if (REPLACE) {
- // 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 -- required for testing
- 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.es/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 -- old IE */
- 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.es/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 FIND = 'find';
- var SKIPS_HOLES = true;
- // Shouldn't skip holes
- if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
- // `Array.prototype.find` method
- // https://tc39.es/ecma262/#sec-array.prototype.find
- $({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
- find: function find(callbackfn /* , that = undefined */) {
- return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
- }
- });
- // https://tc39.es/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));
- /***/ }),
- /***/ "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");
- // Detect IE8's incomplete defineProperty implementation
- 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.es/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.es/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.
- // eslint-disable-next-line regexp/no-assertion-capturing-group, regexp/no-empty-group -- required for testing
- 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.es/ecma262/#sec-array.prototype.concat
- // with adding support of @@isConcatSpreadable and @@species
- $({ target: 'Array', proto: true, forced: FORCED }, {
- // eslint-disable-next-line no-unused-vars -- required for `.length`
- concat: function concat(arg) {
- 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 -- safe
- 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.es/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.es/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 HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('splice');
- 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.es/ecma262/#sec-array.prototype.splice
- // with adding support of @@species
- $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
- 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;
- }
- });
- /***/ }),
- /***/ "a4b4":
- /***/ (function(module, exports, __webpack_require__) {
- var userAgent = __webpack_require__("342f");
- module.exports = /web0s(?!.*chrome)/i.test(userAgent);
- /***/ }),
- /***/ "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.es/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.es/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.es/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.es/ecma262/#sec-object.create
- create: $create,
- // `Object.defineProperty` method
- // https://tc39.es/ecma262/#sec-object.defineproperty
- defineProperty: $defineProperty,
- // `Object.defineProperties` method
- // https://tc39.es/ecma262/#sec-object.defineproperties
- defineProperties: $defineProperties,
- // `Object.getOwnPropertyDescriptor` method
- // https://tc39.es/ecma262/#sec-object.getownpropertydescriptors
- getOwnPropertyDescriptor: $getOwnPropertyDescriptor
- });
- $({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL }, {
- // `Object.getOwnPropertyNames` method
- // https://tc39.es/ecma262/#sec-object.getownpropertynames
- getOwnPropertyNames: $getOwnPropertyNames,
- // `Object.getOwnPropertySymbols` method
- // https://tc39.es/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.es/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 -- required for `.length`
- 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.es/ecma262/#sec-symbol.prototype-@@toprimitive
- if (!$Symbol[PROTOTYPE][TO_PRIMITIVE]) {
- createNonEnumerableProperty($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);
- }
- // `Symbol.prototype[@@toStringTag]` property
- // https://tc39.es/ecma262/#sec-symbol.prototype-@@tostringtag
- setToStringTag($Symbol, SYMBOL);
- hiddenKeys[HIDDEN] = true;
- /***/ }),
- /***/ "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.es/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 -- required for testing
- 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.es/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.es/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.es/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");
- // `RegExp.prototype.exec` method
- // https://tc39.es/ecma262/#sec-regexp.prototype.exec
- $({ 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.es/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;
- };
- /***/ }),
- /***/ "ae93":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var fails = __webpack_require__("d039");
- 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.es/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;
- }
- }
- var NEW_ITERATOR_PROTOTYPE = IteratorPrototype == undefined || fails(function () {
- var test = {};
- // FF44- legacy iterators case
- return IteratorPrototype[ITERATOR].call(test) !== test;
- });
- if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype = {};
- // 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
- if ((!IS_PURE || NEW_ITERATOR_PROTOTYPE) && !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.es/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.es/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 '';
- }
- }
- });
- }
- /***/ }),
- /***/ "b575":
- /***/ (function(module, exports, __webpack_require__) {
- var global = __webpack_require__("da84");
- var getOwnPropertyDescriptor = __webpack_require__("06cf").f;
- var macrotask = __webpack_require__("2cf4").set;
- var IS_IOS = __webpack_require__("1cdc");
- var IS_WEBOS_WEBKIT = __webpack_require__("a4b4");
- var IS_NODE = __webpack_require__("605d");
- var MutationObserver = global.MutationObserver || global.WebKitMutationObserver;
- var document = global.document;
- var process = global.process;
- var Promise = global.Promise;
- // Node.js 11 shows ExperimentalWarning on getting `queueMicrotask`
- var queueMicrotaskDescriptor = getOwnPropertyDescriptor(global, 'queueMicrotask');
- var queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;
- var flush, head, last, notify, toggle, node, promise, then;
- // modern engines have queueMicrotask method
- if (!queueMicrotask) {
- flush = function () {
- var parent, fn;
- if (IS_NODE && (parent = process.domain)) parent.exit();
- while (head) {
- fn = head.fn;
- head = head.next;
- try {
- fn();
- } catch (error) {
- if (head) notify();
- else last = undefined;
- throw error;
- }
- } last = undefined;
- if (parent) parent.enter();
- };
- // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339
- // also except WebOS Webkit https://github.com/zloirock/core-js/issues/898
- if (!IS_IOS && !IS_NODE && !IS_WEBOS_WEBKIT && MutationObserver && document) {
- toggle = true;
- node = document.createTextNode('');
- new MutationObserver(flush).observe(node, { characterData: true });
- notify = function () {
- node.data = toggle = !toggle;
- };
- // environments with maybe non-completely correct, but existent Promise
- } else if (Promise && Promise.resolve) {
- // Promise.resolve without an argument throws an error in LG WebOS 2
- promise = Promise.resolve(undefined);
- then = promise.then;
- notify = function () {
- then.call(promise, flush);
- };
- // Node.js without promises
- } else if (IS_NODE) {
- notify = function () {
- process.nextTick(flush);
- };
- // for other environments - macrotask based on:
- // - setImmediate
- // - MessageChannel
- // - window.postMessag
- // - onreadystatechange
- // - setTimeout
- } else {
- notify = function () {
- // strange IE + webpack dev server bug - use .call(global)
- macrotask.call(global, flush);
- };
- }
- }
- module.exports = queueMicrotask || function (fn) {
- var task = { fn: fn, next: undefined };
- if (last) last.next = task;
- if (!head) {
- head = task;
- notify();
- } last = task;
- };
- /***/ }),
- /***/ "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) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {
- 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.es/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 multiply = function (data, 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 (data, 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 (data) {
- 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;
- };
- 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.es/ecma262/#sec-number.prototype.tofixed
- $({ target: 'Number', proto: true, forced: FORCED }, {
- 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;
- if (fractDigits < 0 || fractDigits > 20) throw RangeError('Incorrect fraction digits');
- // eslint-disable-next-line no-self-compare -- NaN check
- 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(data, 0, z);
- j = fractDigits;
- while (j >= 7) {
- multiply(data, 1e7, 0);
- j -= 7;
- }
- multiply(data, pow(10, j, 1), 0);
- j = e - 1;
- while (j >= 23) {
- divide(data, 1 << 23);
- j -= 23;
- }
- divide(data, 1 << j);
- multiply(data, 1, 1);
- divide(data, 2);
- result = dataToString(data);
- } else {
- multiply(data, 0, z);
- multiply(data, 1 << -e, 0);
- result = dataToString(data) + 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.es/ecma262/#sec-array.prototype.foreach
- forEach: createMethod(0),
- // `Array.prototype.map` method
- // https://tc39.es/ecma262/#sec-array.prototype.map
- map: createMethod(1),
- // `Array.prototype.filter` method
- // https://tc39.es/ecma262/#sec-array.prototype.filter
- filter: createMethod(2),
- // `Array.prototype.some` method
- // https://tc39.es/ecma262/#sec-array.prototype.some
- some: createMethod(3),
- // `Array.prototype.every` method
- // https://tc39.es/ecma262/#sec-array.prototype.every
- every: createMethod(4),
- // `Array.prototype.find` method
- // https://tc39.es/ecma262/#sec-array.prototype.find
- find: createMethod(5),
- // `Array.prototype.findIndex` method
- // https://tc39.es/ecma262/#sec-array.prototype.findIndex
- findIndex: createMethod(6),
- // `Array.prototype.filterOut` method
- // https://github.com/tc39/proposal-array-filtering
- filterOut: createMethod(7)
- };
- /***/ }),
- /***/ "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.es/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.es/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;
- });
- };
- /***/ }),
- /***/ "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");
- // `Array.prototype.includes` method
- // https://tc39.es/ecma262/#sec-array.prototype.includes
- $({ target: 'Array', proto: true }, {
- includes: function includes(el /* , fromIndex = 0 */) {
- return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
- }
- });
- // https://tc39.es/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) : {};
- };
- /***/ }),
- /***/ "cca6":
- /***/ (function(module, exports, __webpack_require__) {
- var $ = __webpack_require__("23e7");
- var assign = __webpack_require__("60da");
- // `Object.assign` method
- // https://tc39.es/ecma262/#sec-object.assign
- $({ target: 'Object', stat: true, forced: Object.assign !== assign }, {
- assign: assign
- });
- /***/ }),
- /***/ "cdf9":
- /***/ (function(module, exports, __webpack_require__) {
- var anObject = __webpack_require__("825a");
- var isObject = __webpack_require__("861d");
- var newPromiseCapability = __webpack_require__("f069");
- module.exports = function (C, x) {
- anObject(C);
- if (isObject(x) && x.constructor === C) return x;
- var promiseCapability = newPromiseCapability.f(C);
- var resolve = promiseCapability.resolve;
- resolve(x);
- return promiseCapability.promise;
- };
- /***/ }),
- /***/ "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.es/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.es/ecma262/#sec-symbol.iterator
- defineWellKnownSymbol('iterator');
- /***/ }),
- /***/ "d2bb":
- /***/ (function(module, exports, __webpack_require__) {
- /* eslint-disable no-proto -- safe */
- var anObject = __webpack_require__("825a");
- var aPossiblePrototype = __webpack_require__("3bbe");
- // `Object.setPrototypeOf` method
- // https://tc39.es/ecma262/#sec-object.setprototypeof
- // Works with __proto__ only. Old v8 can't work with null proto objects.
- 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.es/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.es/ecma262/#sec-array.prototype.reduce
- left: createMethod(false),
- // `Array.prototype.reduceRight` method
- // https://tc39.es/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 () {
- // eslint-disable-next-line regexp/no-empty-group -- required for testing
- 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 HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('map');
- // `Array.prototype.map` method
- // https://tc39.es/ecma262/#sec-array.prototype.map
- // with adding support of @@species
- $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
- 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 =
- /* global globalThis -- safe */
- 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 -- fallback
- (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.es/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.es/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.es/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.es/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.es/ecma262/#sec-array.prototype.entries
- // `Array.prototype.keys` method
- // https://tc39.es/ecma262/#sec-array.prototype.keys
- // `Array.prototype.values` method
- // https://tc39.es/ecma262/#sec-array.prototype.values
- // `Array.prototype[@@iterator]` method
- // https://tc39.es/ecma262/#sec-array.prototype-@@iterator
- // `CreateArrayIterator` internal method
- // https://tc39.es/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.es/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.es/ecma262/#sec-createunmappedargumentsobject
- // https://tc39.es/ecma262/#sec-createmappedargumentsobject
- Iterators.Arguments = Iterators.Array;
- // https://tc39.es/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.es/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;
- /***/ }),
- /***/ "e667":
- /***/ (function(module, exports) {
- module.exports = function (exec) {
- try {
- return { error: false, value: exec() };
- } catch (error) {
- return { error: true, value: error };
- }
- };
- /***/ }),
- /***/ "e6cf":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var $ = __webpack_require__("23e7");
- var IS_PURE = __webpack_require__("c430");
- var global = __webpack_require__("da84");
- var getBuiltIn = __webpack_require__("d066");
- var NativePromise = __webpack_require__("fea9");
- var redefine = __webpack_require__("6eeb");
- var redefineAll = __webpack_require__("e2cc");
- var setToStringTag = __webpack_require__("d44e");
- var setSpecies = __webpack_require__("2626");
- var isObject = __webpack_require__("861d");
- var aFunction = __webpack_require__("1c0b");
- var anInstance = __webpack_require__("19aa");
- var inspectSource = __webpack_require__("8925");
- var iterate = __webpack_require__("2266");
- var checkCorrectnessOfIteration = __webpack_require__("1c7e");
- var speciesConstructor = __webpack_require__("4840");
- var task = __webpack_require__("2cf4").set;
- var microtask = __webpack_require__("b575");
- var promiseResolve = __webpack_require__("cdf9");
- var hostReportErrors = __webpack_require__("44de");
- var newPromiseCapabilityModule = __webpack_require__("f069");
- var perform = __webpack_require__("e667");
- var InternalStateModule = __webpack_require__("69f3");
- var isForced = __webpack_require__("94ca");
- var wellKnownSymbol = __webpack_require__("b622");
- var IS_NODE = __webpack_require__("605d");
- var V8_VERSION = __webpack_require__("2d00");
- var SPECIES = wellKnownSymbol('species');
- var PROMISE = 'Promise';
- var getInternalState = InternalStateModule.get;
- var setInternalState = InternalStateModule.set;
- var getInternalPromiseState = InternalStateModule.getterFor(PROMISE);
- var PromiseConstructor = NativePromise;
- var TypeError = global.TypeError;
- var document = global.document;
- var process = global.process;
- var $fetch = getBuiltIn('fetch');
- var newPromiseCapability = newPromiseCapabilityModule.f;
- var newGenericPromiseCapability = newPromiseCapability;
- var DISPATCH_EVENT = !!(document && document.createEvent && global.dispatchEvent);
- var NATIVE_REJECTION_EVENT = typeof PromiseRejectionEvent == 'function';
- var UNHANDLED_REJECTION = 'unhandledrejection';
- var REJECTION_HANDLED = 'rejectionhandled';
- var PENDING = 0;
- var FULFILLED = 1;
- var REJECTED = 2;
- var HANDLED = 1;
- var UNHANDLED = 2;
- var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;
- var FORCED = isForced(PROMISE, function () {
- var GLOBAL_CORE_JS_PROMISE = inspectSource(PromiseConstructor) !== String(PromiseConstructor);
- if (!GLOBAL_CORE_JS_PROMISE) {
- // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
- // https://bugs.chromium.org/p/chromium/issues/detail?id=830565
- // We can't detect it synchronously, so just check versions
- if (V8_VERSION === 66) return true;
- // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test
- if (!IS_NODE && !NATIVE_REJECTION_EVENT) return true;
- }
- // We need Promise#finally in the pure version for preventing prototype pollution
- if (IS_PURE && !PromiseConstructor.prototype['finally']) return true;
- // We can't use @@species feature detection in V8 since it causes
- // deoptimization and performance degradation
- // https://github.com/zloirock/core-js/issues/679
- if (V8_VERSION >= 51 && /native code/.test(PromiseConstructor)) return false;
- // Detect correctness of subclassing with @@species support
- var promise = PromiseConstructor.resolve(1);
- var FakePromise = function (exec) {
- exec(function () { /* empty */ }, function () { /* empty */ });
- };
- var constructor = promise.constructor = {};
- constructor[SPECIES] = FakePromise;
- return !(promise.then(function () { /* empty */ }) instanceof FakePromise);
- });
- var INCORRECT_ITERATION = FORCED || !checkCorrectnessOfIteration(function (iterable) {
- PromiseConstructor.all(iterable)['catch'](function () { /* empty */ });
- });
- // helpers
- var isThenable = function (it) {
- var then;
- return isObject(it) && typeof (then = it.then) == 'function' ? then : false;
- };
- var notify = function (state, isReject) {
- if (state.notified) return;
- state.notified = true;
- var chain = state.reactions;
- microtask(function () {
- var value = state.value;
- var ok = state.state == FULFILLED;
- var index = 0;
- // variable length - can't use forEach
- while (chain.length > index) {
- var reaction = chain[index++];
- var handler = ok ? reaction.ok : reaction.fail;
- var resolve = reaction.resolve;
- var reject = reaction.reject;
- var domain = reaction.domain;
- var result, then, exited;
- try {
- if (handler) {
- if (!ok) {
- if (state.rejection === UNHANDLED) onHandleUnhandled(state);
- state.rejection = HANDLED;
- }
- if (handler === true) result = value;
- else {
- if (domain) domain.enter();
- result = handler(value); // can throw
- if (domain) {
- domain.exit();
- exited = true;
- }
- }
- if (result === reaction.promise) {
- reject(TypeError('Promise-chain cycle'));
- } else if (then = isThenable(result)) {
- then.call(result, resolve, reject);
- } else resolve(result);
- } else reject(value);
- } catch (error) {
- if (domain && !exited) domain.exit();
- reject(error);
- }
- }
- state.reactions = [];
- state.notified = false;
- if (isReject && !state.rejection) onUnhandled(state);
- });
- };
- var dispatchEvent = function (name, promise, reason) {
- var event, handler;
- if (DISPATCH_EVENT) {
- event = document.createEvent('Event');
- event.promise = promise;
- event.reason = reason;
- event.initEvent(name, false, true);
- global.dispatchEvent(event);
- } else event = { promise: promise, reason: reason };
- if (!NATIVE_REJECTION_EVENT && (handler = global['on' + name])) handler(event);
- else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);
- };
- var onUnhandled = function (state) {
- task.call(global, function () {
- var promise = state.facade;
- var value = state.value;
- var IS_UNHANDLED = isUnhandled(state);
- var result;
- if (IS_UNHANDLED) {
- result = perform(function () {
- if (IS_NODE) {
- process.emit('unhandledRejection', value, promise);
- } else dispatchEvent(UNHANDLED_REJECTION, promise, value);
- });
- // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
- state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED;
- if (result.error) throw result.value;
- }
- });
- };
- var isUnhandled = function (state) {
- return state.rejection !== HANDLED && !state.parent;
- };
- var onHandleUnhandled = function (state) {
- task.call(global, function () {
- var promise = state.facade;
- if (IS_NODE) {
- process.emit('rejectionHandled', promise);
- } else dispatchEvent(REJECTION_HANDLED, promise, state.value);
- });
- };
- var bind = function (fn, state, unwrap) {
- return function (value) {
- fn(state, value, unwrap);
- };
- };
- var internalReject = function (state, value, unwrap) {
- if (state.done) return;
- state.done = true;
- if (unwrap) state = unwrap;
- state.value = value;
- state.state = REJECTED;
- notify(state, true);
- };
- var internalResolve = function (state, value, unwrap) {
- if (state.done) return;
- state.done = true;
- if (unwrap) state = unwrap;
- try {
- if (state.facade === value) throw TypeError("Promise can't be resolved itself");
- var then = isThenable(value);
- if (then) {
- microtask(function () {
- var wrapper = { done: false };
- try {
- then.call(value,
- bind(internalResolve, wrapper, state),
- bind(internalReject, wrapper, state)
- );
- } catch (error) {
- internalReject(wrapper, error, state);
- }
- });
- } else {
- state.value = value;
- state.state = FULFILLED;
- notify(state, false);
- }
- } catch (error) {
- internalReject({ done: false }, error, state);
- }
- };
- // constructor polyfill
- if (FORCED) {
- // 25.4.3.1 Promise(executor)
- PromiseConstructor = function Promise(executor) {
- anInstance(this, PromiseConstructor, PROMISE);
- aFunction(executor);
- Internal.call(this);
- var state = getInternalState(this);
- try {
- executor(bind(internalResolve, state), bind(internalReject, state));
- } catch (error) {
- internalReject(state, error);
- }
- };
- // eslint-disable-next-line no-unused-vars -- required for `.length`
- Internal = function Promise(executor) {
- setInternalState(this, {
- type: PROMISE,
- done: false,
- notified: false,
- parent: false,
- reactions: [],
- rejection: false,
- state: PENDING,
- value: undefined
- });
- };
- Internal.prototype = redefineAll(PromiseConstructor.prototype, {
- // `Promise.prototype.then` method
- // https://tc39.es/ecma262/#sec-promise.prototype.then
- then: function then(onFulfilled, onRejected) {
- var state = getInternalPromiseState(this);
- var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor));
- reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;
- reaction.fail = typeof onRejected == 'function' && onRejected;
- reaction.domain = IS_NODE ? process.domain : undefined;
- state.parent = true;
- state.reactions.push(reaction);
- if (state.state != PENDING) notify(state, false);
- return reaction.promise;
- },
- // `Promise.prototype.catch` method
- // https://tc39.es/ecma262/#sec-promise.prototype.catch
- 'catch': function (onRejected) {
- return this.then(undefined, onRejected);
- }
- });
- OwnPromiseCapability = function () {
- var promise = new Internal();
- var state = getInternalState(promise);
- this.promise = promise;
- this.resolve = bind(internalResolve, state);
- this.reject = bind(internalReject, state);
- };
- newPromiseCapabilityModule.f = newPromiseCapability = function (C) {
- return C === PromiseConstructor || C === PromiseWrapper
- ? new OwnPromiseCapability(C)
- : newGenericPromiseCapability(C);
- };
- if (!IS_PURE && typeof NativePromise == 'function') {
- nativeThen = NativePromise.prototype.then;
- // wrap native Promise#then for native async functions
- redefine(NativePromise.prototype, 'then', function then(onFulfilled, onRejected) {
- var that = this;
- return new PromiseConstructor(function (resolve, reject) {
- nativeThen.call(that, resolve, reject);
- }).then(onFulfilled, onRejected);
- // https://github.com/zloirock/core-js/issues/640
- }, { unsafe: true });
- // wrap fetch result
- if (typeof $fetch == 'function') $({ global: true, enumerable: true, forced: true }, {
- // eslint-disable-next-line no-unused-vars -- required for `.length`
- fetch: function fetch(input /* , init */) {
- return promiseResolve(PromiseConstructor, $fetch.apply(global, arguments));
- }
- });
- }
- }
- $({ global: true, wrap: true, forced: FORCED }, {
- Promise: PromiseConstructor
- });
- setToStringTag(PromiseConstructor, PROMISE, false, true);
- setSpecies(PROMISE);
- PromiseWrapper = getBuiltIn(PROMISE);
- // statics
- $({ target: PROMISE, stat: true, forced: FORCED }, {
- // `Promise.reject` method
- // https://tc39.es/ecma262/#sec-promise.reject
- reject: function reject(r) {
- var capability = newPromiseCapability(this);
- capability.reject.call(undefined, r);
- return capability.promise;
- }
- });
- $({ target: PROMISE, stat: true, forced: IS_PURE || FORCED }, {
- // `Promise.resolve` method
- // https://tc39.es/ecma262/#sec-promise.resolve
- resolve: function resolve(x) {
- return promiseResolve(IS_PURE && this === PromiseWrapper ? PromiseConstructor : this, x);
- }
- });
- $({ target: PROMISE, stat: true, forced: INCORRECT_ITERATION }, {
- // `Promise.all` method
- // https://tc39.es/ecma262/#sec-promise.all
- all: function all(iterable) {
- var C = this;
- var capability = newPromiseCapability(C);
- var resolve = capability.resolve;
- var reject = capability.reject;
- var result = perform(function () {
- var $promiseResolve = aFunction(C.resolve);
- var values = [];
- var counter = 0;
- var remaining = 1;
- iterate(iterable, function (promise) {
- var index = counter++;
- var alreadyCalled = false;
- values.push(undefined);
- remaining++;
- $promiseResolve.call(C, promise).then(function (value) {
- if (alreadyCalled) return;
- alreadyCalled = true;
- values[index] = value;
- --remaining || resolve(values);
- }, reject);
- });
- --remaining || resolve(values);
- });
- if (result.error) reject(result.value);
- return capability.promise;
- },
- // `Promise.race` method
- // https://tc39.es/ecma262/#sec-promise.race
- race: function race(iterable) {
- var C = this;
- var capability = newPromiseCapability(C);
- var reject = capability.reject;
- var result = perform(function () {
- var $promiseResolve = aFunction(C.resolve);
- iterate(iterable, function (promise) {
- $promiseResolve.call(C, promise).then(capability.resolve, reject);
- });
- });
- if (result.error) reject(result.value);
- return capability.promise;
- }
- });
- /***/ }),
- /***/ "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.es/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);
- };
- /***/ }),
- /***/ "f069":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var aFunction = __webpack_require__("1c0b");
- var PromiseCapability = function (C) {
- var resolve, reject;
- this.promise = new C(function ($$resolve, $$reject) {
- if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');
- resolve = $$resolve;
- reject = $$reject;
- });
- this.resolve = aFunction(resolve);
- this.reject = aFunction(reject);
- };
- // 25.4.1.5 NewPromiseCapability(C)
- module.exports.f = function (C) {
- return new PromiseCapability(C);
- };
- /***/ }),
- /***/ "f0af":
- /***/ (function(module, exports) {
- module.exports = __WEBPACK_EXTERNAL_MODULE_f0af__;
- /***/ }),
- /***/ "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__, "install", function() { return /* reexport */ all_install; });
- __webpack_require__.d(__webpack_exports__, "use", function() { return /* reexport */ use; });
- __webpack_require__.d(__webpack_exports__, "config", function() { return /* reexport */ v_x_e_table_config; });
- __webpack_require__.d(__webpack_exports__, "t", function() { return /* reexport */ t; });
- __webpack_require__.d(__webpack_exports__, "_t", function() { return /* reexport */ _t; });
- __webpack_require__.d(__webpack_exports__, "v", function() { return /* reexport */ v; });
- __webpack_require__.d(__webpack_exports__, "VXETable", function() { return /* reexport */ VXETable; });
- __webpack_require__.d(__webpack_exports__, "interceptor", function() { return /* reexport */ interceptor; });
- __webpack_require__.d(__webpack_exports__, "renderer", function() { return /* reexport */ renderer; });
- __webpack_require__.d(__webpack_exports__, "commands", function() { return /* reexport */ commands; });
- __webpack_require__.d(__webpack_exports__, "menus", function() { return /* reexport */ menus; });
- __webpack_require__.d(__webpack_exports__, "formats", function() { return /* reexport */ formats; });
- __webpack_require__.d(__webpack_exports__, "setup", function() { return /* reexport */ setup; });
- __webpack_require__.d(__webpack_exports__, "Icon", function() { return /* reexport */ Icon; });
- __webpack_require__.d(__webpack_exports__, "Filter", function() { return /* reexport */ Filter; });
- __webpack_require__.d(__webpack_exports__, "Edit", function() { return /* reexport */ Edit; });
- __webpack_require__.d(__webpack_exports__, "saveFile", function() { return /* reexport */ saveLocalFile; });
- __webpack_require__.d(__webpack_exports__, "readFile", function() { return /* reexport */ readLocalFile; });
- __webpack_require__.d(__webpack_exports__, "print", function() { return /* reexport */ print; });
- __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__, "Header", function() { return /* reexport */ Header; });
- __webpack_require__.d(__webpack_exports__, "Footer", function() { return /* reexport */ Footer; });
- __webpack_require__.d(__webpack_exports__, "Column", function() { return /* reexport */ Column; });
- __webpack_require__.d(__webpack_exports__, "Colgroup", function() { return /* reexport */ Colgroup; });
- __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__, "CheckboxGroup", function() { return /* reexport */ CheckboxGroup; });
- __webpack_require__.d(__webpack_exports__, "Radio", function() { return /* reexport */ Radio; });
- __webpack_require__.d(__webpack_exports__, "RadioGroup", function() { return /* reexport */ RadioGroup; });
- __webpack_require__.d(__webpack_exports__, "RadioButton", function() { return /* reexport */ RadioButton; });
- __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__, "modal", function() { return /* reexport */ modal_modal; });
- __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__, "FormItem", function() { return /* reexport */ FormItem; });
- __webpack_require__.d(__webpack_exports__, "FormGather", function() { return /* reexport */ FormGather; });
- __webpack_require__.d(__webpack_exports__, "Select", function() { return /* reexport */ Select; });
- __webpack_require__.d(__webpack_exports__, "Optgroup", function() { return /* reexport */ Optgroup; });
- __webpack_require__.d(__webpack_exports__, "Option", function() { return /* reexport */ Option; });
- __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__, "Table", function() { return /* reexport */ Table; });
- // NAMESPACE OBJECT: ./packages/all.js
- var all_namespaceObject = {};
- __webpack_require__.r(all_namespaceObject);
- __webpack_require__.d(all_namespaceObject, "install", function() { return all_install; });
- __webpack_require__.d(all_namespaceObject, "use", function() { return use; });
- __webpack_require__.d(all_namespaceObject, "config", function() { return v_x_e_table_config; });
- __webpack_require__.d(all_namespaceObject, "t", function() { return t; });
- __webpack_require__.d(all_namespaceObject, "_t", function() { return _t; });
- __webpack_require__.d(all_namespaceObject, "v", function() { return v; });
- __webpack_require__.d(all_namespaceObject, "VXETable", function() { return VXETable; });
- __webpack_require__.d(all_namespaceObject, "interceptor", function() { return interceptor; });
- __webpack_require__.d(all_namespaceObject, "renderer", function() { return renderer; });
- __webpack_require__.d(all_namespaceObject, "commands", function() { return commands; });
- __webpack_require__.d(all_namespaceObject, "menus", function() { return menus; });
- __webpack_require__.d(all_namespaceObject, "formats", function() { return formats; });
- __webpack_require__.d(all_namespaceObject, "setup", function() { return setup; });
- __webpack_require__.d(all_namespaceObject, "Icon", function() { return Icon; });
- __webpack_require__.d(all_namespaceObject, "Filter", function() { return Filter; });
- __webpack_require__.d(all_namespaceObject, "Edit", function() { return Edit; });
- __webpack_require__.d(all_namespaceObject, "saveFile", function() { return saveLocalFile; });
- __webpack_require__.d(all_namespaceObject, "readFile", function() { return readLocalFile; });
- __webpack_require__.d(all_namespaceObject, "print", function() { return print; });
- __webpack_require__.d(all_namespaceObject, "Export", function() { return Export; });
- __webpack_require__.d(all_namespaceObject, "Keyboard", function() { return Keyboard; });
- __webpack_require__.d(all_namespaceObject, "Validator", function() { return Validator; });
- __webpack_require__.d(all_namespaceObject, "Header", function() { return Header; });
- __webpack_require__.d(all_namespaceObject, "Footer", function() { return Footer; });
- __webpack_require__.d(all_namespaceObject, "Column", function() { return Column; });
- __webpack_require__.d(all_namespaceObject, "Colgroup", function() { return Colgroup; });
- __webpack_require__.d(all_namespaceObject, "Grid", function() { return Grid; });
- __webpack_require__.d(all_namespaceObject, "Menu", function() { return Menu; });
- __webpack_require__.d(all_namespaceObject, "Toolbar", function() { return Toolbar; });
- __webpack_require__.d(all_namespaceObject, "Pager", function() { return Pager; });
- __webpack_require__.d(all_namespaceObject, "Checkbox", function() { return Checkbox; });
- __webpack_require__.d(all_namespaceObject, "CheckboxGroup", function() { return CheckboxGroup; });
- __webpack_require__.d(all_namespaceObject, "Radio", function() { return Radio; });
- __webpack_require__.d(all_namespaceObject, "RadioGroup", function() { return RadioGroup; });
- __webpack_require__.d(all_namespaceObject, "RadioButton", function() { return RadioButton; });
- __webpack_require__.d(all_namespaceObject, "Input", function() { return Input; });
- __webpack_require__.d(all_namespaceObject, "Textarea", function() { return Textarea; });
- __webpack_require__.d(all_namespaceObject, "Button", function() { return Button; });
- __webpack_require__.d(all_namespaceObject, "modal", function() { return modal_modal; });
- __webpack_require__.d(all_namespaceObject, "Modal", function() { return Modal; });
- __webpack_require__.d(all_namespaceObject, "Tooltip", function() { return Tooltip; });
- __webpack_require__.d(all_namespaceObject, "Form", function() { return Form; });
- __webpack_require__.d(all_namespaceObject, "FormItem", function() { return FormItem; });
- __webpack_require__.d(all_namespaceObject, "FormGather", function() { return FormGather; });
- __webpack_require__.d(all_namespaceObject, "Select", function() { return Select; });
- __webpack_require__.d(all_namespaceObject, "Optgroup", function() { return Optgroup; });
- __webpack_require__.d(all_namespaceObject, "Option", function() { return Option; });
- __webpack_require__.d(all_namespaceObject, "Switch", function() { return Switch; });
- __webpack_require__.d(all_namespaceObject, "List", function() { return List; });
- __webpack_require__.d(all_namespaceObject, "Pulldown", function() { return Pulldown; });
- __webpack_require__.d(all_namespaceObject, "Table", function() { return 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: ./node_modules/core-js/modules/es.array.map.js
- var es_array_map = __webpack_require__("d81d");
- // EXTERNAL MODULE: external {"root":"XEUtils","commonjs":"xe-utils","commonjs2":"xe-utils","amd":"xe-utils"}
- var external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_ = __webpack_require__("f0af");
- var external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default = /*#__PURE__*/__webpack_require__.n(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_);
- // 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/conf.js
- var iconPrefix = 'vxe-icon--';
- var GlobalConfig = {
- size: null,
- // 全局尺寸
- zIndex: 100,
- // 全局 zIndex 起始值,如果项目的的 z-index 样式值过大时就需要跟随设置更大,避免被遮挡
- version: 0,
- // 版本号,对于某些带数据缓存的功能有用到,上升版本号可以用于重置数据
- // resizeInterval: 500,
- emptyCell: ' ',
- table: {
- fit: true,
- showHeader: true,
- delayHover: 250,
- // keepSource: 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
- },
- expandConfig: {
- // trigger: 'default',
- showIcon: true
- },
- editConfig: {
- // mode: 'cell',
- showIcon: true,
- showAsterisk: true
- },
- importConfig: {
- modes: ['insert', 'covering']
- },
- exportConfig: {
- modes: ['current', 'selected']
- },
- printConfig: {
- 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
- },
- scrollY: {
- enabled: true,
- gt: 100 // oSize: 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_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 + 'question',
- FORM_SUFFIX: iconPrefix + 'question',
- 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),
- startWeek: 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,
- // storage: false,
- storageKey: 'VXE_MODAL_POSITION'
- },
- list: {
- // size: null,
- scrollY: {
- enabled: true,
- gt: 100 // oSize: 0
- }
- },
- i18n: function i18n(key) {
- return key;
- }
- };
- /* harmony default export */ var conf = (GlobalConfig);
- // 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.regexp.exec.js
- var es_regexp_exec = __webpack_require__("ac1f");
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.split.js
- var es_string_split = __webpack_require__("1276");
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.join.js
- var es_array_join = __webpack_require__("a15b");
- // 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.object.to-string.js
- var es_object_to_string = __webpack_require__("d3b7");
- // 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.string.iterator.js
- var es_string_iterator = __webpack_require__("3ca3");
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.iterator.js
- var es_array_iterator = __webpack_require__("e260");
- // EXTERNAL MODULE: ./node_modules/core-js/modules/web.dom-collections.iterator.js
- var web_dom_collections_iterator = __webpack_require__("ddb0");
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.from.js
- var es_array_from = __webpack_require__("a630");
- // 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");
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.function.name.js
- var es_function_name = __webpack_require__("b0c0");
- // 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();
- }
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.object.assign.js
- var es_object_assign = __webpack_require__("cca6");
- // 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");
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.splice.js
- var es_array_splice = __webpack_require__("a434");
- // 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(name) {
- return this.store[name];
- }
- }, {
- key: "add",
- value: function add(name, render) {
- // 检测是否覆盖
- if (false) {}
- this.store[name] = render;
- return Store;
- }
- }, {
- key: "delete",
- value: function _delete(name) {
- delete this.store[name];
- 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();
- if (false) {}
- // CONCATENATED MODULE: ./packages/tools/src/utils.js
- var zindexIndex = 0;
- var lastZindex = 1;
- 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 = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isBoolean(_vm.visible) ? _vm.visible : true;
- if (false) { var _globalFunc, globalFunc, types; }
- Object.assign(this, {
- // 基本属性
- type: _vm.type,
- property: _vm.field,
- title: _vm.title,
- 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.className,
- headerClassName: _vm.headerClassName,
- footerClassName: _vm.footerClassName,
- formatter: formatter,
- sortable: _vm.sortable,
- sortBy: _vm.sortBy,
- sortType: _vm.sortType,
- sortMethod: _vm.sortMethod,
- remoteSort: _vm.remoteSort,
- filters: UtilTools.getFilters(_vm.filters),
- filterMultiple: external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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,
- 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
- });
- if (proxyOpts && proxyOpts.beforeColumn) {
- proxyOpts.beforeColumn({
- $grid: $xegrid,
- column: this
- });
- }
- }
- _createClass(ColumnInfo, [{
- key: "getTitle",
- value: function getTitle() {
- return UtilTools.getFuncText(this.title || (this.type === 'seq' ? conf.i18n('vxe.table.seqTitle') : ''));
- }
- }, {
- key: "getKey",
- value: function getKey() {
- return this.property || (this.type ? "type=".concat(this.type) : null);
- }
- }, {
- key: "update",
- value: function update(name, value) {
- // 不支持双向的属性
- if (name !== 'filters') {
- if (name === 'field') {
- this.property = value;
- } else {
- this[name] = value;
- }
- }
- }
- }]);
- return ColumnInfo;
- }();
- function isEnableConf(conf) {
- return conf && conf.enabled !== false;
- }
- 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 external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, UtilTools.getRowkey($xetable));
- return 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 ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(property) ? property(params) : property : '';
- },
- getFilters: function getFilters(filters) {
- if (filters && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, column.property);
- },
- setCellValue: function setCellValue(row, column, value) {
- return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 (false) {}
- if (!groupConfig.children) {
- groupConfig.children = [];
- }
- groupConfig.children.splice([].indexOf.call($xecolumn.$el.children, $el), 0, columnConfig);
- } else {
- $xetable.staticColumns.splice([].indexOf.call($xetable.$refs.hideColumn.children, $el), 0, columnConfig);
- }
- },
- // 销毁列
- destroyColumn: function destroyColumn(_vm) {
- var $xetable = _vm.$xetable,
- columnConfig = _vm.columnConfig;
- var matchObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.findTree($xetable.staticColumns, 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;
- },
- parseFile: function parseFile(file) {
- var name = file.name;
- var tIndex = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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));
- }
- };
- /* 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.regexp.to-string.js
- var es_regexp_to_string = __webpack_require__("25f0");
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.match.js
- var es_string_match = __webpack_require__("466d");
- // 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.promise.js
- var es_promise = __webpack_require__("e6cf");
- // CONCATENATED MODULE: ./packages/tools/src/dom.js
- var dom_getRowid = utils.getRowid;
- var browse = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.browse();
- 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 !== document.documentElement && parentElem !== document.body) {
- 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;
- }
- function isScale(val) {
- return val && /^\d+%$/.test(val);
- }
- function hasClass(elem, cls) {
- return elem && elem.className && elem.className.match && elem.className.match(getClsRE(cls));
- }
- function removeClass(elem, cls) {
- if (elem && hasClass(elem, cls)) {
- elem.className = elem.className.replace(getClsRE(cls), '');
- }
- }
- 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
- };
- }
- var DomTools = {
- browse: browse,
- isPx: function isPx(val) {
- return val && /^\d+(px)?$/.test(val);
- },
- isScale: isScale,
- hasClass: hasClass,
- removeClass: removeClass,
- addClass: function addClass(elem, cls) {
- if (elem && !hasClass(elem, cls)) {
- 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("[rowid=\"".concat(dom_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: getDomNode,
- /**
- * 检查触发源是否属于目标节点
- */
- getEventTargetNode: function getEventTargetNode(evnt, container, queryCls, queryMethod) {
- var targetElem;
- var target = evnt.target;
- while (target && target.nodeType && target !== document) {
- if (queryCls && 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 _getDomNode = getDomNode(),
- scrollTop = _getDomNode.scrollTop,
- scrollLeft = _getDomNode.scrollLeft,
- visibleHeight = _getDomNode.visibleHeight,
- visibleWidth = _getDomNode.visibleWidth;
- return {
- boundingTop: boundingTop,
- top: scrollTop + boundingTop,
- boundingLeft: boundingLeft,
- left: scrollLeft + boundingLeft,
- visibleHeight: visibleHeight,
- visibleWidth: visibleWidth
- };
- },
- 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 {
- var excludeHeight = $xetable.getExcludeHeight();
- if (isScale(val)) {
- num = Math.floor((external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toInteger(val) || 1) / 100 * $xetable.parentHeight);
- } else {
- num = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(val);
- }
- num = Math.max(40, num - excludeHeight);
- }
- }
- 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) {
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.throttle(GlobalEvent.trigger, 100, {
- leading: true,
- trailing: false
- }), false);
- }
- /* harmony default export */ var src_event = (GlobalEvent);
- // 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;
- setTimeout(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) {
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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;
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.remove(resize_eventStore, function (item) {
- return item === _this2;
- });
- }
- }]);
- return ResizeObserverPolyfill;
- }();
- function createResizeEvent(callback) {
- if (window.ResizeObserver) {
- return new window.ResizeObserver(callback);
- }
- return new resize_ResizeObserverPolyfill(callback);
- }
- // CONCATENATED MODULE: ./packages/tools/index.js
- /* harmony default export */ var tools = ({
- UtilTools: utils,
- DomTools: dom,
- GlobalEvent: src_event
- });
- // CONCATENATED MODULE: ./packages/v-x-e-table/src/interceptor.js
- function toType(type) {
- return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toValueString(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) {
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.each(map, function (callback, type) {
- return interceptor.add(type, callback);
- });
- return interceptor;
- },
- get: function get(type) {
- return storeMap[toType(type)] || [];
- },
- add: function add(type, callback) {
- type = toType(type); // 检测类型
- if (false) {}
- if (callback && eventTypes.indexOf(type) > -1) {
- var eList = storeMap[type];
- if (!eList) {
- eList = storeMap[type] = [];
- } // 检测重复
- if (false) {}
- eList.push(callback);
- }
- return interceptor;
- },
- delete: function _delete(type, callback) {
- var eList = storeMap[toType(type)];
- if (eList) {
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.remove(eList, function (fn) {
- return fn === callback;
- });
- }
- return interceptor;
- }
- };
- // 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;
- }
- // 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.number.to-fixed.js
- var es_number_to_fixed = __webpack_require__("b680");
- // CONCATENATED MODULE: ./packages/v-x-e-table/src/renderer.js
- var defaultCompProps = {
- transfer: true
- };
- var componentDefaultModelProp = 'value';
- function isEmptyValue(cellValue) {
- return cellValue === null || cellValue === undefined || cellValue === '';
- }
- function getChangeEvent(renderOpts) {
- switch (renderOpts.name) {
- case 'input':
- case 'textarea':
- case '$input':
- case '$textarea':
- return 'input';
- }
- return 'change';
- }
- function parseDate(value, props) {
- return value && props.valueFormat ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 getInputImmediateModel(renderOpts) {
- var name = renderOpts.name,
- immediate = renderOpts.immediate,
- props = renderOpts.props;
- if (!immediate) {
- if (name === '$input') {
- var _ref3 = props || {},
- type = _ref3.type;
- return !(!type || type === 'text' || type === 'number' || type === 'integer' || type === 'float');
- }
- if (name === 'input' || name === 'textarea' || name === '$textarea') {
- return false;
- }
- return true;
- }
- return immediate;
- }
- function isImmediateCell(renderOpts, params) {
- return params.$type === 'cell' || getInputImmediateModel(renderOpts);
- }
- function getCellEditProps(renderOpts, params, value, defaultProps) {
- var vSize = params.$table.vSize;
- return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.assign({
- immediate: getInputImmediateModel(renderOpts)
- }, vSize ? {
- size: vSize
- } : {}, defaultCompProps, defaultProps, renderOpts.props, _defineProperty({}, componentDefaultModelProp, value));
- }
- function getFilterProps(renderOpts, params, value, defaultProps) {
- var vSize = params.$table.vSize;
- return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.assign(vSize ? {
- size: vSize
- } : {}, defaultCompProps, defaultProps, renderOpts.props, _defineProperty({}, componentDefaultModelProp, value));
- }
- function getItemProps(renderOpts, params, value, defaultProps) {
- var vSize = params.$form.vSize;
- return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.assign(vSize ? {
- size: vSize
- } : {}, defaultCompProps, defaultProps, renderOpts.props, _defineProperty({}, componentDefaultModelProp, 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 = {};
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 name = renderOpts.name,
- events = renderOpts.events;
- var modelEvent = 'input';
- var changeEvent = getChangeEvent(renderOpts);
- var isSameEvent = changeEvent === modelEvent;
- var ons = {};
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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(name === '$input' || name === '$textarea' ? targetEvnt.value : 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;
- var name = renderOpts.name;
- var model = column.model;
- var isImmediate = isImmediateCell(renderOpts, params);
- return getOns(renderOpts, params, function (cellValue) {
- // 处理 model 值双向绑定
- if (isImmediate) {
- UtilTools.setCellValue(row, column, cellValue);
- } else {
- model.update = true;
- model.value = cellValue;
- }
- }, function (eventParams) {
- // 处理 change 事件相关逻辑
- if (!isImmediate && (name === '$input' || name === '$textarea')) {
- $table.updateStatus(params, eventParams.value);
- } else {
- $table.updateStatus(params);
- }
- });
- }
- function getFilterOns(renderOpts, params, option) {
- return getOns(renderOpts, params, function (value) {
- // 处理 model 值双向绑定
- option.data = value;
- }, function () {
- handleConfirmFilter(params, !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 值双向绑定
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.set(data, property, value);
- }, function () {
- // 处理 change 事件相关逻辑
- $form.updateStatus(params);
- });
- }
- 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 (isImmediateCell(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, !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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;
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 = isImmediateCell(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: getCellEditProps(renderOpts, params, cellValue),
- on: getEditOns(renderOpts, params),
- nativeOn: getNativeOns(renderOpts, params)
- })];
- }
- function defaultButtonEditRender(h, renderOpts, params) {
- return [h('vxe-button', {
- props: getCellEditProps(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 = isImmediateCell(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: getFilterProps(renderOpts, renderOpts, optionValue),
- on: getFilterOns(renderOpts, params, option)
- });
- });
- }
- function handleFilterMethod(_ref4) {
- var option = _ref4.option,
- row = _ref4.row,
- column = _ref4.column;
- var data = option.data;
- var cellValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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: getCellEditProps(renderOpts, params, cellValue, {
- options: options,
- optionProps: optionProps,
- optionGroups: optionGroups,
- optionGroupProps: optionGroupProps
- }),
- on: getEditOns(renderOpts, params)
- })];
- }
- function getSelectCellValue(renderOpts, _ref5) {
- var row = _ref5.row,
- column = _ref5.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 = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(data, property);
- var name = getDefaultComponentName(renderOpts);
- 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]
- }
- });
- }))];
- }
- /**
- * 内置的组件渲染
- */
- 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 = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toFixed(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.floor(cellValue, digits), digits);
- 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: getFilterProps(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 = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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) {
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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) {
- // 检测是否覆盖
- if (false) {}
- Object.assign(renders, options);
- } else {
- renderMap[name] = options;
- }
- }
- return renderer;
- },
- delete: function _delete(name) {
- delete renderMap[name];
- return renderer;
- }
- };
- // CONCATENATED MODULE: ./packages/v-x-e-table/src/commands.js
- var commands = new store();
- if (false) {}
- // CONCATENATED MODULE: ./packages/v-x-e-table/src/menus.js
- var menus = new store();
- if (false) {}
- // CONCATENATED MODULE: ./packages/v-x-e-table/src/setup.js
- /**
- * 全局参数设置
- */
- function setup(options) {
- return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.merge(conf, options);
- }
- // 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 (false) {}
- VXETable["_".concat(key)] = 1;
- }
- function getExportOrImpotType(types, flag) {
- var rest = [];
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.objectEach(types, function (val, type) {
- if (val === 0 || val === flag) {
- rest.push(type);
- }
- });
- return rest;
- }
- var v_x_e_table_VXETableConfig = /*#__PURE__*/function () {
- function VXETableConfig() {
- _classCallCheck(this, VXETableConfig);
- }
- _createClass(VXETableConfig, [{
- key: "zIndex",
- get:
- /**
- * 获取当前的 zIndex
- */
- function get() {
- return UtilTools.getLastZIndex();
- }
- /**
- * 获取下一个 zIndex
- */
- }, {
- key: "nextZIndex",
- get: function get() {
- return UtilTools.nextZIndex();
- }
- /**
- * 获取所有导出类型
- */
- }, {
- key: "exportTypes",
- get: function get() {
- return getExportOrImpotType(conf.export.types, 1);
- }
- /**
- * 获取所有导入类型
- */
- }, {
- key: "importTypes",
- get: function get() {
- return getExportOrImpotType(conf.export.types, 2);
- }
- }]);
- return VXETableConfig;
- }();
- var v_x_e_table_config = new v_x_e_table_VXETableConfig();
- function t(key, args) {
- return conf.i18n(key, args);
- }
- function _t(key, args) {
- return key ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toValueString(conf.translate ? conf.translate(key, args) : key) : '';
- }
- var v = 'v3';
- var VXETable = {
- v: v,
- reg: reg,
- use: use,
- setup: setup,
- interceptor: interceptor,
- renderer: renderer,
- commands: commands,
- formats: formats,
- menus: menus,
- config: v_x_e_table_config,
- t: t,
- _t: _t
- };
- /* harmony default export */ var v_x_e_table = (VXETable);
- // CONCATENATED MODULE: ./packages/icon/index.js
- var Icon = {
- /* eslint-disable @typescript-eslint/no-empty-function */
- install: function install() {}
- };
- /* harmony default export */ var packages_icon = (Icon);
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.number.constructor.js
- var es_number_constructor = __webpack_require__("a9e3");
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.map.js
- var es_map = __webpack_require__("4ec9");
- // 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.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");
- // CONCATENATED MODULE: ./packages/table/src/util.js
- var lineOffsetSizes = {
- mini: 3,
- small: 2,
- medium: 1
- };
- function getPaddingLeftRightSize(elem) {
- if (elem) {
- var computedStyle = getComputedStyle(elem);
- var paddingLeft = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(computedStyle.paddingLeft);
- var paddingRight = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(computedStyle.paddingRight);
- return paddingLeft + paddingRight;
- }
- return 0;
- }
- function getElemenMarginWidth(elem) {
- if (elem) {
- var computedStyle = getComputedStyle(elem);
- var marginLeft = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(computedStyle.marginLeft);
- var marginRight = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(computedStyle.marginRight);
- return elem.offsetWidth + marginLeft + marginRight;
- }
- return 0;
- }
- function handleFieldOrColumn(_vm, fieldOrColumn) {
- if (fieldOrColumn) {
- return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isString(fieldOrColumn) ? _vm.getColumnByField(fieldOrColumn) : fieldOrColumn;
- }
- return null;
- }
- function queryCellElement(cell, selector) {
- return cell.querySelector('.vxe-cell' + selector);
- }
- function getColMinWidth(params) {
- var $table = params.$table,
- column = params.column,
- cell = params.cell;
- var allColumnHeaderOverflow = $table.showHeaderOverflow,
- resizableOpts = $table.resizableOpts;
- var minWidth = resizableOpts.minWidth;
- if (minWidth) {
- var customMinWidth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(minWidth) ? minWidth(params) : minWidth;
- if (customMinWidth !== 'auto') {
- return Math.max(1, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(customMinWidth));
- }
- }
- var showHeaderOverflow = column.showHeaderOverflow;
- var headOverflow = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isUndefined(showHeaderOverflow) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow;
- var showEllipsis = headOverflow === 'ellipsis';
- var showTitle = headOverflow === 'title';
- var showTooltip = headOverflow === true || headOverflow === 'tooltip';
- var hasEllipsis = showTitle || showTooltip || showEllipsis;
- var minTitleWidth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.floor((external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(getComputedStyle(cell).fontSize) || 14) * 1.6);
- var paddingLeftRight = getPaddingLeftRightSize(cell) + getPaddingLeftRightSize(queryCellElement(cell, ''));
- var colMinWidth = minTitleWidth + paddingLeftRight;
- if (hasEllipsis) {
- var checkboxIconWidth = getPaddingLeftRightSize(queryCellElement(cell, '--title>.vxe-cell--checkbox'));
- var requiredIconWidth = getElemenMarginWidth(queryCellElement(cell, '>.vxe-cell--required-icon'));
- var editIconWidth = getElemenMarginWidth(queryCellElement(cell, '>.vxe-cell--edit-icon'));
- var helpIconWidth = getElemenMarginWidth(queryCellElement(cell, '>.vxe-cell-help-icon'));
- var sortIconWidth = getElemenMarginWidth(queryCellElement(cell, '>.vxe-cell--sort'));
- var filterIconWidth = getElemenMarginWidth(queryCellElement(cell, '>.vxe-cell--filter'));
- colMinWidth += checkboxIconWidth + requiredIconWidth + editIconWidth + helpIconWidth + filterIconWidth + sortIconWidth;
- }
- return colMinWidth;
- }
- 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) {
- return lineOffsetSizes[$xetable.vSize] || 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 mergeBodyMethod(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 clearTableDefaultStatus(_vm) {
- _vm.initStatus = false;
- _vm.clearSort();
- _vm.clearCurrentRow();
- _vm.clearCurrentColumn();
- _vm.clearRadioRow();
- _vm.clearRadioReserve();
- _vm.clearCheckboxRow();
- _vm.clearCheckboxReserve();
- _vm.clearRowExpand();
- _vm.clearTreeExpand();
- _vm.clearTreeExpandReserve();
- if (_vm.clearActived && v_x_e_table._edit) {
- _vm.clearActived();
- }
- if (_vm.clearSelected && (_vm.keyboardConfig || _vm.mouseConfig)) {
- _vm.clearSelected();
- }
- if (_vm.clearCellAreas && _vm.mouseConfig) {
- _vm.clearCellAreas();
- _vm.clearCopyCellArea();
- }
- return _vm.clearScroll();
- }
- function clearTableAllStatus(_vm) {
- if (_vm.clearFilter && v_x_e_table._filter) {
- _vm.clearFilter();
- }
- return clearTableDefaultStatus(_vm);
- }
- // CONCATENATED MODULE: ./packages/table/src/body.js
- var cellType = 'body'; // 滚动、拖动过程中不需要触发
- function isOperateMouse($xetable) {
- return $xetable._isResize || $xetable.lastScrollTime && Date.now() < $xetable.lastScrollTime + $xetable.delayHover;
- }
- function renderLine(h, _vm, $xetable, rowLevel, items, params) {
- var column = params.column;
- var treeOpts = $xetable.treeOpts,
- treeConfig = $xetable.treeConfig;
- var slots = column.slots,
- treeNode = column.treeNode;
- if (slots && slots.line) {
- return $xetable.callSlot(slots.line, params, h);
- }
- if (treeConfig && treeNode && treeOpts.line) {
- return [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")
- }
- })])];
- }
- return [];
- }
- /**
- * 渲染列
- */
- function renderColumn(h, _vm, $xetable, $seq, seq, rowid, fixedType, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, columns, items) {
- var _ref2;
- var 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,
- isAllOverflow = $xetable.isAllOverflow,
- 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,
- tooltipConfig = $xetable.tooltipConfig;
- var type = column.type,
- 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 = isEnableConf(editRender);
- var fixedHiddenColumn = fixedType ? column.fixed !== fixedType : column.fixed && overflowX;
- var cellOverflow = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isUndefined(showOverflow) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNull(showOverflow) ? allColumnOverflow : showOverflow;
- 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 = {
- 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 || tooltipConfig) {
- 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 || tooltipConfig) {
- 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 || tableListeners['cell-click'] || editRender && editConfig || expandOpts.trigger === 'row' || expandOpts.trigger === 'cell' || radioOpts.trigger === 'row' || column.type === 'radio' && radioOpts.trigger === 'cell' || checkboxOpts.trigger === 'row' || column.type === 'checkbox' && checkboxOpts.trigger === 'cell' || treeOpts.trigger === 'row' || column.treeNode && treeOpts.trigger === 'cell') {
- 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 = mergeBodyMethod(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 tdVNs = [];
- if (fixedHiddenColumn && (allColumnOverflow ? isAllOverflow : allColumnOverflow)) {
- tdVNs.push(h('div', {
- class: ['vxe-cell', {
- 'c--title': showTitle,
- 'c--tooltip': showTooltip,
- 'c--ellipsis': showEllipsis
- }]
- }));
- } else {
- // 渲染单元格
- tdVNs.push.apply(tdVNs, _toConsumableArray(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))]));
- if (showValidTip && hasValidError) {
- tdVNs.push(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)]));
- }
- }
- 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 ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(cellStyle) ? cellStyle(params) : cellStyle : null,
- on: tdOns
- }, tdVNs);
- }
- 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,
- editConfig = $xetable.editConfig,
- allColumnOverflow = $xetable.showOverflow,
- treeConfig = $xetable.treeConfig,
- treeOpts = $xetable.treeOpts,
- editOpts = $xetable.editOpts,
- treeExpandeds = $xetable.treeExpandeds,
- scrollYLoad = $xetable.scrollYLoad,
- scrollYStore = $xetable.scrollYStore,
- editStore = $xetable.editStore,
- rowExpandeds = $xetable.rowExpandeds,
- radioOpts = $xetable.radioOpts,
- checkboxOpts = $xetable.checkboxOpts,
- expandColumn = $xetable.expandColumn,
- hasFixedColumn = $xetable.hasFixedColumn;
- 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
- };
- var isNewRow = false;
- if (editConfig) {
- isNewRow = editStore.insertList.indexOf(row) > -1;
- }
- rows.push(h('tr', {
- class: ['vxe-body--row', {
- 'row--stripe': stripe && ($xetable.getVTRowIndex(row) + 1) % 2 === 0,
- 'is--new': isNewRow,
- 'row--new': isNewRow && (editOpts.showStatus || editOpts.showInsertStatus),
- 'row--radio': radioOpts.highlight && $xetable.selectRow === row,
- 'row--checked': checkboxOpts.highlight && $xetable.isCheckedByCheckboxRow(row)
- }, rowClassName ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(rowClassName) ? rowClassName(params) : rowClassName : ''],
- attrs: {
- rowid: rowid
- },
- style: rowStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 cellStyle;
- if (treeConfig) {
- cellStyle = {
- paddingLeft: "".concat(rowLevel * treeOpts.indent + 30, "px")
- };
- }
- var showOverflow = expandColumn.showOverflow;
- var hasEllipsis = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isUndefined(showOverflow) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNull(showOverflow) ? allColumnOverflow : showOverflow;
- var expandParams = {
- $table: $xetable,
- $seq: $seq,
- seq: seq,
- column: expandColumn,
- 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 ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(rowStyle) ? rowStyle(expandParams) : rowStyle : null,
- on: trOn
- }, [h('td', {
- class: ['vxe-body--expanded-column', {
- 'fixed--hidden': fixedType && !hasFixedColumn,
- '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;
- }
- /**
- * 同步滚动条
- */
- 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,
- 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', "-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,
- keyboardConfig = $xetable.keyboardConfig,
- keyboardOpts = $xetable.keyboardOpts,
- mergeList = $xetable.mergeList,
- spanMethod = $xetable.spanMethod,
- scrollXLoad = $xetable.scrollXLoad,
- scrollYLoad = $xetable.scrollYLoad,
- isAllOverflow = $xetable.isAllOverflow,
- emptyRender = $xetable.emptyRender,
- emptyOpts = $xetable.emptyOpts,
- mouseConfig = $xetable.mouseConfig,
- mouseOpts = $xetable.mouseOpts; // 如果是使用优化模式
- if (fixedType) {
- if (!mergeList.length && !spanMethod && !(keyboardConfig && keyboardOpts.isMerge) && (scrollXLoad || scrollYLoad || (allColumnOverflow ? isAllOverflow : allColumnOverflow))) {
- 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
- });
- } 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: {
- xid: 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: {
- xid: 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))]), 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 (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/mixins/size.js
- /* harmony default export */ var size = ({
- computed: {
- vSize: function vSize() {
- var $parent = this.$parent,
- size = this.size;
- return size || $parent && ($parent.size || $parent.vSize);
- }
- }
- });
- // 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.string.trim.js
- var es_string_trim = __webpack_require__("498a");
- // CONCATENATED MODULE: ./packages/table/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 = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isUndefined(showHeaderOverflow) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow;
- 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 $table.callSlot(slots.footer, 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);
- }
- }
- 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':
- 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;
- case 'checkbox':
- 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, $table.callSlot(slots.header, 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));
- }
- }
- 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 $table.callSlot(slots.default, 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'
- }, params));
- }
- }
- var cellValue = $table.getCellLabel(row, column);
- var cellPlaceholder = editRender ? editRender.placeholder : '';
- return [h('span', {
- class: 'vxe-cell--label'
- }, editRender && !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 $table.callSlot(slots.icon, 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 ? $table.callSlot(slots.header, params, h) : UtilTools.formatText(column.getTitle(), 1));
- },
- renderIndexCell: function renderIndexCell(h, params) {
- var $table = params.$table,
- column = params.column;
- var seqOpts = $table.seqOpts;
- var slots = column.slots;
- if (slots && slots.default) {
- return $table.callSlot(slots.default, params, h);
- }
- var $seq = params.$seq,
- seq = params.seq,
- level = params.level;
- var seqMethod = seqOpts.seqMethod;
- return [UtilTools.formatText(seqMethod ? seqMethod(params) : level ? "".concat($seq, ".").concat(seq) : seqOpts.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;
- return renderTitleContent(h, params, slots && slots.header ? $table.callSlot(slots.header, 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({
- row: row
- });
- }
- }
- 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 ? $table.callSlot(slots.default, params, h) : labelField ? [h('span', {
- class: 'vxe-radio--label'
- }, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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;
- var checkboxOpts = $table.checkboxOpts;
- var headerTitle = column.getTitle();
- var isChecked = false;
- var on;
- if (checkboxOpts.checkStrictly ? !checkboxOpts.showHeader : checkboxOpts.showHeader === false) {
- return renderTitleContent(h, params, slots && slots.header ? $table.callSlot(slots.header, 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 ? $table.callSlot(slots.header, 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({
- row: row
- });
- }
- 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 ? $table.callSlot(slots.default, params, h) : labelField ? [h('span', {
- class: 'vxe-checkbox--label'
- }, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, property);
- on = {
- click: function click(evnt) {
- if (!isDisabled) {
- $table.triggerCheckRowEvent(evnt, params, !isChecked);
- }
- }
- };
- if (checkMethod) {
- isDisabled = !checkMethod({
- row: row
- });
- }
- 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 ? $table.callSlot(slots.default, params, h) : labelField ? [h('span', {
- class: 'vxe-checkbox--label'
- }, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 $table.callSlot(slots.icon, 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 ? $table.callSlot(slots.default, params, h) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 && slots.content) {
- return $table.callSlot(slots.content, 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);
- }
- }
- return [];
- },
- /**
- * HTML 标签
- */
- renderHTMLCell: function renderHTMLCell(h, params) {
- var $table = params.$table,
- column = params.column;
- var slots = column.slots;
- if (slots && slots.default) {
- return $table.callSlot(slots.default, 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,
- filters = column.filters,
- editRender = column.editRender;
- var isRequired;
- if (editRules) {
- var columnRules = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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, 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, 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, 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 (isEdit) {
- if (slots && slots.edit) {
- return $table.callSlot(slots.edit, params, h);
- }
- return compConf && compConf.renderEdit ? compConf.renderEdit.call($table, h, editRender, Object.assign({
- $type: 'edit'
- }, params)) : [];
- }
- if (slots && slots.default) {
- return $table.callSlot(slots.default, 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/table/src/methods.js
- var methods_getRowid = UtilTools.getRowid,
- getRowkey = UtilTools.getRowkey,
- methods_setCellValue = UtilTools.setCellValue,
- hasChildrenList = UtilTools.hasChildrenList,
- methods_getColumnList = UtilTools.getColumnList;
- var methods_browse = DomTools.browse,
- methods_calcHeight = DomTools.calcHeight,
- methods_hasClass = DomTools.hasClass,
- addClass = DomTools.addClass,
- methods_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 external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.uniqueId('row_');
- }
- /**
- * 单元格的值为:'' | null | undefined 时都属于空值
- */
- function eqCellNull(cellValue) {
- return cellValue === '' || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eqNull(cellValue);
- }
- function eqCellValue(row1, row2, field) {
- var val1 = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row1, field);
- var val2 = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row2, field);
- if (eqCellNull(val1) && eqCellNull(val2)) {
- return true;
- }
- if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isString(val1) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNumber(val1)) {
- /* eslint-disable eqeqeq */
- return val1 == val2;
- }
- return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 = [];
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 restoreScroll(_vm, scrollLeft, scrollTop) {
- return _vm.clearScroll().then(function () {
- if (scrollLeft || scrollTop) {
- // 重置最后滚动状态
- _vm.lastScrollLeft = 0;
- _vm.lastScrollTop = 0; // 还原滚动状态
- return _vm.scrollTo(scrollLeft, scrollTop);
- }
- });
- }
- function computeVirtualX(_vm) {
- var $refs = _vm.$refs,
- visibleColumn = _vm.visibleColumn;
- var tableBody = $refs.tableBody;
- var tableBodyElem = tableBody ? tableBody.$el : null;
- if (tableBodyElem) {
- var scrollLeft = tableBodyElem.scrollLeft,
- clientWidth = tableBodyElem.clientWidth;
- var endWidth = scrollLeft + clientWidth;
- var toVisibleIndex = -1;
- var cWidth = 0;
- var visibleSize = 0;
- for (var colIndex = 0, colLen = visibleColumn.length; colIndex < colLen; colIndex++) {
- cWidth += visibleColumn[colIndex].renderWidth;
- if (toVisibleIndex === -1 && scrollLeft < cWidth) {
- toVisibleIndex = colIndex;
- }
- if (toVisibleIndex >= 0) {
- visibleSize++;
- if (cWidth > endWidth) {
- break;
- }
- }
- }
- return {
- toVisibleIndex: Math.max(0, toVisibleIndex),
- visibleSize: Math.max(8, visibleSize)
- };
- }
- return {
- toVisibleIndex: 0,
- visibleSize: 8
- };
- }
- function computeVirtualY(_vm) {
- var $refs = _vm.$refs,
- vSize = _vm.vSize,
- rowHeightMaps = _vm.rowHeightMaps;
- var tableHeader = $refs.tableHeader,
- tableBody = $refs.tableBody;
- var tableBodyElem = tableBody ? tableBody.$el : null;
- if (tableBodyElem) {
- var tableHeaderElem = tableHeader ? tableHeader.$el : null;
- var rowHeight = 0;
- var firstTrElem;
- firstTrElem = tableBodyElem.querySelector('tr');
- if (!firstTrElem && tableHeaderElem) {
- firstTrElem = tableHeaderElem.querySelector('tr');
- }
- if (firstTrElem) {
- rowHeight = firstTrElem.clientHeight;
- }
- if (!rowHeight) {
- rowHeight = rowHeightMaps[vSize || 'default'];
- }
- var visibleSize = Math.max(8, Math.ceil(tableBodyElem.clientHeight / rowHeight) + 2);
- return {
- rowHeight: rowHeight,
- visibleSize: visibleSize
- };
- }
- return {
- rowHeight: 0,
- visibleSize: 8
- };
- }
- function calculateMergerOffserIndex(list, offsetItem, type) {
- for (var mcIndex = 0, len = list.length; mcIndex < len; mcIndex++) {
- var mergeItem = list[mcIndex];
- var startIndex = offsetItem.startIndex,
- endIndex = offsetItem.endIndex;
- var mergeStartIndex = mergeItem[type];
- var mergeSpanNumber = mergeItem[type + 'span'];
- var mergeEndIndex = mergeStartIndex + mergeSpanNumber;
- if (mergeStartIndex < startIndex && startIndex < mergeEndIndex) {
- offsetItem.startIndex = mergeStartIndex;
- }
- if (mergeStartIndex < endIndex && endIndex < mergeEndIndex) {
- offsetItem.endIndex = mergeEndIndex;
- }
- if (offsetItem.startIndex !== startIndex || offsetItem.endIndex !== endIndex) {
- mcIndex = -1;
- }
- }
- }
- 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 (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNumber(row)) {
- row = rowList[row];
- }
- if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNumber(col)) {
- col = visibleColumn[col];
- }
- if ((rowList ? row : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNumber(row)) && col && (rowspan || colspan)) {
- rowspan = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(rowspan) || 1;
- colspan = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(colspan) || 1;
- if (rowspan > 1 || colspan > 1) {
- var mcIndex = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(merges)) {
- merges = [merges];
- }
- merges.forEach(function (item) {
- var row = item.row,
- col = item.col;
- if (rowList && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNumber(row)) {
- row = rowList[row];
- }
- if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNumber(col)) {
- col = visibleColumn[col];
- }
- var mcIndex = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 clearAllSort(_vm) {
- _vm.tableFullColumn.forEach(function (column) {
- column.order = null;
- });
- }
- function getOrderField(_vm, column) {
- var sortBy = column.sortBy,
- sortType = column.sortType;
- return function (row) {
- var cellValue;
- if (sortBy) {
- cellValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(sortBy) ? sortBy({
- row: row,
- column: column
- }) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, sortBy);
- } else {
- cellValue = _vm.getCellLabel(row, column);
- }
- if (!sortType || sortType === 'auto') {
- return isNaN(cellValue) ? cellValue : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(cellValue);
- } else if (sortType === 'number') {
- return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(cellValue);
- } else if (sortType === 'string') {
- return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toValueString(cellValue);
- }
- return cellValue;
- };
- }
- var Methods = {
- callSlot: function callSlot(slotFunc, params, h, vNodes) {
- if (slotFunc) {
- var $xegrid = this.$xegrid;
- if ($xegrid) {
- return $xegrid.callSlot(slotFunc, params, h, vNodes);
- }
- if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(slotFunc)) {
- return slotFunc.call(this, params, h, vNodes);
- }
- }
- return [];
- },
- /**
- * 获取父容器元素
- */
- getParentElem: function getParentElem() {
- var $el = this.$el,
- $xegrid = this.$xegrid;
- return $xegrid ? $xegrid.$el.parentNode : $el.parentNode;
- },
- /**
- * 获取父容器的高度
- */
- getParentHeight: function getParentHeight() {
- var $el = this.$el,
- $xegrid = this.$xegrid;
- return Math.floor($xegrid ? $xegrid.getParentHeight() : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(getComputedStyle($el.parentNode).height));
- },
- /**
- * 获取需要排除的高度
- * 但渲染表格高度时,需要排除工具栏或分页等相关组件的高度
- * 如果存在表尾合计滚动条,则需要排除滚动条高度
- */
- getExcludeHeight: function getExcludeHeight() {
- var $xegrid = this.$xegrid;
- return $xegrid ? $xegrid.getExcludeHeight() : 0;
- },
- /**
- * 重置表格的一切数据状态
- */
- clearAll: function clearAll() {
- return clearTableAllStatus(this);
- },
- /**
- * 同步 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, scrollYStore.endIndex) : 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,
- scrollXStore = this.scrollXStore,
- lastScrollLeft = this.lastScrollLeft,
- lastScrollTop = this.lastScrollTop;
- var tableFullData = datas ? datas.slice(0) : [];
- var scrollYLoad = !treeConfig && sYOpts.enabled && sYOpts.gt > -1 && sYOpts.gt < tableFullData.length;
- scrollYStore.startIndex = 0;
- scrollYStore.endIndex = 1;
- scrollXStore.startIndex = 0;
- scrollXStore.endIndex = 1;
- editStore.insertList = [];
- editStore.removeList = []; // 全量数据
- this.tableFullData = tableFullData; // 缓存数据
- this.updateCache(true); // 原始数据
- this.tableSynchData = datas;
- if (keepSource) {
- this.tableSourceData = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.clone(tableFullData, true);
- }
- this.scrollYLoad = scrollYLoad;
- if (false) {}
- this.clearMergeCells();
- this.clearMergeFooterItems();
- this.handleTableData(true);
- this.updateFooter();
- return this.$nextTick().then(function () {
- _this2.updateHeight();
- _this2.updateStyle();
- }).then(function () {
- _this2.computeScrollLoad();
- }).then(function () {
- // 是否加载了数据
- if (scrollYLoad) {
- scrollYStore.endIndex = scrollYStore.visibleSize;
- }
- _this2.handleReserveStatus();
- _this2.checkSelectionStatus();
- return _this2.$nextTick().then(function () {
- return _this2.recalculate();
- }).then(function () {
- return restoreScroll(_this2, lastScrollLeft, lastScrollTop);
- });
- });
- },
- /**
- * 重新加载数据,不会清空表格状态
- * @param {Array} datas 数据
- */
- loadData: function loadData(datas) {
- var _this3 = this;
- var inited = this.inited,
- initStatus = this.initStatus;
- return this.loadTableData(datas).then(function () {
- _this3.inited = true;
- _this3.initStatus = true;
- if (!initStatus) {
- _this3.handleLoadDefaults();
- }
- if (!inited) {
- _this3.handleInitDefaults();
- }
- return _this3.recalculate();
- });
- },
- /**
- * 重新加载数据,会清空表格状态
- * @param {Array} datas 数据
- */
- reloadData: function reloadData(datas) {
- var _this4 = this;
- var inited = this.inited;
- return this.clearAll().then(function () {
- _this4.inited = true;
- _this4.initStatus = true;
- return _this4.loadTableData(datas);
- }).then(function () {
- _this4.handleLoadDefaults();
- if (!inited) {
- _this4.handleInitDefaults();
- }
- return _this4.recalculate();
- });
- },
- /**
- * 局部加载行数据并恢复到初始状态
- * 对于行数据需要局部更改的场景中可能会用到
- * @param {Row} row 行对象
- * @param {Object} record 新数据
- * @param {String} field 字段名
- */
- reloadRow: function reloadRow(row, record, field) {
- var keepSource = this.keepSource,
- tableSourceData = this.tableSourceData,
- tableData = this.tableData;
- if (keepSource) {
- var rowIndex = this.getRowIndex(row);
- var oRow = tableSourceData[rowIndex];
- if (oRow && row) {
- if (field) {
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.set(oRow, field, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(record || row, field));
- } else {
- if (record) {
- tableSourceData[rowIndex] = record;
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.clear(row, undefined);
- Object.assign(row, this.defineField(Object.assign({}, record)));
- this.updateCache(true);
- } else {
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.destructuring(oRow, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.clone(row, true));
- }
- }
- }
- this.tableData = tableData.slice(0);
- } else {
- if (false) {}
- }
- return this.$nextTick();
- },
- /**
- * 加载列配置
- * 对于表格列需要重载、局部递增场景下可能会用到
- * @param {ColumnInfo} columns 列配置
- */
- loadColumn: function loadColumn(columns) {
- var _this5 = this;
- var collectColumn = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.mapTree(columns, function (column) {
- return src_cell.createColumn(_this5, column);
- });
- this.handleColumn(collectColumn);
- return this.$nextTick();
- },
- /**
- * 加载列配置并恢复到初始状态
- * 对于表格列需要重载、局部递增场景下可能会用到
- * @param {ColumnInfo} columns 列配置
- */
- reloadColumn: function reloadColumn(columns) {
- var _this6 = this;
- return this.clearAll().then(function () {
- return _this6.loadColumn(columns);
- });
- },
- handleColumn: function handleColumn(collectColumn) {
- var _this7 = this;
- this.collectColumn = collectColumn;
- var tableFullColumn = methods_getColumnList(collectColumn);
- this.tableFullColumn = tableFullColumn;
- this.cacheColumnMap();
- this.restoreCustomStorage();
- this.refreshColumn().then(function () {
- if (_this7.scrollXLoad) {
- _this7.loadScrollXData(true);
- }
- });
- this.clearMergeCells();
- this.clearMergeFooterItems();
- this.handleTableData(true);
- if (false) {}
- this.$nextTick(function () {
- if (_this7.$toolbar) {
- _this7.$toolbar.syncUpdate({
- collectColumn: collectColumn,
- $table: _this7
- });
- }
- });
- },
- /**
- * 更新数据行的 Map
- * 牺牲数据组装的耗时,用来换取使用过程中的流畅
- */
- updateCache: function updateCache(source) {
- var _this8 = 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(_this8, row);
- if (!rowid) {
- rowid = getRowUniqueId();
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.set(row, rowkey, rowid);
- }
- if (isLazy && row[treeOpts.hasChild] && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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) {
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(tableFullData, handleCache, treeOpts);
- } else {
- tableFullData.forEach(handleCache);
- }
- },
- loadChildren: function loadChildren(row, childRecords) {
- var _this9 = this;
- return this.createData(childRecords).then(function (rows) {
- var keepSource = _this9.keepSource,
- tableSourceData = _this9.tableSourceData,
- treeOpts = _this9.treeOpts,
- fullDataRowIdData = _this9.fullDataRowIdData,
- fullDataRowMap = _this9.fullDataRowMap,
- fullAllDataRowMap = _this9.fullAllDataRowMap,
- fullAllDataRowIdData = _this9.fullAllDataRowIdData;
- var children = treeOpts.children;
- if (keepSource) {
- var rowid = methods_getRowid(_this9, row);
- var matchObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.findTree(tableSourceData, function (item) {
- return rowid === methods_getRowid(_this9, item);
- }, treeOpts);
- if (matchObj) {
- matchObj.item[children] = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.clone(rows, true);
- }
- }
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(rows, function (childRow, index, items, path, parent) {
- var rowid = methods_getRowid(_this9, 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 _this10 = this;
- var tableFullColumn = this.tableFullColumn,
- collectColumn = this.collectColumn,
- fullColumnMap = this.fullColumnMap,
- showOverflow = this.showOverflow;
- var fullColumnIdData = this.fullColumnIdData = {};
- var fullColumnFieldData = this.fullColumnFieldData = {};
- var isGroup = collectColumn.some(hasChildrenList);
- var isAllOverflow = !!showOverflow;
- 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 (false) {}
- fullColumnFieldData[property] = rest;
- }
- if (!hasFixed && fixed) {
- hasFixed = fixed;
- }
- if (treeNode) {
- if (false) {}
- if (!treeNodeColumn) {
- treeNodeColumn = column;
- }
- } else if (type === 'expand') {
- if (false) {}
- if (!expandColumn) {
- expandColumn = column;
- }
- }
- if (false) {}
- if (false) {}
- if (isAllOverflow && column.showOverflow === false) {
- isAllOverflow = false;
- }
- if (fullColumnIdData[colid]) {
- UtilTools.error('vxe.error.colRepet', ['colId', colid]);
- }
- fullColumnIdData[colid] = rest;
- fullColumnMap.set(column, rest);
- };
- fullColumnMap.clear();
- if (isGroup) {
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 (false) {}
- this.isGroup = isGroup;
- this.treeNodeColumn = treeNodeColumn;
- this.expandColumn = expandColumn;
- this.isAllOverflow = isAllOverflow;
- },
- /**
- * 根据 tr 元素获取对应的 row 信息
- * @param {Element} tr 元素
- */
- getRowNode: function getRowNode(tr) {
- if (tr) {
- var fullAllDataRowIdData = this.fullAllDataRowIdData;
- var rowid = tr.getAttribute('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('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) {
- if (false) {}
- return this.getVTRowIndex(row);
- },
- /**
- * 根据 row 获取渲染中的虚拟索引
- * @param {Row} row 行对象
- */
- getVMRowIndex: function getVMRowIndex(row) {
- return this.tableData.indexOf(row);
- },
- // 在 v3 中废弃
- $getRowIndex: function $getRowIndex(row) {
- if (false) {}
- 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) {
- if (false) {}
- return this.getVTColumnIndex(column);
- },
- /**
- * 根据 column 获取渲染中的虚拟索引
- * @param {ColumnInfo} column 列配置
- */
- getVMColumnIndex: function getVMColumnIndex(column) {
- return this.tableColumn.indexOf(column);
- },
- // 在 v3 中废弃
- $getColumnIndex: function $getColumnIndex(column) {
- if (false) {}
- return this.getVMColumnIndex(column);
- },
- /**
- * 判断是否为索引列
- * @param {ColumnInfo} column 列配置
- */
- isSeqColumn: function isSeqColumn(column) {
- return column && column.type === 'seq';
- },
- /**
- * 定义行数据中的列属性,如果不存在则定义
- * @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 && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.has(record, property)) {
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.set(record, property, editRender && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isUndefined(editRender.defaultValue) ? editRender.defaultValue : null);
- }
- });
- var ohterFields = [radioOpts.labelField, checkboxOpts.checkField, checkboxOpts.labelField, expandOpts.labelField];
- ohterFields.forEach(function (key) {
- if (key && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(record, key)) {
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.set(record, key, null);
- }
- });
- if (treeConfig && treeOpts.lazy && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isUndefined(record[treeOpts.children])) {
- record[treeOpts.children] = null;
- } // 必须有行数据的唯一主键,可以自行设置;也可以默认生成一个随机数
- if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(record, rowkey)) {
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.set(record, rowkey, getRowUniqueId());
- }
- return record;
- },
- /**
- * 创建 data 对象
- * 对于某些特殊场景可能会用到,会自动对数据的字段名进行检测,如果不存在就自动定义
- * @param {Array} records 新数据
- */
- createData: function createData(records) {
- var _this11 = this;
- var treeConfig = this.treeConfig,
- treeOpts = this.treeOpts;
- var handleRrecord = function handleRrecord(record) {
- return _this11.defineField(Object.assign({}, record));
- };
- var rows = treeConfig ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 _this12 = this;
- var isArr = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(records);
- if (!isArr) {
- records = [records];
- }
- return this.$nextTick().then(function () {
- return _this12.createData(records).then(function (rows) {
- return isArr ? rows : rows[0];
- });
- });
- },
- /**
- * 还原数据
- * 如果不传任何参数,则还原整个表格
- * 如果传 row 则还原一行
- * 如果传 rows 则还原多行
- * 如果还额外传了 field 则还原指定的单元格数据
- */
- revertData: function revertData(rows, field) {
- var _this13 = this;
- var keepSource = this.keepSource,
- tableSourceData = this.tableSourceData,
- treeConfig = this.treeConfig;
- if (keepSource) {
- if (arguments.length) {
- if (rows && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(rows)) {
- rows = [rows];
- }
- rows.forEach(function (row) {
- if (!_this13.isInsertByRow(row)) {
- var rowIndex = _this13.getRowIndex(row);
- if (treeConfig && rowIndex === -1) {
- throw new Error(UtilTools.getLog('vxe.error.noTree', ['revertData']));
- }
- var oRow = tableSourceData[rowIndex];
- if (oRow && row) {
- if (field) {
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.set(row, field, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.clone(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(oRow, field), true));
- } else {
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.destructuring(row, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.clone(oRow, true));
- }
- }
- }
- });
- return this.$nextTick();
- }
- return this.reloadData(tableSourceData);
- } else {
- if (false) {}
- }
- return this.$nextTick();
- },
- /**
- * 清空单元格内容
- * 如果不创参数,则清空整个表格内容
- * 如果传 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 && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(rows)) {
- rows = [rows];
- }
- if (field) {
- rows.forEach(function (row) {
- return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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;
- },
- /**
- * 检查行或列数据是否发生改变
- * @param {Row} row 行对象
- * @param {String} field 字段名
- */
- isUpdateByRow: function isUpdateByRow(row, field) {
- var _this14 = 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 = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.findTree(tableSourceData, function (item) {
- return rowid === methods_getRowid(_this14, 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 external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isUndefined(columnIndex) ? columns.slice(0) : columns[columnIndex];
- },
- /**
- * 根据列的唯一主键获取列
- * @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)
- };
- },
- /**
- * 获取数据,和 data 的行为一致,也可以指定索引获取数据
- */
- getData: function getData(rowIndex) {
- var tableSynchData = this.data || this.tableSynchData;
- return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isUndefined(rowIndex) ? tableSynchData.slice(0) : tableSynchData[rowIndex];
- },
- /**
- * 用于多选行,获取已选中的数据
- */
- 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 = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.filterTree(tableFullData, function (row) {
- return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, property);
- }, treeOpts);
- } else {
- rowList = tableFullData.filter(function (row) {
- return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, property);
- });
- }
- } else {
- var selection = this.selection;
- if (treeConfig) {
- rowList = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 _this15 = this;
- var visibleColumn = this.visibleColumn,
- tableFullData = this.tableFullData,
- filterOpts = this.filterOpts,
- sortOpts = this.sortOpts;
- var allRemoteFilter = filterOpts.remote,
- allFilterMethod = filterOpts.filterMethod;
- var allRemoteSort = sortOpts.remote,
- allSortMethod = sortOpts.sortMethod,
- sortMultiple = sortOpts.multiple;
- var tableData = tableFullData.slice(0);
- var filterColumns = [];
- var orderColumns = [];
- visibleColumn.forEach(function (column) {
- var sortable = column.sortable,
- order = column.order,
- filters = column.filters;
- if (!allRemoteFilter && filters && filters.length) {
- var valueList = [];
- var itemList = [];
- filters.forEach(function (item) {
- if (item.checked) {
- itemList.push(item);
- valueList.push(item.value);
- }
- });
- if (itemList.length) {
- filterColumns.push({
- column: column,
- valueList: valueList,
- itemList: itemList
- });
- }
- }
- if (!allRemoteSort && sortable && order) {
- orderColumns.push({
- column: column,
- sortBy: column.sortBy,
- property: column.property,
- order: 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 && !allRemoteFilter) {
- var filterMethod = column.filterMethod,
- filterRender = column.filterRender;
- var compConf = filterRender ? v_x_e_table.renderer.get(filterRender.name) : null;
- var compFilterMethod = compConf && compConf.renderFilter ? compConf.filterMethod : null;
- if (filterMethod) {
- return itemList.some(function (item) {
- return filterMethod({
- value: item.value,
- option: item,
- row: row,
- column: column,
- $table: _this15
- });
- });
- } else if (compFilterMethod) {
- return itemList.some(function (item) {
- return compFilterMethod({
- value: item.value,
- option: item,
- row: row,
- column: column,
- $table: _this15
- });
- });
- } else if (allFilterMethod) {
- return allFilterMethod({
- options: itemList,
- values: valueList,
- row: row,
- column: column
- });
- }
- return valueList.indexOf(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, column.property)) > -1;
- }
- return true;
- });
- });
- }
- var firstOrderColumn = orderColumns[0];
- if (!allRemoteSort && firstOrderColumn) {
- if (allSortMethod) {
- var sortRests = allSortMethod({
- data: tableData,
- column: firstOrderColumn.column,
- property: firstOrderColumn.property,
- order: firstOrderColumn.order,
- sortList: orderColumns,
- $table: this
- });
- tableData = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(sortRests) ? sortRests : tableData;
- } else {
- // 兼容 v4
- if (sortMultiple) {
- tableData = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.orderBy(tableData, orderColumns.map(function (_ref3) {
- var column = _ref3.column,
- order = _ref3.order;
- return [getOrderField(_this15, column), order];
- }));
- } else {
- // 兼容 v2,在 v4 中废弃, sortBy 不能为数组
- var sortByConfs;
- if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(firstOrderColumn.sortBy)) {
- sortByConfs = firstOrderColumn.sortBy.map(function (item) {
- return [item, firstOrderColumn.order];
- });
- }
- tableData = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.orderBy(tableData, sortByConfs || [firstOrderColumn].map(function (_ref4) {
- var column = _ref4.column,
- order = _ref4.order;
- return [getOrderField(_this15, column), order];
- }));
- }
- }
- }
- 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)
- };
- },
- /**
- * 处理数据加载默认行为
- * 默认执行一次,除非被重置
- */
- handleLoadDefaults: function handleLoadDefaults() {
- var _this16 = this;
- if (this.checkboxConfig) {
- this.handleDefaultSelectionChecked();
- }
- if (this.radioConfig) {
- this.handleDefaultRadioChecked();
- }
- 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(_this16.recalculate);
- });
- },
- /**
- * 处理初始化的默认行为
- * 只会执行一次
- */
- handleInitDefaults: function handleInitDefaults() {
- var sortConfig = this.sortConfig;
- if (sortConfig) {
- this.handleDefaultSort();
- }
- },
- /**
- * 隐藏指定列
- */
- hideColumn: function hideColumn(fieldOrColumn) {
- var column = handleFieldOrColumn(this, fieldOrColumn);
- if (column) {
- column.visible = false;
- }
- return this.handleCustom();
- },
- /**
- * 显示指定列
- */
- showColumn: function showColumn(fieldOrColumn) {
- var column = handleFieldOrColumn(this, fieldOrColumn);
- if (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();
- },
- /**
- * 还原自定义列操作状态
- */
- restoreCustomStorage: function restoreCustomStorage() {
- var id = this.id,
- collectColumn = this.collectColumn,
- customConfig = this.customConfig,
- customOpts = this.customOpts;
- var storage = customOpts.storage;
- var isAllStorage = customOpts.storage === true;
- var isResizable = isAllStorage || storage && storage.resizable;
- var isVisible = isAllStorage || storage && storage.visible;
- if (customConfig && (isResizable || isVisible)) {
- var customMap = {};
- if (!id) {
- UtilTools.error('vxe.error.reqProp', ['id']);
- return;
- }
- if (isResizable) {
- var columnWidthStorage = getCustomStorageMap(resizableStorageKey)[id];
- if (columnWidthStorage) {
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 = {};
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(collectColumn, function (column) {
- var colKey = column.getKey();
- if (colKey) {
- keyMap[colKey] = column;
- }
- });
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.each(customMap, function (_ref5, field) {
- var visible = _ref5.visible,
- resizeWidth = _ref5.resizeWidth;
- var column = keyMap[field];
- if (column) {
- if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNumber(resizeWidth)) {
- column.resizeWidth = resizeWidth;
- }
- if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isBoolean(visible)) {
- column.visible = visible;
- }
- }
- });
- }
- },
- saveCustomVisible: function saveCustomVisible() {
- var id = this.id,
- 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;
- if (customConfig && isVisible) {
- var columnVisibleStorageMap = getCustomStorageMap(visibleStorageKey);
- var colHides = [];
- var colShows = [];
- if (!id) {
- UtilTools.error('vxe.error.reqProp', ['id']);
- return;
- }
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toJSONString(columnVisibleStorageMap));
- }
- },
- saveCustomResizable: function saveCustomResizable(isReset) {
- var id = this.id,
- collectColumn = this.collectColumn,
- customConfig = this.customConfig,
- customOpts = this.customOpts;
- var storage = customOpts.storage;
- var isAllStorage = customOpts.storage === true;
- var isResizable = isAllStorage || storage && storage.resizable;
- if (customConfig && isResizable) {
- var columnWidthStorageMap = getCustomStorageMap(resizableStorageKey);
- var columnWidthStorage;
- if (!id) {
- UtilTools.error('vxe.error.reqProp', ['id']);
- return;
- }
- if (!isReset) {
- columnWidthStorage = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isPlainObject(columnWidthStorageMap[id]) ? columnWidthStorageMap[id] : {};
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(collectColumn, function (column) {
- if (column.resizeWidth) {
- var colKey = column.getKey();
- if (colKey) {
- columnWidthStorage[colKey] = column.renderWidth;
- }
- }
- });
- }
- columnWidthStorageMap[id] = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isEmpty(columnWidthStorage) ? undefined : columnWidthStorage;
- localStorage.setItem(resizableStorageKey, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toJSONString(columnWidthStorageMap));
- }
- },
- /**
- * 刷新列信息
- * 将固定的列左边、右边分别靠边
- */
- refreshColumn: function refreshColumn() {
- var _this17 = 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 = [];
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 = !!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 scrollXLoad = sXOpts.enabled && sXOpts.gt > -1 && sXOpts.gt < tableFullColumn.length;
- this.hasFixedColumn = leftList.length > 0 || rightList.length > 0;
- Object.assign(columnStore, {
- leftList: leftList,
- centerList: centerList,
- rightList: rightList
- });
- if (scrollXLoad && isGroup) {
- scrollXLoad = false;
- if (false) {}
- }
- if (scrollXLoad) {
- if (false) {}
- var _computeVirtualX = computeVirtualX(this),
- visibleSize = _computeVirtualX.visibleSize;
- scrollXStore.startIndex = 0;
- scrollXStore.endIndex = visibleSize;
- scrollXStore.visibleSize = visibleSize;
- } // 如果列被显示/隐藏,则清除合并状态
- // 如果列被设置为固定,则清除合并状态
- if (visibleColumn.length !== this.visibleColumn.length || !this.visibleColumn.every(function (column, index) {
- return column === visibleColumn[index];
- })) {
- this.clearMergeCells();
- this.clearMergeFooterItems();
- }
- this.scrollXLoad = scrollXLoad;
- this.visibleColumn = visibleColumn;
- this.handleTableColumn();
- return this.$nextTick().then(function () {
- _this17.updateFooter();
- return _this17.recalculate(true);
- }).then(function () {
- _this17.updateCellAreas();
- return _this17.$nextTick().then(function () {
- return _this17.recalculate();
- });
- });
- },
- /**
- * 指定列宽的列进行拆分
- */
- analyColumnWidth: function analyColumnWidth() {
- var columnOpts = this.columnOpts;
- var defaultWidth = columnOpts.width,
- defaultMinWidth = columnOpts.minWidth;
- 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 lastScrollLeft = this.lastScrollLeft,
- lastScrollTop = this.lastScrollTop;
- return restoreScroll(this, lastScrollLeft, lastScrollTop);
- },
- /**
- * 计算单元格列宽,动态分配可用剩余空间
- * 支持 width=? width=?px width=?% min-width=? min-width=?px min-width=?%
- */
- recalculate: function recalculate(refull) {
- var _this18 = 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 () {
- _this18.autoCellWidth(headerElem, bodyElem, footerElem);
- return _this18.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 - 1;
- 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 - bodyElem.clientWidth : 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.updateHeight();
- this.parentHeight = Math.max(this.headerHeight + this.footerHeight + 20, this.getParentHeight());
- if (this.overflowX) {
- this.checkScrolling();
- }
- },
- updateHeight: function updateHeight() {
- this.customHeight = methods_calcHeight(this, 'height');
- this.customMaxHeight = methods_calcHeight(this, 'maxHeight');
- },
- updateStyle: function updateStyle() {
- var _this19 = 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,
- keyboardConfig = this.keyboardConfig,
- keyboardOpts = this.keyboardOpts,
- spanMethod = this.spanMethod,
- mergeList = this.mergeList,
- mergeFooterList = this.mergeFooterList,
- footerSpanMethod = this.footerSpanMethod,
- isAllOverflow = this.isAllOverflow;
- 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; // 如果是使用优化模式
- var isOptimize = false;
- if (!isGroup) {
- if (fixedType) {
- if (scrollXLoad || allColumnHeaderOverflow) {
- isOptimize = true;
- }
- }
- }
- if (isOptimize) {
- tableColumn = fixedColumn;
- }
- if (isOptimize || scrollXLoad) {
- 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) {
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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) {
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.arrayEach(listElem.querySelectorAll('.col--group'), function (thElem) {
- var colNode = _this19.getColumnNode(thElem);
- if (colNode) {
- var column = colNode.item;
- var showHeaderOverflow = column.showHeaderOverflow;
- var cellOverflow = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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) {
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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) {
- 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; // 如果是使用优化模式
- var _isOptimize = false;
- if (fixedType) {
- if (!mergeList.length && !spanMethod && !(keyboardConfig && keyboardOpts.isMerge) && (scrollXLoad || scrollYLoad || (allColumnOverflow ? isAllOverflow : allColumnOverflow))) {
- _isOptimize = true;
- }
- }
- if (_isOptimize) {
- tableColumn = fixedColumn;
- }
- if (_isOptimize || scrollXLoad) {
- _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; // 如果是使用优化模式
- var _isOptimize2 = false;
- if (fixedType) {
- if ((!mergeFooterList.length || !footerSpanMethod) && (scrollXLoad || allColumnFooterOverflow)) {
- _isOptimize2 = true;
- }
- }
- if (_isOptimize2) {
- tableColumn = fixedColumn;
- }
- if (_isOptimize2 || scrollXLoad) {
- _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") : '';
- }
- }
- var colgroupElem = elemStore["".concat(name, "-").concat(layout, "-colgroup")];
- if (colgroupElem) {
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isUndefined(showHeaderOverflow) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow;
- } else if (layout === 'footer') {
- cellOverflow = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isUndefined(showFooterOverflow) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNull(showFooterOverflow) ? allColumnFooterOverflow : showFooterOverflow;
- } else {
- cellOverflow = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isUndefined(showOverflow) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNull(showOverflow) ? allColumnOverflow : showOverflow;
- }
- 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) {
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 = _this19.getColumnIndex(column);
- for (var _index = 1; _index < colspan; _index++) {
- var nextColumn = _this19.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 _this20 = this;
- var evntList = v_x_e_table.interceptor.get(type);
- var rest;
- if (!evntList.some(function (func) {
- return func(Object.assign({
- $grid: _this20.$xegrid,
- $table: _this20,
- $event: evnt
- }, args)) === false;
- })) {
- if (next) {
- rest = next();
- }
- }
- if (end) {
- end();
- }
- return rest;
- },
- /**
- * 全局按下事件处理
- */
- handleGlobalMousedownEvent: function handleGlobalMousedownEvent(evnt) {
- var _this21 = this;
- var $el = this.$el,
- $refs = this.$refs,
- $xegrid = this.$xegrid,
- $toolbar = this.$toolbar,
- mouseConfig = this.mouseConfig,
- editStore = this.editStore,
- ctxMenuStore = this.ctxMenuStore,
- editOpts = this.editOpts,
- filterStore = this.filterStore,
- getRowNode = this.getRowNode;
- var actived = editStore.actived;
- var ctxWrapper = $refs.ctxWrapper,
- filterWrapper = $refs.filterWrapper,
- validTip = $refs.validTip;
- 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 && _this21.height && !_this21.overflowY) {
- var bodyWrapperElem = evnt.target;
- if (methods_hasClass(bodyWrapperElem, 'vxe-table--body-wrapper')) {
- isClearActived = evnt.offsetY < bodyWrapperElem.clientHeight;
- }
- }
- if (isClearActived || // 如果点击了当前表格之外
- !getEventTargetNode(evnt, $el).flag) {
- setTimeout(function () {
- return _this21.clearActived(evnt);
- });
- }
- });
- }
- }
- }
- }
- } else if (mouseConfig) {
- if (!getEventTargetNode(evnt, $el).flag && !($xegrid && getEventTargetNode(evnt, $xegrid.$el).flag) && !(ctxWrapper && getEventTargetNode(evnt, ctxWrapper.$el).flag) && !($toolbar && getEventTargetNode(evnt, $toolbar.$el).flag)) {
- this.clearSelected();
- if (!getEventTargetNode(evnt, document.body, 'vxe-table--ignore-areas-clear').flag) {
- this.preventEvent(evnt, 'event.clearAreas', {}, function () {
- _this21.clearCellAreas();
- _this21.clearCopyCellArea();
- });
- }
- }
- } // 如果配置了快捷菜单且,点击了其他地方则关闭
- if (ctxMenuStore.visible && ctxWrapper && !getEventTargetNode(evnt, 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 _this22 = this;
- // 该行为只对当前激活的表格有效
- if (this.isActivated) {
- this.preventEvent(evnt, 'event.keydown', null, function () {
- var filterStore = _this22.filterStore,
- isCtxMenu = _this22.isCtxMenu,
- ctxMenuStore = _this22.ctxMenuStore,
- editStore = _this22.editStore,
- editOpts = _this22.editOpts,
- editConfig = _this22.editConfig,
- mouseConfig = _this22.mouseConfig,
- mouseOpts = _this22.mouseOpts,
- keyboardConfig = _this22.keyboardConfig,
- keyboardOpts = _this22.keyboardOpts,
- treeConfig = _this22.treeConfig,
- treeOpts = _this22.treeOpts,
- highlightCurrentRow = _this22.highlightCurrentRow,
- currentRow = _this22.currentRow,
- bodyCtxMenu = _this22.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 isF2 = keyCode === 113;
- var isContextMenu = keyCode === 93;
- var hasMetaKey = evnt.metaKey;
- var hasCtrlKey = evnt.ctrlKey;
- var hasShiftKey = evnt.shiftKey;
- var hasAltKey = evnt.altKey;
- 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) {
- _this22.closeFilter();
- }
- return;
- }
- if (operCtxMenu) {
- // 如果配置了右键菜单; 支持方向键操作、回车
- evnt.preventDefault();
- if (ctxMenuStore.showChild && hasChildrenList(ctxMenuStore.selected)) {
- _this22.moveCtxMenu(evnt, keyCode, ctxMenuStore, 'selectChild', 37, false, ctxMenuStore.selected.children);
- } else {
- _this22.moveCtxMenu(evnt, keyCode, ctxMenuStore, 'selected', 39, true, _this22.ctxMenuList);
- }
- } else if (keyboardConfig && mouseConfig && mouseOpts.area && _this22.handleKeyboardEvent) {
- _this22.handleKeyboardEvent(evnt);
- } else if (keyboardConfig && isSpacebar && keyboardOpts.isChecked && selected.row && selected.column && (selected.column.type === 'checkbox' || selected.column.type === 'radio')) {
- // 空格键支持选中复选框
- evnt.preventDefault();
- if (selected.column.type === 'checkbox') {
- _this22.handleToggleCheckRowEvent(evnt, selected.args);
- } else {
- _this22.triggerRadioRowEvent(evnt, selected.args);
- }
- } else if (isEsc) {
- // 如果按下了 Esc 键,关闭快捷菜单、筛选
- _this22.closeMenu();
- _this22.closeFilter(); // 如果是激活编辑状态,则取消编辑
- if (actived.row) {
- params = actived.args;
- _this22.clearActived(evnt); // 如果配置了选中功能,则为选中状态
- if (mouseConfig && mouseOpts.selected) {
- _this22.$nextTick(function () {
- return _this22.handleSelected(params, evnt);
- });
- }
- }
- } else if (isF2) {
- if (!isEditStatus) {
- // 如果按下了 F2 键
- if (selected.row && selected.column) {
- evnt.preventDefault();
- _this22.handleActived(selected.args, evnt);
- }
- }
- } else if (isContextMenu) {
- // 如果按下上下文键
- _this22._keyCtx = selected.row && selected.column && bodyCtxMenu.length;
- clearTimeout(_this22.keyCtxTimeout);
- _this22.keyCtxTimeout = setTimeout(function () {
- _this22._keyCtx = false;
- }, 1000);
- } else if (isEnter && !hasAltKey && keyboardConfig && keyboardOpts.isEnter && (selected.row || actived.row || treeConfig && highlightCurrentRow && currentRow)) {
- // 退出选中
- if (hasCtrlKey) {
- // 如果是激活编辑状态,则取消编辑
- if (actived.row) {
- params = actived.args;
- _this22.clearActived(evnt); // 如果配置了选中功能,则为选中状态
- if (mouseConfig && mouseOpts.selected) {
- _this22.$nextTick(function () {
- return _this22.handleSelected(params, evnt);
- });
- }
- }
- } else {
- // 如果是激活状态,退则出到上一行/下一行
- if (selected.row || actived.row) {
- var targetArgs = selected.row ? selected.args : actived.args;
- if (hasShiftKey) {
- if (keyboardOpts.enterToTab) {
- _this22.moveTabSelected(targetArgs, hasShiftKey, evnt);
- } else {
- _this22.moveSelected(targetArgs, isLeftArrow, true, isRightArrow, false, evnt);
- }
- } else {
- if (keyboardOpts.enterToTab) {
- _this22.moveTabSelected(targetArgs, hasShiftKey, evnt);
- } else {
- _this22.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: _this22,
- row: targetRow
- };
- _this22.setTreeExpand(currentRow, true).then(function () {
- return _this22.scrollToRow(targetRow);
- }).then(function () {
- return _this22.triggerCurrentRowEvent(evnt, params);
- });
- }
- }
- }
- } else if (operArrow && keyboardConfig && keyboardOpts.isArrow) {
- if (!isEditStatus) {
- // 如果按下了方向键
- if (selected.row && selected.column) {
- _this22.moveSelected(selected.args, isLeftArrow, isUpArrow, isRightArrow, isDwArrow, evnt);
- } else if ((isUpArrow || isDwArrow) && highlightCurrentRow) {
- // 当前行按键上下移动
- _this22.moveCurrentRow(isUpArrow, isDwArrow, evnt);
- }
- }
- } else if (isTab && keyboardConfig && keyboardOpts.isTab) {
- // 如果按下了 Tab 键切换
- if (selected.row || selected.column) {
- _this22.moveTabSelected(selected.args, hasShiftKey, evnt);
- } else if (actived.row || actived.column) {
- _this22.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: _this22.getRowIndex(selected.row),
- column: selected.column,
- columnIndex: _this22.getColumnIndex(selected.column),
- $table: _this22
- });
- } else {
- methods_setCellValue(selected.row, selected.column, null);
- }
- if (isBack) {
- if (backMethod) {
- backMethod({
- row: selected.row,
- rowIndex: _this22.getRowIndex(selected.row),
- column: selected.column,
- columnIndex: _this22.getColumnIndex(selected.column),
- $table: _this22
- });
- } else {
- _this22.handleActived(selected.args, evnt);
- }
- }
- } else if (isBack && keyboardOpts.isArrow && treeConfig && highlightCurrentRow && currentRow) {
- // 如果树形表格回退键关闭当前行返回父节点
- var _XEUtils$findTree = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.findTree(_this22.afterFullData, function (item) {
- return item === currentRow;
- }, treeOpts),
- parentRow = _XEUtils$findTree.parent;
- if (parentRow) {
- evnt.preventDefault();
- params = {
- $table: _this22,
- row: parentRow
- };
- _this22.setTreeExpand(parentRow, false).then(function () {
- return _this22.scrollToRow(parentRow);
- }).then(function () {
- return _this22.triggerCurrentRowEvent(evnt, params);
- });
- }
- }
- }
- } 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 && isEnableConf(selected.column.editRender)) {
- if (!editOpts.activeMethod || editOpts.activeMethod(selected.args)) {
- if (editMethod) {
- editMethod({
- row: selected.row,
- rowIndex: _this22.getRowIndex(selected.row),
- column: selected.column,
- columnIndex: _this22.getColumnIndex(selected.column),
- $table: _this22
- });
- } else {
- methods_setCellValue(selected.row, selected.column, null);
- _this22.handleActived(selected.args, evnt);
- }
- }
- }
- }
- _this22.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);
- }
- }
- 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);
- }
- }
- 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);
- }
- }
- this.emitEvent('cut', {}, evnt);
- }
- },
- handleGlobalResizeEvent: function handleGlobalResizeEvent() {
- this.closeMenu();
- this.updateCellAreas();
- this.recalculate(true);
- },
- handleTooltipLeaveMethod: function handleTooltipLeaveMethod() {
- var _this23 = this;
- var tooltipOpts = this.tooltipOpts;
- setTimeout(function () {
- if (!_this23.tooltipActive) {
- _this23.closeTooltip();
- }
- }, tooltipOpts.leaveDelay);
- return false;
- },
- handleTargetEnterEvent: function handleTargetEnterEvent() {
- clearTimeout(this.tooltipTimeout);
- this.tooltipActive = true;
- this.closeTooltip();
- },
- handleTargetLeaveEvent: function handleTargetLeaveEvent() {
- var _this24 = this;
- var tooltipOpts = this.tooltipOpts;
- this.tooltipActive = false;
- if (tooltipOpts.enterable) {
- this.tooltipTimeout = setTimeout(function () {
- if (!_this24.$refs.tooltip.isHover) {
- _this24.closeTooltip();
- }
- }, tooltipOpts.leaveDelay);
- } else {
- this.closeTooltip();
- }
- },
- triggerHeaderHelpEvent: function triggerHeaderHelpEvent(evnt, params) {
- var column = params.column;
- var titleHelp = column.titleHelp;
- if (titleHelp.message) {
- var $refs = this.$refs,
- tooltipStore = this.tooltipStore;
- var tooltip = $refs.tooltip;
- var content = UtilTools.getFuncText(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 column = params.column;
- var tooltipStore = this.tooltipStore;
- 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 enabled = tooltipOpts.enabled,
- contentMethod = tooltipOpts.contentMethod;
- var tooltip = $refs.tooltip;
- var customContent = contentMethod ? contentMethod(params) : null;
- var useCustom = contentMethod && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 && (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, content) {
- var $refs = this.$refs;
- var commTip = $refs.commTip;
- if (commTip) {
- return commTip.open(target, content);
- }
- return this.$nextTick();
- },
- /**
- * 关闭 tooltip
- */
- closeTooltip: function closeTooltip() {
- var $refs = this.$refs,
- tooltipStore = this.tooltipStore;
- var tooltip = $refs.tooltip;
- var commTip = $refs.commTip;
- if (tooltipStore.visible) {
- Object.assign(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;
- },
- /**
- * 判断复选框是否全选
- */
- isCheckboxIndeterminate: function isCheckboxIndeterminate() {
- return !this.isAllSelected && this.isIndeterminate;
- },
- /**
- * 获取复选框半选状态的行数据
- */
- 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);
- }
- },
- /**
- * 用于多选行,设置行为选中状态,第二个参数为选中与否
- * @param {Array/Row} rows 行数据
- * @param {Boolean} value 是否选中
- */
- setCheckboxRow: function setCheckboxRow(rows, value) {
- var _this25 = this;
- if (rows && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(rows)) {
- rows = [rows];
- }
- rows.forEach(function (row) {
- return _this25.handleSelectRow({
- row: row
- }, !!value);
- });
- return this.$nextTick();
- },
- isCheckedByCheckboxRow: function isCheckedByCheckboxRow(row) {
- var property = this.checkboxOpts.checkField;
- if (property) {
- return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, property);
- }
- return this.selection.indexOf(row) > -1;
- },
- /**
- * 多选,行选中事件
- * value 选中true 不选false 不确定-1
- */
- handleSelectRow: function handleSelectRow(_ref6, value) {
- var _this26 = this;
- var row = _ref6.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);
- }
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.set(row, property, false);
- } else {
- // 更新子节点状态
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree([row], function (item) {
- if (row === item || !checkMethod || checkMethod({
- row: item
- })) {
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.set(item, property, value);
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.remove(treeIndeterminates, function (half) {
- return half === item;
- });
- _this26.handleCheckboxReserveRow(row, value);
- }
- }, treeOpts);
- } // 如果存在父节点,更新父节点状态
- var matchObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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
- })) {
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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);
- }
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.remove(selection, function (item) {
- return item === row;
- });
- } else {
- // 更新子节点状态
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree([row], function (item) {
- if (row === item || !checkMethod || checkMethod({
- row: item
- })) {
- if (value) {
- selection.push(item);
- } else {
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.remove(selection, function (select) {
- return select === item;
- });
- }
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.remove(treeIndeterminates, function (half) {
- return half === item;
- });
- _this26.handleCheckboxReserveRow(row, value);
- }
- }, treeOpts);
- } // 如果存在父节点,更新父节点状态
- var _matchObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 {
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 ? !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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);
- this.emitEvent('checkbox-change', Object.assign({
- records: this.getCheckboxRecords(),
- reserves: this.getCheckboxReserveRecords(),
- indeterminates: this.getCheckboxIndeterminateRecords(),
- checked: value
- }, params), evnt);
- }
- },
- /**
- * 多选,切换某一行的选中状态
- */
- toggleCheckboxRow: function toggleCheckboxRow(row) {
- this.handleToggleCheckRowEvent(null, {
- row: row
- });
- return this.$nextTick();
- },
- /**
- * 用于多选行,设置所有行的选中状态
- * @param {Boolean} value 是否选中
- */
- setAllCheckboxRow: function setAllCheckboxRow(value) {
- var _this27 = 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);
- }
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.set(row, property, value);
- }
- }; // 如果存在选中方法
- // 如果方法成立,则更新值,否则忽略该数据
- if (treeConfig) {
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(afterFullData, checkValFn, treeOpts);
- } else {
- afterFullData.forEach(checkValFn);
- }
- } else {
- /**
- * 默认方式(低性能,无污染)
- * 无需任何属性,直接绑定
- */
- if (treeConfig) {
- if (value) {
- /**
- * 如果是树勾选
- * 如果方法成立,则添加到临时集合中
- */
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(afterFullData, function (row) {
- if (!checkMethod || checkMethod({
- row: row
- })) {
- selectRows.push(row);
- }
- }, treeOpts);
- } else {
- /**
- * 如果是树取消
- * 如果方法成立,则不添加到临时集合中
- */
- if (checkMethod) {
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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(_this27, row)] = row;
- });
- } else {
- afterFullData.forEach(function (row) {
- return _this27.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
- }) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, checkField);
- } : function (row) {
- return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, checkField);
- });
- if (treeConfig) {
- if (halfField) {
- isIndeterminate = !isAllSelected && afterFullData.some(function (row) {
- return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, checkField) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, halfField) || treeIndeterminates.indexOf(row) > -1;
- });
- } else {
- isIndeterminate = !isAllSelected && afterFullData.some(function (row) {
- return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, checkField) || treeIndeterminates.indexOf(row) > -1;
- });
- }
- } else {
- if (halfField) {
- isIndeterminate = !isAllSelected && afterFullData.some(function (row) {
- return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, checkField) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, halfField);
- });
- } else {
- isIndeterminate = !isAllSelected && afterFullData.some(function (row) {
- return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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;
- }
- },
- /**
- * 获取复选框保留选中的行
- */
- getCheckboxReserveRecords: function getCheckboxReserveRecords() {
- var fullDataRowIdData = this.fullDataRowIdData,
- checkboxReserveRowMap = this.checkboxReserveRowMap,
- checkboxOpts = this.checkboxOpts;
- var reserveSelection = [];
- if (checkboxOpts.reserve) {
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.each(checkboxReserveRowMap, function (row, rowid) {
- if (row && !fullDataRowIdData[rowid]) {
- reserveSelection.push(row);
- }
- });
- }
- return reserveSelection;
- },
- 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);
- this.emitEvent('checkbox-all', {
- records: this.getCheckboxRecords(),
- reserves: this.getCheckboxReserveRecords(),
- indeterminates: this.getCheckboxIndeterminateRecords(),
- checked: value
- }, evnt);
- },
- /**
- * 多选,切换所有行的选中状态
- */
- toggleAllCheckboxRow: function toggleAllCheckboxRow() {
- this.triggerCheckAllEvent(null, !this.isAllSelected);
- return this.$nextTick();
- },
- /**
- * 用于多选行,手动清空用户的选择
- * 清空行为不管是否被禁用还是保留记录,都将彻底清空选中状态
- */
- clearCheckboxRow: function clearCheckboxRow() {
- var _this28 = 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) {
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(tableFullData, function (item) {
- return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.set(item, property, false);
- }, treeOpts);
- } else {
- tableFullData.forEach(function (item) {
- return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.set(item, property, false);
- });
- }
- }
- if (reserve) {
- tableFullData.forEach(function (row) {
- return _this28.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) {
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.arrayEach(this.$el.querySelectorAll("[rowid=\"".concat(methods_getRowid(this, row), "\"]")), function (elem) {
- 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;
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.arrayEach(this.$el.querySelectorAll('.row--current'), function (elem) {
- return methods_removeClass(elem, 'row--current');
- });
- return this.$nextTick();
- },
- /**
- * 用于单选行,手动清空用户的选择
- */
- clearRadioRow: function clearRadioRow() {
- this.selectRow = null;
- return this.$nextTick();
- },
- /**
- * 用于当前行,获取当前行的数据
- */
- getCurrentRecord: function getCurrentRecord() {
- return this.highlightCurrentRow ? this.currentRow : null;
- },
- /**
- * 用于单选行,获取当已选中的数据
- */
- getRadioRecord: function getRadioRecord() {
- return this.selectRow;
- },
- /**
- * 行 hover 事件
- */
- triggerHoverEvent: function triggerHoverEvent(evnt, _ref7) {
- var row = _ref7.row;
- this.setHoverRow(row);
- },
- setHoverRow: function setHoverRow(row) {
- var rowid = methods_getRowid(this, row);
- this.clearHoverRow();
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.arrayEach(this.$el.querySelectorAll("[rowid=\"".concat(rowid, "\"]")), function (elem) {
- return addClass(elem, 'row--hover');
- });
- this.hoverRow = row;
- },
- clearHoverRow: function clearHoverRow() {
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.arrayEach(this.$el.querySelectorAll('.vxe-body--row.row--hover'), function (elem) {
- return methods_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} fieldOrColumn 列配置
- */
- setCurrentColumn: function setCurrentColumn(fieldOrColumn) {
- var column = handleFieldOrColumn(this, fieldOrColumn);
- if (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 _this29 = this;
- 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;
- });
- });
- },
- /**
- * 列点击事件
- * 如果是单击模式,则激活为编辑状态
- * 如果是双击模式,则单击后选中状态
- */
- 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;
- var actived = editStore.actived;
- var _params = params,
- row = _params.row,
- column = _params.column;
- var type = column.type,
- treeNode = column.treeNode;
- var isRadioType = type === 'radio';
- var isCheckboxType = type === 'checkbox';
- 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);
- if (!triggerCheckbox && !triggerRadio) {
- // 如果是展开行
- 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 (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 _this30 = 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 () {
- _this30.handleActived(params, evnt).then(function () {
- return _this30.checkValidate('change');
- }).catch(function (e) {
- return e;
- });
- });
- } else if (editOpts.mode === 'cell') {
- this.handleActived(params, evnt).then(function () {
- return _this30.checkValidate('change');
- }).catch(function (e) {
- return e;
- });
- }
- }
- }
- this.emitEvent('cell-dblclick', params, evnt);
- },
- handleDefaultSort: function handleDefaultSort() {
- var _this31 = this;
- var sortConfig = this.sortConfig,
- sortOpts = this.sortOpts;
- var defaultSort = sortOpts.defaultSort;
- if (defaultSort) {
- if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(defaultSort)) {
- defaultSort = [defaultSort];
- }
- if (defaultSort.length) {
- (sortConfig.multiple ? defaultSort : defaultSort.slice(0, 1)).forEach(function (item) {
- var field = item.field,
- order = item.order;
- if (field && order) {
- var column = _this31.getColumnByField(field);
- if (column && column.sortable) {
- column.order = order;
- }
- }
- });
- if (!sortOpts.remote) {
- this.handleTableData(true).then(this.updateStyle);
- }
- }
- }
- },
- /**
- * 点击排序事件
- */
- triggerSortEvent: function triggerSortEvent(evnt, column, order) {
- var sortOpts = this.sortOpts;
- var property = column.property;
- if (column.sortable || column.remoteSort) {
- if (!order || column.order === order) {
- this.clearSort(sortOpts.multiple ? column : null);
- } else {
- this.sort({
- field: property,
- order: 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(sortConfs, sortOrder) {
- var _this32 = this;
- var sortOpts = this.sortOpts;
- var multiple = sortOpts.multiple,
- remote = sortOpts.remote,
- orders = sortOpts.orders;
- if (sortConfs) {
- if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isString(sortConfs)) {
- sortConfs = [{
- field: sortConfs,
- order: sortOrder
- }];
- }
- }
- if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(sortConfs)) {
- sortConfs = [sortConfs];
- }
- if (sortConfs.length) {
- var firstSortColumn;
- if (!multiple) {
- clearAllSort(this);
- }
- (multiple ? sortConfs : [sortConfs[0]]).forEach(function (confs) {
- var field = confs.field,
- order = confs.order;
- var column = field;
- if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isString(field)) {
- column = _this32.getColumnByField(field);
- }
- if (column && (column.sortable || column.remoteSort)) {
- if (!firstSortColumn) {
- firstSortColumn = column;
- }
- if (orders.indexOf(order) === -1) {
- order = getNextSortOrder(_this32, column);
- }
- if (column.order !== order) {
- column.order = order;
- }
- }
- }); // 如果是服务端排序,则跳过本地排序处理
- if (!remote || firstSortColumn && firstSortColumn.remoteSort) {
- this.handleTableData(true);
- }
- return this.$nextTick().then(this.updateStyle);
- }
- return this.$nextTick();
- },
- /**
- * 清空指定列的排序条件
- * 如果为空则清空所有列的排序条件
- * @param {String} column 列或字段名
- */
- clearSort: function clearSort(fieldOrColumn) {
- var sortOpts = this.sortOpts;
- if (fieldOrColumn) {
- var column = handleFieldOrColumn(this, fieldOrColumn);
- if (column) {
- column.order = null;
- }
- } else {
- clearAllSort(this);
- }
- if (!sortOpts.remote) {
- return this.handleTableData(true);
- }
- return this.$nextTick();
- },
- // 在 v3 中废弃
- getSortColumn: function getSortColumn() {
- if (false) {}
- return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.find(this.visibleColumn, function (column) {
- return (column.sortable || column.remoteSort) && column.order;
- });
- },
- isSort: function isSort(fieldOrColumn) {
- if (fieldOrColumn) {
- var column = handleFieldOrColumn(this, fieldOrColumn);
- return column && column.sortable && !!column.order;
- }
- return this.getSortColumns().length > 0;
- },
- getSortColumns: function getSortColumns() {
- var sortList = [];
- this.visibleColumn.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 = handleFieldOrColumn(this, fieldOrColumn);
- if (column) {
- return column.filters && column.filters.some(function (option) {
- return option.checked;
- });
- }
- return this.getCheckedFilters().length > 0;
- },
- /**
- * 判断展开行是否懒加载完成
- * @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;
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.remove(expandLazyLoadeds, function (item) {
- return row === item;
- });
- }
- return this.$nextTick();
- },
- /**
- * 重新加载展开行的内容
- * @param {Row} row 行对象
- */
- reloadExpandContent: function reloadExpandContent(row) {
- var _this33 = this;
- var expandOpts = this.expandOpts,
- expandLazyLoadeds = this.expandLazyLoadeds;
- var lazy = expandOpts.lazy;
- if (lazy && expandLazyLoadeds.indexOf(row) === -1) {
- this.clearRowExpandLoaded(row).then(function () {
- return _this33.handleAsyncRowExpand(row);
- });
- }
- return this.$nextTick();
- },
- /**
- * 展开行事件
- */
- triggerRowExpandEvent: function triggerRowExpandEvent(evnt, params) {
- var 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);
- this.emitEvent('toggle-row-expand', {
- expanded: expanded,
- column: column,
- columnIndex: columnIndex,
- $columnIndex: $columnIndex,
- row: row,
- rowIndex: this.getRowIndex(row),
- $rowIndex: this.getVMRowIndex(row)
- }, evnt);
- }
- },
- /**
- * 切换展开行
- */
- 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);
- }
- },
- /**
- * 设置所有行的展开与否
- * @param {Boolean} expanded 是否展开
- */
- setAllRowExpand: function setAllRowExpand(expanded) {
- return this.setRowExpand(this.expandOpts.lazy ? this.tableData : this.tableFullData, expanded);
- },
- handleAsyncRowExpand: function handleAsyncRowExpand(row) {
- var _this34 = this;
- var rest = this.fullAllDataRowMap.get(row);
- return new Promise(function (resolve) {
- _this34.expandLazyLoadeds.push(row);
- _this34.expandOpts.loadMethod({
- $table: _this34,
- row: row,
- rowIndex: _this34.getRowIndex(row),
- $rowIndex: _this34.getVMRowIndex(row)
- }).catch(function (e) {
- return e;
- }).then(function () {
- rest.expandLoaded = true;
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.remove(_this34.expandLazyLoadeds, function (item) {
- return item === row;
- });
- _this34.rowExpandeds.push(row);
- resolve(_this34.$nextTick().then(_this34.recalculate));
- });
- });
- },
- /**
- * 设置展开行,二个参数设置这一行展开与否
- * 支持单行
- * 支持多行
- * @param {Array/Row} rows 行数据
- * @param {Boolean} expanded 是否展开
- */
- setRowExpand: function setRowExpand(rows, expanded) {
- var _this35 = 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 (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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: _this35.getRowIndex(row),
- $rowIndex: _this35.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(_this35.handleAsyncRowExpand(row));
- } else {
- rowExpandeds.push(row);
- }
- }
- });
- } else {
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.remove(rowExpandeds, function (row) {
- return validRows.indexOf(row) > -1;
- });
- }
- if (reserve) {
- validRows.forEach(function (row) {
- return _this35.handleRowExpandReserve(row, expanded);
- });
- }
- }
- this.rowExpandeds = rowExpandeds;
- return Promise.all(lazyRests).then(this.recalculate);
- },
- /**
- * 判断行是否为展开状态
- * @param {Row} row 行对象
- */
- isExpandByRow: function isExpandByRow(row) {
- return this.rowExpandeds.indexOf(row) > -1;
- },
- /**
- * 手动清空展开行状态,数据会恢复成未展开的状态
- */
- clearRowExpand: function clearRowExpand() {
- var _this36 = 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 _this36.handleRowExpandReserve(row, false);
- });
- }
- return this.$nextTick().then(function () {
- if (isExists) {
- _this36.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;
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.remove(treeExpandeds, function (item) {
- return row === item;
- });
- }
- return this.$nextTick();
- },
- /**
- * 重新加载树的子节点
- * @param {Row} row 行对象
- */
- reloadTreeChilds: function reloadTreeChilds(row) {
- var _this37 = 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 _this37.handleAsyncTreeExpandChilds(row);
- });
- }
- return this.$nextTick();
- },
- /**
- * 展开树节点事件
- */
- triggerTreeExpandEvent: function triggerTreeExpandEvent(evnt, params) {
- var 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);
- this.emitEvent('toggle-tree-expand', {
- expanded: expanded,
- column: column,
- columnIndex: columnIndex,
- $columnIndex: $columnIndex,
- row: row
- }, evnt);
- }
- },
- /**
- * 切换/展开树节点
- */
- 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 = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.findTree(tableFullData, function (item) {
- return rowid === external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(item, rowkey);
- }, treeOpts);
- if (matchObj) {
- defExpandeds.push(matchObj.item);
- }
- });
- this.setTreeExpand(defExpandeds, true);
- }
- }
- },
- handleAsyncTreeExpandChilds: function handleAsyncTreeExpandChilds(row) {
- var _this38 = 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: _this38,
- row: row
- }).catch(function () {
- return [];
- }).then(function (childRecords) {
- rest.treeLoaded = true;
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.remove(treeLazyLoadeds, function (item) {
- return item === row;
- });
- if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(childRecords)) {
- childRecords = [];
- }
- if (childRecords) {
- _this38.loadChildren(row, childRecords).then(function (childRows) {
- if (childRows.length && treeExpandeds.indexOf(row) === -1) {
- treeExpandeds.push(row);
- } // 如果当前节点已选中,则展开后子节点也被选中
- if (!checkStrictly && _this38.isCheckedByCheckboxRow(row)) {
- _this38.setCheckboxRow(childRows, true);
- }
- });
- }
- resolve(_this38.$nextTick().then(_this38.recalculate));
- });
- });
- },
- /**
- * 设置所有树节点的展开与否
- * @param {Boolean} expanded 是否展开
- */
- setAllTreeExpand: function setAllTreeExpand(expanded) {
- var tableFullData = this.tableFullData,
- treeOpts = this.treeOpts;
- var lazy = treeOpts.lazy,
- children = treeOpts.children;
- var expandeds = [];
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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);
- },
- /**
- * 设置展开树形节点,二个参数设置这一行展开与否
- * 支持单行
- * 支持多行
- * @param {Array/Row} rows 行数据
- * @param {Boolean} expanded 是否展开
- */
- setTreeExpand: function setTreeExpand(rows, expanded) {
- var _this39 = 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 (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.findTree(tableFullData, function (item) {
- return item === validRows[0];
- }, treeOpts);
- if (matchObj) {
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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(_this39.handleAsyncTreeExpandChilds(row));
- } else {
- if (row[children] && row[children].length) {
- treeExpandeds.push(row);
- }
- }
- }
- });
- } else {
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.remove(treeExpandeds, function (row) {
- return validRows.indexOf(row) > -1;
- });
- }
- if (reserve) {
- validRows.forEach(function (row) {
- return _this39.handleTreeExpandReserve(row, expanded);
- });
- }
- return Promise.all(result).then(this.recalculate);
- }
- }
- return this.$nextTick();
- },
- /**
- * 判断行是否为树形节点展开状态
- * @param {Row} row 行对象
- */
- isTreeExpandByRow: function isTreeExpandByRow(row) {
- return this.treeExpandeds.indexOf(row) > -1;
- },
- /**
- * 手动清空树形节点的展开状态,数据会恢复成未展开的状态
- */
- clearTreeExpand: function clearTreeExpand() {
- var _this40 = this;
- var treeOpts = this.treeOpts,
- treeExpandeds = this.treeExpandeds,
- tableFullData = this.tableFullData;
- var reserve = treeOpts.reserve;
- var isExists = treeExpandeds.length;
- this.treeExpandeds = [];
- if (reserve) {
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(tableFullData, function (row) {
- return _this40.handleTreeExpandReserve(row, false);
- }, treeOpts);
- }
- return this.$nextTick().then(function () {
- if (isExists) {
- _this40.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];
- }
- }
- },
- /**
- * 获取表格的滚动状态
- */
- 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() {
- var mergeList = this.mergeList,
- mergeFooterList = this.mergeFooterList,
- scrollXStore = this.scrollXStore;
- var startIndex = scrollXStore.startIndex,
- endIndex = scrollXStore.endIndex,
- offsetSize = scrollXStore.offsetSize;
- var _computeVirtualX2 = computeVirtualX(this),
- toVisibleIndex = _computeVirtualX2.toVisibleIndex,
- visibleSize = _computeVirtualX2.visibleSize;
- var offsetItem = {
- startIndex: Math.max(0, toVisibleIndex - 1 - offsetSize),
- endIndex: toVisibleIndex + visibleSize + offsetSize
- };
- calculateMergerOffserIndex(mergeList.concat(mergeFooterList), offsetItem, 'col');
- var offsetStartIndex = offsetItem.startIndex,
- offsetEndIndex = offsetItem.endIndex;
- if (toVisibleIndex <= startIndex || toVisibleIndex >= endIndex - visibleSize - 1) {
- if (startIndex !== offsetStartIndex || endIndex !== offsetEndIndex) {
- scrollXStore.startIndex = offsetStartIndex;
- scrollXStore.endIndex = offsetEndIndex;
- this.updateScrollXData();
- }
- }
- this.closeTooltip();
- },
- /**
- * 纵向 Y 可视渲染事件处理
- */
- triggerScrollYEvent: function triggerScrollYEvent(evnt) {
- var scrollYStore = this.scrollYStore;
- var adaptive = scrollYStore.adaptive,
- offsetSize = scrollYStore.offsetSize,
- visibleSize = scrollYStore.visibleSize; // webkit 浏览器使用最佳的渲染方式,且最高渲染量不能大于 40 条
- if (isWebkit && adaptive && offsetSize * 2 + visibleSize <= 40) {
- this.loadScrollYData(evnt);
- } else {
- this.debounceScrollY(evnt);
- }
- },
- debounceScrollY: external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.debounce(function (evnt) {
- this.loadScrollYData(evnt);
- }, debounceScrollYDuration, {
- leading: false,
- trailing: true
- }),
- /**
- * 纵向 Y 可视渲染处理
- */
- loadScrollYData: function loadScrollYData(evnt) {
- var mergeList = this.mergeList,
- scrollYStore = this.scrollYStore;
- var startIndex = scrollYStore.startIndex,
- endIndex = scrollYStore.endIndex,
- visibleSize = scrollYStore.visibleSize,
- offsetSize = scrollYStore.offsetSize,
- rowHeight = scrollYStore.rowHeight;
- var scrollBodyElem = evnt.target;
- var scrollTop = scrollBodyElem.scrollTop;
- var toVisibleIndex = Math.floor(scrollTop / rowHeight);
- var offsetItem = {
- startIndex: Math.max(0, toVisibleIndex - 1 - offsetSize),
- endIndex: toVisibleIndex + visibleSize + offsetSize
- };
- calculateMergerOffserIndex(mergeList, offsetItem, 'row');
- var offsetStartIndex = offsetItem.startIndex,
- offsetEndIndex = offsetItem.endIndex;
- if (toVisibleIndex <= startIndex || toVisibleIndex >= endIndex - visibleSize - 1) {
- if (startIndex !== offsetStartIndex || endIndex !== offsetEndIndex) {
- scrollYStore.startIndex = offsetStartIndex;
- scrollYStore.endIndex = offsetEndIndex;
- this.updateScrollYData();
- }
- }
- },
- // 计算可视渲染相关数据
- computeScrollLoad: function computeScrollLoad() {
- var _this41 = this;
- return this.$nextTick().then(function () {
- var sYOpts = _this41.sYOpts,
- sXOpts = _this41.sXOpts,
- scrollXLoad = _this41.scrollXLoad,
- scrollYLoad = _this41.scrollYLoad,
- scrollXStore = _this41.scrollXStore,
- scrollYStore = _this41.scrollYStore; // 计算 X 逻辑
- if (scrollXLoad) {
- var _computeVirtualX3 = computeVirtualX(_this41),
- visibleXSize = _computeVirtualX3.visibleSize;
- var offsetXSize = sXOpts.oSize ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(sXOpts.oSize) : methods_browse.msie ? 10 : methods_browse.edge ? 5 : 0;
- scrollXStore.offsetSize = offsetXSize;
- scrollXStore.visibleSize = visibleXSize;
- scrollXStore.endIndex = Math.max(scrollXStore.startIndex + scrollXStore.visibleSize + offsetXSize, scrollXStore.endIndex);
- _this41.updateScrollXData();
- } else {
- _this41.updateScrollXSpace();
- } // 计算 Y 逻辑
- var _computeVirtualY = computeVirtualY(_this41),
- rowHeight = _computeVirtualY.rowHeight,
- visibleYSize = _computeVirtualY.visibleSize;
- scrollYStore.rowHeight = rowHeight;
- if (scrollYLoad) {
- var offsetYSize = sYOpts.oSize ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(sYOpts.oSize) : methods_browse.msie ? 20 : methods_browse.edge ? 10 : 0;
- scrollYStore.offsetSize = offsetYSize;
- scrollYStore.visibleSize = visibleYSize;
- scrollYStore.endIndex = Math.max(scrollYStore.startIndex + visibleYSize + offsetYSize, scrollYStore.endIndex);
- _this41.updateScrollYData();
- } else {
- _this41.updateScrollYSpace();
- }
- _this41.rowHeight = rowHeight;
- _this41.$nextTick(_this41.updateStyle);
- });
- },
- handleTableColumn: function handleTableColumn() {
- var scrollXLoad = this.scrollXLoad,
- visibleColumn = this.visibleColumn,
- scrollXStore = this.scrollXStore;
- this.tableColumn = scrollXLoad ? visibleColumn.slice(scrollXStore.startIndex, scrollXStore.endIndex) : visibleColumn.slice(0);
- },
- updateScrollXData: function updateScrollXData() {
- this.handleTableColumn();
- 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 tableBodyElem = tableBody ? tableBody.$el : null;
- if (tableBodyElem) {
- var tableHeaderElem = tableHeader ? tableHeader.$el : null;
- var tableFooterElem = tableFooter ? tableFooter.$el : null;
- var headerElem = tableHeaderElem ? tableHeaderElem.querySelector('.vxe-table--header') : null;
- var bodyElem = tableBodyElem.querySelector('.vxe-table--body');
- var footerElem = tableFooterElem ? tableFooterElem.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 startIndex = scrollYStore.startIndex,
- rowHeight = scrollYStore.rowHeight;
- var bodyHeight = afterFullData.length * rowHeight;
- var topSpaceHeight = Math.max(0, startIndex * rowHeight);
- 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 _this42 = 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 (footerTargetElem && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNumber(scrollLeft)) {
- footerTargetElem.scrollLeft = scrollLeft;
- }
- if (bodyTargetElem && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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(_this42.$nextTick());
- }, 50);
- });
- }
- return this.$nextTick();
- },
- /**
- * 如果有滚动条,则滚动到对应的行
- * @param {Row} row 行对象
- * @param {ColumnInfo} column 列配置
- */
- scrollToRow: function scrollToRow(row, fieldOrColumn) {
- var rest = [];
- if (row) {
- if (this.treeConfig) {
- rest.push(this.scrollToTreeRow(row));
- } else {
- rest.push(DomTools.rowToVisible(this, row));
- }
- }
- if (fieldOrColumn) {
- rest.push(this.scrollToColumn(fieldOrColumn));
- }
- return Promise.all(rest);
- },
- /**
- * 如果有滚动条,则滚动到对应的列
- * @param {ColumnInfo} column 列配置
- */
- scrollToColumn: function scrollToColumn(fieldOrColumn) {
- var column = handleFieldOrColumn(this, fieldOrColumn);
- if (column && this.fullColumnMap.has(column)) {
- return DomTools.colToVisible(this, column);
- }
- return this.$nextTick();
- },
- /**
- * 对于树形结构中,可以直接滚动到指定深层节点中
- * 对于某些特定的场景可能会用到,比如定位到某一节点
- * @param {Row} row 行对象
- */
- scrollToTreeRow: function scrollToTreeRow(row) {
- var _this43 = this;
- var tableFullData = this.tableFullData,
- treeConfig = this.treeConfig,
- treeOpts = this.treeOpts;
- if (treeConfig) {
- var matchObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 && !_this43.isTreeExpandByRow(row)) {
- _this43.setTreeExpand(row, true);
- }
- });
- }
- }
- return this.$nextTick();
- },
- /**
- * 手动清除滚动相关信息,还原到初始状态
- */
- 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 _this44 = this;
- var customVal = !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isUndefined(cellValue);
- return this.$nextTick().then(function () {
- var $refs = _this44.$refs,
- editRules = _this44.editRules,
- validStore = _this44.validStore;
- if (scope && $refs.tableBody && editRules) {
- var row = scope.row,
- column = scope.column;
- var type = 'change';
- if (_this44.hasCellRules(type, row, column)) {
- var cell = _this44.getCell(row, column);
- if (cell) {
- return _this44.validCellRules(type, row, column, cellValue).then(function () {
- if (customVal && validStore.visible) {
- methods_setCellValue(row, column, cellValue);
- }
- _this44.clearValidate();
- }).catch(function (_ref8) {
- var rule = _ref8.rule;
- if (customVal) {
- methods_setCellValue(row, column, cellValue);
- }
- _this44.showValidTooltip({
- rule: rule,
- row: row,
- column: column,
- cell: cell
- });
- });
- }
- }
- }
- });
- },
- handleDefaultMergeCells: function handleDefaultMergeCells() {
- this.setMergeCells(this.mergeCells);
- },
- /**
- * 设置合并单元格
- * @param {TableMergeConfig[]} merges { row: Row|number, column: ColumnInfo|number, rowspan: number, colspan: number }
- */
- setMergeCells: function setMergeCells(merges) {
- var _this45 = 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 _this45.updateCellAreas();
- });
- },
- /**
- * 移除单元格合并
- * @param {TableMergeConfig[]} merges 多个或数组 [{row:Row|number, col:ColumnInfo|number}]
- */
- removeMergeCells: function removeMergeCells(merges) {
- var _this46 = 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 () {
- _this46.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 _this47 = 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 _this47.updateCellAreas();
- });
- },
- removeMergeFooterItems: function removeMergeFooterItems(merges) {
- var _this48 = 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 () {
- _this48.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() {
- var _this49 = this;
- this.recalculate().then(function () {
- return _this49.refreshScroll();
- }).then(function () {
- if (_this49.mouseConfig && _this49.mouseOpts.area && _this49.handleUpdateCellAreas) {
- _this49.handleUpdateCellAreas();
- }
- });
- },
- emitEvent: function emitEvent(type, params, evnt) {
- this.$emit(type, Object.assign({
- $table: this,
- $grid: this.$xegrid,
- $event: evnt
- }, params));
- },
- 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();
- },
- /*************************
- * 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[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 fullAllDataRowMap = this.fullAllDataRowMap;
- var colid = column.id;
- 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 (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isString(formatter)) {
- var globalFunc = formats.get(formatter);
- cellLabel = globalFunc ? globalFunc(formatParams) : '';
- } else if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(formatter)) {
- var _globalFunc = formats.get(formatter[0]);
- cellLabel = _globalFunc ? _globalFunc.apply(void 0, [formatParams].concat(_toConsumableArray(formatter.slice(1)))) : '';
- } else {
- cellLabel = formatter(formatParams);
- }
- if (formatData) {
- formatData[colid] = {
- value: cellValue,
- label: cellLabel
- };
- }
- }
- return cellLabel;
- }
- /*************************
- * Publish methods
- *************************/
- }; // Module methods
- var funcs = 'setFilter,clearFilter,getCheckedFilters,closeMenu,setActiveCellArea,getActiveCellArea,getCellAreas,clearCellAreas,copyCellArea,cutCellArea,pasteCellArea,getCopyCellArea,clearCopyCellArea,setCellAreas,openFind,openReplace,getSelectedCell,clearSelected,insert,insertAt,remove,removeCheckboxRow,removeRadioRow,removeCurrentRow,getRecordset,getInsertRecords,getRemoveRecords,getUpdateRecords,clearActived,getActiveRecord,isActiveByRow,setActiveRow,setActiveCell,setSelectCell,clearValidate,fullValidate,validate,openExport,openPrint,exportData,openImport,importData,saveFile,readFile,importByFile,print'.split(',');
- 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 _e = $xetable._e,
- tableData = $xetable.tableData,
- tableColumn = $xetable.tableColumn,
- tableGroupColumn = $xetable.tableGroupColumn,
- 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,
- tableGroupColumn: tableGroupColumn,
- size: vSize,
- fixedColumn: fixedColumn
- },
- ref: "".concat(fixedType, "Header")
- }) : _e(), h('vxe-table-body', {
- props: {
- fixedType: fixedType,
- tableData: tableData,
- tableColumn: tableColumn,
- fixedColumn: fixedColumn,
- size: vSize
- },
- ref: "".concat(fixedType, "Body")
- }), showFooter ? h('vxe-table-footer', {
- props: {
- footerTableData: footerTableData,
- tableColumn: tableColumn,
- fixedColumn: fixedColumn,
- fixedType: fixedType,
- size: vSize
- },
- ref: "".concat(fixedType, "Footer")
- }) : _e()]);
- }
- function renderEmptyContenet(h, _vm) {
- var $scopedSlots = _vm.$scopedSlots,
- emptyOpts = _vm.emptyOpts;
- var emptyContent = '';
- var params = {
- $table: _vm
- };
- if ($scopedSlots.empty) {
- emptyContent = $scopedSlots.empty.call(_vm, params, h);
- } else {
- var compConf = _vm.emptyRender ? v_x_e_table.renderer.get(emptyOpts.name) : null;
- if (compConf) {
- emptyContent = compConf.renderEmpty.call(_vm, h, emptyOpts, params);
- } else {
- emptyContent = _vm.emptyText || conf.i18n('vxe.table.emptyText');
- }
- }
- return emptyContent;
- }
- function handleUupdateResize(_vm) {
- var $el = _vm.$el;
- if ($el && $el.clientWidth && $el.clientHeight) {
- _vm.recalculate();
- }
- }
- /* harmony default export */ var table = ({
- name: 'VxeTable',
- mixins: [size],
- props: {
- /** 基本属性 */
- id: String,
- // 数据
- data: 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;
- }
- },
- // 是否要高亮当前选中行
- 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;
- }
- },
- /** 高级属性 */
- // 主键配置
- columnKey: Boolean,
- rowKey: Boolean,
- rowId: {
- type: String,
- default: function _default() {
- return conf.table.rowId;
- }
- },
- zIndex: Number,
- emptyText: String,
- 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,
- // 复选框配置项
- checkboxConfig: Object,
- // tooltip 配置项
- tooltipConfig: Object,
- // 导出配置项
- exportConfig: [Boolean, Object],
- // 导入配置项
- importConfig: [Boolean, Object],
- // 打印配置项
- printConfig: Object,
- // 展开行配置项
- expandConfig: Object,
- // 树形结构配置项
- treeConfig: [Boolean, Object],
- // 快捷菜单配置项
- menuConfig: [Boolean, Object],
- // 在 v4 中废弃 contextMenu
- 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,
- // 优化相关
- animat: {
- type: Boolean,
- default: function _default() {
- return conf.table.animat;
- }
- },
- delayHover: {
- type: Number,
- default: function _default() {
- return conf.table.delayHover;
- }
- },
- // 额外的参数
- params: Object
- },
- components: {
- VxeTableBody: src_body
- },
- provide: function provide() {
- return {
- $xetable: this,
- xecolgroup: null
- };
- },
- inject: {
- $xegrid: {
- default: null
- }
- },
- data: function data() {
- return {
- tId: "".concat(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.uniqueId()),
- // 低性能的静态列
- staticColumns: [],
- // 渲染的列分组
- tableGroupColumn: [],
- // 可视区渲染的列
- tableColumn: [],
- // 渲染中的数据
- tableData: [],
- // 是否启用了横向 X 可视渲染方式加载
- scrollXLoad: false,
- // 是否启用了纵向 Y 可视渲染方式加载
- scrollYLoad: false,
- // 是否存在纵向滚动条
- overflowY: true,
- // 是否存在横向滚动条
- overflowX: false,
- // 纵向滚动条的宽度
- scrollbarWidth: 0,
- // 横向滚动条的高度
- scrollbarHeight: 0,
- // 行高
- rowHeight: 0,
- // 表格父容器的高度
- parentHeight: 0,
- // 是否使用分组表头
- isGroup: false,
- isAllOverflow: false,
- // 复选框属性,是否全选
- isAllSelected: false,
- // 复选框属性,有选中且非全选状态
- isIndeterminate: false,
- // 复选框属性,已选中的行
- selection: [],
- // 当前行
- currentRow: null,
- // 单选框属性,选中列
- currentColumn: null,
- // 单选框属性,选中行
- selectRow: null,
- // 表尾合计数据
- footerTableData: [],
- // 展开列信息
- expandColumn: null,
- hasFixedColumn: false,
- // 树节点列信息
- treeNodeColumn: null,
- // 已展开的行
- rowExpandeds: [],
- // 懒加载中的展开行的列表
- expandLazyLoadeds: [],
- // 已展开树节点
- treeExpandeds: [],
- // 懒加载中的树节点的列表
- treeLazyLoadeds: [],
- // 树节点不确定状态的列表
- treeIndeterminates: [],
- // 合并单元格的对象集
- mergeList: [],
- // 合并表尾数据的对象集
- mergeFooterList: [],
- // 初始化标识
- initStore: {
- filter: false,
- import: false,
- export: 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: []
- },
- // 选中源
- 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: {
- inited: false,
- file: null,
- type: '',
- modeList: [],
- typeList: [],
- filename: '',
- visible: false
- },
- importParams: {
- mode: '',
- types: null,
- message: true
- },
- // 导出相关信息
- exportStore: {
- inited: false,
- name: '',
- modeList: [],
- typeList: [],
- columns: [],
- isPrint: false,
- hasFooter: false,
- hasTree: false,
- hasMerge: false,
- hasColgroup: false,
- visible: false
- },
- exportParams: {
- filename: '',
- sheetName: '',
- mode: '',
- type: '',
- isColgroup: false,
- isMerge: false,
- isAllExpand: false,
- useStyle: false,
- original: false,
- message: true,
- isHeader: false,
- isFooter: false
- }
- };
- },
- computed: {
- validOpts: function validOpts() {
- return Object.assign({
- message: 'default'
- }, conf.table.validConfig, this.validConfig);
- },
- sXOpts: function sXOpts() {
- return Object.assign({}, conf.table.scrollX, this.scrollX);
- },
- sYOpts: function sYOpts() {
- return Object.assign({}, conf.table.scrollY, this.scrollY);
- },
- 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);
- },
- tooltipOpts: function tooltipOpts() {
- var opts = Object.assign({
- leaveDelay: 300
- }, conf.table.tooltipConfig, this.tooltipConfig);
- if (opts.enterable) {
- opts.leaveMethod = this.handleTooltipLeaveMethod;
- }
- return opts;
- },
- 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);
- },
- hasTip: function hasTip() {
- return v_x_e_table._tooltip;
- },
- 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) && isEnableConf(this.ctxMenuOpts) && (this.headerCtxMenu.length || this.bodyCtxMenu.length || this.footerCtxMenu.length));
- },
- ctxMenuOpts: function ctxMenuOpts() {
- return Object.assign({}, 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;
- var inited = this.inited,
- initStatus = this.initStatus;
- this.loadTableData(value).then(function () {
- _this.inited = true;
- _this.initStatus = true;
- if (!initStatus) {
- _this.handleLoadDefaults();
- }
- if (!inited) {
- _this.handleInitDefaults();
- }
- if ((_this.scrollXLoad || _this.scrollYLoad) && _this.expandColumn) {
- UtilTools.warn('vxe.error.scrollErrProp', ['column.type=expand']);
- }
- _this.recalculate();
- });
- },
- staticColumns: function staticColumns(value) {
- this.handleColumn(value);
- },
- tableColumn: function tableColumn() {
- this.analyColumnWidth();
- },
- showHeader: function showHeader() {
- var _this2 = this;
- this.$nextTick(function () {
- _this2.recalculate(true).then(function () {
- return _this2.refreshScroll();
- });
- });
- },
- showFooter: function showFooter() {
- var _this3 = this;
- this.$nextTick(function () {
- _this3.recalculate(true).then(function () {
- return _this3.refreshScroll();
- });
- });
- },
- height: function height() {
- var _this4 = this;
- this.$nextTick(function () {
- return _this4.recalculate(true);
- });
- },
- maxHeight: function maxHeight() {
- var _this5 = this;
- this.$nextTick(function () {
- return _this5.recalculate(true);
- });
- },
- syncResize: function syncResize(value) {
- var _this6 = this;
- if (value) {
- handleUupdateResize(this);
- this.$nextTick(function () {
- handleUupdateResize(_this6);
- setTimeout(function () {
- return handleUupdateResize(_this6);
- });
- });
- }
- },
- mergeCells: function mergeCells(value) {
- this.clearMergeCells();
- this.setMergeCells(value);
- },
- mergeFooterItems: function mergeFooterItems(value) {
- this.clearMergeFooterItems();
- this.setMergeFooterItems(value);
- }
- },
- created: function created() {
- var _this7 = 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: [],
- // 收集的列配置(带分组)
- collectColumn: [],
- // 完整所有列(不带分组)
- tableFullColumn: [],
- // 渲染所有列
- visibleColumn: [],
- // 缓存数据集
- fullAllDataRowMap: new Map(),
- fullAllDataRowIdData: {},
- fullDataRowMap: new Map(),
- fullDataRowIdData: {},
- fullColumnMap: new Map(),
- fullColumnIdData: {},
- fullColumnFieldData: {}
- }),
- scrollXStore = _Object$assign.scrollXStore,
- sYOpts = _Object$assign.sYOpts,
- scrollYStore = _Object$assign.scrollYStore,
- data = _Object$assign.data,
- editOpts = _Object$assign.editOpts,
- treeOpts = _Object$assign.treeOpts,
- treeConfig = _Object$assign.treeConfig,
- showOverflow = _Object$assign.showOverflow;
- if (false) { var exportConfig, exportOpts, importConfig, importOpts; }
- if (false) { var customOpts; } // v4 中只支持对象类型
- if (false) {} // 检查是否有安装需要的模块
- if (false) {}
- Object.assign(scrollYStore, {
- startIndex: 0,
- endIndex: 0,
- visibleSize: 0,
- adaptive: sYOpts.adaptive !== false
- });
- Object.assign(scrollXStore, {
- startIndex: 0,
- endIndex: 0,
- visibleSize: 0
- });
- this.loadTableData(data).then(function () {
- if (data && data.length) {
- _this7.inited = true;
- _this7.initStatus = true;
- _this7.handleLoadDefaults();
- _this7.handleInitDefaults();
- }
- _this7.updateStyle();
- });
- 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 _this8 = this;
- if (this.autoResize) {
- var resizeObserver = createResizeEvent(function () {
- return _this8.recalculate(true);
- });
- resizeObserver.observe(this.$el);
- resizeObserver.observe(this.getParentElem());
- this.$resize = resizeObserver;
- }
- this.preventEvent(null, 'mounted');
- },
- activated: function activated() {
- var _this9 = this;
- this.recalculate().then(function () {
- return _this9.refreshScroll();
- });
- this.preventEvent(null, 'activated');
- },
- deactivated: function deactivated() {
- this.preventEvent(null, 'deactivated');
- },
- beforeDestroy: function beforeDestroy() {
- 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,
- tId = this.tId,
- tableData = this.tableData,
- tableColumn = this.tableColumn,
- tableGroupColumn = this.tableGroupColumn,
- isGroup = this.isGroup,
- loading = this.loading,
- 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,
- 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,
- validTipOpts = this.validTipOpts,
- tooltipOpts = this.tooltipOpts,
- initStore = this.initStore,
- columnStore = this.columnStore,
- filterStore = this.filterStore,
- ctxMenuStore = this.ctxMenuStore,
- ctxMenuOpts = this.ctxMenuOpts,
- footerTableData = this.footerTableData,
- hasTip = this.hasTip;
- var leftList = columnStore.leftList,
- rightList = columnStore.rightList;
- return h('div', {
- class: ['vxe-table', 'vxe-table--render-default', "tid_".concat(tId), vSize ? "size--".concat(vSize) : '', "border--".concat(tableBorder), {
- 'vxe-editable': !!editConfig,
- 'cell--highlight': highlightCell,
- 'cell--selected': mouseConfig && mouseOpts.selected,
- 'cell--area': mouseConfig && mouseOpts.area,
- 'row--highlight': highlightHoverRow,
- 'column--highlight': highlightHoverColumn,
- 'is--header': showHeader,
- 'is--footer': showFooter,
- 'is--group': isGroup,
- 'is--tree-line': treeConfig && treeOpts.line,
- 'is--fixed-left': leftList.length,
- 'is--fixed-right': rightList.length,
- 'is--animat': !!this.animat,
- 'is--round': this.round,
- 'is--stripe': !treeConfig && stripe,
- 'is--loading': loading,
- 'is--empty': !loading && !tableData.length,
- 'is--scroll-y': overflowY,
- 'is--scroll-x': overflowX,
- 'is--virtual-x': scrollXLoad,
- 'is--virtual-y': scrollYLoad
- }]
- }, [
- /**
- * 隐藏列
- */
- h('div', {
- class: 'vxe-table-slots',
- ref: 'hideColumn'
- }, this.$slots.default), h('div', {
- class: 'vxe-table--render-wrapper'
- }, [h('div', {
- class: 'vxe-table--main-wrapper'
- }, [
- /**
- * 表头
- */
- showHeader ? h('vxe-table-header', {
- ref: 'tableHeader',
- props: {
- tableData: tableData,
- tableColumn: tableColumn,
- tableGroupColumn: tableGroupColumn,
- size: vSize
- }
- }) : _e(),
- /**
- * 表体
- */
- h('vxe-table-body', {
- ref: 'tableBody',
- props: {
- tableData: tableData,
- tableColumn: tableColumn,
- size: vSize
- }
- }),
- /**
- * 表尾
- */
- showFooter ? h('vxe-table-footer', {
- ref: 'tableFooter',
- props: {
- footerTableData: footerTableData,
- tableColumn: tableColumn,
- size: vSize
- }
- }) : _e()]), h('div', {
- class: 'vxe-table--fixed-wrapper'
- }, [
- /**
- * 左侧固定区域
- */
- 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'
- }, renderEmptyContenet(h, this))]),
- /**
- * 边框线
- */
- h('div', {
- class: 'vxe-table--border-line'
- }),
- /**
- * 列宽线
- */
- h('div', {
- class: 'vxe-table--resizable-bar',
- style: overflowX ? {
- 'padding-bottom': "".concat(scrollbarHeight, "px")
- } : null,
- ref: 'resizeBar'
- }),
- /**
- * 加载中
- */
- h('div', {
- class: ['vxe-table--loading vxe-loading', {
- 'is--visible': loading
- }]
- }, [h('div', {
- class: 'vxe-loading--spinner'
- })]),
- /**
- * 筛选
- */
- initStore.filter ? h('vxe-table-filter', {
- ref: 'filterWrapper',
- props: {
- filterStore: filterStore
- }
- }) : _e(),
- /**
- * 导入
- */
- initStore.import && this.importConfig ? h('vxe-import-panel', {
- props: {
- defaultOptions: this.importParams,
- storeData: this.importStore
- }
- }) : _e(),
- /**
- * 导出/打印
- */
- initStore.export && (this.exportConfig || this.printConfig) ? h('vxe-export-panel', {
- props: {
- defaultOptions: this.exportParams,
- storeData: this.exportStore
- }
- }) : _e(),
- /**
- * 快捷菜单
- */
- ctxMenuStore.visible && this.isCtxMenu ? h('vxe-table-context-menu', {
- ref: 'ctxWrapper',
- props: {
- ctxMenuStore: ctxMenuStore,
- ctxMenuOpts: ctxMenuOpts
- }
- }) : _e(),
- /**
- * 通用提示
- */
- hasTip ? h('vxe-tooltip', {
- ref: 'commTip',
- props: {
- isArrow: false,
- enterable: false
- }
- }) : _e(),
- /**
- * 工具提示
- */
- hasTip ? h('vxe-tooltip', {
- ref: 'tooltip',
- props: tooltipOpts
- }) : _e(),
- /**
- * 校验提示
- */
- hasTip && this.editRules && validOpts.showMessage && (validOpts.message === 'default' ? !height : validOpts.message === 'tooltip') ? h('vxe-tooltip', {
- ref: 'validTip',
- class: 'vxe-table--valid-error',
- props: validOpts.message === 'tooltip' || tableData.length === 1 ? validTipOpts : null
- }) : _e()]);
- },
- methods: methods
- });
- // CONCATENATED MODULE: ./packages/table/index.js
- var Table = Object.assign(table, {
- install: function install(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);
- Vue.component(src_body.name, src_body);
- }
- });
- /* harmony default export */ var packages_table = (Table);
- // 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 : '', {
- 'is--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'
- }, $xetable.callSlot(slots.filter, 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)))];
- }
- 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 || (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isBoolean(compConf.showFilterFooter) ? compConf.showFilterFooter !== false : compConf.isFooter !== false)) ? [h('div', {
- 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: {
- /**
- * 修改筛选条件列表
- * @param {ColumnInfo} fieldOrColumn 列
- * @param {Array} options 选项
- */
- _setFilter: function _setFilter(fieldOrColumn, options) {
- var column = handleFieldOrColumn(this, fieldOrColumn);
- if (column && 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 filterStore = this.filterStore;
- if (filterStore.column === column && filterStore.visible) {
- filterStore.visible = false;
- } else {
- 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.initStore.filter = true;
- this.$nextTick(function () {
- var $refs = _this.$refs;
- var bodyElem = $refs.tableBody.$el;
- var filterWrapperElem = $refs.filterWrapper.$el;
- var filterWidth = filterWrapperElem.offsetWidth;
- var centerWidth = filterWidth / 2;
- var minMargin = 10;
- var maxLeft = bodyElem.clientWidth - filterWidth - minMargin;
- 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.min(maxLeft, Math.max(minMargin, left)), "px");
- } else if (right) {
- var _overflowWidth = pageX + filterWidth - centerWidth + minMargin - visibleWidth;
- if (_overflowWidth > 0) {
- right += _overflowWidth;
- }
- style.right = "".concat(Math.max(minMargin, right), "px");
- }
- filterStore.style = style;
- });
- }
- },
- _getCheckedFilters: function _getCheckedFilters() {
- var visibleColumn = this.visibleColumn;
- var filterList = [];
- visibleColumn.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,
- 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) {
- this.handleTableData(true);
- this.checkSelectionStatus();
- }
- this.emitEvent('filter-change', {
- column: column,
- property: 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 = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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} fieldOrColumn 列
- */
- _clearFilter: function _clearFilter(fieldOrColumn) {
- var filterStore = this.filterStore;
- var column;
- if (fieldOrColumn) {
- column = handleFieldOrColumn(this, fieldOrColumn);
- if (column) {
- this.handleClearFilter(column);
- }
- } else {
- this.visibleColumn.forEach(this.handleClearFilter);
- }
- if (!fieldOrColumn || 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
- var Filter = {
- Panel: panel,
- install: function install(Vue) {
- v_x_e_table.reg('filter');
- packages_table.mixins.push(src_mixin);
- Vue.component(panel.name, panel);
- }
- };
- /* harmony default export */ var filter = (Filter);
- // CONCATENATED MODULE: ./packages/menu/src/panel.js
- /* harmony default export */ var src_panel = ({
- name: 'VxeTableContextMenu',
- props: {
- ctxMenuStore: Object,
- ctxMenuOpts: Object
- },
- mounted: function mounted() {
- document.body.appendChild(this.$el);
- },
- beforeDestroy: function beforeDestroy() {
- var $el = this.$el;
- if ($el.parentNode) {
- $el.parentNode.removeChild($el);
- }
- },
- render: function render(h) {
- var $xetable = this.$parent;
- var ctxMenuOpts = this.ctxMenuOpts,
- ctxMenuStore = this.ctxMenuStore;
- return h('div', {
- class: ['vxe-table--context-menu-wrapper', ctxMenuOpts.className],
- style: ctxMenuStore.style
- }, ctxMenuStore.list.map(function (options, gIndex) {
- return h('ul', {
- class: 'vxe-context-menu--option-wrapper',
- key: gIndex
- }, options.map(function (item, index) {
- var hasChildMenus = item.children && item.children.length;
- return item.visible === false ? null : 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 ? null : 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))])]);
- })) : null]);
- }));
- }));
- }
- });
- // 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 = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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('xid') === 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")]) {
- if (false) {}
- 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('xid') === 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, null, function () {
- if (!visibleMethod || visibleMethod(params)) {
- 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) {
- if (!menu.disabled && (!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);
- } // 在 v4 中废弃事件 context-menu-click
- if (this.$listeners['context-menu-click']) {
- if (false) {}
- this.emitEvent('context-menu-click', params, evnt);
- } else {
- this.emitEvent('menu-click', params, evnt);
- }
- this.closeMenu();
- }
- }
- }
- });
- // CONCATENATED MODULE: ./packages/menu/index.js
- var Menu = {
- Panel: src_panel,
- install: function install(Vue) {
- v_x_e_table.reg('menu');
- packages_table.mixins.push(menu_src_mixin);
- Vue.component(src_panel.name, src_panel);
- }
- };
- /* harmony default export */ var packages_menu = (Menu);
- // 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 (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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, [afIndex, 0].concat(_toConsumableArray(newRecords)));
- tableFullData.splice.apply(tableFullData, [tableFullData.indexOf(row), 0].concat(_toConsumableArray(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.updateCellAreas();
- return _this.recalculate();
- }).then(function () {
- 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 (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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.updateCellAreas();
- return _this2.recalculate();
- }).then(function () {
- return {
- row: rest.length ? rest[rest.length - 1] : null,
- rows: rest
- };
- });
- },
- /**
- * 删除复选框选中的数据
- */
- _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;
- if (keepSource) {
- var actived = editStore.actived;
- var row = actived.row,
- column = actived.column;
- if (row || column) {
- this.clearActived();
- }
- if (treeConfig) {
- return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 (isEnableConf(editRender) && cell) {
- if (actived.row !== row || (mode === 'cell' ? actived.column !== column : false)) {
- // 判断是否禁用编辑
- var type = 'edit-disabled';
- if (!activeMethod || activeMethod(params)) {
- if (mouseConfig) {
- 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, {
- 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.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;
- }
- },
- /**
- * 清除激活的编辑
- */
- _clearActived: function _clearActived(evnt) {
- 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);
- }
- actived.args = null;
- actived.row = null;
- actived.column = null;
- this.updateFooter();
- this.emitEvent('edit-closed', {
- 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);
- },
- _getActiveRecord: function _getActiveRecord() {
- var $el = this.$el,
- editStore = this.editStore,
- afterFullData = this.afterFullData;
- var actived = editStore.actived;
- var args = actived.args,
- row = actived.row;
- if (args && afterFullData.indexOf(row) > -1 && $el.querySelectorAll('.vxe-body--column.col--actived').length) {
- return Object.assign({}, args);
- }
- return null;
- },
- /**
- * 判断行是否为激活编辑状态
- * @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 (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, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.find(this.visibleColumn, function (column) {
- return isEnableConf(column.editRender);
- }));
- },
- /**
- * 激活单元格编辑
- */
- _setActiveCell: function _setActiveCell(row, fieldOrColumn) {
- var _this8 = this;
- var column = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isString(fieldOrColumn) ? this.getColumnByField(fieldOrColumn) : fieldOrColumn;
- if (row && column && 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 = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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) {
- 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;
- var actived = editStore.actived,
- selected = editStore.selected;
- var row = params.row,
- column = params.column;
- var isMouseSelected = mouseConfig && mouseOpts.selected;
- var selectMethod = function selectMethod() {
- if (isMouseSelected && (selected.row !== row || selected.column !== column)) {
- if (actived.row !== row || (editOpts.mode === 'cell' ? actived.column !== column : false)) {
- _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();
- }
- _this9.focus();
- if (evnt) {
- _this9.emitEvent('cell-selected', params, evnt);
- }
- }
- }
- return _this9.$nextTick();
- };
- return selectMethod();
- },
- /**
- * 获取选中的单元格
- */
- _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;
- },
- /**
- * 清除所选中源状态
- */
- _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) {
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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: ./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/modal.js
- var allActivedModals = [];
- var msgQueue = [];
- /* harmony default export */ var modal = ({
- name: 'VxeModal',
- mixins: [size],
- 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;
- }
- },
- message: [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: {
- 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']);
- }
- },
- 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 $el = this.$el;
- GlobalEvent.off(this, 'keydown');
- this.removeMsgQueue();
- if ($el.parentNode === document.body) {
- $el.parentNode.removeChild($el);
- }
- },
- render: function render(h) {
- var _ref,
- _this = 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,
- message = this.message,
- lockScroll = this.lockScroll,
- lockView = this.lockView,
- mask = this.mask,
- isMsg = this.isMsg,
- showTitleOverflow = this.showTitleOverflow,
- destroyOnClose = this.destroyOnClose;
- 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 && 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 ? 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(message)), !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: {
- type: type
- },
- on: {
- mousedown: _this.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
- });
- this.close(type);
- },
- confirmEvent: function confirmEvent(evnt) {
- var type = 'confirm';
- this.$emit(type, {
- type: type,
- $modal: this,
- $event: evnt
- });
- this.close(type);
- },
- cancelEvent: function cancelEvent(evnt) {
- var type = 'cancel';
- this.$emit(type, {
- type: type,
- $modal: this,
- $event: evnt
- });
- this.close(type);
- },
- open: function open() {
- var _this2 = 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) {
- if (!remember) {
- this.recalculate();
- }
- this.visible = true;
- this.contentVisible = false;
- this.updateZindex();
- allActivedModals.push(this);
- setTimeout(function () {
- _this2.contentVisible = true;
- _this2.$nextTick(function () {
- if (showFooter) {
- var operBtn = $refs.confirmBtn || $refs.cancelBtn;
- if (operBtn) {
- operBtn.focus();
- }
- }
- var type = '';
- var params = {
- type: type,
- $modal: _this2
- };
- if (events.show) {
- events.show.call(_this2, params);
- } else {
- _this2.$emit('input', true);
- _this2.$emit('show', params);
- }
- });
- }, 10);
- if (isMsg) {
- this.addMsgQueue();
- if (duration !== -1) {
- setTimeout(this.close, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(duration));
- }
- } else {
- this.$nextTick(function () {
- var firstOpen = _this2.firstOpen,
- fullscreen = _this2.fullscreen;
- if (!remember || !firstOpen) {
- _this2.updatePosition().then(function () {
- setTimeout(function () {
- return _this2.updatePosition();
- }, 20);
- });
- }
- if (!firstOpen) {
- _this2.firstOpen = true;
- if (_this2.hasPosStorage()) {
- _this2.restorePosStorage();
- } else if (fullscreen) {
- _this2.$nextTick(function () {
- return _this2.maximize();
- });
- }
- }
- });
- }
- }
- },
- addMsgQueue: function addMsgQueue() {
- if (msgQueue.indexOf(this) === -1) {
- msgQueue.push(this);
- }
- this.updateStyle();
- },
- removeMsgQueue: function removeMsgQueue() {
- var _this3 = this;
- if (msgQueue.indexOf(this) > -1) {
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.remove(msgQueue, function (comp) {
- return comp === _this3;
- });
- }
- this.updateStyle();
- },
- updateStyle: function updateStyle() {
- this.$nextTick(function () {
- var offsetTop = 0;
- msgQueue.forEach(function (comp) {
- offsetTop += external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(comp.top);
- comp.modalTop = offsetTop;
- offsetTop += comp.$refs.modalBox.clientHeight;
- });
- });
- },
- updatePosition: function updatePosition() {
- var _this4 = this;
- return this.$nextTick().then(function () {
- var marginSize = _this4.marginSize,
- position = _this4.position;
- var modalBoxElem = _this4.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 _this5 = 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
- };
- if (visible) {
- Promise.resolve(beforeHideMethod ? beforeHideMethod(params) : null).then(function (rest) {
- if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isError(rest)) {
- if (isMsg) {
- _this5.removeMsgQueue();
- }
- _this5.contentVisible = false;
- if (!remember) {
- _this5.zoomLocat = null;
- }
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.remove(allActivedModals, function (item) {
- return item === _this5;
- });
- setTimeout(function () {
- _this5.visible = false;
- if (events.hide) {
- events.hide.call(_this5, params);
- } else {
- _this5.$emit('input', false);
- _this5.$emit('hide', params);
- }
- }, 200);
- }
- }).catch(function (e) {
- return e;
- });
- }
- },
- handleGlobalKeydownEvent: function handleGlobalKeydownEvent(evnt) {
- var _this6 = this;
- if (evnt.keyCode === 27) {
- var lastModal = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.max(allActivedModals, function (item) {
- return item.modalZindex;
- }); // 多个时,只关掉最上层的窗口
- if (lastModal) {
- setTimeout(function () {
- if (lastModal === _this6 && lastModal.escClosable) {
- _this6.close();
- }
- }, 10);
- }
- }
- },
- getBox: function getBox() {
- return this.$refs.modalBox;
- },
- isMaximized: function isMaximized() {
- return !!this.zoomLocat;
- },
- maximize: function maximize() {
- var _this7 = this;
- return this.$nextTick().then(function () {
- if (!_this7.zoomLocat) {
- var marginSize = _this7.marginSize;
- var modalBoxElem = _this7.getBox();
- var _DomTools$getDomNode = DomTools.getDomNode(),
- visibleHeight = _DomTools$getDomNode.visibleHeight,
- visibleWidth = _DomTools$getDomNode.visibleWidth;
- _this7.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")
- });
- _this7.savePosStorage();
- }
- });
- },
- revert: function revert() {
- var _this8 = this;
- return this.$nextTick().then(function () {
- var zoomLocat = _this8.zoomLocat;
- if (zoomLocat) {
- var modalBoxElem = _this8.getBox();
- _this8.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")
- });
- _this8.savePosStorage();
- }
- });
- },
- zoom: function zoom() {
- var _this9 = this;
- return this[this.zoomLocat ? 'revert' : 'maximize']().then(function () {
- return _this9.isMaximized();
- });
- },
- toggleZoomEvent: function toggleZoomEvent(evnt) {
- var _this10 = 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) {
- _this10.$emit('zoom', params);
- } else if (events.zoom) {
- events.zoom.call(_this10, params);
- }
- });
- },
- 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 (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNumber(top)) {
- modalBoxElem.style.top = "".concat(top, "px");
- }
- if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNumber(left)) {
- modalBoxElem.style.left = "".concat(left, "px");
- }
- }
- return this.$nextTick();
- },
- boxMousedownEvent: function boxMousedownEvent() {
- var modalZindex = this.modalZindex;
- if (allActivedModals.some(function (_vm) {
- return _vm.visible && _vm.modalZindex > modalZindex;
- })) {
- this.updateZindex();
- }
- },
- mousedownEvent: function mousedownEvent(evnt) {
- var _this11 = 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) {
- _this11.$nextTick(function () {
- _this11.savePosStorage();
- });
- }
- };
- }
- },
- dragEvent: function dragEvent(evnt) {
- var _this12 = 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.getAttribute('type');
- var minWidth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(this.minWidth);
- var minHeight = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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) {
- _this12.savePosStorage();
- }
- if ($listeners.zoom) {
- _this12.$emit('zoom', params);
- } else if (events.zoom) {
- events.zoom.call(_this12, params);
- }
- };
- document.onmouseup = function () {
- _this12.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 = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(val) : '';
- }).join(',');
- localStorage.setItem(storageKey, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toJSONString(posStorageMap));
- }
- }
- }
- });
- // 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.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;
- }
- // 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 toStringTimeDate(str) {
- if (str) {
- var rest = new Date();
- var h, m, s;
- if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isDate(str)) {
- h = str.getHours();
- m = str.getMinutes();
- s = str.getSeconds();
- } else {
- str = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toValueString(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 getNumberValue(_vm, val) {
- var type = _vm.type,
- digitsValue = _vm.digitsValue;
- return type === 'float' ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toFixed(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.floor(val, digitsValue), digitsValue) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toValueString(val);
- }
- function renderDateLabel(h, _vm, item, label) {
- var festivalMethod = _vm.festivalMethod;
- if (festivalMethod) {
- var festivalRest = festivalMethod(_objectSpread2({
- type: _vm.datePanelType
- }, item));
- var festivalItem = festivalRest ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isString(festivalRest) ? {
- label: festivalRest
- } : festivalRest : {};
- var extraItem = festivalItem.extra ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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
- }, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toValueString(extraItem.label))] : label)];
- var festivalLabel = festivalItem.label;
- if (festivalLabel) {
- // 默认最多支持3个节日重叠
- var festivalLabels = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toValueString(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;
- return disabledMethod && disabledMethod({
- type: _vm.type,
- 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': external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isDateSame(dateValue, item.date, matchFormat),
- 'is--hover': external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isDateSame(dateValue, item.date, matchFormat);
- });
- var isHover = rows.some(function (item) {
- return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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': external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isDateSame(dateValue, item.date, matchFormat),
- 'is--hover': external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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': external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isDateSame(dateValue, item.date, matchFormat),
- 'is--hover': external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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: {
- 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,
- inputValue = _vm.inputValue,
- 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 && !(inputValue === '' || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eqNull(inputValue))
- }],
- 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',
- mixins: [size],
- model: {
- prop: 'value',
- event: 'modelValue'
- },
- props: {
- value: [String, Number, Date],
- immediate: {
- type: Boolean,
- default: true
- },
- 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: {
- type: Number,
- default: function _default() {
- return conf.input.startWeek;
- }
- },
- labelFormat: {
- type: String,
- default: function _default() {
- return conf.input.labelFormat;
- }
- },
- 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: this.value,
- datetimePanelValue: null,
- datePanelValue: null,
- datePanelLabel: '',
- datePanelType: 'day',
- selectMonth: null,
- currentDate: null
- };
- },
- computed: {
- 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 external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toInteger(step) || 1;
- } else if (type === 'float') {
- return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(step) || 1 / Math.pow(10, this.digitsValue);
- }
- return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(step) || 1;
- },
- digitsValue: function digitsValue() {
- return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toStringDate(this.minDate) : null;
- },
- dateMaxTime: function dateMaxTime() {
- return this.maxDate ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toStringDate(this.maxDate) : null;
- },
- dateValue: function dateValue() {
- var inputValue = this.inputValue,
- value = this.value,
- isDatePicker = this.isDatePicker,
- type = this.type,
- dateValueFormat = this.dateValueFormat;
- var val = null;
- if (inputValue && isDatePicker) {
- var date;
- if (type === 'time') {
- date = toStringTimeDate(inputValue);
- } else {
- date = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toStringDate(type === 'week' ? value : inputValue, dateValueFormat);
- }
- if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isValidDate(date)) {
- val = date;
- }
- }
- return val;
- },
- dateTimeLabel: function dateTimeLabel() {
- var datetimePanelValue = this.datetimePanelValue;
- if (datetimePanelValue) {
- return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 || 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 || (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 sWeek = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(this.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 = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatYear(selectMonth, 0, 'first').getFullYear();
- for (var index = -4; index < monthSize - 4; index++) {
- var date = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatDay(selectMonth, prevOffsetDate).getTime() + hmsTime);
- for (var index = 0; index < 42; index++) {
- var date = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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: external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getYearWeek(firstItem.date)
- };
- return [item].concat(list);
- });
- },
- 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;
- },
- inpImmediate: function inpImmediate() {
- var type = this.type,
- immediate = this.immediate;
- return immediate || !(type === 'text' || type === 'number' || type === 'integer' || type === 'float');
- },
- 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 && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(maxlength) ? 16 : maxlength,
- // 数值最大长度限制 16 位,包含小数
- readonly: readonly || type === 'week' || !editable,
- disabled: disabled,
- autocomplete: autocomplete
- };
- if (placeholder) {
- attrs.placeholder = UtilTools.getFuncText(placeholder);
- }
- return attrs;
- },
- inpEvents: function inpEvents() {
- var _this = this;
- var evnts = {};
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.each(this.$listeners, function (cb, name) {
- if (['input', 'change', 'blur', '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.change = this.changeEvent;
- evnts.focus = this.focusEvent;
- evnts.blur = this.blurEvent;
- return evnts;
- }
- },
- watch: {
- value: function value(val) {
- this.inputValue = val;
- 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,
- inputValue = this.inputValue,
- isDatePicker = this.isDatePicker,
- visiblePanel = this.visiblePanel,
- isActivated = this.isActivated,
- vSize = this.vSize,
- type = this.type,
- align = this.align,
- readonly = this.readonly,
- disabled = this.disabled,
- inpAttrs = this.inpAttrs,
- inpEvents = this.inpEvents;
- var childs = [];
- var prefix = rendePrefixIcon(h, this);
- var suffix = renderSuffixIcon(h, this); // 前缀图标
- if (prefix) {
- childs.push(prefix);
- } // 输入框
- childs.push(h('input', {
- ref: 'input',
- class: 'vxe-input--inner',
- domProps: {
- value: inputValue
- },
- attrs: inpAttrs,
- on: inpEvents
- })); // 后缀图标
- 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,
- inputValue = this.inputValue;
- this.$emit(evnt.type, {
- $panel: $refs.panel,
- value: inputValue,
- $event: evnt
- });
- },
- emitModel: function emitModel(value, evnt) {
- this.inputValue = value;
- this.$emit('modelValue', value);
- this.$emit('input', {
- value: value,
- $event: evnt
- });
- if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toValueString(this.value) !== value) {
- this.$emit('change', {
- value: value,
- $event: evnt
- });
- }
- },
- emitInputEvent: function emitInputEvent(value, evnt) {
- var inpImmediate = this.inpImmediate,
- isDatePicker = this.isDatePicker;
- this.inputValue = value;
- if (!isDatePicker) {
- if (inpImmediate) {
- this.emitModel(value, evnt);
- } else {
- this.$emit('input', {
- value: value,
- $event: evnt
- });
- }
- }
- },
- inputEvent: function inputEvent(evnt) {
- var value = evnt.target.value;
- this.emitInputEvent(value, evnt);
- },
- changeEvent: function changeEvent(evnt) {
- var inpImmediate = this.inpImmediate;
- if (inpImmediate) {
- this.triggerEvent(evnt);
- } else {
- this.emitModel(this.inputValue, evnt);
- }
- },
- focusEvent: function focusEvent(evnt) {
- this.isActivated = true;
- this.triggerEvent(evnt);
- },
- blurEvent: function blurEvent(evnt) {
- var inputValue = this.inputValue,
- inpImmediate = this.inpImmediate;
- var value = inputValue;
- if (!inpImmediate) {
- this.emitModel(value, evnt);
- }
- this.afterCheckValue();
- if (!this.visiblePanel) {
- this.isActivated = false;
- }
- this.$emit('blur', {
- value: value,
- $event: 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)) {
- 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,
- inputValue = this.inputValue;
- if (!disabled) {
- this.$emit('prefix-click', {
- $panel: $refs.panel,
- value: inputValue,
- $event: evnt
- });
- }
- },
- clickSuffixEvent: function clickSuffixEvent(evnt) {
- var $refs = this.$refs,
- disabled = this.disabled,
- inputValue = this.inputValue;
- if (!disabled) {
- if (DomTools.hasClass(evnt.currentTarget, 'is--clear')) {
- this.emitModel('', evnt);
- this.clearValueEvent(evnt, '');
- } else {
- this.$emit('suffix-click', {
- $panel: $refs.panel,
- value: inputValue,
- $event: evnt
- });
- }
- }
- },
- clearValueEvent: function clearValueEvent(evnt, value) {
- var $refs = this.$refs,
- type = this.type,
- isNumber = this.isNumber;
- if (this.isDatePicker) {
- this.hidePanel();
- }
- if (isNumber || ['text', 'search', 'password'].indexOf(type) > -1) {
- this.focus();
- }
- this.$emit('clear', {
- $panel: $refs.panel,
- value: value,
- $event: evnt
- });
- },
- /**
- * 检查初始值
- */
- initValue: function initValue() {
- var type = this.type,
- isDatePicker = this.isDatePicker,
- inputValue = this.inputValue,
- digitsValue = this.digitsValue;
- if (isDatePicker) {
- this.changeValue();
- } else if (type === 'float') {
- if (inputValue) {
- var validValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toFixed(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.floor(inputValue, digitsValue), digitsValue);
- if (inputValue !== validValue) {
- this.emitModel(validValue, {
- type: 'init'
- });
- }
- }
- }
- },
- /**
- * 值变化时处理
- */
- changeValue: function changeValue() {
- if (this.isDatePicker) {
- this.dateParseValue(this.inputValue);
- this.inputValue = this.datePanelLabel;
- }
- },
- afterCheckValue: function afterCheckValue() {
- var type = this.type,
- inpAttrs = this.inpAttrs,
- inputValue = this.inputValue,
- isDatePicker = this.isDatePicker,
- isNumber = this.isNumber,
- datetimePanelValue = this.datetimePanelValue,
- dateLabelFormat = this.dateLabelFormat,
- min = this.min,
- max = this.max;
- if (!inpAttrs.readonly) {
- if (isNumber) {
- if (inputValue) {
- var inpVal = type === 'integer' ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toInteger(inputValue) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(inputValue);
- if (!this.vaildMinNum(inpVal)) {
- inpVal = min;
- } else if (!this.vaildMaxNum(inpVal)) {
- inpVal = max;
- }
- this.emitModel(getNumberValue(this, inpVal), {
- type: 'check'
- });
- }
- } else if (isDatePicker) {
- var _inpVal = inputValue;
- if (_inpVal) {
- if (type === 'time') {
- _inpVal = toStringTimeDate(_inpVal);
- } else {
- _inpVal = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toStringDate(_inpVal, dateLabelFormat);
- }
- if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isValidDate(_inpVal)) {
- if (type === 'time') {
- _inpVal = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toDateString(_inpVal, dateLabelFormat);
- if (inputValue !== _inpVal) {
- this.emitModel(_inpVal, {
- type: 'check'
- });
- }
- this.inputValue = _inpVal;
- } else {
- if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isDateSame(inputValue, _inpVal, dateLabelFormat)) {
- if (type === 'datetime') {
- datetimePanelValue.setHours(_inpVal.getHours());
- datetimePanelValue.setMinutes(_inpVal.getMinutes());
- datetimePanelValue.setSeconds(_inpVal.getSeconds());
- }
- } else {
- this.inputValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toDateString(_inpVal, dateLabelFormat);
- }
- this.dateChange(_inpVal);
- }
- } else {
- this.dateRevert();
- }
- } else {
- this.emitModel('', {
- 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 >= external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(this.min);
- },
- vaildMaxNum: function vaildMaxNum(num) {
- return this.max === null || num <= external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 min = this.min,
- max = this.max,
- type = this.type,
- inputValue = this.inputValue,
- stepValue = this.stepValue;
- var numValue = type === 'integer' ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toInteger(inputValue) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(inputValue);
- var newValue = isPlus ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.add(numValue, stepValue) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.subtract(numValue, stepValue);
- var restNum;
- if (!this.vaildMinNum(newValue)) {
- restNum = min;
- } else if (!this.vaildMaxNum(newValue)) {
- restNum = max;
- } else {
- restNum = newValue;
- }
- this.emitInputEvent(getNumberValue(this, restNum), evnt);
- },
- // 数值
- // 日期
- datePickerOpenEvent: function datePickerOpenEvent(evnt) {
- var readonly = this.readonly;
- if (!readonly) {
- evnt.preventDefault();
- this.showPanel();
- }
- },
- dateMonthHandle: function dateMonthHandle(date, offsetMonth) {
- this.selectMonth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatMonth(date, offsetMonth, 'first');
- },
- dateNowHandle: function dateNowHandle() {
- var currentDate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatYear(this.selectMonth, -yearSize, 'first');
- } else if (type === 'month') {
- if (datePanelType === 'year') {
- this.selectMonth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatYear(this.selectMonth, -yearSize, 'first');
- } else {
- this.selectMonth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatYear(this.selectMonth, -1, 'first');
- }
- } else {
- if (datePanelType === 'year') {
- this.selectMonth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatYear(this.selectMonth, -yearSize, 'first');
- } else if (datePanelType === 'month') {
- this.selectMonth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatYear(this.selectMonth, -1, 'first');
- } else {
- this.selectMonth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatYear(this.selectMonth, yearSize, 'first');
- } else if (type === 'month') {
- if (datePanelType === 'year') {
- this.selectMonth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatYear(this.selectMonth, yearSize, 'first');
- } else {
- this.selectMonth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatYear(this.selectMonth, 1, 'first');
- }
- } else {
- if (datePanelType === 'year') {
- this.selectMonth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatYear(this.selectMonth, yearSize, 'first');
- } else if (datePanelType === 'month') {
- this.selectMonth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatYear(this.selectMonth, 1, 'first');
- } else {
- this.selectMonth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatMonth(this.selectMonth, 1, 'first');
- }
- }
- this.$emit('date-next', {
- 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;
- var isWeekType = type === 'week';
- 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();
- }
- }
- if (isWeekType) {
- this.changeValue();
- }
- },
- 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 external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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;
- var dValue = null;
- var dLabel = '';
- if (date) {
- if (type === 'time') {
- dValue = toStringTimeDate(date);
- } else {
- dValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toStringDate(date, valueFormat);
- }
- }
- if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isValidDate(dValue)) {
- dLabel = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatYear(datePanelValue || Date.now(), 0, 'first');
- if (isLeftArrow) {
- offsetYear = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatYear(offsetYear, -1);
- } else if (isUpArrow) {
- offsetYear = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatYear(offsetYear, -4);
- } else if (isRightArrow) {
- offsetYear = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatYear(offsetYear, 1);
- } else if (isDwArrow) {
- offsetYear = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatYear(offsetYear, 4);
- }
- this.dateMoveYear(offsetYear);
- } else if (datePanelType === 'month') {
- var offsetMonth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatMonth(datePanelValue || Date.now(), 0, 'first');
- if (isLeftArrow) {
- offsetMonth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatMonth(offsetMonth, -1);
- } else if (isUpArrow) {
- offsetMonth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatMonth(offsetMonth, -4);
- } else if (isRightArrow) {
- offsetMonth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatMonth(offsetMonth, 1);
- } else if (isDwArrow) {
- offsetMonth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatMonth(offsetMonth, 4);
- }
- this.dateMoveMonth(offsetMonth);
- } else {
- var offsetDay = datePanelValue || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatDay(Date.now(), 0, 'first');
- if (isLeftArrow) {
- offsetDay = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatDay(offsetDay, -1);
- } else if (isUpArrow) {
- offsetDay = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatWeek(offsetDay, -1);
- } else if (isRightArrow) {
- offsetDay = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatDay(offsetDay, 1);
- } else if (isDwArrow) {
- offsetDay = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(this.startWeek);
- date = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toDateString(date, dateValueFormat);
- this.dateCheckMonth(date);
- if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isEqual(value, inpVal)) {
- this.emitModel(inpVal, {
- type: 'update'
- });
- }
- },
- dateCheckMonth: function dateCheckMonth(date) {
- var month = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatMonth(date, 0, 'first');
- if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getWhatDay(Date.now(), 0, 'first');
- this.$nextTick(function () {
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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/checkbox/src/checkbox.js
- /* harmony default export */ var src_checkbox = ({
- name: 'VxeCheckbox',
- mixins: [size],
- props: {
- value: Boolean,
- label: [String, Number],
- indeterminate: Boolean,
- title: [String, Number],
- content: [String, Number],
- disabled: Boolean,
- size: {
- type: String,
- default: function _default() {
- return conf.checkbox.size || conf.size;
- }
- }
- },
- inject: {
- $xecheckboxgroup: {
- default: null
- }
- },
- computed: {
- isGroup: function isGroup() {
- return this.$xecheckboxgroup;
- },
- isDisabled: function isDisabled() {
- return this.disabled || this.isGroup && this.$xecheckboxgroup.disabled;
- }
- },
- render: function render(h) {
- var _ref;
- var $scopedSlots = this.$scopedSlots,
- $xecheckboxgroup = this.$xecheckboxgroup,
- isGroup = this.isGroup,
- isDisabled = this.isDisabled,
- title = this.title,
- vSize = this.vSize,
- indeterminate = this.indeterminate,
- value = this.value,
- label = this.label,
- content = this.content;
- 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 ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.includes($xecheckboxgroup.value, label) : value
- },
- on: {
- change: this.changeEvent
- }
- }), h('span', {
- class: 'vxe-checkbox--icon'
- }), h('span', {
- class: 'vxe-checkbox--label'
- }, $scopedSlots.default ? $scopedSlots.default.call(this, {}) : [UtilTools.getFuncText(content)])]);
- },
- methods: {
- changeEvent: function changeEvent(evnt) {
- var $xecheckboxgroup = this.$xecheckboxgroup,
- isGroup = this.isGroup,
- isDisabled = this.isDisabled,
- label = this.label;
- if (!isDisabled) {
- var checked = evnt.target.checked;
- var params = {
- checked: checked,
- label: label,
- $event: evnt
- };
- if (isGroup) {
- $xecheckboxgroup.handleChecked(params);
- } else {
- this.$emit('input', checked);
- this.$emit('change', params);
- }
- }
- }
- }
- });
- // CONCATENATED MODULE: ./packages/select/src/select.js
- function isOptionVisible(option) {
- return option.visible !== false;
- }
- function getOptUniqueId() {
- return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.uniqueId('opt_');
- }
- function getOptkey(_vm) {
- return _vm.optionId || '_XID';
- }
- function getOptid(_vm, option) {
- var optid = option[getOptkey(_vm)];
- return optid ? encodeURIComponent(optid) : '';
- }
- function findOffsetOption(_vm, optionValue) {
- var isUpArrow = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
- 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 external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toValueString(item ? item[_vm.labelField] : value);
- }
- function renderOption(h, _vm, list, group) {
- var isGroup = _vm.isGroup,
- labelField = _vm.labelField,
- valueField = _vm.valueField,
- 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 ? optid : cIndex,
- class: ['vxe-select-option', {
- 'is--disabled': isDisabled,
- 'is--selected': multiple ? value && value.indexOf(optionValue) > -1 : value === optionValue,
- 'is--hover': currentValue === optionValue
- }],
- attrs: {
- optid: optid
- },
- on: {
- 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,
- 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 ? optid : gIndex,
- class: ['vxe-optgroup', {
- 'is--disabled': isGroupDisabled
- }],
- attrs: {
- 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',
- mixins: [size],
- 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,
- optionId: {
- type: String,
- default: function _default() {
- return conf.select.optionId;
- }
- },
- 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: {
- 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 external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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,
- 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--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: {
- placement: this.panelPlacement
- },
- style: this.panelStyle
- }, inited ? [h('div', {
- ref: 'optWrapper',
- class: 'vxe-select-option--wrapper'
- }, select_renderOpts(h, this))] : null)]);
- },
- 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("[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
- });
- },
- changeEvent: function changeEvent(evnt, selectValue) {
- if (selectValue !== this.value) {
- this.$emit('input', selectValue);
- this.$emit('change', {
- value: selectValue,
- $event: evnt
- });
- }
- },
- changeOptionEvent: function changeOptionEvent(evnt, selectValue) {
- 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);
- this.hideOptionPanel();
- }
- },
- 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;
- },
- togglePanel: function togglePanel() {
- if (this.visiblePanel) {
- this.hideOptionPanel();
- } else {
- this.showOptionPanel();
- }
- this.$nextTick();
- },
- hidePanel: function hidePanel() {
- if (this.visiblePanel) {
- this.hideOptionPanel();
- }
- this.$nextTick();
- },
- showPanel: function showPanel() {
- if (!this.visiblePanel) {
- this.showOptionPanel();
- }
- this.$nextTick();
- },
- togglePanelEvent: function togglePanelEvent(params) {
- var $event = params.$event;
- $event.preventDefault();
- if (this.visiblePanel) {
- this.hideOptionPanel();
- } else {
- this.showOptionPanel();
- }
- },
- showOptionPanel: function showOptionPanel() {
- var _this4 = 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 = _this4.value,
- multiple = _this4.multiple;
- var currOption = findOption(_this4, multiple && value ? value[0] : value);
- _this4.visiblePanel = true;
- if (currOption) {
- _this4.setCurrentOption(currOption);
- _this4.scrollToOption(currOption);
- }
- }, 10);
- this.updateZindex();
- this.updatePlacement();
- }
- },
- hideOptionPanel: function hideOptionPanel() {
- var _this5 = this;
- this.visiblePanel = false;
- this.hidePanelTimeout = setTimeout(function () {
- _this5.animatVisible = false;
- }, 350);
- },
- 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.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");
- }
- }
- }
- }
- _this6.panelStyle = panelStyle;
- _this6.panelPlacement = panelPlacement;
- return _this6.$nextTick();
- }
- });
- },
- focus: function focus() {
- this.isActivated = true;
- this.$refs.input.focus();
- return this.$nextTick();
- },
- blur: function blur() {
- this.hideOptionPanel();
- this.$refs.input.blur();
- 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 = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 watch = {};
- Object.keys(option_props).forEach(function (name) {
- 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: 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/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;
- },
- checkedAll: function checkedAll() {
- return this.storeData.columns.every(function (column) {
- return column.checked;
- });
- },
- showSheet: function showSheet() {
- return ['html', 'xml', 'xlsx', 'pdf'].indexOf(this.defaultOptions.type) > -1;
- },
- supportMerge: function supportMerge() {
- var storeData = this.storeData,
- defaultOptions = this.defaultOptions;
- return !defaultOptions.original && defaultOptions.mode === 'current' && (storeData.isPrint || ['html', 'xlsx'].indexOf(defaultOptions.type) > -1);
- },
- supportStyle: function supportStyle() {
- var defaultOptions = this.defaultOptions;
- return !defaultOptions.original && ['xlsx'].indexOf(defaultOptions.type) > -1;
- }
- },
- render: function render(h) {
- var _this = this;
- var _e = this._e,
- checkedAll = this.checkedAll,
- isAll = this.isAll,
- isIndeterminate = this.isIndeterminate,
- showSheet = this.showSheet,
- supportMerge = this.supportMerge,
- supportStyle = this.supportStyle,
- defaultOptions = this.defaultOptions,
- storeData = this.storeData;
- var hasTree = storeData.hasTree,
- hasMerge = storeData.hasMerge,
- isPrint = storeData.isPrint,
- hasColgroup = storeData.hasColgroup;
- var isHeader = defaultOptions.isHeader;
- var cols = [];
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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(isPrint ? 'vxe.export.printTitle' : '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', [[isPrint ? _e() : 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: {
- modelValue: function modelValue(value) {
- defaultOptions.filename = value;
- }
- }
- })])]), isPrint ? _e() : 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)
- }
- });
- }))])]), isPrint || showSheet ? h('tr', [h('td', conf.i18n('vxe.export.expSheetName')), h('td', [h('vxe-input', {
- ref: 'sheetname',
- props: {
- value: defaultOptions.sheetName,
- type: 'text',
- clearable: true,
- placeholder: conf.i18n('vxe.export.expSheetNamePlaceholder')
- },
- on: {
- modelValue: function modelValue(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('div', {
- class: 'vxe-export--panel-option-row'
- }, [h('vxe-checkbox', {
- props: {
- value: isHeader,
- title: conf.i18n('vxe.export.expHeaderTitle'),
- content: conf.i18n('vxe.export.expOptHeader')
- },
- on: {
- input: function input(value) {
- defaultOptions.isHeader = value;
- }
- }
- }), h('vxe-checkbox', {
- props: {
- value: defaultOptions.isFooter,
- disabled: !storeData.hasFooter,
- title: conf.i18n('vxe.export.expFooterTitle'),
- content: conf.i18n('vxe.export.expOptFooter')
- },
- on: {
- input: function input(value) {
- defaultOptions.isFooter = value;
- }
- }
- }), h('vxe-checkbox', {
- props: {
- value: defaultOptions.original,
- title: conf.i18n('vxe.export.expOriginalTitle'),
- content: conf.i18n('vxe.export.expOptOriginal')
- },
- on: {
- input: function input(value) {
- defaultOptions.original = value;
- }
- }
- })]), h('div', {
- class: 'vxe-export--panel-option-row'
- }, [h('vxe-checkbox', {
- props: {
- value: isHeader && hasColgroup && supportMerge ? defaultOptions.isColgroup : false,
- disabled: !isHeader || !hasColgroup || !supportMerge,
- title: conf.i18n('vxe.export.expColgroupTitle'),
- content: conf.i18n('vxe.export.expOptColgroup')
- },
- on: {
- input: function input(value) {
- defaultOptions.isColgroup = value;
- }
- }
- }), h('vxe-checkbox', {
- props: {
- value: hasMerge && supportMerge && checkedAll ? defaultOptions.isMerge : false,
- disabled: !hasMerge || !supportMerge || !checkedAll,
- title: conf.i18n('vxe.export.expMergeTitle'),
- content: conf.i18n('vxe.export.expOptMerge')
- },
- on: {
- input: function input(value) {
- defaultOptions.isMerge = value;
- }
- }
- }), isPrint ? _e() : h('vxe-checkbox', {
- props: {
- value: supportStyle ? defaultOptions.useStyle : false,
- disabled: !supportStyle,
- title: conf.i18n('vxe.export.expUseStyleTitle'),
- content: conf.i18n('vxe.export.expOptUseStyle')
- },
- on: {
- input: function input(value) {
- defaultOptions.useStyle = value;
- }
- }
- }), h('vxe-checkbox', {
- props: {
- value: hasTree ? defaultOptions.isAllExpand : false,
- disabled: !hasTree,
- title: conf.i18n('vxe.export.expAllExpandTitle'),
- content: conf.i18n('vxe.export.expOptAllExpand')
- },
- on: {
- input: function input(value) {
- defaultOptions.isAllExpand = value;
- }
- }
- })])])])]])]), h('div', {
- class: 'vxe-export--panel-btns'
- }, [h('vxe-button', {
- props: {
- content: conf.i18n('vxe.export.expCancel')
- },
- on: {
- click: this.cancelEvent
- }
- }), h('vxe-button', {
- ref: 'confirmBtn',
- props: {
- status: 'primary',
- content: conf.i18n(isPrint ? 'vxe.export.expPrint' : 'vxe.export.expConfirm')
- },
- on: {
- click: this.confirmEvent
- }
- })])])]);
- },
- methods: {
- changeOption: function changeOption(column) {
- var isChecked = !column.checked;
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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;
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 () {
- var $refs = _this2.$refs;
- var targetElem = $refs.filename || $refs.sheetname || $refs.confirmBtn;
- if (targetElem) {
- targetElem.focus();
- }
- });
- this.checkStatus();
- },
- getExportOption: function getExportOption() {
- var checkedAll = this.checkedAll,
- storeData = this.storeData,
- defaultOptions = this.defaultOptions,
- supportMerge = this.supportMerge;
- var hasMerge = storeData.hasMerge,
- columns = storeData.columns;
- var expColumns = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.searchTree(columns, function (column) {
- return column.checked;
- }, {
- children: 'children',
- mapChildren: 'childNodes',
- original: true
- });
- return Object.assign({}, defaultOptions, {
- columns: expColumns,
- isMerge: hasMerge && supportMerge && checkedAll ? defaultOptions.isMerge : false
- });
- },
- cancelEvent: function cancelEvent() {
- this.storeData.visible = false;
- },
- confirmEvent: function confirmEvent(evnt) {
- if (this.storeData.isPrint) {
- this.printEvent(evnt);
- } else {
- this.exportEvent(evnt);
- }
- },
- 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/radio/src/radio.js
- /* harmony default export */ var src_radio = ({
- name: 'VxeRadio',
- mixins: [size],
- props: {
- value: [String, Number, Boolean],
- label: [String, Number, Boolean],
- title: [String, Number],
- content: [String, Number],
- disabled: Boolean,
- name: String,
- size: {
- type: String,
- default: function _default() {
- return conf.radio.size || conf.size;
- }
- }
- },
- inject: {
- $xeradiogroup: {
- default: null
- }
- },
- computed: {
- isDisabled: function isDisabled() {
- var $xeradiogroup = this.$xeradiogroup;
- return this.disabled || $xeradiogroup && $xeradiogroup.disabled;
- }
- },
- render: function render(h) {
- var _ref,
- _this = this;
- var $scopedSlots = this.$scopedSlots,
- $xeradiogroup = this.$xeradiogroup,
- 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: $xeradiogroup ? $xeradiogroup.name : name,
- disabled: isDisabled
- },
- domProps: {
- checked: $xeradiogroup ? $xeradiogroup.value === label : value === label
- },
- on: {
- change: function change(evnt) {
- if (!isDisabled) {
- var params = {
- label: label,
- $event: evnt
- };
- if ($xeradiogroup) {
- $xeradiogroup.handleChecked(params);
- } else {
- _this.$emit('input', label);
- _this.$emit('change', params);
- }
- }
- }
- }
- }), h('span', {
- class: 'vxe-radio--icon'
- }), h('span', {
- class: 'vxe-radio--label'
- }, $scopedSlots.default ? $scopedSlots.default.call(this, {}) : [UtilTools.getFuncText(content)])]);
- },
- methods: {
- changeEvent: function changeEvent(evnt) {
- var $xeradiogroup = this.$xeradiogroup,
- isDisabled = this.isDisabled,
- label = this.label;
- if (!isDisabled) {
- var params = {
- label: label,
- $event: evnt
- };
- if ($xeradiogroup) {
- $xeradiogroup.handleChecked(params);
- } else {
- this.$emit('input', label);
- this.$emit('change', params);
- }
- }
- }
- }
- });
- // 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 = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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;
- },
- 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.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('button', {
- ref: 'fileBtn',
- class: 'vxe-import-select--file',
- attrs: {
- type: 'button'
- },
- 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', {
- on: {
- click: this.cancelEvent
- }
- }, conf.i18n('vxe.import.impCancel')), 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;
- });
- },
- showEvent: function showEvent() {
- var _this2 = this;
- this.$nextTick(function () {
- var $refs = _this2.$refs;
- var targetElem = $refs.fileBtn;
- if (targetElem) {
- targetElem.focus();
- }
- });
- },
- cancelEvent: function cancelEvent() {
- this.storeData.visible = false;
- },
- importEvent: function importEvent() {
- var _this3 = this;
- var $xetable = this.$parent;
- this.loading = true;
- $xetable.importByFile(this.storeData.file, Object.assign({}, $xetable.importOpts, this.defaultOptions)).then(function () {
- _this3.loading = false;
- _this3.storeData.visible = false;
- }).catch(function () {
- _this3.loading = false;
- });
- }
- }
- });
- // EXTERNAL MODULE: ./node_modules/core-js/modules/web.url.js
- var web_url = __webpack_require__("2b3d");
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.repeat.js
- var es_string_repeat = __webpack_require__("38cf");
- // CONCATENATED MODULE: ./packages/export/src/mixin.js
- var mixin_formatText = UtilTools.formatText; // 默认导出或打印的 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 > 0;
- }
- function getSeq($xetable, row, rowIndex, column, columnIndex) {
- var seqOpts = $xetable.seqOpts;
- var seqMethod = seqOpts.seqMethod || column.seqMethod;
- return seqMethod ? seqMethod({
- row: row,
- rowIndex: rowIndex,
- column: column,
- columnIndex: columnIndex
- }) : seqOpts.startIndex + rowIndex + 1;
- }
- function defaultFilterExportColumn(column) {
- return column.property || ['seq', 'checkbox', 'radio'].indexOf(column.type) > -1;
- }
- function toTableBorder(border) {
- if (border === true) {
- return 'full';
- }
- if (border) {
- return border;
- }
- return 'default';
- }
- function toBooleanValue(cellValue) {
- return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isBoolean(cellValue) ? cellValue ? 'TRUE' : 'FALSE' : cellValue;
- }
- function getLabelData($xetable, opts, columns, datas) {
- var isAllExpand = opts.isAllExpand;
- var treeConfig = $xetable.treeConfig,
- treeOpts = $xetable.treeOpts,
- radioOpts = $xetable.radioOpts,
- checkboxOpts = $xetable.checkboxOpts;
- if (!htmlCellElem) {
- htmlCellElem = document.createElement('div');
- }
- if (treeConfig) {
- // 如果是树表格只允许导出数据源
- var rest = [];
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(datas, function (item, rowIndex, items, path, parent, nodes) {
- var row = item._row || item;
- var parentRow = parent && parent._row ? parent._row : parent;
- if (isAllExpand || !parentRow || $xetable.isTreeExpandByRow(parentRow)) {
- var hasRowChild = hasTreeChildren($xetable, row);
- var _item = {
- _row: row,
- _level: nodes.length - 1,
- _hasChild: hasRowChild,
- _expand: hasRowChild && $xetable.isTreeExpandByRow(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) {
- case 'seq':
- cellValue = getSeq($xetable, row, rowIndex, column, columnIndex);
- break;
- case 'checkbox':
- cellValue = toBooleanValue($xetable.isCheckedByCheckboxRow(row));
- _item._checkboxLabel = checkboxOpts.labelField ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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();
- } else {
- var cell = $xetable.getCell(row, column);
- if (cell) {
- cellValue = cell.innerText.trim();
- }
- }
- }
- }
- }
- _item[column.id] = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toValueString(cellValue);
- });
- rest.push(Object.assign(_item, row));
- }
- }, treeOpts);
- return rest;
- }
- return datas.map(function (row, rowIndex) {
- var item = {
- _row: 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) {
- case 'seq':
- cellValue = getSeq($xetable, row, rowIndex, column, columnIndex);
- break;
- case 'checkbox':
- cellValue = toBooleanValue($xetable.isCheckedByCheckboxRow(row));
- item._checkboxLabel = checkboxOpts.labelField ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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();
- } else {
- var cell = $xetable.getCell(row, column);
- if (cell) {
- cellValue = cell.innerText.trim();
- }
- }
- }
- }
- }
- item[column.id] = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toValueString(cellValue);
- });
- return item;
- });
- }
- function getExportData($xetable, opts) {
- var columns = opts.columns,
- dataFilterMethod = opts.dataFilterMethod;
- var datas = opts.data;
- if (dataFilterMethod) {
- datas = datas.filter(function (row, index) {
- return dataFilterMethod({
- row: row,
- $rowIndex: index
- });
- });
- }
- return 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
- }) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toValueString(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 getCsvCellTypeLabel(column, cellValue) {
- if (cellValue) {
- switch (column.cellType) {
- case 'string':
- if (!isNaN(cellValue)) {
- return "\t".concat(cellValue);
- }
- break;
- case 'number':
- break;
- default:
- if (cellValue.length >= 12 && !isNaN(cellValue)) {
- return "\t".concat(cellValue);
- }
- break;
- }
- }
- return cellValue;
- }
- function toTxtCellLabel(val) {
- if (/[",\s\n]/.test(val)) {
- return "\"".concat(val.replace(/"/g, '""'), "\"");
- }
- return val;
- }
- function toCsv($xetable, opts, columns, datas) {
- var content = csvBOM;
- if (opts.isHeader) {
- content += columns.map(function (column) {
- return toTxtCellLabel(getHeaderTitle(opts, column));
- }).join(',') + enterSymbol;
- }
- datas.forEach(function (row) {
- content += columns.map(function (column) {
- return toTxtCellLabel(getCsvCellTypeLabel(column, 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 toTxtCellLabel(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 toTxtCellLabel(getHeaderTitle(opts, column));
- }).join('\t') + enterSymbol;
- }
- datas.forEach(function (row) {
- content += columns.map(function (column) {
- return toTxtCellLabel(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 toTxtCellLabel(getFooterCellValue($xetable, opts, rows, column));
- }).join(',') + enterSymbol;
- });
- }
- return content;
- }
- function mixin_hasEllipsis($xetable, column, property, allColumnOverflow) {
- var columnOverflow = column[property];
- var headOverflow = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isUndefined(columnOverflow) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNull(columnOverflow) ? allColumnOverflow : columnOverflow;
- 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(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,
- mergeList = $xetable.mergeList;
- var isPrint = opts.print,
- isHeader = opts.isHeader,
- isFooter = opts.isFooter,
- isColgroup = opts.isColgroup,
- isMerge = opts.isMerge,
- colgroups = opts.colgroups,
- original = opts.original;
- var allCls = 'check-all';
- var clss = ['vxe-table', "border--".concat(toTableBorder(border)), isPrint ? 'is--print' : '', isHeader ? 'is--header' : ''].filter(function (cls) {
- return cls;
- });
- var tables = ["<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>")];
- if (isHeader) {
- tables.push('<thead>');
- if (isColgroup && !original) {
- colgroups.forEach(function (cols) {
- tables.push("<tr>".concat(cols.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);
- var childWidth = 0;
- var countChild = 0;
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree([column], function (item) {
- if (!item.childNodes || !column.childNodes.length) {
- countChild++;
- }
- childWidth += item.renderWidth;
- }, {
- children: 'childNodes'
- });
- var cellWidth = childWidth - countChild;
- if (headAlign) {
- classNames.push("col--".concat(headAlign));
- }
- if (column.type === 'checkbox') {
- return "<th class=\"".concat(classNames.join(' '), "\" colspan=\"").concat(column._colSpan, "\" rowspan=\"").concat(column._rowSpan, "\"><div ").concat(isPrint ? '' : "style=\"width: ".concat(cellWidth, "px\""), "><input type=\"checkbox\" class=\"").concat(allCls, "\" ").concat(isAllSelected ? 'checked' : '', "><span>").concat(cellTitle, "</span></div></th>");
- }
- return "<th class=\"".concat(classNames.join(' '), "\" colspan=\"").concat(column._colSpan, "\" rowspan=\"").concat(column._rowSpan, "\" title=\"").concat(cellTitle, "\"><div ").concat(isPrint ? '' : "style=\"width: ".concat(cellWidth, "px\""), "><span>").concat(mixin_formatText(cellTitle, true), "</span></div></th>");
- }).join(''), "</tr>"));
- });
- } else {
- tables.push("<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') {
- 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(mixin_formatText(cellTitle, true), "</span></div></th>");
- }).join(''), "</tr>"));
- }
- tables.push('</thead>');
- }
- if (datas.length) {
- tables.push('<tbody>');
- if (treeConfig) {
- datas.forEach(function (item) {
- tables.push('<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') {
- 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') {
- 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(mixin_formatText(cellValue, true), "</div></td>");
- }).join('') + '</tr>');
- });
- } else {
- datas.forEach(function (item) {
- tables.push('<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];
- var rowSpan = 1;
- var colSpan = 1;
- if (isMerge && mergeList.length) {
- var _rowIndex = $xetable.getVTRowIndex(item._row);
- var _columnIndex = $xetable.getVTColumnIndex(column);
- var spanRest = mergeBodyMethod(mergeList, _rowIndex, _columnIndex);
- if (spanRest) {
- var rowspan = spanRest.rowspan,
- colspan = spanRest.colspan;
- if (!rowspan || !colspan) {
- return '';
- }
- if (rowspan > 1) {
- rowSpan = rowspan;
- }
- if (colspan > 1) {
- colSpan = colspan;
- }
- }
- }
- if (cellAlign) {
- classNames.push("col--".concat(cellAlign));
- }
- if (column.type === 'radio') {
- return "<td class=\"".concat(classNames.join(' '), "\" rowspan=\"").concat(rowSpan, "\" colspan=\"").concat(colSpan, "\"><div ").concat(isPrint ? '' : "style=\"width: ".concat(column.renderWidth, "px\""), "><input type=\"radio\" name=\"radio_").concat(id, "\" ").concat(item._radioDisabled ? 'disabled ' : '').concat(getBooleanValue(cellValue) ? 'checked' : '', "><span>").concat(item._radioLabel, "</span></div></td>");
- } else if (column.type === 'checkbox') {
- return "<td class=\"".concat(classNames.join(' '), "\" rowspan=\"").concat(rowSpan, "\" colspan=\"").concat(colSpan, "\"><div ").concat(isPrint ? '' : "style=\"width: ".concat(column.renderWidth, "px\""), "><input type=\"checkbox\" ").concat(item._checkboxDisabled ? 'disabled ' : '').concat(getBooleanValue(cellValue) ? 'checked' : '', "><span>").concat(item._checkboxLabel, "</span></div></td>");
- }
- return "<td class=\"".concat(classNames.join(' '), "\" rowspan=\"").concat(rowSpan, "\" colspan=\"").concat(colSpan, "\" title=\"").concat(cellValue, "\"><div ").concat(isPrint ? '' : "style=\"width: ".concat(column.renderWidth, "px\""), ">").concat(mixin_formatText(cellValue, true), "</div></td>");
- }).join('') + '</tr>');
- });
- }
- tables.push('</tbody>');
- }
- if (isFooter) {
- var footerTableData = $xetable.footerTableData;
- var footers = getFooterData(opts, footerTableData);
- if (footers.length) {
- tables.push('<tfoot>');
- footers.forEach(function (rows) {
- tables.push("<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(mixin_formatText(cellValue, true), "</div></td>");
- }).join(''), "</tr>"));
- });
- tables.push('</tfoot>');
- }
- } // 是否半选状态
- var script = !isAllSelected && isIndeterminate ? "<script>(function(){var a=document.querySelector(\".".concat(allCls, "\");if(a){a.indeterminate=true}})()</script>") : '';
- tables.push('</table>', script);
- return isPrint ? tables.join('') : createHtmlPage(opts, tables.join(''));
- }
- 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(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toValueString(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 clearColumnConvert(columns) {
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(columns, function (column) {
- delete column._level;
- delete column._colSpan;
- delete column._rowSpan;
- delete column._children;
- delete column.childNodes;
- }, {
- children: 'children'
- });
- }
- function handleExport($xetable, opts) {
- var remote = opts.remote,
- columns = opts.columns,
- colgroups = opts.colgroups,
- exportMethod = opts.exportMethod,
- afterExportMethod = opts.afterExportMethod;
- return new Promise(function (resolve) {
- if (remote) {
- var params = {
- options: opts,
- $table: $xetable,
- $grid: $xetable.$xegrid
- };
- resolve(exportMethod ? exportMethod(params) : params);
- } else {
- var datas = getExportData($xetable, opts);
- resolve($xetable.preventEvent(null, 'event.export', {
- options: opts,
- columns: columns,
- colgroups: colgroups,
- datas: datas
- }, function () {
- return downloadFile($xetable, opts, getContent($xetable, opts, columns, datas));
- }));
- }
- }).then(function (params) {
- clearColumnConvert(columns);
- if (!opts.print) {
- if (afterExportMethod) {
- afterExportMethod({
- status: true,
- options: opts,
- $table: $xetable,
- $grid: $xetable.$xegrid
- });
- }
- }
- return Object.assign({
- status: true
- }, params);
- }).catch(function () {
- clearColumnConvert(columns);
- if (!opts.print) {
- if (afterExportMethod) {
- afterExportMethod({
- status: false,
- options: opts,
- $table: $xetable,
- $grid: $xetable.$xegrid
- });
- }
- }
- var params = {
- status: false
- };
- return Promise.reject(params);
- });
- }
- function getElementsByTagName(elem, qualifiedName) {
- return elem.getElementsByTagName(qualifiedName);
- }
- function getTxtCellKey(now) {
- return "#".concat(now, "@").concat(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.uniqueId());
- }
- function replaceTxtCell(cell, vMaps) {
- return cell.replace(/#\d+@\d+/g, function (key) {
- return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.hasOwnProp(vMaps, key) ? vMaps[key] : key;
- });
- }
- function getTxtCellValue(val, vMaps) {
- var rest = replaceTxtCell(val, vMaps);
- return rest.replace(/^"+$/g, function (qVal) {
- return '"'.repeat(Math.ceil(qVal.length / 2));
- });
- }
- function parseCsvAndTxt(columns, content, cellSeparator) {
- var list = content.split(enterSymbol);
- var rows = [];
- var fields = [];
- if (list.length) {
- var vMaps = {};
- var now = Date.now();
- list.forEach(function (rVal) {
- if (rVal) {
- var item = {};
- rVal = rVal.replace(/("")|(\n)/g, function (text, dVal) {
- var key = getTxtCellKey(now);
- vMaps[key] = dVal ? '"' : '\n';
- return key;
- }).replace(/"(.*?)"/g, function (text, cVal) {
- var key = getTxtCellKey(now);
- vMaps[key] = replaceTxtCell(cVal, vMaps);
- return key;
- });
- var cells = rVal.split(cellSeparator);
- if (!fields.length) {
- fields = cells.map(function (val) {
- return getTxtCellValue(val.trim(), vMaps);
- });
- } else {
- cells.forEach(function (val, colIndex) {
- if (colIndex < fields.length) {
- item[fields[colIndex]] = getTxtCellValue(val, vMaps);
- }
- });
- rows.push(item);
- }
- }
- });
- }
- return {
- fields: fields,
- rows: rows
- };
- }
- function parseCsv(columns, content) {
- return parseCsvAndTxt(columns, content, ',');
- }
- function parseTxt(columns, content) {
- return parseCsvAndTxt(columns, content, '\t');
- }
- 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) {
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.arrayEach(getElementsByTagName(theadNodes[0], 'tr'), function (rowNode) {
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.arrayEach(getElementsByTagName(rowNode, 'th'), function (cellNode) {
- fields.push(cellNode.textContent);
- });
- });
- var tbodyNodes = getElementsByTagName(tableNodes[0], 'tbody');
- if (tbodyNodes.length) {
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.arrayEach(getElementsByTagName(tbodyNodes[0], 'tr'), function (rowNode) {
- var item = {};
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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) {
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.arrayEach(getElementsByTagName(rowNodes[0], 'Cell'), function (cellNode) {
- fields.push(cellNode.textContent);
- });
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.arrayEach(rowNodes, function (rowNode, index) {
- if (index) {
- var item = {};
- var cellNodes = getElementsByTagName(rowNode, 'Cell');
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 fields.some(function (field) {
- return tableFields.indexOf(field) > -1;
- });
- }
- function handleImport($xetable, content, opts) {
- var tableFullColumn = $xetable.tableFullColumn,
- _importResolve = $xetable._importResolve,
- _importReject = $xetable._importReject;
- 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) {
- var loadRest;
- if (opts.mode === 'insert') {
- loadRest = $xetable.insert(data);
- } else {
- loadRest = $xetable.reloadData(data);
- }
- if (opts.message !== false) {
- v_x_e_table.modal.message({
- message: conf.i18n('vxe.table.impSuccess', [rows.length]),
- status: 'success'
- });
- }
- return loadRest.then(function () {
- if (_importResolve) {
- _importResolve({
- status: true
- });
- }
- });
- });
- } else if (opts.message !== false) {
- v_x_e_table.modal.message({
- message: conf.i18n('vxe.error.impFields'),
- status: 'error'
- });
- if (_importReject) {
- _importReject({
- status: false
- });
- }
- }
- }
- function handleFileImport($xetable, file, opts) {
- var importMethod = opts.importMethod,
- afterImportMethod = opts.afterImportMethod;
- var _UtilTools$parseFile = UtilTools.parseFile(file),
- type = _UtilTools$parseFile.type,
- filename = _UtilTools$parseFile.filename; // 检查类型,如果为自定义导出,则不需要校验类型
- if (!importMethod && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.includes(v_x_e_table.config.importTypes, type)) {
- if (opts.message !== false) {
- v_x_e_table.modal.message({
- message: conf.i18n('vxe.error.notType', [type]),
- status: 'error'
- });
- }
- var params = {
- status: false
- };
- return Promise.reject(params);
- }
- var rest = new Promise(function (resolve, reject) {
- var _importResolve = function _importResolve(params) {
- resolve(params);
- $xetable._importResolve = null;
- $xetable._importReject = null;
- };
- var _importReject = function _importReject(params) {
- reject(params);
- $xetable._importResolve = null;
- $xetable._importReject = null;
- };
- $xetable._importResolve = _importResolve;
- $xetable._importReject = _importReject;
- if (window.FileReader) {
- var options = Object.assign({
- mode: 'insert'
- }, opts, {
- type: type,
- filename: filename
- });
- if (options.remote) {
- if (importMethod) {
- Promise.resolve(importMethod({
- file: file,
- options: options,
- $table: $xetable
- })).then(function () {
- _importResolve({
- status: true
- });
- }).catch(function () {
- _importResolve({
- status: true
- });
- });
- } else {
- _importResolve({
- status: true
- });
- }
- } else {
- $xetable.preventEvent(null, 'event.import', {
- file: file,
- options: options,
- columns: $xetable.tableFullColumn
- }, function () {
- var reader = new FileReader();
- reader.onerror = function () {
- UtilTools.error('vxe.error.notType', [type]);
- _importReject({
- status: false
- });
- };
- reader.onload = function (e) {
- handleImport($xetable, e.target.result, options);
- };
- reader.readAsText(file, 'UTF-8');
- });
- }
- } else {
- // 不支持的浏览器
- if (false) {}
- _importResolve({
- status: true
- });
- }
- });
- return rest.then(function () {
- if (afterImportMethod) {
- afterImportMethod({
- status: true,
- options: opts,
- $table: $xetable
- });
- }
- }).catch(function (e) {
- if (afterImportMethod) {
- afterImportMethod({
- status: false,
- options: opts,
- $table: $xetable
- });
- }
- return Promise.reject(e);
- });
- }
- /**
- * 读取本地文件
- * @param {*} options 参数
- */
- function readLocalFile() {
- 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);
- }
- return new Promise(function (resolve, reject) {
- 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 (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.includes(types, type)) {
- errType = type;
- break;
- }
- }
- }
- if (!errType) {
- resolve({
- status: true,
- files: files,
- file: file
- });
- } else {
- if (options.message !== false) {
- v_x_e_table.modal.message({
- message: conf.i18n('vxe.error.notType', [errType]),
- status: 'error'
- });
- }
- var params = {
- status: false,
- files: files,
- file: file
- };
- reject(params);
- }
- };
- fileForm.reset();
- fileInput.click();
- });
- }
- 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.print();
- }
- };
- document.body.appendChild(printFrame);
- }
- printFrame.src = URL.createObjectURL(blob);
- }
- }
- function handleExportAndPrint($xetable, options, isPrint) {
- var initStore = $xetable.initStore,
- customOpts = $xetable.customOpts,
- collectColumn = $xetable.collectColumn,
- footerTableData = $xetable.footerTableData,
- treeConfig = $xetable.treeConfig,
- mergeList = $xetable.mergeList,
- isGroup = $xetable.isGroup,
- exportParams = $xetable.exportParams;
- var selectRecords = $xetable.getCheckboxRecords();
- var hasFooter = !!footerTableData.length;
- var hasTree = treeConfig;
- var hasMerge = !hasTree && mergeList.length;
- var defOpts = Object.assign({
- message: true,
- isHeader: true
- }, options);
- var types = defOpts.types || v_x_e_table.config.exportTypes;
- var modes = defOpts.modes;
- var checkMethod = customOpts.checkMethod;
- var exportColumns = collectColumn.slice(0);
- var columns = defOpts.columns; // 处理类型
- var typeList = types.map(function (value) {
- return {
- value: value,
- label: "vxe.export.types.".concat(value)
- };
- });
- var modeList = modes.map(function (value) {
- return {
- value: value,
- label: "vxe.export.modes.".concat(value)
- };
- }); // 默认选中
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isString(item)) {
- return column.field === item;
- } else {
- var colid = item.id || item.colId;
- 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($xetable.exportStore, {
- columns: exportColumns,
- typeList: typeList,
- modeList: modeList,
- hasFooter: hasFooter,
- hasMerge: hasMerge,
- hasTree: hasTree,
- isPrint: isPrint,
- hasColgroup: isGroup,
- visible: true
- }); // 默认参数
- if (!initStore.export) {
- Object.assign(exportParams, {
- mode: selectRecords.length ? 'selected' : 'current'
- }, defOpts);
- }
- if (modes.indexOf(exportParams.mode) === -1) {
- exportParams.mode = modes[0];
- }
- if (types.indexOf(exportParams.type) === -1) {
- exportParams.type = types[0];
- }
- initStore.export = true;
- return $xetable.$nextTick();
- }
- var mixin_getConvertColumns = function getConvertColumns(columns) {
- var result = [];
- columns.forEach(function (column) {
- if (column.childNodes && column.childNodes.length) {
- result.push(column);
- result.push.apply(result, _toConsumableArray(getConvertColumns(column.childNodes)));
- } 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.childNodes && column.childNodes.length) {
- var colSpan = 0;
- column.childNodes.forEach(function (subColumn) {
- 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 = mixin_getConvertColumns(originColumns);
- allColumns.forEach(function (column) {
- if (column.childNodes && column.childNodes.length) {
- column._rowSpan = 1;
- } else {
- column._rowSpan = maxLevel - column._level + 1;
- }
- rows[column._level - 1].push(column);
- });
- return rows;
- };
- /* harmony default export */ var export_src_mixin = ({
- methods: {
- /**
- * 导出文件,支持 csv/html/xml/txt
- * 如果是树表格,则默认是导出所有节点
- * 如果是启用了虚拟滚动,则只能导出数据源,可以配合 dataFilterMethod 函数自行转换数据
- * @param {Object} options 参数
- */
- _exportData: function _exportData(options) {
- var _this = this;
- var $xegrid = this.$xegrid,
- isGroup = this.isGroup,
- tableGroupColumn = this.tableGroupColumn,
- tableFullColumn = this.tableFullColumn,
- afterFullData = this.afterFullData,
- treeConfig = this.treeConfig,
- treeOpts = this.treeOpts,
- exportOpts = this.exportOpts;
- var opts = Object.assign({
- // filename: '',
- // sheetName: '',
- // original: false,
- // message: false,
- isHeader: true,
- isFooter: true,
- isColgroup: true,
- isMerge: false,
- isAllExpand: false,
- download: true,
- type: 'csv',
- mode: 'current' // data: null,
- // remote: false,
- // dataFilterMethod: null,
- // footerFilterMethod: null,
- // exportMethod: null,
- // columnFilterMethod: null,
- // beforeExportMethod: null,
- // afterExportMethod: null
- }, exportOpts, {
- print: false
- }, options);
- var type = opts.type,
- mode = opts.mode,
- columns = opts.columns,
- original = opts.original,
- beforeExportMethod = opts.beforeExportMethod;
- var groups = [];
- var customCols = columns && columns.length ? columns : null; // 如果设置源数据,则默认导出设置了字段的列
- var columnFilterMethod = opts.columnFilterMethod;
- if (!customCols && !columnFilterMethod) {
- columnFilterMethod = original ? function (_ref) {
- var column = _ref.column;
- return column.property;
- } : function (_ref2) {
- var column = _ref2.column;
- return defaultFilterExportColumn(column);
- };
- }
- if (customCols) {
- groups = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.searchTree(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.mapTree(customCols, function (item) {
- var targetColumn;
- if (item) {
- if (UtilTools.isColumn(item)) {
- targetColumn = item;
- } else if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isString(item)) {
- targetColumn = _this.getColumnByField(item);
- } else {
- var colid = item.id || item.colId;
- var _type = item.type;
- var field = item.property || item.field;
- if (colid) {
- targetColumn = _this.getColumnById(colid);
- } else 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;
- });
- }
- }
- return targetColumn || {};
- }
- }, {
- children: 'childNodes',
- mapChildren: '_children'
- }), function (column, index) {
- return UtilTools.isColumn(column) && (!columnFilterMethod || columnFilterMethod({
- column: column,
- $columnIndex: index
- }));
- }, {
- children: '_children',
- mapChildren: 'childNodes',
- original: true
- });
- } else {
- groups = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.searchTree(isGroup ? tableGroupColumn : tableFullColumn, function (column, index) {
- return column.visible && (!columnFilterMethod || columnFilterMethod({
- column: column,
- $columnIndex: index
- }));
- }, {
- children: 'children',
- mapChildren: 'childNodes',
- original: true
- });
- } // 获取所有列
- var cols = [];
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(groups, function (column) {
- var isColGroup = column.children && column.children.length;
- if (!isColGroup) {
- cols.push(column);
- }
- }, {
- children: 'childNodes'
- }); // 构建分组层级
- opts.columns = cols;
- opts.colgroups = convertToRows(groups);
- if (!opts.filename) {
- opts.filename = conf.i18n(opts.original ? 'vxe.table.expOriginFilename' : 'vxe.table.expFilename', [external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toDateString(Date.now(), 'yyyyMMddHHmmss')]);
- }
- if (!opts.sheetName) {
- opts.sheetName = document.title;
- } // 检查类型,如果为自定义导出,则不需要校验类型
- if (!opts.exportMethod && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.includes(v_x_e_table.config.exportTypes, type)) {
- if (false) {}
- var params = {
- status: false
- };
- return Promise.reject(params);
- }
- if (!opts.print) {
- if (beforeExportMethod) {
- beforeExportMethod({
- options: opts,
- $table: this,
- $grid: $xegrid
- });
- }
- }
- if (!opts.data) {
- opts.data = afterFullData;
- if (mode === 'selected') {
- var selectRecords = this.getCheckboxRecords();
- if (['html', 'pdf'].indexOf(type) > -1 && treeConfig) {
- opts.data = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.searchTree(this.getTableData().fullData, function (item) {
- return selectRecords.indexOf(item) > -1;
- }, Object.assign({}, treeOpts, {
- data: '_row'
- }));
- } else {
- opts.data = selectRecords;
- }
- } else if (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 ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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, options) {
- var opts = Object.assign({}, options);
- var beforeImportMethod = opts.beforeImportMethod;
- if (beforeImportMethod) {
- beforeImportMethod({
- options: opts,
- $table: this
- });
- }
- return handleFileImport(this, file, opts);
- },
- _importData: function _importData(options) {
- var _this2 = this;
- var opts = Object.assign({
- types: v_x_e_table.config.importTypes // beforeImportMethod: null,
- // afterImportMethod: null
- }, this.importOpts, options);
- var beforeImportMethod = opts.beforeImportMethod,
- afterImportMethod = opts.afterImportMethod;
- if (beforeImportMethod) {
- beforeImportMethod({
- options: opts,
- $table: this
- });
- }
- return readLocalFile(opts).catch(function (e) {
- if (afterImportMethod) {
- afterImportMethod({
- status: false,
- options: opts,
- $table: _this2
- });
- }
- return Promise.reject(e);
- }).then(function (params) {
- var file = params.file;
- return handleFileImport(_this2, file, opts);
- });
- },
- _saveFile: function _saveFile(options) {
- return saveLocalFile(options);
- },
- _readFile: function _readFile(options) {
- return readLocalFile(options);
- },
- _print: function _print(options) {
- var _this3 = this;
- var opts = Object.assign({
- original: false // beforePrintMethod
- }, this.printOpts, options, {
- type: 'html',
- download: false,
- remote: false,
- print: true
- });
- if (!opts.sheetName) {
- opts.sheetName = document.title;
- }
- return new Promise(function (resolve) {
- if (opts.content) {
- resolve(handlePrint(_this3, opts, opts.content));
- } else {
- resolve(_this3.exportData(opts).then(function (_ref3) {
- var content = _ref3.content;
- return handlePrint(_this3, opts, content);
- }));
- }
- });
- },
- _openImport: function _openImport(options) {
- var defOpts = Object.assign({
- mode: 'insert',
- message: true,
- types: v_x_e_table.config.importTypes
- }, options, this.importOpts);
- var types = defOpts.types;
- 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);
- this.initStore.import = true;
- },
- _openExport: function _openExport(options) {
- var exportOpts = this.exportOpts;
- if (false) {}
- return handleExportAndPrint(this, Object.assign({}, exportOpts, options));
- },
- _openPrint: function _openPrint(options) {
- var printOpts = this.printOpts;
- if (false) {}
- return handleExportAndPrint(this, Object.assign({}, printOpts, options), true);
- }
- }
- });
- // CONCATENATED MODULE: ./packages/export/index.js
- function print(options) {
- var opts = Object.assign({}, options, {
- type: 'html'
- });
- handlePrint(null, opts, opts.content);
- }
- var Export = {
- ExportPanel: export_panel,
- ImportPanel: import_panel,
- install: function install(Vue) {
- v_x_e_table.reg('export');
- v_x_e_table.saveFile = saveLocalFile;
- v_x_e_table.readFile = readLocalFile;
- 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 -= external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(checkboxLabelStyle.paddingTop);
- offsetLeft -= external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 -= external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(checkboxStyle.paddingTop);
- offsetLeft -= external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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;
- var targetRow;
- var targetRowIndex;
- var targetColumnIndex;
- var params = Object.assign({}, args);
- var _rowIndex = this.getVTRowIndex(params.row);
- var _columnIndex = this.getVTColumnIndex(params.column);
- evnt.preventDefault();
- if (isLeft) {
- // 向左
- if (_columnIndex <= 0) {
- // 如果已经是第一列,则移动到上一行
- if (_rowIndex > 0) {
- targetRowIndex = _rowIndex - 1;
- targetRow = afterFullData[targetRowIndex];
- targetColumnIndex = visibleColumn.length - 1;
- }
- } else {
- targetColumnIndex = _columnIndex - 1;
- }
- } else {
- if (_columnIndex >= visibleColumn.length - 1) {
- // 如果已经是第一列,则移动到上一行
- if (_rowIndex < afterFullData.length - 1) {
- targetRowIndex = _rowIndex + 1;
- targetRow = afterFullData[targetRowIndex];
- targetColumnIndex = 0;
- }
- } else {
- targetColumnIndex = _columnIndex + 1;
- }
- }
- var targetColumn = visibleColumn[targetColumnIndex];
- 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);
- });
- }
- }
- } 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 = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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;
- 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) {
- // 移动到左侧单元格
- params.columnIndex = _columnIndex - 1;
- params.column = visibleColumn[params.columnIndex];
- } else if (isRightArrow && _columnIndex < visibleColumn.length - 1) {
- // 移动到右侧单元格
- params.columnIndex = _columnIndex + 1;
- params.column = visibleColumn[params.columnIndex];
- }
- 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;
- if (mouseConfig && mouseOpts.area && this.handleHeaderCellAreaEvent) {
- var cell = evnt.currentTarget;
- var triggerSort = DomTools.getEventTargetNode(evnt, cell, 'vxe-cell--sort').flag;
- var triggerFilter = DomTools.getEventTargetNode(evnt, cell, 'vxe-cell--filter').flag;
- this.handleHeaderCellAreaEvent(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 editConfig = this.editConfig,
- editOpts = this.editOpts,
- handleSelected = this.handleSelected,
- checkboxConfig = this.checkboxConfig,
- checkboxOpts = this.checkboxOpts,
- mouseConfig = this.mouseConfig,
- mouseOpts = this.mouseOpts;
- if (mouseConfig && mouseOpts.area && this.handleCellAreaEvent) {
- return this.handleCellAreaEvent(evnt, params);
- } else {
- if (checkboxConfig && checkboxOpts.range) {
- this.handleCheckboxRangeEvent(evnt, params);
- }
- if (mouseConfig && mouseOpts.selected) {
- if (!editConfig || editOpts.mode === 'cell') {
- handleSelected(params, evnt);
- }
- }
- }
- },
- handleCheckboxRangeEvent: function handleCheckboxRangeEvent(evnt, params) {
- var _this4 = this;
- var column = params.column,
- cell = params.cell;
- if (column.type === 'checkbox') {
- 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) {
- _this4.emitEvent("checkbox-range-".concat(type), {
- records: _this4.getCheckboxRecords(),
- reserves: _this4.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(_this4, params, trElem, offsetTop < marginSize ? -rangeHeight : rangeHeight); // 至少滑动 10px 才能有效匹配
- if (rangeHeight > 10 && rangeRows.length !== lastRangeRows.length) {
- lastRangeRows = rangeRows;
- if (evnt.ctrlKey) {
- rangeRows.forEach(function (row) {
- _this4.handleSelectRow({
- row: row
- }, selectRecords.indexOf(row) === -1);
- });
- } else {
- _this4.setAllCheckboxRow(false);
- _this4.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) {
- _this4.scrollTo(scrollLeft, scrollTop + topSize);
- startMouseScroll(evnt);
- handleChecked(evnt);
- } else {
- stopMouseScroll();
- }
- } else {
- if (scrollTop) {
- _this4.scrollTo(scrollLeft, scrollTop - topSize);
- startMouseScroll(evnt);
- handleChecked(evnt);
- } else {
- stopMouseScroll();
- }
- }
- }
- }, 50);
- };
- DomTools.addClass($el, 'drag--range');
- 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--range');
- checkboxRangeElem.removeAttribute('style');
- document.onmousemove = domMousemove;
- document.onmouseup = domMouseup;
- triggerEvent('end', evnt);
- };
- triggerEvent('start', evnt);
- }
- }
- }
- });
- // 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: "message",
- get: function get() {
- return UtilTools.getFuncText(this.$options.message);
- }
- }]);
- 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;
- return new Promise(function (resolve) {
- if (_this.validOpts.autoPos === false) {
- _this.emitEvent('valid-error', params);
- resolve();
- } else {
- _this.handleActived(params, {
- type: 'valid-error',
- trigger: 'call'
- }).then(function () {
- setTimeout(function () {
- resolve(_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 (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(rows)) {
- cb = rows;
- } else {
- vaildDatas = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(rows) ? rows : [rows];
- }
- }
- if (!vaildDatas) {
- vaildDatas = this.getInsertRecords().concat(this.getUpdateRecords());
- }
- 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) && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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) {
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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) {
- cb();
- }
- });
- }).catch(function (firstErrParams) {
- return new Promise(function (resolve, reject) {
- var finish = function finish() {
- _this2.$nextTick(function () {
- if (cb) {
- 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).then(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) {
- cb();
- }
- });
- },
- hasCellRules: function hasCellRules(type, row, column) {
- var editRules = this.editRules;
- var property = column.property;
- if (property && editRules) {
- var rules = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(editRules, property);
- return rules && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(editRules, property);
- if (rules) {
- var cellValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isUndefined(val) ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, property) : val;
- rules.forEach(function (rule) {
- if (type === 'all' || !rule.trigger || type === rule.trigger) {
- if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(rule.validator)) {
- var 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 (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 : rule.message,
- rule: new mixin_Rule(rule)
- }));
- }));
- }
- }
- } else {
- var isNumType = rule.type === 'number';
- var isArrType = rule.type === 'array';
- var numVal = isNumType ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(cellValue) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getSize(cellValue);
- if (rule.required && (isArrType ? !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(cellValue) || !cellValue.length : cellValue === null || cellValue === undefined || cellValue === '')) {
- _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;
- return this.$nextTick(function () {
- Object.assign(_this5.validStore, {
- row: row,
- column: column,
- rule: rule,
- content: content,
- visible: true
- });
- _this5.emitEvent('valid-error', params);
- if (validTip && (validOpts.message === 'tooltip' || validOpts.message === 'default' && !height && tableData.length < 2)) {
- return validTip.open(cell, content);
- }
- });
- }
- }
- });
- // 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/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 util_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,
- tableGroupColumn: Array,
- fixedColumn: Array,
- size: String,
- fixedType: String
- },
- 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 tableListeners = $xetable.$listeners,
- tId = $xetable.tId,
- isGroup = $xetable.isGroup,
- 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,
- scrollXLoad = $xetable.scrollXLoad,
- overflowX = $xetable.overflowX,
- scrollbarWidth = $xetable.scrollbarWidth,
- sortOpts = $xetable.sortOpts,
- mouseConfig = $xetable.mouseConfig;
- var tableColumn = this.tableColumn;
- var headerGroups = headerColumn; // 如果是使用优化模式
- if (!isGroup) {
- if (fixedType) {
- if (scrollXLoad || allColumnHeaderOverflow) {
- tableColumn = fixedColumn;
- }
- }
- headerGroups = [tableColumn];
- }
- return h('div', {
- class: ['vxe-table--header-wrapper', fixedType ? "fixed-".concat(fixedType, "--wrapper") : 'body--wrapper'],
- attrs: {
- xid: tId
- }
- }, [fixedType ? _e() : h('div', {
- class: 'vxe-body--x-space',
- ref: 'xSpace'
- }), h('table', {
- class: 'vxe-table--header',
- attrs: {
- xid: 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'
- }, headerGroups.map(function (cols, $rowIndex) {
- return h('tr', {
- class: ['vxe-header--row', headerRowClassName ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(headerRowClassName) ? headerRowClassName({
- $table: $xetable,
- $rowIndex: $rowIndex,
- fixed: fixedType,
- type: header_cellType
- }) : headerRowClassName : ''],
- style: headerRowStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 type = column.type,
- showHeaderOverflow = column.showHeaderOverflow,
- headerAlign = column.headerAlign,
- align = column.align,
- headerClassName = column.headerClassName; // const { enabled } = tooltipOpts
- var isColGroup = column.children && column.children.length;
- var fixedHiddenColumn = fixedType ? column.fixed !== fixedType && !isColGroup : column.fixed && overflowX;
- var headOverflow = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isUndefined(showHeaderOverflow) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow;
- 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;
- });
- var columnIndex = $xetable.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'] || 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);
- };
- }
- 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: {
- colid: column.id,
- colspan: column.colSpan > 1 ? column.colSpan : null,
- rowspan: column.rowSpan > 1 ? column.rowSpan : null
- },
- style: headerCellStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 && (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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() {
- var $xetable = this.$parent;
- this.headerColumn = $xetable.isGroup ? util_convertToRows(this.tableGroupColumn) : [];
- },
- 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 = 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 (evnt) {
- 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
- var Header = Object.assign(header, {
- install: function install(Vue) {
- Vue.component(header.name, 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,
- fixedColumn: Array,
- fixedType: String,
- size: 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 (fixedType) {
- if ((!mergeFooterList.length || !footerSpanMethod) && (scrollXLoad || allColumnFooterOverflow)) {
- tableColumn = fixedColumn;
- }
- }
- return h('div', {
- class: ['vxe-table--footer-wrapper', fixedType ? "fixed-".concat(fixedType, "--wrapper") : 'body--wrapper'],
- attrs: {
- xid: tId
- },
- on: {
- scroll: this.scrollEvent
- }
- }, [fixedType ? _e() : h('div', {
- class: 'vxe-body--x-space',
- ref: 'xSpace'
- }), h('table', {
- class: 'vxe-table--footer',
- attrs: {
- xid: 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 ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(footerRowClassName) ? footerRowClassName({
- $table: $xetable,
- _rowIndex: _rowIndex,
- $rowIndex: $rowIndex,
- fixed: fixedType,
- type: footer_cellType
- }) : footerRowClassName : ''],
- style: footerRowStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 type = column.type,
- 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 = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isUndefined(showFooterOverflow) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNull(showFooterOverflow) ? allColumnFooterOverflow : showFooterOverflow;
- 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 = {
- 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;
- }
- }
- 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 ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 ? footerElem.scrollLeft : 0;
- 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
- var Footer = Object.assign(footer, {
- install: function install(Vue) {
- Vue.component(footer.name, footer);
- }
- });
- /* harmony default export */ var packages_footer = (Footer);
- // CONCATENATED MODULE: ./packages/table/src/column.js
- var column_props = {
- // 列唯一主键
- colId: [String, Number],
- // 渲染类型 seq,radio,checkbox,expand,html
- type: 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],
- // 是否允许排序
- sortable: Boolean,
- // 在 v3 中废弃
- remoteSort: {
- type: Boolean,
- default: null
- },
- // 在 v3 中只支持字符串类型
- sortBy: [String, Function],
- // 排序的字段类型,比如字符串转数值等
- 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 column_watch = {};
- Object.keys(column_props).forEach(function (name) {
- column_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,
- $xegrid: null
- };
- },
- inject: {
- $xetable: {
- default: null
- },
- $xecolumn: {
- default: null
- }
- },
- watch: column_watch,
- created: function created() {
- this.columnConfig = this.createColumn(this.$xetable, this);
- },
- mounted: function mounted() {
- UtilTools.assemColumn(this);
- },
- destroyed: function destroyed() {
- UtilTools.destroyColumn(this);
- },
- render: function render(h) {
- return h('div', this.$slots.default);
- },
- methods: src_cell
- });
- // CONCATENATED MODULE: ./packages/column/index.js
- var Column = Object.assign(src_column, {
- install: function install(Vue) {
- Vue.component(src_column.name, src_column);
- Vue.component('VxeTableColumn', src_column);
- }
- });
- /* harmony default export */ var packages_column = (Column);
- // CONCATENATED MODULE: ./packages/table/src/group.js
- /* harmony default export */ var src_group = ({
- name: 'VxeColgroup',
- extends: src_column,
- provide: function provide() {
- return {
- xecolgroup: this,
- $xegrid: null
- };
- }
- });
- // CONCATENATED MODULE: ./packages/colgroup/index.js
- var Colgroup = Object.assign(src_group, {
- install: function install(Vue) {
- Vue.component(src_group.name, src_group);
- Vue.component('VxeTableColgroup', src_group);
- }
- });
- /* harmony default export */ var colgroup = (Colgroup);
- // 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) {
- if (elem) {
- var computedStyle = getComputedStyle(elem);
- var paddingTop = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(computedStyle.paddingTop);
- var paddingBottom = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(computedStyle.paddingBottom);
- return paddingTop + paddingBottom;
- }
- return 0;
- }
- function renderDefaultForm(h, _vm) {
- var $scopedSlots = _vm.$scopedSlots,
- proxyConfig = _vm.proxyConfig,
- proxyOpts = _vm.proxyOpts,
- formData = _vm.formData,
- formConfig = _vm.formConfig,
- formOpts = _vm.formOpts;
- if (isEnableConf(formConfig) && formOpts.items && formOpts.items.length) {
- var formSlots = {};
- if (!formOpts.inited) {
- formOpts.inited = true;
- var beforeItem = proxyOpts.beforeItem;
- if (proxyOpts && beforeItem) {
- formOpts.items.forEach(function (item) {
- beforeItem.call(_vm, {
- $grid: _vm,
- item: item
- });
- });
- }
- } // 处理插槽
- formOpts.items.forEach(function (item) {
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.each(item.slots, function (func) {
- if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(func)) {
- if ($scopedSlots[func]) {
- formSlots[func] = $scopedSlots[func];
- }
- }
- });
- });
- return [h('vxe-form', {
- props: Object.assign({}, formOpts, {
- data: proxyConfig && proxyOpts.form ? formData : formOpts.data
- }),
- on: {
- submit: _vm.submitEvent,
- reset: _vm.resetEvent,
- 'submit-invalid': _vm.submitInvalidEvent,
- 'toggle-collapse': _vm.togglCollapseEvent
- },
- scopedSlots: formSlots
- })];
- }
- return [];
- }
- function getFuncSlot(_vm, optSlots, slotKey) {
- var $scopedSlots = _vm.$scopedSlots;
- var funcSlot = optSlots[slotKey];
- if (funcSlot) {
- if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isString(funcSlot)) {
- if ($scopedSlots[funcSlot]) {
- return $scopedSlots[funcSlot];
- } else {
- if (false) {}
- }
- } else {
- return funcSlot;
- }
- }
- return null;
- }
- function getToolbarSlots(_vm) {
- var $scopedSlots = _vm.$scopedSlots,
- toolbarOpts = _vm.toolbarOpts;
- var toolbarOptSlots = toolbarOpts.slots;
- var buttonsSlot;
- var toolsSlot;
- var slots = {};
- if (false) {}
- if (toolbarOptSlots) {
- buttonsSlot = getFuncSlot(_vm, toolbarOptSlots, 'buttons');
- toolsSlot = getFuncSlot(_vm, toolbarOptSlots, 'tools');
- if (buttonsSlot) {
- slots.buttons = buttonsSlot;
- }
- if (toolsSlot) {
- slots.tools = toolsSlot;
- }
- }
- return slots;
- }
- function getPagerSlots(_vm) {
- var pagerOpts = _vm.pagerOpts;
- var pagerOptSlots = pagerOpts.slots;
- var slots = {};
- var leftSlot;
- var rightSlot;
- if (pagerOptSlots) {
- leftSlot = getFuncSlot(_vm, pagerOptSlots, 'left');
- rightSlot = getFuncSlot(_vm, pagerOptSlots, 'right');
- if (leftSlot) {
- slots.left = leftSlot;
- }
- if (rightSlot) {
- slots.right = rightSlot;
- }
- }
- return slots;
- }
- function getTableOns(_vm) {
- var $listeners = _vm.$listeners,
- proxyConfig = _vm.proxyConfig,
- proxyOpts = _vm.proxyOpts;
- var ons = {};
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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',
- mixins: [size],
- props: _objectSpread2(_objectSpread2({}, packages_table.props), {}, {
- columns: Array,
- pagerConfig: [Boolean, Object],
- proxyConfig: Object,
- toolbar: [Boolean, Object],
- toolbarConfig: [Boolean, Object],
- formConfig: [Boolean, Object],
- zoomConfig: Object,
- size: {
- type: String,
- default: function _default() {
- return conf.grid.size || conf.size;
- }
- }
- }),
- provide: function provide() {
- return {
- $xegrid: this
- };
- },
- data: function data() {
- return {
- tableLoading: false,
- isZMax: false,
- tableData: [],
- pendingRecords: [],
- filterData: [],
- formData: {},
- sortData: [],
- tZindex: 0,
- tablePage: {
- total: 0,
- pageSize: 10,
- currentPage: 1
- }
- };
- },
- computed: {
- 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,
- editConfig = this.editConfig,
- proxyConfig = this.proxyConfig,
- proxyOpts = this.proxyOpts,
- tableExtendProps = this.tableExtendProps,
- tableLoading = this.tableLoading,
- tablePage = this.tablePage,
- tableData = this.tableData;
- var tableProps = Object.assign({}, tableExtendProps);
- if (isZMax) {
- if (tableExtendProps.maxHeight) {
- tableProps.maxHeight = 'auto';
- } else {
- tableProps.height = 'auto';
- }
- }
- if (proxyConfig) {
- tableProps.loading = loading || tableLoading;
- tableProps.data = tableData;
- tableProps.rowClassName = this.handleRowClassName;
- if (proxyOpts.seq && isEnableConf(pagerConfig)) {
- tableProps.seqConfig = Object.assign({}, seqConfig, {
- startIndex: (tablePage.currentPage - 1) * tablePage.pageSize
- });
- }
- }
- if (editConfig) {
- tableProps.editConfig = Object.assign({}, editConfig, {
- activeMethod: this.handleActiveMethod
- });
- }
- return tableProps;
- },
- 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 data = this.data,
- formOpts = this.formOpts,
- proxyOpts = this.proxyOpts,
- proxyConfig = this.proxyConfig;
- if (proxyConfig && (data || proxyOpts.form && formOpts.data)) {
- console.error('[vxe-grid] There is a conflict between the props proxy-config and data.');
- }
- if (false) {}
- 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 || isEnableConf(this.formConfig));
- var hasToolbar = !!($scopedSlots.toolbar || isEnableConf(this.toolbarConfig) || this.toolbar);
- var hasPager = !!($scopedSlots.pager || isEnableConf(this.pagerConfig));
- return h('div', {
- class: ['vxe-grid', (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, 'is--animat', !!this.animat), _defineProperty(_ref, 'is--round', this.round), _defineProperty(_ref, 'is--maximize', isZMax), _defineProperty(_ref, 'is--loading', this.loading || this.tableLoading), _ref)],
- 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,
- /**
- * 渲染表格顶部区域
- */
- $scopedSlots.top ? 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'
- }),
- /**
- * 渲染表格底部区域
- */
- $scopedSlots.bottom ? 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), {}, {
- callSlot: function callSlot(slotFunc, params, h, vNodes) {
- if (slotFunc) {
- var $scopedSlots = this.$scopedSlots;
- if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isString(slotFunc)) {
- slotFunc = $scopedSlots[slotFunc] || null;
- }
- if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(slotFunc)) {
- return slotFunc.call(this, params, h, vNodes);
- }
- }
- return [];
- },
- getParentHeight: function getParentHeight() {
- var $el = this.$el,
- isZMax = this.isZMax;
- return (isZMax ? DomTools.getDomNode().visibleHeight : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(getComputedStyle($el.parentNode).height)) - this.getExcludeHeight();
- },
- /**
- * 获取需要排除的高度
- */
- 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 ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(rowClassName) ? rowClassName(params) : rowClassName : '');
- return clss;
- },
- handleActiveMethod: function handleActiveMethod(params) {
- var editConfig = this.editConfig;
- var activeMethod = editConfig ? editConfig.activeMethod : null;
- return this.pendingRecords.indexOf(params.row) === -1 && (!activeMethod || activeMethod(params));
- },
- initToolbar: function initToolbar() {
- var _this3 = this;
- this.$nextTick(function () {
- var _this3$$refs = _this3.$refs,
- xTable = _this3$$refs.xTable,
- xToolbar = _this3$$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 _this4 = this;
- var proxyInited = this.proxyInited,
- proxyConfig = this.proxyConfig,
- proxyOpts = this.proxyOpts,
- formConfig = this.formConfig,
- formOpts = this.formOpts;
- if (proxyConfig) {
- if (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 && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 _this4.commitProxy('_init');
- });
- }
- }
- },
- 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(proxyTarget) {
- var _this5 = this;
- var $refs = this.$refs,
- toolbar = this.toolbar,
- toolbarConfig = this.toolbarConfig,
- toolbarOpts = this.toolbarOpts,
- proxyOpts = this.proxyOpts,
- tablePage = this.tablePage,
- pagerConfig = this.pagerConfig,
- 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,
- proxyProps = _proxyOpts$props === void 0 ? {} : _proxyOpts$props;
- var $xetable = $refs.xTable;
- var button;
- var code;
- if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isString(proxyTarget)) {
- var matchObj = toolbarConfig || toolbar ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.findTree(toolbarOpts.buttons, function (item) {
- return item.code === proxyTarget;
- }, {
- children: 'dropdowns'
- }) : null;
- code = proxyTarget;
- button = matchObj ? matchObj.item : null;
- } else {
- button = proxyTarget;
- 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 _this5.setActiveRow(row);
- });
- break;
- case 'mark_cancel':
- this.triggerPendingEvent(code);
- break;
- case 'remove':
- return this.handleDeleteRow(code, 'vxe.grid.removeSelectRecord', function () {
- return _this5.removeCheckboxRow();
- });
- 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 ajaxMethods = ajax.query;
- if (ajaxMethods) {
- var isInited = code === '_init';
- var isReload = code === 'reload';
- var sortList = [];
- var filterList = [];
- var pageParams = {};
- if (pagerConfig) {
- if (isInited || isReload) {
- tablePage.currentPage = 1;
- }
- if (isEnableConf(pagerConfig)) {
- pageParams = _objectSpread2({}, tablePage);
- }
- }
- if (isInited) {
- var sortOpts = $xetable.sortOpts;
- var defaultSort = sortOpts.defaultSort; // 如果使用默认排序
- if (defaultSort) {
- if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(defaultSort)) {
- defaultSort = [defaultSort];
- }
- sortList = defaultSort.map(function (item) {
- return {
- property: item.field,
- order: item.order
- };
- });
- }
- filterList = $xetable.getCheckedFilters();
- } else {
- if (isReload) {
- this.pendingRecords = [];
- $xetable.clearAll();
- } else {
- sortList = $xetable.getSortColumns();
- filterList = $xetable.getCheckedFilters();
- }
- }
- var params = {
- code: code,
- button: button,
- $grid: this,
- page: pageParams,
- sort: sortList.length ? sortList[0] : {},
- sorts: sortList,
- filters: filterList,
- form: formData,
- options: ajaxMethods
- };
- this.sortData = sortList;
- this.filterData = filterList;
- this.tableLoading = true;
- var applyArgs = [params].concat(args);
- return Promise.resolve((beforeQuery || ajaxMethods).apply(void 0, _toConsumableArray(applyArgs))).catch(function (e) {
- return e;
- }).then(function (rest) {
- _this5.tableLoading = false;
- if (rest) {
- if (isEnableConf(pagerConfig)) {
- var total = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(rest, proxyProps.total || 'page.total') || 0;
- tablePage.total = total;
- _this5.tableData = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(rest, proxyProps.result || 'result') || []; // 检验当前页码,不能超出当前最大页数
- var pageCount = Math.max(Math.ceil(total / tablePage.pageSize), 1);
- if (tablePage.currentPage > pageCount) {
- tablePage.currentPage = pageCount;
- }
- } else {
- _this5.tableData = (proxyProps.list ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(rest, proxyProps.list) : rest) || [];
- }
- } else {
- _this5.tableData = [];
- }
- if (afterQuery) {
- afterQuery.apply(void 0, _toConsumableArray(applyArgs));
- }
- });
- } else {
- UtilTools.error('vxe.error.notFunc', ['query']);
- }
- break;
- }
- case 'delete':
- {
- var _ajaxMethods = ajax.delete;
- if (_ajaxMethods) {
- var removeRecords = this.getCheckboxRecords();
- var body = {
- removeRecords: removeRecords
- };
- var _applyArgs = [{
- $grid: this,
- code: code,
- button: button,
- body: body,
- options: _ajaxMethods
- }].concat(args);
- if (removeRecords.length) {
- return this.handleDeleteRow(code, 'vxe.grid.deleteSelectRecord', function () {
- _this5.tableLoading = true;
- return Promise.resolve((beforeDelete || _ajaxMethods).apply(void 0, _toConsumableArray(_applyArgs))).then(function (rest) {
- _this5.tableLoading = false;
- _this5.pendingRecords = _this5.pendingRecords.filter(function (row) {
- return removeRecords.indexOf(row) === -1;
- });
- if (isMsg) {
- v_x_e_table.modal.message({
- message: _this5.getRespMsg(rest, 'vxe.grid.delSuccess'),
- status: 'success'
- });
- }
- if (afterDelete) {
- afterDelete.apply(void 0, _toConsumableArray(_applyArgs));
- } else {
- _this5.commitProxy('query');
- }
- }).catch(function (rest) {
- _this5.tableLoading = false;
- if (isMsg) {
- v_x_e_table.modal.message({
- id: code,
- message: _this5.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) {
- _this5.tableLoading = true;
- return Promise.resolve((beforeSave || _ajaxMethods2).apply(void 0, _toConsumableArray(_applyArgs2))).then(function (rest) {
- _this5.tableLoading = false;
- _this5.pendingRecords = [];
- if (isMsg) {
- v_x_e_table.modal.message({
- message: _this5.getRespMsg(rest, 'vxe.grid.saveSuccess'),
- status: 'success'
- });
- }
- if (afterSave) {
- afterSave.apply(void 0, _toConsumableArray(_applyArgs2));
- } else {
- _this5.commitProxy('query');
- }
- }).catch(function (rest) {
- _this5.tableLoading = false;
- if (isMsg) {
- v_x_e_table.modal.message({
- id: code,
- message: _this5.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(void 0, [{
- 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,
- proxyProps = _this$proxyOpts$props === void 0 ? {} : _this$proxyOpts$props;
- var msg;
- if (rest && proxyProps.message) {
- msg = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(rest, proxyProps.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();
- }
- }
- return Promise.resolve();
- },
- getFormItems: function getFormItems(itemIndex) {
- var formConfig = this.formConfig,
- formOpts = this.formOpts;
- var itemList = [];
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(isEnableConf(formConfig) && formOpts.items ? formOpts.items : [], function (item) {
- itemList.push(item);
- }, {
- children: 'children'
- });
- return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isUndefined(itemIndex) ? itemList : itemList[itemIndex];
- },
- 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
- });
- },
- 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;
- this.$emit('page-change', Object.assign({
- $grid: this
- }, params));
- if (proxyConfig) {
- this.commitProxy('query');
- }
- },
- sortChangeEvent: function sortChangeEvent(params) {
- var $table = params.$table,
- column = params.column,
- sortList = params.sortList;
- var isRemote = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isBoolean(column.remoteSort) ? column.remoteSort : $table.sortOpts.remote; // 如果是服务端排序
- if (isRemote) {
- this.sortData = sortList;
- 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.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) {
- var proxyConfig = this.proxyConfig;
- if (proxyConfig) {
- this.commitProxy('reload');
- }
- this.$emit('form-submit', Object.assign({
- $grid: this
- }, params));
- },
- resetEvent: function resetEvent(params) {
- var proxyConfig = this.proxyConfig;
- if (proxyConfig) {
- this.commitProxy('reload');
- }
- this.$emit('form-reset', Object.assign({
- $grid: this
- }, params));
- },
- submitInvalidEvent: function submitInvalidEvent(params) {
- this.$emit('form-submit-invalid', Object.assign({
- $grid: this
- }, params));
- },
- togglCollapseEvent: function togglCollapseEvent(params) {
- var _this6 = this;
- this.$nextTick(function () {
- return _this6.recalculate(true);
- });
- this.$emit('form-toggle-collapse', Object.assign({
- $grid: this
- }, params));
- },
- triggerZoomEvent: function triggerZoomEvent(evnt) {
- this.zoom();
- this.$emit('zoom', {
- $grid: this,
- 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 _this7 = 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 _this7.recalculate(true);
- }).then(function () {
- return _this7.isZMax;
- });
- },
- getProxyInfo: function getProxyInfo() {
- var sortData = this.sortData,
- proxyConfig = this.proxyConfig;
- if (proxyConfig) {
- return {
- data: this.tableData,
- filter: this.filterData,
- form: this.formData,
- sort: sortData.length ? sortData[0] : {},
- sorts: sortData,
- pager: this.tablePage,
- pendingRecords: this.pendingRecords
- };
- }
- return null;
- }
- }, false ? undefined : null)
- });
- // CONCATENATED MODULE: ./packages/grid/index.js
- var Grid = Object.assign(grid, {
- install: function install(Vue) {
- v_x_e_table.Grid = grid;
- v_x_e_table.GridComponent = grid;
- Vue.component(grid.name, grid);
- }
- });
- /* harmony default export */ var packages_grid = (Grid);
- // 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 _dropdowns = item.dropdowns,
- buttonRender = item.buttonRender;
- var compConf = buttonRender ? v_x_e_table.renderer.get(buttonRender.name) : null;
- if (item.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
- }));
- }
- }
- 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,
- content: UtilTools.getFuncText(item.name),
- destroyOnClose: item.destroyOnClose,
- placement: item.placement,
- transfer: item.transfer
- },
- scopedSlots: _dropdowns && _dropdowns.length ? {
- 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,
- content: UtilTools.getFuncText(child.name)
- }
- });
- });
- }
- } : null
- });
- });
- }
- /**
- * 渲染右侧工具
- */
- 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.checkMethod : null;
- 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;
- }
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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',
- mixins: [size],
- props: {
- loading: Boolean,
- refresh: [Boolean, Object],
- import: [Boolean, Object],
- export: [Boolean, Object],
- print: [Boolean, Object],
- zoom: [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: {
- 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);
- },
- zoomOpts: function zoomOpts() {
- return Object.assign({}, conf.toolbar.zoom, this.zoom);
- },
- customOpts: function customOpts() {
- return Object.assign({}, conf.toolbar.custom, this.custom);
- }
- },
- created: function created() {
- var _this = this;
- var refresh = this.refresh,
- refreshOpts = this.refreshOpts;
- this.$nextTick(function () {
- var $xetable = _this.fintTable();
- if (refresh && !_this.$xegrid && !refreshOpts.query) {
- UtilTools.warn('vxe.error.notFunc', ['query']);
- }
- if ($xetable) {
- $xetable.connect(_this);
- }
- if (false) {}
- });
- 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 _e = this._e,
- $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,
- 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-button--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
- }
- }) : _e(), 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
- }
- }) : _e(), 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
- }
- }) : _e(), 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
- }
- }) : _e(), 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
- }
- }) : _e(), custom ? renderCustoms(h, this) : _e()])]);
- },
- 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 external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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,
- customStore = this.customStore;
- if (customStore.visible) {
- customStore.visible = false;
- if (custom && !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;
- var checkMethod = $xetable.customOpts.checkMethod;
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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
- });
- },
- changeCustomOption: function changeCustomOption(column) {
- var isChecked = !column.visible;
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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;
- var checkMethod = $xetable.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,
- customStore = this.customStore;
- var checkMethod = $xetable.customOpts.checkMethod;
- var isAll = !customStore.isAll;
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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);
- }
- }
- },
- 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.openPrint(this.printOpts);
- }
- }
- }
- });
- // CONCATENATED MODULE: ./packages/toolbar/index.js
- var Toolbar = Object.assign(src_toolbar, {
- install: function install(Vue) {
- Vue.component(src_toolbar.name, src_toolbar);
- }
- });
- /* harmony default export */ var packages_toolbar = (Toolbar);
- // CONCATENATED MODULE: ./packages/pager/src/pager.js
- /* harmony default export */ var pager = ({
- name: 'VxePager',
- mixins: [size],
- 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: {
- 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 (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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('button', {
- 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 || 'button', {
- 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('span', {
- class: 'vxe-pager--btn-wrapper'
- }, this.renderPageBtn(h));
- },
- // jumpNumber
- renderJumpNumber: function renderJumpNumber(h) {
- return h('span', {
- class: 'vxe-pager--btn-wrapper'
- }, this.renderPageBtn(h, true));
- },
- // 向下翻页
- renderNextJump: function renderNextJump(h, tagName) {
- return h(tagName || 'button', {
- 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('button', {
- 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('button', {
- class: 'vxe-pager--num-btn',
- on: {
- click: function click() {
- return _this3.jumpPage(1);
- }
- }
- }, 1), this.renderPrevJump(h, 'span'));
- }
- numList.forEach(function (item, index) {
- var number = startNumber + index;
- if (number <= pageCount) {
- nums.push(h('button', {
- 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, 'button'), h('button', {
- 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);
- this.$emit('page-change', {
- type: 'current',
- pageSize: this.pageSize,
- currentPage: currentPage
- });
- }
- },
- pageSizeEvent: function pageSizeEvent(pageSize) {
- this.changePageSize(pageSize);
- },
- changePageSize: function changePageSize(pageSize) {
- if (pageSize !== this.pageSize) {
- this.$emit('update:pageSize', pageSize);
- this.$emit('page-change', {
- type: 'size',
- pageSize: pageSize,
- currentPage: Math.min(this.currentPage, this.getPageCount(this.total, pageSize))
- });
- }
- },
- 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 = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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
- var Pager = Object.assign(pager, {
- install: function install(Vue) {
- Vue.component(pager.name, pager);
- }
- });
- /* harmony default export */ var packages_pager = (Pager);
- // CONCATENATED MODULE: ./packages/checkbox/index.js
- var Checkbox = Object.assign(src_checkbox, {
- install: function install(Vue) {
- Vue.component(src_checkbox.name, src_checkbox);
- }
- });
- /* harmony default export */ var packages_checkbox = (Checkbox);
- // 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 {
- $xecheckboxgroup: this
- };
- },
- computed: {
- vSize: function vSize() {
- return this.size || this.$parent.size || this.$parent.vSize;
- }
- },
- render: function render(h) {
- var $scopedSlots = this.$scopedSlots;
- return h('div', {
- class: 'vxe-checkbox-group'
- }, $scopedSlots.default ? $scopedSlots.default.call(this, {}) : []);
- },
- methods: {
- handleChecked: function handleChecked(params) {
- 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));
- }
- }
- });
- // CONCATENATED MODULE: ./packages/checkbox-group/index.js
- var CheckboxGroup = Object.assign(checkbox_src_group, {
- install: function install(Vue) {
- Vue.component(checkbox_src_group.name, checkbox_src_group);
- }
- });
- /* harmony default export */ var checkbox_group = (CheckboxGroup);
- // CONCATENATED MODULE: ./packages/radio/index.js
- var Radio = Object.assign(src_radio, {
- install: function install(Vue) {
- Vue.component(src_radio.name, src_radio);
- }
- });
- /* harmony default export */ var packages_radio = (Radio);
- // CONCATENATED MODULE: ./packages/radio/src/group.js
- /* harmony default export */ var radio_src_group = ({
- name: 'VxeRadioGroup',
- props: {
- value: [String, Number, Boolean],
- disabled: Boolean,
- size: {
- type: String,
- default: function _default() {
- return conf.radio.size || conf.size;
- }
- }
- },
- provide: function provide() {
- return {
- $xeradiogroup: this
- };
- },
- computed: {
- vSize: function vSize() {
- return this.size || this.$parent.size || this.$parent.vSize;
- }
- },
- data: function data() {
- return {
- name: external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.uniqueId('xegroup_')
- };
- },
- render: function render(h) {
- var $scopedSlots = this.$scopedSlots;
- return h('div', {
- class: 'vxe-radio-group'
- }, $scopedSlots.default ? $scopedSlots.default.call(this, {}) : []);
- },
- methods: {
- handleChecked: function handleChecked(params) {
- this.$emit('input', params.label);
- this.$emit('change', params);
- }
- }
- });
- // CONCATENATED MODULE: ./packages/radio-group/index.js
- var RadioGroup = Object.assign(radio_src_group, {
- install: function install(Vue) {
- Vue.component(radio_src_group.name, radio_src_group);
- }
- });
- /* harmony default export */ var radio_group = (RadioGroup);
- // CONCATENATED MODULE: ./packages/radio/src/button.js
- /* harmony default export */ var src_button = ({
- name: 'VxeRadioButton',
- props: {
- value: [String, Number, Boolean],
- label: [String, Number, Boolean],
- title: [String, Number],
- content: [String, Number],
- disabled: Boolean,
- size: {
- type: String,
- default: function _default() {
- return conf.radio.size || conf.size;
- }
- }
- },
- inject: {
- $xeradiogroup: {
- default: null
- }
- },
- computed: {
- vSize: function vSize() {
- return this.size || this.$parent.size || this.$parent.vSize;
- },
- isDisabled: function isDisabled() {
- var $xeradiogroup = this.$xeradiogroup;
- return this.disabled || $xeradiogroup && $xeradiogroup.disabled;
- }
- },
- render: function render(h) {
- var _ref;
- var $scopedSlots = this.$scopedSlots,
- $xeradiogroup = this.$xeradiogroup,
- isDisabled = this.isDisabled,
- title = this.title,
- vSize = this.vSize,
- value = this.value,
- 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: $xeradiogroup ? $xeradiogroup.name : null,
- disabled: isDisabled
- },
- domProps: {
- checked: $xeradiogroup ? $xeradiogroup.value === label : value === label
- },
- on: {
- change: this.changeEvent
- }
- }), h('span', {
- class: 'vxe-radio--label'
- }, $scopedSlots.default ? $scopedSlots.default.call(this, {}) : [UtilTools.getFuncText(content)])]);
- },
- methods: {
- changeEvent: function changeEvent(evnt) {
- var $xeradiogroup = this.$xeradiogroup,
- isDisabled = this.isDisabled,
- label = this.label;
- if (!isDisabled) {
- var params = {
- label: label,
- $event: evnt
- };
- if ($xeradiogroup) {
- $xeradiogroup.handleChecked(params);
- } else {
- this.$emit('input', label);
- this.$emit('change', params);
- }
- }
- }
- }
- });
- // CONCATENATED MODULE: ./packages/radio-button/index.js
- var RadioButton = Object.assign(src_button, {
- install: function install(Vue) {
- Vue.component(src_button.name, src_button);
- }
- });
- /* harmony default export */ var radio_button = (RadioButton);
- // CONCATENATED MODULE: ./packages/input/index.js
- var Input = Object.assign(input, {
- install: function install(Vue) {
- Vue.component(input.name, 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',
- mixins: [size],
- model: {
- prop: 'value',
- event: 'modelValue'
- },
- props: {
- value: [String, Number],
- immediate: {
- type: Boolean,
- default: true
- },
- 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;
- }
- }
- },
- data: function data() {
- return {
- inputValue: this.value
- };
- },
- computed: {
- inputCount: function inputCount() {
- return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getSize(this.inputValue);
- },
- isCountError: function isCountError() {
- return this.maxlength && this.inputCount > external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(this.maxlength);
- },
- defaultEvents: function defaultEvents() {
- var _this = this;
- var evnts = {};
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.each(this.$listeners, function (cb, name) {
- if (['input', 'change', 'blur'].indexOf(name) === -1) {
- evnts[name] = _this.triggerEvent;
- }
- });
- evnts.input = this.inputEvent;
- evnts.change = this.changeEvent;
- evnts.blur = this.blurEvent;
- return evnts;
- },
- sizeOpts: function sizeOpts() {
- return Object.assign({
- minRows: 1,
- maxRows: 10
- }, conf.textarea.autosize, this.autosize);
- }
- },
- watch: {
- value: function value(val) {
- this.inputValue = val;
- this.updateAutoTxt();
- }
- },
- mounted: function mounted() {
- var autosize = this.autosize;
- if (autosize) {
- this.updateAutoTxt();
- this.handleResize();
- }
- },
- render: function render(h) {
- var _ref;
- var defaultEvents = this.defaultEvents,
- inputValue = this.inputValue,
- 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: inputValue
- },
- 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 inputValue = this.inputValue;
- this.$emit(evnt.type, {
- value: inputValue,
- $event: evnt
- });
- },
- emitUpdate: function emitUpdate(value, evnt) {
- this.inputValue = value;
- this.$emit('modelValue', value);
- if (this.value !== value) {
- this.$emit('change', {
- value: value,
- $event: evnt
- });
- }
- },
- inputEvent: function inputEvent(evnt) {
- var immediate = this.immediate;
- var value = evnt.target.value;
- this.inputValue = value;
- if (immediate) {
- this.emitUpdate(value, evnt);
- }
- this.handleResize();
- this.triggerEvent(evnt);
- },
- changeEvent: function changeEvent(evnt) {
- var immediate = this.immediate;
- if (immediate) {
- this.triggerEvent(evnt);
- } else {
- this.emitUpdate(this.inputValue, evnt);
- }
- },
- blurEvent: function blurEvent(evnt) {
- var inputValue = this.inputValue,
- immediate = this.immediate;
- if (!immediate) {
- this.emitUpdate(inputValue, evnt);
- }
- this.$emit('blur', {
- value: inputValue,
- $event: evnt
- });
- },
- updateAutoTxt: function updateAutoTxt() {
- var $refs = this.$refs,
- inputValue = this.inputValue,
- size = this.size,
- autosize = this.autosize;
- if (autosize) {
- if (!autoTxtElem) {
- autoTxtElem = document.createElement('div');
- }
- if (!autoTxtElem.parentNode) {
- document.body.appendChild(autoTxtElem);
- }
- 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 = ('' + (inputValue || ' ')).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 = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(textStyle.lineHeight);
- var paddingTop = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(textStyle.paddingTop);
- var paddingBottom = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(textStyle.paddingBottom);
- var borderTopWidth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(textStyle.borderTopWidth);
- var borderBottomWidth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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
- var Textarea = Object.assign(src_textarea, {
- install: function install(Vue) {
- Vue.component(src_textarea.name, src_textarea);
- }
- });
- /* harmony default export */ var packages_textarea = (Textarea);
- // CONCATENATED MODULE: ./packages/button/src/button.js
- /* harmony default export */ var button_src_button = ({
- name: 'VxeButton',
- mixins: [size],
- 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: {
- 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';
- }
- },
- created: function created() {
- 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,
- status = this.status,
- 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: 'xBtn',
- class: ['vxe-button', "type--".concat(btnType), (_ref2 = {}, _defineProperty(_ref2, "size--".concat(vSize), vSize), _defineProperty(_ref2, "theme--".concat(status), status), _defineProperty(_ref2, 'is--round', this.round), _defineProperty(_ref2, 'is--circle', this.circle), _defineProperty(_ref2, 'is--disabled', disabled || loading), _defineProperty(_ref2, 'is--loading', loading), _ref2)],
- attrs: {
- name: name,
- type: isFormBtn ? type : 'button',
- disabled: disabled || loading
- },
- on: Object.assign({
- mouseenter: this.mouseenterTargetEvent,
- mouseleave: this.mouseleaveEvent
- }, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.objectMap($listeners, function (cb, type) {
- return function (evnt) {
- return _this.$emit(type, {
- $event: 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: {
- 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: 'xBtn',
- class: ['vxe-button', "type--".concat(btnType), (_ref4 = {}, _defineProperty(_ref4, "size--".concat(vSize), vSize), _defineProperty(_ref4, "theme--".concat(status), status), _defineProperty(_ref4, 'is--round', this.round), _defineProperty(_ref4, 'is--circle', this.circle), _defineProperty(_ref4, 'is--disabled', disabled || loading), _defineProperty(_ref4, 'is--loading', loading), _ref4)],
- attrs: {
- name: name,
- type: isFormBtn ? type : 'button',
- disabled: disabled || loading
- },
- on: external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.objectMap($listeners, function (cb, type) {
- return function (evnt) {
- return _this.$emit(type, {
- $event: 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
- });
- }
- },
- 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.xBtn;
- 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 + targetWidth - panelWidth;
- 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"),
- right: 'auto',
- 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
- var Button = Object.assign(button_src_button, {
- install: function install(Vue) {
- Vue.component(button_src_button.name, button_src_button);
- }
- });
- /* harmony default export */ var packages_button = (Button);
- // 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 && allActivedModals.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();
- }
- });
- }
- });
- }
- /**
- * 全局关闭动态的活动窗口(只能用于关闭动态的创建的活动窗口)
- * 如果传 id 则关闭指定的窗口
- * 如果不传则关闭所有窗口
- */
- function closeModal(id) {
- var modals = arguments.length ? [getModal(id)] : allActivedModals;
- modals.forEach(function ($modal) {
- if ($modal) {
- $modal.isDestroy = true;
- $modal.close('close');
- }
- });
- return Promise.resolve();
- }
- function getModal(id) {
- return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.find(allActivedModals, function ($modal) {
- return $modal.id === id;
- });
- }
- var ModalController = {
- get: getModal,
- close: closeModal,
- open: openModal
- };
- var modal_modal = ModalController;
- var shortcutTypes = ['alert', 'confirm', 'message'];
- shortcutTypes.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 (message, title, options) {
- var opts;
- if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isObject(message)) {
- opts = message;
- } else {
- if (title) {
- opts = index === 2 ? {
- status: title
- } : {
- title: title
- };
- }
- }
- return openModal(Object.assign({
- message: external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toValueString(message),
- type: type
- }, defOpts, opts, options));
- };
- });
- var Modal = Object.assign(modal, {
- install: function install(Vue) {
- v_x_e_table._modal = 1;
- Vue.component(modal.name, modal);
- ModalClass = Vue.extend(modal);
- v_x_e_table.modal = ModalController;
- if (!Vue.prototype.$vxe) {
- Vue.prototype.$vxe = {
- modal: ModalController
- };
- } else {
- Vue.prototype.$vxe.modal = ModalController;
- }
- }
- });
- /* harmony default export */ var packages_modal = (Modal);
- // 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 tipTop = top - offsetHeight - marginSize;
- var 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',
- mixins: [size],
- 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, Number],
- zIndex: [String, Number],
- isArrow: {
- type: Boolean,
- default: true
- },
- enterable: Boolean,
- leaveDelay: {
- type: Number,
- default: conf.tooltip.leaveDelay
- },
- leaveMethod: Function
- },
- data: function data() {
- return {
- isUpdate: false,
- isHover: false,
- visible: false,
- message: '',
- tipTarget: null,
- tipZindex: 0,
- tipStore: {
- style: {},
- placement: '',
- arrowStyle: null
- }
- };
- },
- 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();
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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 $scopedSlots = this.$scopedSlots,
- 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'
- }, $scopedSlots.content ? $scopedSlots.content.call(this, {}) : message), h('div', {
- class: 'vxe-table--tooltip-arrow',
- style: tipStore.arrowStyle
- })].concat($scopedSlots.default ? $scopedSlots.default.call(this, {}) : []));
- },
- methods: {
- 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 leaveMethod = this.leaveMethod,
- trigger = this.trigger,
- enterable = this.enterable,
- leaveDelay = this.leaveDelay;
- this.isHover = false;
- if (!leaveMethod || leaveMethod({
- $event: evnt
- }) !== false) {
- if (enterable && trigger === 'hover') {
- setTimeout(function () {
- if (!_this3.targetActive) {
- _this3.close();
- }
- }, leaveDelay);
- }
- }
- }
- }
- });
- // CONCATENATED MODULE: ./packages/tooltip/index.js
- var Tooltip = Object.assign(src_tooltip, {
- install: function install(Vue) {
- v_x_e_table._tooltip = 1;
- Vue.component(src_tooltip.name, src_tooltip);
- }
- });
- /* harmony default export */ var packages_tooltip = (Tooltip);
- // CONCATENATED MODULE: ./packages/form/src/util.js
- var util_ItemConfig = /*#__PURE__*/function () {
- function ItemConfig($xeform, item) {
- _classCallCheck(this, ItemConfig);
- Object.assign(this, {
- id: external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.uniqueId('item_'),
- title: item.title,
- field: item.field,
- span: item.span,
- align: item.align,
- titleAlign: item.titleAlign,
- titleWidth: item.titleWidth,
- titlePrefix: item.titlePrefix,
- titleSuffix: item.titleSuffix,
- titleOverflow: item.titleOverflow,
- resetValue: item.resetValue,
- visible: item.visible,
- visibleMethod: item.visibleMethod,
- folding: item.folding,
- collapseNode: item.collapseNode,
- className: item.className,
- itemRender: item.itemRender,
- // 渲染属性
- showError: false,
- errRule: null,
- slots: item.slots,
- children: []
- });
- if (false) { var compConf; }
- }
- _createClass(ItemConfig, [{
- key: "update",
- value: function update(name, value) {
- this[name] = value;
- }
- }]);
- return ItemConfig;
- }();
- function isItem(option) {
- return option instanceof util_ItemConfig;
- }
- function getItemConfig($xeform, _vm, options) {
- return isItem(_vm) ? _vm : new util_ItemConfig($xeform, _vm, options);
- }
- function createItem($xeform, _vm) {
- return getItemConfig($xeform, _vm);
- }
- function destroyItem(_vm) {
- var $xeform = _vm.$xeform,
- itemConfig = _vm.itemConfig;
- var matchObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.findTree($xeform.staticItems, function (option) {
- return option === itemConfig;
- });
- if (matchObj) {
- matchObj.items.splice(matchObj.index, 1);
- }
- }
- function assemItem(_vm) {
- var $el = _vm.$el,
- $xeform = _vm.$xeform,
- xeformgather = _vm.xeformgather,
- itemConfig = _vm.itemConfig;
- var itemGather = xeformgather ? xeformgather.itemConfig : null;
- itemConfig.slots = _vm.$scopedSlots;
- if (itemGather) {
- if (!itemGather.children) {
- itemGather.children = [];
- }
- itemGather.children.splice([].indexOf.call(xeformgather.$el.children, $el), 0, itemConfig);
- } else {
- $xeform.staticItems.splice([].indexOf.call($xeform.$refs.hideItem.children, $el), 0, itemConfig);
- }
- }
- // 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: "message",
- get: function get() {
- return UtilTools.getFuncText(this.$options.message);
- }
- }]);
- return Rule;
- }();
- function getResetValue(value, resetValue) {
- if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(value)) {
- resetValue = [];
- }
- return resetValue;
- }
- function form_callSlot(_vm, slotFunc, params, h) {
- if (slotFunc) {
- var $scopedSlots = _vm.$scopedSlots;
- if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isString(slotFunc)) {
- slotFunc = $scopedSlots[slotFunc] || null;
- }
- if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(slotFunc)) {
- return slotFunc.call(_vm, params, h);
- }
- }
- return [];
- }
- function renderPrefixIcon(h, titlePrefix) {
- return h('span', {
- class: 'vxe-form--item-title-prefix'
- }, [h('i', {
- class: titlePrefix.icon || conf.icon.FORM_PREFIX
- })]);
- }
- function form_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, item) {
- var data = _vm.data;
- var slots = item.slots,
- field = item.field,
- itemRender = item.itemRender,
- titlePrefix = item.titlePrefix,
- titleSuffix = item.titleSuffix;
- var compConf = isEnableConf(itemRender) ? v_x_e_table.renderer.get(itemRender.name) : null;
- var params = {
- data: data,
- property: field,
- item: item,
- $form: _vm
- };
- var tss = [];
- if (titlePrefix) {
- tss.push(titlePrefix.message ? h('vxe-tooltip', {
- props: {
- content: UtilTools.getFuncText(titlePrefix.message),
- enterable: titlePrefix.enterable,
- theme: titlePrefix.theme
- }
- }, [renderPrefixIcon(h, titlePrefix)]) : renderPrefixIcon(h, titlePrefix));
- }
- tss.push(h('span', {
- class: 'vxe-form--item-title-label'
- }, compConf && compConf.renderItemTitle ? compConf.renderItemTitle(itemRender, params) : slots && slots.title ? form_callSlot(_vm, slots.title, params, h) : UtilTools.getFuncText(item.title)));
- if (titleSuffix) {
- tss.push(titleSuffix.message ? h('vxe-tooltip', {
- props: {
- content: UtilTools.getFuncText(titleSuffix.message),
- enterable: titleSuffix.enterable,
- theme: titleSuffix.theme
- }
- }, [form_renderSuffixIcon(h, titleSuffix)]) : form_renderSuffixIcon(h, titleSuffix));
- }
- return tss;
- }
- function renderItems(h, _vm, itemList) {
- var _e = _vm._e,
- rules = _vm.rules,
- data = _vm.data,
- collapseAll = _vm.collapseAll,
- validOpts = _vm.validOpts,
- allTitleOverflow = _vm.titleOverflow;
- return itemList.map(function (item, index) {
- var slots = item.slots,
- title = item.title,
- folding = item.folding,
- visible = item.visible,
- visibleMethod = item.visibleMethod,
- field = item.field,
- collapseNode = item.collapseNode,
- itemRender = item.itemRender,
- showError = item.showError,
- errRule = item.errRule,
- className = item.className,
- titleOverflow = item.titleOverflow,
- children = item.children;
- var compConf = isEnableConf(itemRender) ? v_x_e_table.renderer.get(itemRender.name) : null;
- var span = item.span || _vm.span;
- var align = item.align || _vm.align;
- var titleAlign = item.titleAlign || _vm.titleAlign;
- var titleWidth = item.titleWidth || _vm.titleWidth;
- var itemVisibleMethod = visibleMethod;
- var itemOverflow = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isUndefined(titleOverflow) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNull(titleOverflow) ? allTitleOverflow : titleOverflow;
- var showEllipsis = itemOverflow === 'ellipsis';
- var showTitle = itemOverflow === 'title';
- var showTooltip = itemOverflow === true || itemOverflow === 'tooltip';
- var hasEllipsis = showTitle || showTooltip || showEllipsis;
- var params = {
- data: data,
- property: field,
- item: item,
- $form: _vm
- };
- var isRequired;
- if (visible === false) {
- return _e();
- } // 如果为项集合
- var isGather = children && children.length > 0;
- if (isGather) {
- var childVNs = renderItems(h, _vm, item.children);
- return childVNs.length ? h('div', {
- class: ['vxe-form--gather vxe-row', item.id, span ? "vxe-col--".concat(span, " is--span") : '', className ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(className) ? className(params) : className : '']
- }, childVNs) : _e();
- }
- if (!itemVisibleMethod && compConf && compConf.itemVisibleMethod) {
- itemVisibleMethod = compConf.itemVisibleMethod;
- }
- if (rules) {
- var itemRules = rules[field];
- if (itemRules) {
- isRequired = itemRules.some(function (rule) {
- return rule.required;
- });
- }
- }
- var contentVNs = [];
- if (slots && slots.default) {
- contentVNs = form_callSlot(_vm, slots.default, params, h);
- } else if (compConf && compConf.renderItemContent) {
- contentVNs = compConf.renderItemContent.call(_vm, h, itemRender, params);
- } else if (compConf && compConf.renderItem) {
- contentVNs = compConf.renderItem.call(_vm, h, itemRender, params);
- } else if (field) {
- contentVNs = ["".concat(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(data, field))];
- }
- var ons = showTooltip ? {
- mouseenter: function mouseenter(evnt) {
- _vm.triggerHeaderHelpEvent(evnt, params);
- },
- mouseleave: _vm.handleTargetLeaveEvent
- } : {};
- return h('div', {
- class: ['vxe-form--item', item.id, span ? "vxe-col--".concat(span, " is--span") : null, className ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(className) ? className(params) : className : '', {
- 'is--title': title,
- 'is--required': isRequired,
- 'is--hidden': folding && collapseAll,
- 'is--active': !itemVisibleMethod || itemVisibleMethod(params),
- 'is--error': showError
- }],
- key: index
- }, [h('div', {
- class: 'vxe-form--item-inner'
- }, [title || slots && slots.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, _vm, item)) : 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: _vm.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, errRule && validOpts.showMessage ? h('div', {
- class: 'vxe-form--item-valid',
- style: errRule.maxWidth ? {
- width: "".concat(errRule.maxWidth, "px")
- } : null
- }, errRule.message) : null]))])]);
- });
- }
- /* harmony default export */ var src_form = ({
- name: 'VxeForm',
- mixins: [size],
- 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,
- staticItems: [],
- formItems: [],
- tooltipTimeout: null,
- tooltipActive: false,
- tooltipStore: {
- item: null,
- visible: false
- }
- };
- },
- provide: function provide() {
- return {
- $xeform: this
- };
- },
- computed: {
- 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;
- }
- },
- created: function created() {
- var _this = this;
- this.$nextTick(function () {
- var items = _this.items;
- if (items) {
- _this.loadItem(items);
- }
- });
- },
- watch: {
- staticItems: function staticItems(value) {
- this.formItems = value;
- },
- items: function items(value) {
- this.loadItem(value);
- }
- },
- render: function render(h) {
- var _ref;
- var _e = this._e,
- loading = this.loading,
- vSize = this.vSize,
- tooltipOpts = this.tooltipOpts,
- formItems = this.formItems;
- var hasUseTooltip = v_x_e_table._tooltip;
- return h('form', {
- class: ['vxe-form', (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, 'is--colon', this.titleColon), _defineProperty(_ref, 'is--asterisk', this.titleAsterisk), _defineProperty(_ref, 'is--loading', loading), _ref)],
- on: {
- submit: this.submitEvent,
- reset: this.resetEvent
- }
- }, [h('div', {
- class: 'vxe-form--wrapper vxe-row'
- }, renderItems(h, this, formItems)), h('div', {
- class: 'vxe-form-slots',
- ref: 'hideItem'
- }, this.$slots.default), h('div', {
- class: ['vxe-loading', {
- 'is--visible': loading
- }]
- }, [h('div', {
- class: 'vxe-loading--spinner'
- })]),
- /**
- * 工具提示
- */
- hasUseTooltip ? h('vxe-tooltip', _objectSpread2({
- ref: 'tooltip'
- }, tooltipOpts)) : _e()]);
- },
- methods: {
- loadItem: function loadItem(list) {
- var _this2 = this;
- if (false) { var $scopedSlots; }
- this.staticItems = list.map(function (item) {
- return createItem(_this2, item);
- });
- return this.$nextTick();
- },
- getItems: function getItems() {
- var itemList = [];
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(this.formItems, function (item) {
- itemList.push(item);
- }, {
- children: 'children'
- });
- return itemList;
- },
- toggleCollapse: function toggleCollapse() {
- this.collapseAll = !this.collapseAll;
- return this.$nextTick();
- },
- toggleCollapseEvent: function toggleCollapseEvent(evnt) {
- this.toggleCollapse();
- this.$emit('toggle-collapse', {
- collapse: !this.collapseAll,
- data: this.data,
- $form: this,
- $event: evnt
- }, evnt);
- },
- submitEvent: function submitEvent(evnt) {
- var _this3 = this;
- evnt.preventDefault();
- if (!this.preventSubmit) {
- this.beginValidate().then(function () {
- _this3.$emit('submit', {
- data: _this3.data,
- $form: _this3,
- $event: evnt
- });
- }).catch(function (errMap) {
- _this3.$emit('submit-invalid', {
- data: _this3.data,
- errMap: errMap,
- $form: _this3,
- $event: evnt
- });
- });
- }
- },
- reset: function reset() {
- var _this4 = this;
- var data = this.data;
- if (data) {
- var itemList = this.getItems();
- itemList.forEach(function (item) {
- var field = item.field,
- resetValue = item.resetValue,
- itemRender = item.itemRender;
- if (isEnableConf(itemRender)) {
- var compConf = v_x_e_table.renderer.get(itemRender.name);
- if (compConf && compConf.itemResetMethod) {
- compConf.itemResetMethod({
- data: data,
- property: field,
- item: item,
- $form: _this4
- });
- } else if (field) {
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.set(data, field, resetValue === null ? getResetValue(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(data, field), undefined) : resetValue);
- }
- }
- });
- }
- return this.clearValidate();
- },
- resetEvent: function resetEvent(evnt) {
- evnt.preventDefault();
- this.reset();
- this.$emit('reset', {
- data: this.data,
- $form: this,
- $event: evnt
- });
- },
- handleTooltipLeaveMethod: function handleTooltipLeaveMethod() {
- var _this5 = this;
- var tooltipOpts = this.tooltipOpts;
- setTimeout(function () {
- if (!_this5.tooltipActive) {
- _this5.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 _this6 = this;
- var tooltipOpts = this.tooltipOpts;
- this.tooltipActive = false;
- if (tooltipOpts.enterable) {
- this.tooltipTimeout = setTimeout(function () {
- var $tooltip = _this6.$refs.tooltip;
- if ($tooltip && !$tooltip.isHover) {
- _this6.closeTooltip();
- }
- }, tooltipOpts.leaveDelay);
- } else {
- this.closeTooltip();
- }
- },
- clearValidate: function clearValidate(field) {
- var itemList = this.getItems();
- if (field) {
- var item = itemList.find(function (item) {
- return item.field === field;
- });
- if (item) {
- item.showError = false;
- }
- } else {
- itemList.forEach(function (item) {
- item.showError = false;
- });
- }
- return this.$nextTick();
- },
- validate: function validate(callback) {
- return this.beginValidate('', callback);
- },
- beginValidate: function beginValidate(type, callback) {
- var _this7 = this;
- var data = this.data,
- formRules = this.rules,
- validOpts = this.validOpts;
- var validRest = {};
- var validFields = [];
- var itemValids = [];
- var itemList = this.getItems();
- this.clearValidate();
- clearTimeout(this.showErrTime);
- if (data && formRules) {
- itemList.forEach(function (item) {
- var field = item.field;
- if (field) {
- itemValids.push(_this7.validItemRules(type || 'all', field).then(function () {
- item.errRule = null;
- }).catch(function (_ref2) {
- var rule = _ref2.rule,
- rules = _ref2.rules;
- var rest = {
- rule: rule,
- rules: rules,
- data: data,
- property: field,
- $form: _this7
- };
- if (!validRest[field]) {
- validRest[field] = [];
- }
- validRest[field].push(rest);
- validFields.push(field);
- item.errRule = rule;
- return Promise.reject(rest);
- }));
- }
- });
- return Promise.all(itemValids).then(function () {
- if (callback) {
- callback();
- }
- }).catch(function () {
- _this7.showErrTime = setTimeout(function () {
- itemList.forEach(function (item) {
- if (item.errRule) {
- item.showError = true;
- }
- });
- }, 20);
- if (callback) {
- callback(validRest);
- }
- if (validOpts.autoPos) {
- _this7.$nextTick(function () {
- _this7.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 _this8 = this;
- var data = this.data,
- formRules = this.rules;
- var errorRules = [];
- var syncVailds = [];
- if (property && formRules) {
- var rules = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(formRules, property);
- if (rules) {
- var itemValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isUndefined(val) ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(data, property) : val;
- rules.forEach(function (rule) {
- if (type === 'all' || !rule.trigger || type === rule.trigger) {
- if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(rule.validator)) {
- var customValid = rule.validator({
- itemValue: itemValue,
- rule: rule,
- rules: rules,
- data: data,
- property: property,
- $form: _this8
- });
- if (customValid) {
- if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_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.message,
- rule: new form_Rule(rule)
- }));
- }));
- }
- }
- } else {
- var isNumber = rule.type === 'number';
- var numVal = isNumber ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(itemValue) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getSize(itemValue);
- 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 $el = this.$el;
- var itemList = this.getItems();
- fields.some(function (property) {
- var item = itemList.find(function (item) {
- return item.field === property;
- });
- if (item && isEnableConf(item.itemRender)) {
- var itemRender = item.itemRender;
- var compConf = v_x_e_table.renderer.get(itemRender.name);
- var inputElem; // 如果指定了聚焦 class
- if (itemRender.autofocus) {
- inputElem = $el.querySelector(".".concat(item.id, " ").concat(itemRender.autofocus));
- } // 渲染器的聚焦处理
- if (!inputElem && compConf && compConf.autofocus) {
- inputElem = $el.querySelector(".".concat(item.id, " ").concat(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 _this9 = this;
- var property = scope.property;
- if (property) {
- this.validItemRules('change', property, itemValue).then(function () {
- _this9.clearValidate(property);
- }).catch(function (_ref3) {
- var rule = _ref3.rule;
- var itemList = _this9.getItems();
- var item = itemList.find(function (item) {
- return item.field === property;
- });
- if (item) {
- item.showError = true;
- item.errRule = rule;
- }
- });
- }
- }
- }
- });
- // CONCATENATED MODULE: ./packages/form/index.js
- var Form = Object.assign(src_form, {
- install: function install(Vue) {
- Vue.component(src_form.name, src_form);
- }
- });
- /* harmony default export */ var packages_form = (Form);
- // CONCATENATED MODULE: ./packages/form/src/form-item.js
- var form_item_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
- };
- var form_item_watch = {};
- Object.keys(form_item_props).forEach(function (name) {
- form_item_watch[name] = function (value) {
- this.itemConfig.update(name, value);
- };
- });
- /* harmony default export */ var form_item = ({
- name: 'VxeFormItem',
- props: form_item_props,
- inject: {
- $xeform: {
- default: null
- },
- xeformgather: {
- default: null
- }
- },
- watch: form_item_watch,
- mounted: function mounted() {
- assemItem(this);
- },
- created: function created() {
- this.itemConfig = createItem(this.$xeform, this);
- },
- destroyed: function destroyed() {
- destroyItem(this);
- },
- render: function render(h) {
- return h('div');
- }
- });
- // CONCATENATED MODULE: ./packages/form-item/index.js
- var FormItem = Object.assign(form_item, {
- install: function install(Vue) {
- Vue.component(form_item.name, form_item);
- }
- });
- /* harmony default export */ var packages_form_item = (FormItem);
- // CONCATENATED MODULE: ./packages/form/src/form-gather.js
- /* harmony default export */ var form_gather = ({
- name: 'VxeFormGather',
- extends: form_item,
- provide: function provide() {
- return {
- xeformgather: this
- };
- },
- render: function render(h) {
- return h('div', this.$slots.default);
- }
- });
- // CONCATENATED MODULE: ./packages/form-gather/index.js
- var FormGather = Object.assign(form_gather, {
- install: function install(Vue) {
- Vue.component(form_gather.name, form_gather);
- }
- });
- /* harmony default export */ var packages_form_gather = (FormGather);
- // 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
- var Select = Object.assign(src_select, {
- Option: src_option,
- Optgroup: optgroup,
- install: function install(Vue) {
- Vue.component(src_select.name, src_select);
- Vue.component(src_option.name, src_option);
- Vue.component(optgroup.name, optgroup);
- }
- });
- /* harmony default export */ var packages_select = (Select);
- // CONCATENATED MODULE: ./packages/optgroup/index.js
- var Optgroup = Object.assign(optgroup, {
- install: function install(Vue) {
- Vue.component(optgroup.name, optgroup);
- }
- });
- /* harmony default export */ var packages_optgroup = (Optgroup);
- // CONCATENATED MODULE: ./packages/option/index.js
- var Option = Object.assign(src_option, {
- install: function install(Vue) {
- Vue.component(src_option.name, src_option);
- }
- });
- /* harmony default export */ var packages_option = (Option);
- // CONCATENATED MODULE: ./packages/switch/src/switch.js
- var switch_browse = DomTools.browse;
- /* harmony default export */ var src_switch = ({
- name: 'VxeSwitch',
- mixins: [size],
- 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
- },
- data: function data() {
- return {
- isActivated: false,
- hasAnimat: false,
- offsetLeft: 0
- };
- },
- computed: {
- isChecked: function isChecked() {
- return this.value === this.openValue;
- },
- onShowLabel: function onShowLabel() {
- return UtilTools.getFuncText(this.openLabel);
- },
- offShowLabel: function offShowLabel() {
- return UtilTools.getFuncText(this.closeLabel);
- },
- styles: function styles() {
- return switch_browse.msie && this.isChecked ? {
- left: "".concat(this.offsetLeft, "px")
- } : null;
- }
- },
- created: function created() {
- var _this = this;
- 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,
- closeIcon = this.closeIcon;
- 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,
- focus: this.focusEvent,
- blur: this.blurEvent
- }
- }, [h('span', {
- class: 'vxe-switch--label vxe-switch--label-on'
- }, [openIcon ? h('i', {
- class: ['vxe-switch--label-icon', openIcon]
- }) : null, this.onShowLabel]), h('span', {
- class: 'vxe-switch--label vxe-switch--label-off'
- }, [closeIcon ? h('i', {
- class: ['vxe-switch--label-icon', closeIcon]
- }) : 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 ? this.closeValue : this.openValue;
- 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);
- }
- },
- focusEvent: function focusEvent(evnt) {
- this.isActivated = true;
- this.$emit('focus', {
- value: this.value,
- $event: evnt
- });
- },
- blurEvent: function blurEvent(evnt) {
- this.isActivated = false;
- this.$emit('blur', {
- value: this.value,
- $event: evnt
- });
- }
- }
- });
- // CONCATENATED MODULE: ./packages/switch/index.js
- var Switch = Object.assign(src_switch, {
- install: function install(Vue) {
- Vue.component(src_switch.name, src_switch);
- }
- });
- /* harmony default export */ var packages_switch = (Switch);
- // CONCATENATED MODULE: ./packages/list/src/list.js
- var list_browse = DomTools.browse;
- /* harmony default export */ var src_list = ({
- name: 'VxeList',
- mixins: [size],
- 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: {
- 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,
- endIndex: 0,
- visibleSize: 0
- }
- });
- this.loadData(this.data);
- GlobalEvent.on(this, 'resize', this.handleGlobalResizeEvent);
- },
- mounted: function mounted() {
- var _this2 = this;
- if (this.autoResize) {
- var resizeObserver = createResizeEvent(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: 'body',
- 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 || [];
- scrollYStore.startIndex = 0;
- scrollYStore.visibleIndex = 0;
- this.fullData = fullData;
- this.scrollYLoad = sYOpts.enabled && sYOpts.gt > -1 && sYOpts.gt <= fullData.length;
- 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, scrollYStore.endIndex) : 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 _this4 = this;
- var scrollBodyElem = this.$refs.virtualWrapper;
- if (scrollBodyElem) {
- scrollBodyElem.scrollTop = 0;
- }
- return new Promise(function (resolve) {
- setTimeout(function () {
- resolve(_this4.$nextTick());
- });
- });
- },
- /**
- * 刷新滚动条
- */
- refreshScroll: function refreshScroll() {
- var _this5 = this;
- var lastScrollLeft = this.lastScrollLeft,
- lastScrollTop = this.lastScrollTop;
- return this.clearScroll().then(function () {
- if (lastScrollLeft || lastScrollTop) {
- _this5.lastScrollLeft = 0;
- _this5.lastScrollTop = 0;
- return _this5.scrollTo(lastScrollLeft, lastScrollTop);
- }
- });
- },
- /**
- * 如果有滚动条,则滚动到对应的位置
- * @param {Number} scrollLeft 左距离
- * @param {Number} scrollTop 上距离
- */
- scrollTo: function scrollTo(scrollLeft, scrollTop) {
- var _this6 = this;
- var scrollBodyElem = this.$refs.virtualWrapper;
- if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNumber(scrollLeft)) {
- scrollBodyElem.scrollLeft = scrollLeft;
- }
- if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNumber(scrollTop)) {
- scrollBodyElem.scrollTop = scrollTop;
- }
- if (this.scrollYLoad) {
- return new Promise(function (resolve) {
- return setTimeout(function () {
- return resolve(_this6.$nextTick());
- }, 50);
- });
- }
- return this.$nextTick();
- },
- computeScrollLoad: function computeScrollLoad() {
- var _this7 = this;
- return this.$nextTick().then(function () {
- var $refs = _this7.$refs,
- sYOpts = _this7.sYOpts,
- scrollYLoad = _this7.scrollYLoad,
- scrollYStore = _this7.scrollYStore;
- var rowHeight = 0;
- var firstItemElem;
- if (sYOpts.sItem) {
- firstItemElem = $refs.body.querySelector(sYOpts.sItem);
- }
- if (!firstItemElem) {
- firstItemElem = $refs.body.children[0];
- }
- if (firstItemElem) {
- rowHeight = firstItemElem.offsetHeight;
- }
- rowHeight = Math.max(20, rowHeight);
- scrollYStore.rowHeight = rowHeight; // 计算 Y 逻辑
- if (scrollYLoad) {
- var visibleYSize = Math.max(8, Math.ceil($refs.virtualWrapper.clientHeight / rowHeight));
- var offsetYSize = sYOpts.oSize ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(sYOpts.oSize) : list_browse.msie ? 20 : list_browse.edge ? 10 : 0;
- scrollYStore.offsetSize = offsetYSize;
- scrollYStore.visibleSize = visibleYSize;
- scrollYStore.endIndex = Math.max(scrollYStore.startIndex, visibleYSize + offsetYSize, scrollYStore.endIndex);
- _this7.updateYData();
- } else {
- _this7.updateYSpace();
- }
- _this7.rowHeight = rowHeight;
- });
- },
- 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 scrollYStore = this.scrollYStore;
- var startIndex = scrollYStore.startIndex,
- endIndex = scrollYStore.endIndex,
- visibleSize = scrollYStore.visibleSize,
- offsetSize = scrollYStore.offsetSize,
- rowHeight = scrollYStore.rowHeight;
- var scrollBodyElem = evnt.target;
- var scrollTop = scrollBodyElem.scrollTop;
- var toVisibleIndex = Math.floor(scrollTop / rowHeight);
- var offsetStartIndex = Math.max(0, toVisibleIndex - 1 - offsetSize);
- var offsetEndIndex = toVisibleIndex + visibleSize + offsetSize;
- if (toVisibleIndex <= startIndex || toVisibleIndex >= endIndex - visibleSize - 1) {
- if (startIndex !== offsetStartIndex || endIndex !== offsetEndIndex) {
- scrollYStore.startIndex = offsetStartIndex;
- scrollYStore.endIndex = offsetEndIndex;
- this.updateYData();
- }
- }
- },
- 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
- var List = Object.assign(src_list, {
- install: function install(Vue) {
- Vue.component(src_list.name, src_list);
- }
- });
- /* harmony default export */ var packages_list = (List);
- // CONCATENATED MODULE: ./packages/pulldown/src/pulldown.js
- /* harmony default export */ var pulldown = ({
- name: 'VxePulldown',
- mixins: [size],
- 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
- };
- },
- 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: {
- 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
- var Pulldown = Object.assign(pulldown, {
- install: function install(Vue) {
- Vue.component(pulldown.name, pulldown);
- }
- });
- /* harmony default export */ var packages_pulldown = (Pulldown);
- // 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 月',
- 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',
- year: 'yyyy'
- },
- weeks: {
- w: '周',
- w0: '周日',
- w1: '周一',
- w2: '周二',
- w3: '周三',
- w4: '周四',
- w5: '周五',
- w6: '周六'
- },
- months: {
- m0: '一月',
- m1: '二月',
- m2: '三月',
- m3: '四月',
- m4: '五月',
- m5: '六月',
- m6: '七月',
- m7: '八月',
- m8: '九月',
- m9: '十月',
- m10: '十一月',
- m11: '十二月'
- }
- }
- }
- }
- });
- // CONCATENATED MODULE: ./packages/all.js
- // 按需加载的组件
- var components = [// 功能模块
- Header, Footer, Icon, Filter, Menu, Edit, Export, Keyboard, Validator, // 可选组件
- Column, Colgroup, Grid, Toolbar, Pager, Checkbox, CheckboxGroup, Radio, RadioGroup, RadioButton, Input, Textarea, Button, Modal, Tooltip, Form, FormItem, FormGather, Select, Optgroup, Option, Switch, List, Pulldown, // 核心
- Table]; // 默认安装
- function all_install(Vue, options) {
- if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isPlainObject(options)) {
- VXETable.setup(options);
- }
- components.map(function (component) {
- return component.install(Vue);
- });
- } // 默认中文
- VXETable.setup({
- i18n: function i18n(key, args) {
- return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toFormatString(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(zh_CN, key), args);
- }
- });
- // EXTERNAL MODULE: ./styles/index.scss
- var styles = __webpack_require__("1a97");
- // CONCATENATED MODULE: ./index.js
- if (typeof window !== 'undefined' && window.Vue) {
- window.Vue.use(all_namespaceObject);
- }
- /* harmony default export */ var index_0 = (all_namespaceObject);
- // 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 HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('slice');
- var SPECIES = wellKnownSymbol('species');
- var nativeSlice = [].slice;
- var max = Math.max;
- // `Array.prototype.slice` method
- // https://tc39.es/ecma262/#sec-array.prototype.slice
- // fallback for not array-like ES3 strings and DOM objects
- $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
- 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
- /* global Symbol -- safe */
- && !Symbol.sham
- && typeof Symbol.iterator == 'symbol';
- /***/ }),
- /***/ "fea9":
- /***/ (function(module, exports, __webpack_require__) {
- var global = __webpack_require__("da84");
- module.exports = global.Promise;
- /***/ })
- /******/ });
- });
|